123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979 |
- /*!
- *
- * iclient-leaflet.(https://iclient.supermap.io)
- * Copyright© 2000 - 2021 SuperMap Software Co.Ltd
- * license: Apache-2.0
- * version: v10.1.1
- *
- */
- /******/ (function() { // webpackBootstrap
- /******/ var __webpack_modules__ = ({
- /***/ 525:
- /***/ (function(module) {
- "use strict";
- module.exports = Point;
- /**
- * A standalone point geometry with useful accessor, comparison, and
- * modification methods.
- *
- * @class Point
- * @param {Number} x the x-coordinate. this could be longitude or screen
- * pixels, or any other sort of unit.
- * @param {Number} y the y-coordinate. this could be latitude or screen
- * pixels, or any other sort of unit.
- * @example
- * var point = new Point(-77, 38);
- */
- function Point(x, y) {
- this.x = x;
- this.y = y;
- }
- Point.prototype = {
- /**
- * Clone this point, returning a new point that can be modified
- * without affecting the old one.
- * @return {Point} the clone
- */
- clone: function clone() {
- return new Point(this.x, this.y);
- },
- /**
- * Add this point's x & y coordinates to another point,
- * yielding a new point.
- * @param {Point} p the other point
- * @return {Point} output point
- */
- add: function add(p) {
- return this.clone()._add(p);
- },
- /**
- * Subtract this point's x & y coordinates to from point,
- * yielding a new point.
- * @param {Point} p the other point
- * @return {Point} output point
- */
- sub: function sub(p) {
- return this.clone()._sub(p);
- },
- /**
- * Multiply this point's x & y coordinates by point,
- * yielding a new point.
- * @param {Point} p the other point
- * @return {Point} output point
- */
- multByPoint: function multByPoint(p) {
- return this.clone()._multByPoint(p);
- },
- /**
- * Divide this point's x & y coordinates by point,
- * yielding a new point.
- * @param {Point} p the other point
- * @return {Point} output point
- */
- divByPoint: function divByPoint(p) {
- return this.clone()._divByPoint(p);
- },
- /**
- * Multiply this point's x & y coordinates by a factor,
- * yielding a new point.
- * @param {Point} k factor
- * @return {Point} output point
- */
- mult: function mult(k) {
- return this.clone()._mult(k);
- },
- /**
- * Divide this point's x & y coordinates by a factor,
- * yielding a new point.
- * @param {Point} k factor
- * @return {Point} output point
- */
- div: function div(k) {
- return this.clone()._div(k);
- },
- /**
- * Rotate this point around the 0, 0 origin by an angle a,
- * given in radians
- * @param {Number} a angle to rotate around, in radians
- * @return {Point} output point
- */
- rotate: function rotate(a) {
- return this.clone()._rotate(a);
- },
- /**
- * Rotate this point around p point by an angle a,
- * given in radians
- * @param {Number} a angle to rotate around, in radians
- * @param {Point} p Point to rotate around
- * @return {Point} output point
- */
- rotateAround: function rotateAround(a, p) {
- return this.clone()._rotateAround(a, p);
- },
- /**
- * Multiply this point by a 4x1 transformation matrix
- * @param {Array<Number>} m transformation matrix
- * @return {Point} output point
- */
- matMult: function matMult(m) {
- return this.clone()._matMult(m);
- },
- /**
- * Calculate this point but as a unit vector from 0, 0, meaning
- * that the distance from the resulting point to the 0, 0
- * coordinate will be equal to 1 and the angle from the resulting
- * point to the 0, 0 coordinate will be the same as before.
- * @return {Point} unit vector point
- */
- unit: function unit() {
- return this.clone()._unit();
- },
- /**
- * Compute a perpendicular point, where the new y coordinate
- * is the old x coordinate and the new x coordinate is the old y
- * coordinate multiplied by -1
- * @return {Point} perpendicular point
- */
- perp: function perp() {
- return this.clone()._perp();
- },
- /**
- * Return a version of this point with the x & y coordinates
- * rounded to integers.
- * @return {Point} rounded point
- */
- round: function round() {
- return this.clone()._round();
- },
- /**
- * Return the magitude of this point: this is the Euclidean
- * distance from the 0, 0 coordinate to this point's x and y
- * coordinates.
- * @return {Number} magnitude
- */
- mag: function mag() {
- return Math.sqrt(this.x * this.x + this.y * this.y);
- },
- /**
- * Judge whether this point is equal to another point, returning
- * true or false.
- * @param {Point} other the other point
- * @return {boolean} whether the points are equal
- */
- equals: function equals(other) {
- return this.x === other.x && this.y === other.y;
- },
- /**
- * Calculate the distance from this point to another point
- * @param {Point} p the other point
- * @return {Number} distance
- */
- dist: function dist(p) {
- return Math.sqrt(this.distSqr(p));
- },
- /**
- * Calculate the distance from this point to another point,
- * without the square root step. Useful if you're comparing
- * relative distances.
- * @param {Point} p the other point
- * @return {Number} distance
- */
- distSqr: function distSqr(p) {
- var dx = p.x - this.x,
- dy = p.y - this.y;
- return dx * dx + dy * dy;
- },
- /**
- * Get the angle from the 0, 0 coordinate to this point, in radians
- * coordinates.
- * @return {Number} angle
- */
- angle: function angle() {
- return Math.atan2(this.y, this.x);
- },
- /**
- * Get the angle from this point to another point, in radians
- * @param {Point} b the other point
- * @return {Number} angle
- */
- angleTo: function angleTo(b) {
- return Math.atan2(this.y - b.y, this.x - b.x);
- },
- /**
- * Get the angle between this point and another point, in radians
- * @param {Point} b the other point
- * @return {Number} angle
- */
- angleWith: function angleWith(b) {
- return this.angleWithSep(b.x, b.y);
- },
- /*
- * Find the angle of the two vectors, solving the formula for
- * the cross product a x b = |a||b|sin(θ) for θ.
- * @param {Number} x the x-coordinate
- * @param {Number} y the y-coordinate
- * @return {Number} the angle in radians
- */
- angleWithSep: function angleWithSep(x, y) {
- return Math.atan2(this.x * y - this.y * x, this.x * x + this.y * y);
- },
- _matMult: function _matMult(m) {
- var x = m[0] * this.x + m[1] * this.y,
- y = m[2] * this.x + m[3] * this.y;
- this.x = x;
- this.y = y;
- return this;
- },
- _add: function _add(p) {
- this.x += p.x;
- this.y += p.y;
- return this;
- },
- _sub: function _sub(p) {
- this.x -= p.x;
- this.y -= p.y;
- return this;
- },
- _mult: function _mult(k) {
- this.x *= k;
- this.y *= k;
- return this;
- },
- _div: function _div(k) {
- this.x /= k;
- this.y /= k;
- return this;
- },
- _multByPoint: function _multByPoint(p) {
- this.x *= p.x;
- this.y *= p.y;
- return this;
- },
- _divByPoint: function _divByPoint(p) {
- this.x /= p.x;
- this.y /= p.y;
- return this;
- },
- _unit: function _unit() {
- this._div(this.mag());
- return this;
- },
- _perp: function _perp() {
- var y = this.y;
- this.y = this.x;
- this.x = -y;
- return this;
- },
- _rotate: function _rotate(angle) {
- var cos = Math.cos(angle),
- sin = Math.sin(angle),
- x = cos * this.x - sin * this.y,
- y = sin * this.x + cos * this.y;
- this.x = x;
- this.y = y;
- return this;
- },
- _rotateAround: function _rotateAround(angle, p) {
- var cos = Math.cos(angle),
- sin = Math.sin(angle),
- x = p.x + cos * (this.x - p.x) - sin * (this.y - p.y),
- y = p.y + sin * (this.x - p.x) + cos * (this.y - p.y);
- this.x = x;
- this.y = y;
- return this;
- },
- _round: function _round() {
- this.x = Math.round(this.x);
- this.y = Math.round(this.y);
- return this;
- }
- };
- /**
- * Construct a point from an array if necessary, otherwise if the input
- * is already a Point, or an unknown type, return it unchanged
- * @param {Array<Number>|Point|*} a any kind of input value
- * @return {Point} constructed point, or passed-through value.
- * @example
- * // this
- * var point = Point.convert([0, 1]);
- * // is equivalent to
- * var point = new Point(0, 1);
- */
- Point.convert = function (a) {
- if (a instanceof Point) {
- return a;
- }
- if (Array.isArray(a)) {
- return new Point(a[0], a[1]);
- }
- return a;
- };
- /***/ }),
- /***/ 721:
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- module.exports.VectorTile = __webpack_require__(473);
- /* unused reexport */ __webpack_require__(233);
- /* unused reexport */ __webpack_require__(557);
- /***/ }),
- /***/ 473:
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- "use strict";
- var VectorTileLayer = __webpack_require__(557);
- module.exports = VectorTile;
- function VectorTile(pbf, end) {
- this.layers = pbf.readFields(readTile, {}, end);
- }
- function readTile(tag, layers, pbf) {
- if (tag === 3) {
- var layer = new VectorTileLayer(pbf, pbf.readVarint() + pbf.pos);
- if (layer.length) layers[layer.name] = layer;
- }
- }
- /***/ }),
- /***/ 233:
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- "use strict";
- var Point = __webpack_require__(525);
- module.exports = VectorTileFeature;
- function VectorTileFeature(pbf, end, extent, keys, values) {
- // Public
- this.properties = {};
- this.extent = extent;
- this.type = 0; // Private
- this._pbf = pbf;
- this._geometry = -1;
- this._keys = keys;
- this._values = values;
- pbf.readFields(readFeature, this, end);
- }
- function readFeature(tag, feature, pbf) {
- if (tag == 1) feature.id = pbf.readVarint();else if (tag == 2) readTag(pbf, feature);else if (tag == 3) feature.type = pbf.readVarint();else if (tag == 4) feature._geometry = pbf.pos;
- }
- function readTag(pbf, feature) {
- var end = pbf.readVarint() + pbf.pos;
- while (pbf.pos < end) {
- var key = feature._keys[pbf.readVarint()],
- value = feature._values[pbf.readVarint()];
- feature.properties[key] = value;
- }
- }
- VectorTileFeature.types = ['Unknown', 'Point', 'LineString', 'Polygon'];
- VectorTileFeature.prototype.loadGeometry = function () {
- var pbf = this._pbf;
- pbf.pos = this._geometry;
- var end = pbf.readVarint() + pbf.pos,
- cmd = 1,
- length = 0,
- x = 0,
- y = 0,
- lines = [],
- line;
- while (pbf.pos < end) {
- if (length <= 0) {
- var cmdLen = pbf.readVarint();
- cmd = cmdLen & 0x7;
- length = cmdLen >> 3;
- }
- length--;
- if (cmd === 1 || cmd === 2) {
- x += pbf.readSVarint();
- y += pbf.readSVarint();
- if (cmd === 1) {
- // moveTo
- if (line) lines.push(line);
- line = [];
- }
- line.push(new Point(x, y));
- } else if (cmd === 7) {
- // Workaround for https://github.com/mapbox/mapnik-vector-tile/issues/90
- if (line) {
- line.push(line[0].clone()); // closePolygon
- }
- } else {
- throw new Error('unknown command ' + cmd);
- }
- }
- if (line) lines.push(line);
- return lines;
- };
- VectorTileFeature.prototype.bbox = function () {
- var pbf = this._pbf;
- pbf.pos = this._geometry;
- var end = pbf.readVarint() + pbf.pos,
- cmd = 1,
- length = 0,
- x = 0,
- y = 0,
- x1 = Infinity,
- x2 = -Infinity,
- y1 = Infinity,
- y2 = -Infinity;
- while (pbf.pos < end) {
- if (length <= 0) {
- var cmdLen = pbf.readVarint();
- cmd = cmdLen & 0x7;
- length = cmdLen >> 3;
- }
- length--;
- if (cmd === 1 || cmd === 2) {
- x += pbf.readSVarint();
- y += pbf.readSVarint();
- if (x < x1) x1 = x;
- if (x > x2) x2 = x;
- if (y < y1) y1 = y;
- if (y > y2) y2 = y;
- } else if (cmd !== 7) {
- throw new Error('unknown command ' + cmd);
- }
- }
- return [x1, y1, x2, y2];
- };
- VectorTileFeature.prototype.toGeoJSON = function (x, y, z) {
- var size = this.extent * Math.pow(2, z),
- x0 = this.extent * x,
- y0 = this.extent * y,
- coords = this.loadGeometry(),
- type = VectorTileFeature.types[this.type],
- i,
- j;
- function project(line) {
- for (var j = 0; j < line.length; j++) {
- var p = line[j],
- y2 = 180 - (p.y + y0) * 360 / size;
- line[j] = [(p.x + x0) * 360 / size - 180, 360 / Math.PI * Math.atan(Math.exp(y2 * Math.PI / 180)) - 90];
- }
- }
- switch (this.type) {
- case 1:
- var points = [];
- for (i = 0; i < coords.length; i++) {
- points[i] = coords[i][0];
- }
- coords = points;
- project(coords);
- break;
- case 2:
- for (i = 0; i < coords.length; i++) {
- project(coords[i]);
- }
- break;
- case 3:
- coords = classifyRings(coords);
- for (i = 0; i < coords.length; i++) {
- for (j = 0; j < coords[i].length; j++) {
- project(coords[i][j]);
- }
- }
- break;
- }
- if (coords.length === 1) {
- coords = coords[0];
- } else {
- type = 'Multi' + type;
- }
- var result = {
- type: "Feature",
- geometry: {
- type: type,
- coordinates: coords
- },
- properties: this.properties
- };
- if ('id' in this) {
- result.id = this.id;
- }
- return result;
- }; // classifies an array of rings into polygons with outer rings and holes
- function classifyRings(rings) {
- var len = rings.length;
- if (len <= 1) return [rings];
- var polygons = [],
- polygon,
- ccw;
- for (var i = 0; i < len; i++) {
- var area = signedArea(rings[i]);
- if (area === 0) continue;
- if (ccw === undefined) ccw = area < 0;
- if (ccw === area < 0) {
- if (polygon) polygons.push(polygon);
- polygon = [rings[i]];
- } else {
- polygon.push(rings[i]);
- }
- }
- if (polygon) polygons.push(polygon);
- return polygons;
- }
- function signedArea(ring) {
- var sum = 0;
- for (var i = 0, len = ring.length, j = len - 1, p1, p2; i < len; j = i++) {
- p1 = ring[i];
- p2 = ring[j];
- sum += (p2.x - p1.x) * (p1.y + p2.y);
- }
- return sum;
- }
- /***/ }),
- /***/ 557:
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- "use strict";
- var VectorTileFeature = __webpack_require__(233);
- module.exports = VectorTileLayer;
- function VectorTileLayer(pbf, end) {
- // Public
- this.version = 1;
- this.name = null;
- this.extent = 4096;
- this.length = 0; // Private
- this._pbf = pbf;
- this._keys = [];
- this._values = [];
- this._features = [];
- pbf.readFields(readLayer, this, end);
- this.length = this._features.length;
- }
- function readLayer(tag, layer, pbf) {
- if (tag === 15) layer.version = pbf.readVarint();else if (tag === 1) layer.name = pbf.readString();else if (tag === 5) layer.extent = pbf.readVarint();else if (tag === 2) layer._features.push(pbf.pos);else if (tag === 3) layer._keys.push(pbf.readString());else if (tag === 4) layer._values.push(readValueMessage(pbf));
- }
- function readValueMessage(pbf) {
- var value = null,
- end = pbf.readVarint() + pbf.pos;
- while (pbf.pos < end) {
- var tag = pbf.readVarint() >> 3;
- value = tag === 1 ? pbf.readString() : tag === 2 ? pbf.readFloat() : tag === 3 ? pbf.readDouble() : tag === 4 ? pbf.readVarint64() : tag === 5 ? pbf.readVarint() : tag === 6 ? pbf.readSVarint() : tag === 7 ? pbf.readBoolean() : null;
- }
- return value;
- } // return feature `i` from this layer as a `VectorTileFeature`
- VectorTileLayer.prototype.feature = function (i) {
- if (i < 0 || i >= this._features.length) throw new Error('feature index out of bounds');
- this._pbf.pos = this._features[i];
- var end = this._pbf.readVarint() + this._pbf.pos;
- return new VectorTileFeature(this._pbf, end, this.extent, this._keys, this._values);
- };
- /***/ }),
- /***/ 937:
- /***/ (function(module) {
- (function (self) {
- 'use strict'; // if __disableNativeFetch is set to true, the it will always polyfill fetch
- // with Ajax.
- if (!self.__disableNativeFetch && self.fetch) {
- return;
- }
- function normalizeName(name) {
- if (typeof name !== 'string') {
- name = String(name);
- }
- if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
- throw new TypeError('Invalid character in header field name');
- }
- return name.toLowerCase();
- }
- function normalizeValue(value) {
- if (typeof value !== 'string') {
- value = String(value);
- }
- return value;
- }
- function Headers(headers) {
- this.map = {};
- if (headers instanceof Headers) {
- headers.forEach(function (value, name) {
- this.append(name, value);
- }, this);
- } else if (headers) {
- Object.getOwnPropertyNames(headers).forEach(function (name) {
- this.append(name, headers[name]);
- }, this);
- }
- }
- Headers.prototype.append = function (name, value) {
- name = normalizeName(name);
- value = normalizeValue(value);
- var list = this.map[name];
- if (!list) {
- list = [];
- this.map[name] = list;
- }
- list.push(value);
- };
- Headers.prototype['delete'] = function (name) {
- delete this.map[normalizeName(name)];
- };
- Headers.prototype.get = function (name) {
- var values = this.map[normalizeName(name)];
- return values ? values[0] : null;
- };
- Headers.prototype.getAll = function (name) {
- return this.map[normalizeName(name)] || [];
- };
- Headers.prototype.has = function (name) {
- return this.map.hasOwnProperty(normalizeName(name));
- };
- Headers.prototype.set = function (name, value) {
- this.map[normalizeName(name)] = [normalizeValue(value)];
- };
- Headers.prototype.forEach = function (callback, thisArg) {
- Object.getOwnPropertyNames(this.map).forEach(function (name) {
- this.map[name].forEach(function (value) {
- callback.call(thisArg, value, name, this);
- }, this);
- }, this);
- };
- function consumed(body) {
- if (body.bodyUsed) {
- return Promise.reject(new TypeError('Already read'));
- }
- body.bodyUsed = true;
- }
- function fileReaderReady(reader) {
- return new Promise(function (resolve, reject) {
- reader.onload = function () {
- resolve(reader.result);
- };
- reader.onerror = function () {
- reject(reader.error);
- };
- });
- }
- function readBlobAsArrayBuffer(blob) {
- var reader = new FileReader();
- reader.readAsArrayBuffer(blob);
- return fileReaderReady(reader);
- }
- function readBlobAsText(blob, options) {
- var reader = new FileReader();
- var contentType = options.headers.map['content-type'] ? options.headers.map['content-type'].toString() : '';
- var regex = /charset\=[0-9a-zA-Z\-\_]*;?/;
- var _charset = blob.type.match(regex) || contentType.match(regex);
- var args = [blob];
- if (_charset) {
- args.push(_charset[0].replace(/^charset\=/, '').replace(/;$/, ''));
- }
- reader.readAsText.apply(reader, args);
- return fileReaderReady(reader);
- }
- var support = {
- blob: 'FileReader' in self && 'Blob' in self && function () {
- try {
- new Blob();
- return true;
- } catch (e) {
- return false;
- }
- }(),
- formData: 'FormData' in self,
- arrayBuffer: 'ArrayBuffer' in self
- };
- function Body() {
- this.bodyUsed = false;
- this._initBody = function (body, options) {
- this._bodyInit = body;
- if (typeof body === 'string') {
- this._bodyText = body;
- } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
- this._bodyBlob = body;
- this._options = options;
- } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
- this._bodyFormData = body;
- } else if (!body) {
- this._bodyText = '';
- } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {// Only support ArrayBuffers for POST method.
- // Receiving ArrayBuffers happens via Blobs, instead.
- } else {
- throw new Error('unsupported BodyInit type');
- }
- };
- if (support.blob) {
- this.blob = function () {
- var rejected = consumed(this);
- if (rejected) {
- return rejected;
- }
- if (this._bodyBlob) {
- return Promise.resolve(this._bodyBlob);
- } else if (this._bodyFormData) {
- throw new Error('could not read FormData body as blob');
- } else {
- return Promise.resolve(new Blob([this._bodyText]));
- }
- };
- this.arrayBuffer = function () {
- return this.blob().then(readBlobAsArrayBuffer);
- };
- this.text = function () {
- var rejected = consumed(this);
- if (rejected) {
- return rejected;
- }
- if (this._bodyBlob) {
- return readBlobAsText(this._bodyBlob, this._options);
- } else if (this._bodyFormData) {
- throw new Error('could not read FormData body as text');
- } else {
- return Promise.resolve(this._bodyText);
- }
- };
- } else {
- this.text = function () {
- var rejected = consumed(this);
- return rejected ? rejected : Promise.resolve(this._bodyText);
- };
- }
- if (support.formData) {
- this.formData = function () {
- return this.text().then(decode);
- };
- }
- this.json = function () {
- return this.text().then(JSON.parse);
- };
- return this;
- } // HTTP methods whose capitalization should be normalized
- var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
- function normalizeMethod(method) {
- var upcased = method.toUpperCase();
- return methods.indexOf(upcased) > -1 ? upcased : method;
- }
- function Request(input, options) {
- options = options || {};
- var body = options.body;
- if (Request.prototype.isPrototypeOf(input)) {
- if (input.bodyUsed) {
- throw new TypeError('Already read');
- }
- this.url = input.url;
- this.credentials = input.credentials;
- if (!options.headers) {
- this.headers = new Headers(input.headers);
- }
- this.method = input.method;
- this.mode = input.mode;
- if (!body) {
- body = input._bodyInit;
- input.bodyUsed = true;
- }
- } else {
- this.url = input;
- }
- this.credentials = options.credentials || this.credentials || 'omit';
- if (options.headers || !this.headers) {
- this.headers = new Headers(options.headers);
- }
- this.method = normalizeMethod(options.method || this.method || 'GET');
- this.mode = options.mode || this.mode || null;
- this.referrer = null;
- if ((this.method === 'GET' || this.method === 'HEAD') && body) {
- throw new TypeError('Body not allowed for GET or HEAD requests');
- }
- this._initBody(body, options);
- }
- Request.prototype.clone = function () {
- return new Request(this);
- };
- function decode(body) {
- var form = new FormData();
- body.trim().split('&').forEach(function (bytes) {
- if (bytes) {
- var split = bytes.split('=');
- var name = split.shift().replace(/\+/g, ' ');
- var value = split.join('=').replace(/\+/g, ' ');
- form.append(decodeURIComponent(name), decodeURIComponent(value));
- }
- });
- return form;
- }
- function headers(xhr) {
- var head = new Headers();
- var pairs = xhr.getAllResponseHeaders().trim().split('\n');
- pairs.forEach(function (header) {
- var split = header.trim().split(':');
- var key = split.shift().trim();
- var value = split.join(':').trim();
- head.append(key, value);
- });
- return head;
- }
- Body.call(Request.prototype);
- function Response(bodyInit, options) {
- if (!options) {
- options = {};
- }
- this._initBody(bodyInit, options);
- this.type = 'default';
- this.status = options.status;
- this.ok = this.status >= 200 && this.status < 300;
- this.statusText = options.statusText;
- this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers);
- this.url = options.url || '';
- }
- Body.call(Response.prototype);
- Response.prototype.clone = function () {
- return new Response(this._bodyInit, {
- status: this.status,
- statusText: this.statusText,
- headers: new Headers(this.headers),
- url: this.url
- });
- };
- Response.error = function () {
- var response = new Response(null, {
- status: 0,
- statusText: ''
- });
- response.type = 'error';
- return response;
- };
- var redirectStatuses = [301, 302, 303, 307, 308];
- Response.redirect = function (url, status) {
- if (redirectStatuses.indexOf(status) === -1) {
- throw new RangeError('Invalid status code');
- }
- return new Response(null, {
- status: status,
- headers: {
- location: url
- }
- });
- };
- self.Headers = Headers;
- self.Request = Request;
- self.Response = Response;
- self.fetch = function (input, init) {
- return new Promise(function (resolve, reject) {
- var request;
- if (Request.prototype.isPrototypeOf(input) && !init) {
- request = input;
- } else {
- request = new Request(input, init);
- }
- var xhr = new XMLHttpRequest();
- function responseURL() {
- if ('responseURL' in xhr) {
- return xhr.responseURL;
- } // Avoid security warnings on getResponseHeader when not allowed by CORS
- if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
- return xhr.getResponseHeader('X-Request-URL');
- }
- return;
- }
- var __onLoadHandled = false;
- function onload() {
- if (xhr.readyState !== 4) {
- return;
- }
- var status = xhr.status === 1223 ? 204 : xhr.status;
- if (status < 100 || status > 599) {
- if (__onLoadHandled) {
- return;
- } else {
- __onLoadHandled = true;
- }
- reject(new TypeError('Network request failed'));
- return;
- }
- var options = {
- status: status,
- statusText: xhr.statusText,
- headers: headers(xhr),
- url: responseURL()
- };
- var body = 'response' in xhr ? xhr.response : xhr.responseText;
- if (__onLoadHandled) {
- return;
- } else {
- __onLoadHandled = true;
- }
- resolve(new Response(body, options));
- }
- xhr.onreadystatechange = onload;
- xhr.onload = onload;
- xhr.onerror = function () {
- if (__onLoadHandled) {
- return;
- } else {
- __onLoadHandled = true;
- }
- reject(new TypeError('Network request failed'));
- };
- xhr.open(request.method, request.url, true); // `withCredentials` should be setted after calling `.open` in IE10
- // http://stackoverflow.com/a/19667959/1219343
- try {
- if (request.credentials === 'include') {
- if ('withCredentials' in xhr) {
- xhr.withCredentials = true;
- } else {
- console && console.warn && console.warn('withCredentials is not supported, you can ignore this warning');
- }
- }
- } catch (e) {
- console && console.warn && console.warn('set withCredentials error:' + e);
- }
- if ('responseType' in xhr && support.blob) {
- xhr.responseType = 'blob';
- }
- request.headers.forEach(function (value, name) {
- xhr.setRequestHeader(name, value);
- });
- xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
- });
- };
- self.fetch.polyfill = true; // Support CommonJS
- if ( true && module.exports) {
- module.exports = self.fetch;
- }
- })(typeof self !== 'undefined' ? self : this);
- /***/ }),
- /***/ 238:
- /***/ (function(module, exports) {
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
- if (true) {
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, module], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else { var mod; }
- })(this, function (exports, module) {
- 'use strict';
- var defaultOptions = {
- timeout: 5000,
- jsonpCallback: 'callback',
- jsonpCallbackFunction: null
- };
- function generateCallbackFunction() {
- return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);
- }
- function clearFunction(functionName) {
- // IE8 throws an exception when you try to delete a property on window
- // http://stackoverflow.com/a/1824228/751089
- try {
- delete window[functionName];
- } catch (e) {
- window[functionName] = undefined;
- }
- }
- function removeScript(scriptId) {
- var script = document.getElementById(scriptId);
- if (script) {
- document.getElementsByTagName('head')[0].removeChild(script);
- }
- }
- function fetchJsonp(_url) {
- var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; // to avoid param reassign
- var url = _url;
- var timeout = options.timeout || defaultOptions.timeout;
- var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;
- var timeoutId = undefined;
- return new Promise(function (resolve, reject) {
- var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();
- var scriptId = jsonpCallback + '_' + callbackFunction;
- window[callbackFunction] = function (response) {
- resolve({
- ok: true,
- // keep consistent with fetch API
- json: function json() {
- return Promise.resolve(response);
- }
- });
- if (timeoutId) clearTimeout(timeoutId);
- removeScript(scriptId);
- clearFunction(callbackFunction);
- }; // Check if the user set their own params, and if not add a ? to start a list of params
- url += url.indexOf('?') === -1 ? '?' : '&';
- var jsonpScript = document.createElement('script');
- jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);
- if (options.charset) {
- jsonpScript.setAttribute('charset', options.charset);
- }
- jsonpScript.id = scriptId;
- document.getElementsByTagName('head')[0].appendChild(jsonpScript);
- timeoutId = setTimeout(function () {
- reject(new Error('JSONP request to ' + _url + ' timed out'));
- clearFunction(callbackFunction);
- removeScript(scriptId);
- window[callbackFunction] = function () {
- clearFunction(callbackFunction);
- };
- }, timeout); // Caught if got 404/500
- jsonpScript.onerror = function () {
- reject(new Error('JSONP request to ' + _url + ' failed'));
- clearFunction(callbackFunction);
- removeScript(scriptId);
- if (timeoutId) clearTimeout(timeoutId);
- };
- });
- } // export as global function
- /*
- let local;
- if (typeof global !== 'undefined') {
- local = global;
- } else if (typeof self !== 'undefined') {
- local = self;
- } else {
- try {
- local = Function('return this')();
- } catch (e) {
- throw new Error('polyfill failed because global object is unavailable in this environment');
- }
- }
- local.fetchJsonp = fetchJsonp;
- */
- module.exports = fetchJsonp;
- });
- /***/ }),
- /***/ 299:
- /***/ (function(__unused_webpack_module, exports) {
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
- exports.read = function (buffer, offset, isLE, mLen, nBytes) {
- var e, m;
- var eLen = nBytes * 8 - mLen - 1;
- var eMax = (1 << eLen) - 1;
- var eBias = eMax >> 1;
- var nBits = -7;
- var i = isLE ? nBytes - 1 : 0;
- var d = isLE ? -1 : 1;
- var s = buffer[offset + i];
- i += d;
- e = s & (1 << -nBits) - 1;
- s >>= -nBits;
- nBits += eLen;
- for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
- m = e & (1 << -nBits) - 1;
- e >>= -nBits;
- nBits += mLen;
- for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
- if (e === 0) {
- e = 1 - eBias;
- } else if (e === eMax) {
- return m ? NaN : (s ? -1 : 1) * Infinity;
- } else {
- m = m + Math.pow(2, mLen);
- e = e - eBias;
- }
- return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
- };
- exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
- var e, m, c;
- var eLen = nBytes * 8 - mLen - 1;
- var eMax = (1 << eLen) - 1;
- var eBias = eMax >> 1;
- var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
- var i = isLE ? 0 : nBytes - 1;
- var d = isLE ? 1 : -1;
- var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
- value = Math.abs(value);
- if (isNaN(value) || value === Infinity) {
- m = isNaN(value) ? 1 : 0;
- e = eMax;
- } else {
- e = Math.floor(Math.log(value) / Math.LN2);
- if (value * (c = Math.pow(2, -e)) < 1) {
- e--;
- c *= 2;
- }
- if (e + eBias >= 1) {
- value += rt / c;
- } else {
- value += rt * Math.pow(2, 1 - eBias);
- }
- if (value * c >= 2) {
- e++;
- c /= 2;
- }
- if (e + eBias >= eMax) {
- m = 0;
- e = eMax;
- } else if (e + eBias >= 1) {
- m = (value * c - 1) * Math.pow(2, mLen);
- e = e + eBias;
- } else {
- m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
- e = 0;
- }
- }
- for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
- e = e << mLen | m;
- eLen += mLen;
- for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
- buffer[offset + i - d] |= s * 128;
- };
- /***/ }),
- /***/ 879:
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- 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); }
- var utils = __webpack_require__(99);
- var AND = '&&',
- OR = '||',
- AND_STR = 'and',
- OR_STR = 'or',
- NOT = '!',
- EQUAL = '=',
- LIKE = '~',
- NOTEQUAL = NOT + EQUAL,
- NOTLIKE = NOT + LIKE,
- GT = '>',
- GE = '>=',
- LT = '<',
- LE = '<=',
- WILDCARD = '*',
- COMMA = ',',
- DELIMITER = '.',
- LEFT = '(',
- RIGHT = ')',
- WHERE = 'where',
- synopsis = {
- pathway: [],
- groups: {}
- },
- AST = {},
- options = {};
- var print = console.log; // ------------------ splitter -------------------- //
- function Tokenize(query) {
- var parts = __splitTrim(query, WHERE);
- var pathway = parts[0];
- var where = parts[1];
- synopsis.pathway = __splitTrim(pathway, COMMA);
- for (var i = 0, len = synopsis.pathway.length; i < len; i++) {
- synopsis.pathway[i] = __splitTrim(synopsis.pathway[i], DELIMITER);
- if (synopsis.pathway[i][0] == WILDCARD) synopsis.pathway[i].shift();
- if (synopsis.pathway[i].length === 0) synopsis.pathway.splice(i, 1);
- }
- var lastLeft = -1,
- lastRight = -1,
- current = 0;
- while (current < where.length) {
- if (where[current] === LEFT) {
- lastLeft = current;
- } else if (where[current] === RIGHT) {
- lastRight = current;
- if (lastRight > lastLeft && lastLeft !== -1) {
- var k = 'gr' + '_' + new Date().getTime();
- synopsis.groups[k] = where.substring(lastLeft + 1, lastRight);
- where = where.replace(LEFT + synopsis.groups[k] + RIGHT, k);
- current = -1;
- }
- }
- current += 1;
- }
- LogicalGrouping(AST, where);
- }
- function LogicalGrouping(current, where) {
- var lastAnd = __findIndex(where, AND),
- lastOr = __findIndex(where, OR);
- if (lastAnd !== Number.MAX_VALUE || lastOr !== Number.MAX_VALUE) {
- if (lastAnd < lastOr) {
- current.and = current.and || [];
- var parts = __splitTrim(where, AND);
- current.and.push(parts[0]);
- LogicalGrouping(current.and, parts[1]);
- } else {
- current.or = current.or || [];
- var parts = __splitTrim(where, OR);
- current.or.push(parts[0]);
- LogicalGrouping(current.or, parts[1]);
- }
- } else {
- if (synopsis.groups[where]) {
- where = synopsis.groups[where];
- LogicalGrouping(current, where);
- } else {
- if (Array.isArray(current)) current.push(where);else current.or = [where];
- ExtractExpression(AST.or ? AST.or : AST.and);
- }
- }
- }
- function ExtractExpression(logicalGroup) {
- for (var k in logicalGroup) {
- if (logicalGroup.hasOwnProperty(k)) {
- if (Array.isArray(logicalGroup[k])) {
- ExtractExpression(logicalGroup[k]);
- } else if (typeof logicalGroup[k] === 'string') {
- if (__contains(logicalGroup[k], NOTEQUAL)) {
- var parts = __splitTrim(logicalGroup[k], NOTEQUAL);
- logicalGroup[k] = {
- ne: [parts[0], parts[1]]
- };
- } else if (__contains(logicalGroup[k], NOTLIKE)) {
- var parts = __splitTrim(logicalGroup[k], NOTLIKE);
- logicalGroup[k] = {
- nreq: [parts[0], parts[1]]
- };
- } else if (__contains(logicalGroup[k], LIKE)) {
- var parts = __splitTrim(logicalGroup[k], LIKE);
- logicalGroup[k] = {
- // rough eq
- req: [parts[0], parts[1]]
- };
- } else if (__contains(logicalGroup[k], GE)) {
- var parts = __splitTrim(logicalGroup[k], GE);
- logicalGroup[k] = {
- // greater than or equal
- ge: [parts[0], parts[1]]
- };
- } else if (__contains(logicalGroup[k], GT)) {
- var parts = __splitTrim(logicalGroup[k], GT);
- logicalGroup[k] = {
- // greater than
- gt: [parts[0], parts[1]]
- };
- } else if (__contains(logicalGroup[k], LE)) {
- var parts = __splitTrim(logicalGroup[k], LE);
- logicalGroup[k] = {
- // less than or equal
- le: [parts[0], parts[1]]
- };
- } else if (__contains(logicalGroup[k], LT)) {
- var parts = __splitTrim(logicalGroup[k], LT);
- logicalGroup[k] = {
- // less than
- lt: [parts[0], parts[1]]
- };
- } else if (__contains(logicalGroup[k], EQUAL)) {
- var parts = __splitTrim(logicalGroup[k], EQUAL);
- logicalGroup[k] = {
- eq: [parts[0], parts[1]]
- };
- }
- }
- }
- }
- }
- function __findIndex(str, token) {
- var index = str.indexOf(token);
- return index === -1 ? Number.MAX_VALUE : index;
- }
- function __splitTrim(str, token) {
- return str.split(token).map(function (p) {
- return p.trim();
- });
- }
- function __contains(a, b) {
- return a.indexOf(b) > -1;
- }
- function __hierarchize(obj, dottedPath) {
- var parts = __splitTrim(dottedPath, DELIMITER);
- var res = obj;
- for (var p in parts) {
- if (res.hasOwnProperty(parts[p])) res = res[parts[p]];else return '';
- } // support comparison for Date/DateString
- if (utils.isDate(res)) res = res.valueOf();else if (utils.isDateString(res)) res = utils.parseDateFromString(res);else res = res.toString();
- return res;
- }
- function FilterOR(ASTNode, row) {
- var res = false;
- for (var k in ASTNode) {
- var filterFunc = k === AND_STR ? FilterAND : k === OR_STR ? FilterOR : Filter;
- res = res || filterFunc(ASTNode[k], row);
- if (options.trace) print(synopsis.step, '======((( or', ASTNode[k], res);
- if (res) return res;
- }
- return res;
- }
- function FilterAND(ASTNode, row) {
- var res = true;
- for (var k in ASTNode) {
- var filterFunc = k === AND_STR ? FilterAND : k === OR_STR ? FilterOR : Filter;
- res = res && filterFunc(ASTNode[k], row);
- if (options.trace) print(synopsis.step, '======((( and', ASTNode[k], res);
- if (!res) return res;
- }
- return res;
- }
- function Filter(ASTNode, row) {
- synopsis.step += 1;
- if (ASTNode.or) {
- var res = FilterOR(ASTNode.or, row);
- if (options.trace) print(synopsis.step, 'OR', ASTNode, res);
- return res;
- } else if (ASTNode.and) {
- var res = FilterAND(ASTNode.and, row);
- if (options.trace) print(synopsis.step, 'AND', ASTNode, res);
- return res;
- } else if (_typeof(ASTNode) === 'object') {
- if (ASTNode.eq) {
- // =
- return __hierarchize(row, ASTNode.eq[0]) === ASTNode.eq[1];
- } else if (ASTNode.ne) {
- // !=
- return __hierarchize(row, ASTNode.ne[0]) !== ASTNode.ne[1];
- } else if (ASTNode.req) {
- // ~
- return __contains(__hierarchize(row, ASTNode.req[0]), ASTNode.req[1]);
- } else if (ASTNode.nreq) {
- // ~
- return !__contains(__hierarchize(row, ASTNode.nreq[0]), ASTNode.nreq[1]);
- } else if (ASTNode.gt) {
- // >
- return __hierarchize(row, ASTNode.gt[0]) > ASTNode.gt[1];
- } else if (ASTNode.ge) {
- // >=
- return __hierarchize(row, ASTNode.ge[0]) >= ASTNode.ge[1];
- } else if (ASTNode.lt) {
- // <
- return __hierarchize(row, ASTNode.lt[0]) < ASTNode.lt[1];
- } else if (ASTNode.le) {
- // <=
- return __hierarchize(row, ASTNode.le[0]) <= ASTNode.le[1];
- } else {
- return Filter(ASTNode, row);
- }
- }
- }
- function Parse(dataSource) {
- var result = [];
- for (var k in dataSource) {
- if (Filter(AST, dataSource[k])) result.push(dataSource[k]);
- }
- return result;
- }
- function Fields(result) {
- if (result && synopsis.pathway.length > 0) {
- //print(synopsis.pathway);
- return result.map(function (ele) {
- var res = {};
- for (var i = 0, len = synopsis.pathway.length; i < len; i++) {
- var key = synopsis.pathway[i].join(DELIMITER);
- res[key] = __hierarchize(ele, key);
- }
- return res;
- });
- }
- return result;
- }
- function Query(dataSource, query, opts) {
- synopsis = {
- pathway: [],
- groups: {},
- step: 0
- };
- AST = {};
- opts = opts || {
- trace: false
- };
- options = opts;
- Tokenize(query);
- return Fields(Parse(dataSource));
- }
- if ( true && typeof module.exports != 'undefined') module.exports = Query;
- if (typeof window != 'undefined') window.Query = Query;
- /***/ }),
- /***/ 99:
- /***/ (function(module) {
- function getObjectType(obj) {
- return Object.prototype.toString.call(obj);
- }
- function isDate(obj) {
- return getObjectType(obj) === '[object Date]';
- }
- function isString(obj) {
- return getObjectType(obj) === '[object String]';
- }
- function isDateString(obj) {
- return isString(obj) && !isNaN(Date.parse(obj));
- }
- function isNumber(obj) {
- return typeof obj === 'number';
- }
- function parseDateFromString(str) {
- return Date.parse(str);
- }
- module.exports = {
- getObjectType: getObjectType,
- isDate: isDate,
- isString: isString,
- isDateString: isDateString,
- parseDateFromString: parseDateFromString,
- isNumber: isNumber
- };
- /***/ }),
- /***/ 820:
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- 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); }
- /**
- * lodash (Custom Build) <https://lodash.com/>
- * Build: `lodash modularize exports="npm" -o ./`
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
- /** Used as references for various `Number` constants. */
- var MAX_SAFE_INTEGER = 9007199254740991;
- /** `Object#toString` result references. */
- var argsTag = '[object Arguments]',
- funcTag = '[object Function]',
- genTag = '[object GeneratorFunction]',
- mapTag = '[object Map]',
- objectTag = '[object Object]',
- promiseTag = '[object Promise]',
- setTag = '[object Set]',
- weakMapTag = '[object WeakMap]';
- var dataViewTag = '[object DataView]';
- /**
- * Used to match `RegExp`
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
- */
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
- /** Used to detect host constructors (Safari). */
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
- /** Used to detect unsigned integer values. */
- var reIsUint = /^(?:0|[1-9]\d*)$/;
- /** Detect free variable `global` from Node.js. */
- var freeGlobal = (typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
- /** Detect free variable `self`. */
- var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
- /** Used as a reference to the global object. */
- var root = freeGlobal || freeSelf || Function('return this')();
- /**
- * A specialized version of `_.map` for arrays without support for iteratee
- * shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the new mapped array.
- */
- function arrayMap(array, iteratee) {
- var index = -1,
- length = array ? array.length : 0,
- result = Array(length);
- while (++index < length) {
- result[index] = iteratee(array[index], index, array);
- }
- return result;
- }
- /**
- * The base implementation of `_.times` without support for iteratee shorthands
- * or max array length checks.
- *
- * @private
- * @param {number} n The number of times to invoke `iteratee`.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the array of results.
- */
- function baseTimes(n, iteratee) {
- var index = -1,
- result = Array(n);
- while (++index < n) {
- result[index] = iteratee(index);
- }
- return result;
- }
- /**
- * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
- * of key-value pairs for `object` corresponding to the property names of `props`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array} props The property names to get values for.
- * @returns {Object} Returns the key-value pairs.
- */
- function baseToPairs(object, props) {
- return arrayMap(props, function (key) {
- return [key, object[key]];
- });
- }
- /**
- * Gets the value at `key` of `object`.
- *
- * @private
- * @param {Object} [object] The object to query.
- * @param {string} key The key of the property to get.
- * @returns {*} Returns the property value.
- */
- function getValue(object, key) {
- return object == null ? undefined : object[key];
- }
- /**
- * Checks if `value` is a host object in IE < 9.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
- */
- function isHostObject(value) {
- // Many host objects are `Object` objects that can coerce to strings
- // despite having improperly defined `toString` methods.
- var result = false;
- if (value != null && typeof value.toString != 'function') {
- try {
- result = !!(value + '');
- } catch (e) {}
- }
- return result;
- }
- /**
- * Converts `map` to its key-value pairs.
- *
- * @private
- * @param {Object} map The map to convert.
- * @returns {Array} Returns the key-value pairs.
- */
- function mapToArray(map) {
- var index = -1,
- result = Array(map.size);
- map.forEach(function (value, key) {
- result[++index] = [key, value];
- });
- return result;
- }
- /**
- * Creates a unary function that invokes `func` with its argument transformed.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {Function} transform The argument transform.
- * @returns {Function} Returns the new function.
- */
- function overArg(func, transform) {
- return function (arg) {
- return func(transform(arg));
- };
- }
- /**
- * Converts `set` to its value-value pairs.
- *
- * @private
- * @param {Object} set The set to convert.
- * @returns {Array} Returns the value-value pairs.
- */
- function setToPairs(set) {
- var index = -1,
- result = Array(set.size);
- set.forEach(function (value) {
- result[++index] = [value, value];
- });
- return result;
- }
- /** Used for built-in method references. */
- var funcProto = Function.prototype,
- objectProto = Object.prototype;
- /** Used to detect overreaching core-js shims. */
- var coreJsData = root['__core-js_shared__'];
- /** Used to detect methods masquerading as native. */
- var maskSrcKey = function () {
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
- return uid ? 'Symbol(src)_1.' + uid : '';
- }();
- /** Used to resolve the decompiled source of functions. */
- var funcToString = funcProto.toString;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
- var objectToString = objectProto.toString;
- /** Used to detect if a method is native. */
- var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
- /** Built-in value references. */
- var propertyIsEnumerable = objectProto.propertyIsEnumerable;
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeKeys = overArg(Object.keys, Object);
- /* Built-in method references that are verified to be native. */
- var DataView = getNative(root, 'DataView'),
- Map = getNative(root, 'Map'),
- Promise = getNative(root, 'Promise'),
- Set = getNative(root, 'Set'),
- WeakMap = getNative(root, 'WeakMap');
- /** Used to detect maps, sets, and weakmaps. */
- var dataViewCtorString = toSource(DataView),
- mapCtorString = toSource(Map),
- promiseCtorString = toSource(Promise),
- setCtorString = toSource(Set),
- weakMapCtorString = toSource(WeakMap);
- /**
- * Creates an array of the enumerable property names of the array-like `value`.
- *
- * @private
- * @param {*} value The value to query.
- * @param {boolean} inherited Specify returning inherited property names.
- * @returns {Array} Returns the array of property names.
- */
- function arrayLikeKeys(value, inherited) {
- // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
- // Safari 9 makes `arguments.length` enumerable in strict mode.
- var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
- var length = result.length,
- skipIndexes = !!length;
- for (var key in value) {
- if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
- result.push(key);
- }
- }
- return result;
- }
- /**
- * The base implementation of `getTag`.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the `toStringTag`.
- */
- function baseGetTag(value) {
- return objectToString.call(value);
- }
- /**
- * The base implementation of `_.isNative` without bad shim checks.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a native function,
- * else `false`.
- */
- function baseIsNative(value) {
- if (!isObject(value) || isMasked(value)) {
- return false;
- }
- var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
- return pattern.test(toSource(value));
- }
- /**
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
- function baseKeys(object) {
- if (!isPrototype(object)) {
- return nativeKeys(object);
- }
- var result = [];
- for (var key in Object(object)) {
- if (hasOwnProperty.call(object, key) && key != 'constructor') {
- result.push(key);
- }
- }
- return result;
- }
- /**
- * Creates a `_.toPairs` or `_.toPairsIn` function.
- *
- * @private
- * @param {Function} keysFunc The function to get the keys of a given object.
- * @returns {Function} Returns the new pairs function.
- */
- function createToPairs(keysFunc) {
- return function (object) {
- var tag = getTag(object);
- if (tag == mapTag) {
- return mapToArray(object);
- }
- if (tag == setTag) {
- return setToPairs(object);
- }
- return baseToPairs(object, keysFunc(object));
- };
- }
- /**
- * Gets the native function at `key` of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {string} key The key of the method to get.
- * @returns {*} Returns the function if it's native, else `undefined`.
- */
- function getNative(object, key) {
- var value = getValue(object, key);
- return baseIsNative(value) ? value : undefined;
- }
- /**
- * Gets the `toStringTag` of `value`.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the `toStringTag`.
- */
- var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11,
- // for data views in Edge < 14, and promises in Node.js.
- 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) {
- getTag = function getTag(value) {
- var result = objectToString.call(value),
- Ctor = result == objectTag ? value.constructor : undefined,
- ctorString = Ctor ? toSource(Ctor) : undefined;
- if (ctorString) {
- switch (ctorString) {
- case dataViewCtorString:
- return dataViewTag;
- case mapCtorString:
- return mapTag;
- case promiseCtorString:
- return promiseTag;
- case setCtorString:
- return setTag;
- case weakMapCtorString:
- return weakMapTag;
- }
- }
- return result;
- };
- }
- /**
- * Checks if `value` is a valid array-like index.
- *
- * @private
- * @param {*} value The value to check.
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
- */
- function isIndex(value, length) {
- length = length == null ? MAX_SAFE_INTEGER : length;
- return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
- }
- /**
- * Checks if `func` has its source masked.
- *
- * @private
- * @param {Function} func The function to check.
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
- */
- function isMasked(func) {
- return !!maskSrcKey && maskSrcKey in func;
- }
- /**
- * Checks if `value` is likely a prototype object.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
- */
- function isPrototype(value) {
- var Ctor = value && value.constructor,
- proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
- return value === proto;
- }
- /**
- * Converts `func` to its source code.
- *
- * @private
- * @param {Function} func The function to process.
- * @returns {string} Returns the source code.
- */
- function toSource(func) {
- if (func != null) {
- try {
- return funcToString.call(func);
- } catch (e) {}
- try {
- return func + '';
- } catch (e) {}
- }
- return '';
- }
- /**
- * Checks if `value` is likely an `arguments` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
- * else `false`.
- * @example
- *
- * _.isArguments(function() { return arguments; }());
- * // => true
- *
- * _.isArguments([1, 2, 3]);
- * // => false
- */
- function isArguments(value) {
- // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
- return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
- }
- /**
- * Checks if `value` is classified as an `Array` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
- * @example
- *
- * _.isArray([1, 2, 3]);
- * // => true
- *
- * _.isArray(document.body.children);
- * // => false
- *
- * _.isArray('abc');
- * // => false
- *
- * _.isArray(_.noop);
- * // => false
- */
- var isArray = Array.isArray;
- /**
- * Checks if `value` is array-like. A value is considered array-like if it's
- * not a function and has a `value.length` that's an integer greater than or
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
- * @example
- *
- * _.isArrayLike([1, 2, 3]);
- * // => true
- *
- * _.isArrayLike(document.body.children);
- * // => true
- *
- * _.isArrayLike('abc');
- * // => true
- *
- * _.isArrayLike(_.noop);
- * // => false
- */
- function isArrayLike(value) {
- return value != null && isLength(value.length) && !isFunction(value);
- }
- /**
- * This method is like `_.isArrayLike` except that it also checks if `value`
- * is an object.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array-like object,
- * else `false`.
- * @example
- *
- * _.isArrayLikeObject([1, 2, 3]);
- * // => true
- *
- * _.isArrayLikeObject(document.body.children);
- * // => true
- *
- * _.isArrayLikeObject('abc');
- * // => false
- *
- * _.isArrayLikeObject(_.noop);
- * // => false
- */
- function isArrayLikeObject(value) {
- return isObjectLike(value) && isArrayLike(value);
- }
- /**
- * Checks if `value` is classified as a `Function` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
- * @example
- *
- * _.isFunction(_);
- * // => true
- *
- * _.isFunction(/abc/);
- * // => false
- */
- function isFunction(value) {
- // The use of `Object#toString` avoids issues with the `typeof` operator
- // in Safari 8-9 which returns 'object' for typed array and other constructors.
- var tag = isObject(value) ? objectToString.call(value) : '';
- return tag == funcTag || tag == genTag;
- }
- /**
- * Checks if `value` is a valid array-like length.
- *
- * **Note:** This method is loosely based on
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
- * @example
- *
- * _.isLength(3);
- * // => true
- *
- * _.isLength(Number.MIN_VALUE);
- * // => false
- *
- * _.isLength(Infinity);
- * // => false
- *
- * _.isLength('3');
- * // => false
- */
- function isLength(value) {
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
- }
- /**
- * Checks if `value` is the
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(_.noop);
- * // => true
- *
- * _.isObject(null);
- * // => false
- */
- function isObject(value) {
- var type = _typeof(value);
- return !!value && (type == 'object' || type == 'function');
- }
- /**
- * Checks if `value` is object-like. A value is object-like if it's not `null`
- * and has a `typeof` result of "object".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- * @example
- *
- * _.isObjectLike({});
- * // => true
- *
- * _.isObjectLike([1, 2, 3]);
- * // => true
- *
- * _.isObjectLike(_.noop);
- * // => false
- *
- * _.isObjectLike(null);
- * // => false
- */
- function isObjectLike(value) {
- return !!value && _typeof(value) == 'object';
- }
- /**
- * Creates an array of the own enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects. See the
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
- * for more details.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keys(new Foo);
- * // => ['a', 'b'] (iteration order is not guaranteed)
- *
- * _.keys('hi');
- * // => ['0', '1']
- */
- function keys(object) {
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
- }
- /**
- * Creates an array of own enumerable string keyed-value pairs for `object`
- * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
- * entries are returned.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @alias entries
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the key-value pairs.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.toPairs(new Foo);
- * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
- */
- var toPairs = createToPairs(keys);
- module.exports = toPairs;
- /***/ }),
- /***/ 943:
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- "use strict";
- module.exports = Pbf;
- var ieee754 = __webpack_require__(299);
- function Pbf(buf) {
- this.buf = ArrayBuffer.isView && ArrayBuffer.isView(buf) ? buf : new Uint8Array(buf || 0);
- this.pos = 0;
- this.type = 0;
- this.length = this.buf.length;
- }
- Pbf.Varint = 0; // varint: int32, int64, uint32, uint64, sint32, sint64, bool, enum
- Pbf.Fixed64 = 1; // 64-bit: double, fixed64, sfixed64
- Pbf.Bytes = 2; // length-delimited: string, bytes, embedded messages, packed repeated fields
- Pbf.Fixed32 = 5; // 32-bit: float, fixed32, sfixed32
- var SHIFT_LEFT_32 = (1 << 16) * (1 << 16),
- SHIFT_RIGHT_32 = 1 / SHIFT_LEFT_32; // Threshold chosen based on both benchmarking and knowledge about browser string
- // data structures (which currently switch structure types at 12 bytes or more)
- var TEXT_DECODER_MIN_LENGTH = 12;
- var utf8TextDecoder = typeof TextDecoder === 'undefined' ? null : new TextDecoder('utf8');
- Pbf.prototype = {
- destroy: function destroy() {
- this.buf = null;
- },
- // === READING =================================================================
- readFields: function readFields(readField, result, end) {
- end = end || this.length;
- while (this.pos < end) {
- var val = this.readVarint(),
- tag = val >> 3,
- startPos = this.pos;
- this.type = val & 0x7;
- readField(tag, result, this);
- if (this.pos === startPos) this.skip(val);
- }
- return result;
- },
- readMessage: function readMessage(readField, result) {
- return this.readFields(readField, result, this.readVarint() + this.pos);
- },
- readFixed32: function readFixed32() {
- var val = readUInt32(this.buf, this.pos);
- this.pos += 4;
- return val;
- },
- readSFixed32: function readSFixed32() {
- var val = readInt32(this.buf, this.pos);
- this.pos += 4;
- return val;
- },
- // 64-bit int handling is based on github.com/dpw/node-buffer-more-ints (MIT-licensed)
- readFixed64: function readFixed64() {
- var val = readUInt32(this.buf, this.pos) + readUInt32(this.buf, this.pos + 4) * SHIFT_LEFT_32;
- this.pos += 8;
- return val;
- },
- readSFixed64: function readSFixed64() {
- var val = readUInt32(this.buf, this.pos) + readInt32(this.buf, this.pos + 4) * SHIFT_LEFT_32;
- this.pos += 8;
- return val;
- },
- readFloat: function readFloat() {
- var val = ieee754.read(this.buf, this.pos, true, 23, 4);
- this.pos += 4;
- return val;
- },
- readDouble: function readDouble() {
- var val = ieee754.read(this.buf, this.pos, true, 52, 8);
- this.pos += 8;
- return val;
- },
- readVarint: function readVarint(isSigned) {
- var buf = this.buf,
- val,
- b;
- b = buf[this.pos++];
- val = b & 0x7f;
- if (b < 0x80) return val;
- b = buf[this.pos++];
- val |= (b & 0x7f) << 7;
- if (b < 0x80) return val;
- b = buf[this.pos++];
- val |= (b & 0x7f) << 14;
- if (b < 0x80) return val;
- b = buf[this.pos++];
- val |= (b & 0x7f) << 21;
- if (b < 0x80) return val;
- b = buf[this.pos];
- val |= (b & 0x0f) << 28;
- return readVarintRemainder(val, isSigned, this);
- },
- readVarint64: function readVarint64() {
- // for compatibility with v2.0.1
- return this.readVarint(true);
- },
- readSVarint: function readSVarint() {
- var num = this.readVarint();
- return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding
- },
- readBoolean: function readBoolean() {
- return Boolean(this.readVarint());
- },
- readString: function readString() {
- var end = this.readVarint() + this.pos;
- var pos = this.pos;
- this.pos = end;
- if (end - pos >= TEXT_DECODER_MIN_LENGTH && utf8TextDecoder) {
- // longer strings are fast with the built-in browser TextDecoder API
- return readUtf8TextDecoder(this.buf, pos, end);
- } // short strings are fast with our custom implementation
- return readUtf8(this.buf, pos, end);
- },
- readBytes: function readBytes() {
- var end = this.readVarint() + this.pos,
- buffer = this.buf.subarray(this.pos, end);
- this.pos = end;
- return buffer;
- },
- // verbose for performance reasons; doesn't affect gzipped size
- readPackedVarint: function readPackedVarint(arr, isSigned) {
- if (this.type !== Pbf.Bytes) return arr.push(this.readVarint(isSigned));
- var end = readPackedEnd(this);
- arr = arr || [];
- while (this.pos < end) {
- arr.push(this.readVarint(isSigned));
- }
- return arr;
- },
- readPackedSVarint: function readPackedSVarint(arr) {
- if (this.type !== Pbf.Bytes) return arr.push(this.readSVarint());
- var end = readPackedEnd(this);
- arr = arr || [];
- while (this.pos < end) {
- arr.push(this.readSVarint());
- }
- return arr;
- },
- readPackedBoolean: function readPackedBoolean(arr) {
- if (this.type !== Pbf.Bytes) return arr.push(this.readBoolean());
- var end = readPackedEnd(this);
- arr = arr || [];
- while (this.pos < end) {
- arr.push(this.readBoolean());
- }
- return arr;
- },
- readPackedFloat: function readPackedFloat(arr) {
- if (this.type !== Pbf.Bytes) return arr.push(this.readFloat());
- var end = readPackedEnd(this);
- arr = arr || [];
- while (this.pos < end) {
- arr.push(this.readFloat());
- }
- return arr;
- },
- readPackedDouble: function readPackedDouble(arr) {
- if (this.type !== Pbf.Bytes) return arr.push(this.readDouble());
- var end = readPackedEnd(this);
- arr = arr || [];
- while (this.pos < end) {
- arr.push(this.readDouble());
- }
- return arr;
- },
- readPackedFixed32: function readPackedFixed32(arr) {
- if (this.type !== Pbf.Bytes) return arr.push(this.readFixed32());
- var end = readPackedEnd(this);
- arr = arr || [];
- while (this.pos < end) {
- arr.push(this.readFixed32());
- }
- return arr;
- },
- readPackedSFixed32: function readPackedSFixed32(arr) {
- if (this.type !== Pbf.Bytes) return arr.push(this.readSFixed32());
- var end = readPackedEnd(this);
- arr = arr || [];
- while (this.pos < end) {
- arr.push(this.readSFixed32());
- }
- return arr;
- },
- readPackedFixed64: function readPackedFixed64(arr) {
- if (this.type !== Pbf.Bytes) return arr.push(this.readFixed64());
- var end = readPackedEnd(this);
- arr = arr || [];
- while (this.pos < end) {
- arr.push(this.readFixed64());
- }
- return arr;
- },
- readPackedSFixed64: function readPackedSFixed64(arr) {
- if (this.type !== Pbf.Bytes) return arr.push(this.readSFixed64());
- var end = readPackedEnd(this);
- arr = arr || [];
- while (this.pos < end) {
- arr.push(this.readSFixed64());
- }
- return arr;
- },
- skip: function skip(val) {
- var type = val & 0x7;
- if (type === Pbf.Varint) while (this.buf[this.pos++] > 0x7f) {} else if (type === Pbf.Bytes) this.pos = this.readVarint() + this.pos;else if (type === Pbf.Fixed32) this.pos += 4;else if (type === Pbf.Fixed64) this.pos += 8;else throw new Error('Unimplemented type: ' + type);
- },
- // === WRITING =================================================================
- writeTag: function writeTag(tag, type) {
- this.writeVarint(tag << 3 | type);
- },
- realloc: function realloc(min) {
- var length = this.length || 16;
- while (length < this.pos + min) {
- length *= 2;
- }
- if (length !== this.length) {
- var buf = new Uint8Array(length);
- buf.set(this.buf);
- this.buf = buf;
- this.length = length;
- }
- },
- finish: function finish() {
- this.length = this.pos;
- this.pos = 0;
- return this.buf.subarray(0, this.length);
- },
- writeFixed32: function writeFixed32(val) {
- this.realloc(4);
- writeInt32(this.buf, val, this.pos);
- this.pos += 4;
- },
- writeSFixed32: function writeSFixed32(val) {
- this.realloc(4);
- writeInt32(this.buf, val, this.pos);
- this.pos += 4;
- },
- writeFixed64: function writeFixed64(val) {
- this.realloc(8);
- writeInt32(this.buf, val & -1, this.pos);
- writeInt32(this.buf, Math.floor(val * SHIFT_RIGHT_32), this.pos + 4);
- this.pos += 8;
- },
- writeSFixed64: function writeSFixed64(val) {
- this.realloc(8);
- writeInt32(this.buf, val & -1, this.pos);
- writeInt32(this.buf, Math.floor(val * SHIFT_RIGHT_32), this.pos + 4);
- this.pos += 8;
- },
- writeVarint: function writeVarint(val) {
- val = +val || 0;
- if (val > 0xfffffff || val < 0) {
- writeBigVarint(val, this);
- return;
- }
- this.realloc(4);
- this.buf[this.pos++] = val & 0x7f | (val > 0x7f ? 0x80 : 0);
- if (val <= 0x7f) return;
- this.buf[this.pos++] = (val >>>= 7) & 0x7f | (val > 0x7f ? 0x80 : 0);
- if (val <= 0x7f) return;
- this.buf[this.pos++] = (val >>>= 7) & 0x7f | (val > 0x7f ? 0x80 : 0);
- if (val <= 0x7f) return;
- this.buf[this.pos++] = val >>> 7 & 0x7f;
- },
- writeSVarint: function writeSVarint(val) {
- this.writeVarint(val < 0 ? -val * 2 - 1 : val * 2);
- },
- writeBoolean: function writeBoolean(val) {
- this.writeVarint(Boolean(val));
- },
- writeString: function writeString(str) {
- str = String(str);
- this.realloc(str.length * 4);
- this.pos++; // reserve 1 byte for short string length
- var startPos = this.pos; // write the string directly to the buffer and see how much was written
- this.pos = writeUtf8(this.buf, str, this.pos);
- var len = this.pos - startPos;
- if (len >= 0x80) makeRoomForExtraLength(startPos, len, this); // finally, write the message length in the reserved place and restore the position
- this.pos = startPos - 1;
- this.writeVarint(len);
- this.pos += len;
- },
- writeFloat: function writeFloat(val) {
- this.realloc(4);
- ieee754.write(this.buf, val, this.pos, true, 23, 4);
- this.pos += 4;
- },
- writeDouble: function writeDouble(val) {
- this.realloc(8);
- ieee754.write(this.buf, val, this.pos, true, 52, 8);
- this.pos += 8;
- },
- writeBytes: function writeBytes(buffer) {
- var len = buffer.length;
- this.writeVarint(len);
- this.realloc(len);
- for (var i = 0; i < len; i++) {
- this.buf[this.pos++] = buffer[i];
- }
- },
- writeRawMessage: function writeRawMessage(fn, obj) {
- this.pos++; // reserve 1 byte for short message length
- // write the message directly to the buffer and see how much was written
- var startPos = this.pos;
- fn(obj, this);
- var len = this.pos - startPos;
- if (len >= 0x80) makeRoomForExtraLength(startPos, len, this); // finally, write the message length in the reserved place and restore the position
- this.pos = startPos - 1;
- this.writeVarint(len);
- this.pos += len;
- },
- writeMessage: function writeMessage(tag, fn, obj) {
- this.writeTag(tag, Pbf.Bytes);
- this.writeRawMessage(fn, obj);
- },
- writePackedVarint: function writePackedVarint(tag, arr) {
- if (arr.length) this.writeMessage(tag, _writePackedVarint, arr);
- },
- writePackedSVarint: function writePackedSVarint(tag, arr) {
- if (arr.length) this.writeMessage(tag, _writePackedSVarint, arr);
- },
- writePackedBoolean: function writePackedBoolean(tag, arr) {
- if (arr.length) this.writeMessage(tag, _writePackedBoolean, arr);
- },
- writePackedFloat: function writePackedFloat(tag, arr) {
- if (arr.length) this.writeMessage(tag, _writePackedFloat, arr);
- },
- writePackedDouble: function writePackedDouble(tag, arr) {
- if (arr.length) this.writeMessage(tag, _writePackedDouble, arr);
- },
- writePackedFixed32: function writePackedFixed32(tag, arr) {
- if (arr.length) this.writeMessage(tag, _writePackedFixed, arr);
- },
- writePackedSFixed32: function writePackedSFixed32(tag, arr) {
- if (arr.length) this.writeMessage(tag, _writePackedSFixed, arr);
- },
- writePackedFixed64: function writePackedFixed64(tag, arr) {
- if (arr.length) this.writeMessage(tag, _writePackedFixed2, arr);
- },
- writePackedSFixed64: function writePackedSFixed64(tag, arr) {
- if (arr.length) this.writeMessage(tag, _writePackedSFixed2, arr);
- },
- writeBytesField: function writeBytesField(tag, buffer) {
- this.writeTag(tag, Pbf.Bytes);
- this.writeBytes(buffer);
- },
- writeFixed32Field: function writeFixed32Field(tag, val) {
- this.writeTag(tag, Pbf.Fixed32);
- this.writeFixed32(val);
- },
- writeSFixed32Field: function writeSFixed32Field(tag, val) {
- this.writeTag(tag, Pbf.Fixed32);
- this.writeSFixed32(val);
- },
- writeFixed64Field: function writeFixed64Field(tag, val) {
- this.writeTag(tag, Pbf.Fixed64);
- this.writeFixed64(val);
- },
- writeSFixed64Field: function writeSFixed64Field(tag, val) {
- this.writeTag(tag, Pbf.Fixed64);
- this.writeSFixed64(val);
- },
- writeVarintField: function writeVarintField(tag, val) {
- this.writeTag(tag, Pbf.Varint);
- this.writeVarint(val);
- },
- writeSVarintField: function writeSVarintField(tag, val) {
- this.writeTag(tag, Pbf.Varint);
- this.writeSVarint(val);
- },
- writeStringField: function writeStringField(tag, str) {
- this.writeTag(tag, Pbf.Bytes);
- this.writeString(str);
- },
- writeFloatField: function writeFloatField(tag, val) {
- this.writeTag(tag, Pbf.Fixed32);
- this.writeFloat(val);
- },
- writeDoubleField: function writeDoubleField(tag, val) {
- this.writeTag(tag, Pbf.Fixed64);
- this.writeDouble(val);
- },
- writeBooleanField: function writeBooleanField(tag, val) {
- this.writeVarintField(tag, Boolean(val));
- }
- };
- function readVarintRemainder(l, s, p) {
- var buf = p.buf,
- h,
- b;
- b = buf[p.pos++];
- h = (b & 0x70) >> 4;
- if (b < 0x80) return toNum(l, h, s);
- b = buf[p.pos++];
- h |= (b & 0x7f) << 3;
- if (b < 0x80) return toNum(l, h, s);
- b = buf[p.pos++];
- h |= (b & 0x7f) << 10;
- if (b < 0x80) return toNum(l, h, s);
- b = buf[p.pos++];
- h |= (b & 0x7f) << 17;
- if (b < 0x80) return toNum(l, h, s);
- b = buf[p.pos++];
- h |= (b & 0x7f) << 24;
- if (b < 0x80) return toNum(l, h, s);
- b = buf[p.pos++];
- h |= (b & 0x01) << 31;
- if (b < 0x80) return toNum(l, h, s);
- throw new Error('Expected varint not more than 10 bytes');
- }
- function readPackedEnd(pbf) {
- return pbf.type === Pbf.Bytes ? pbf.readVarint() + pbf.pos : pbf.pos + 1;
- }
- function toNum(low, high, isSigned) {
- if (isSigned) {
- return high * 0x100000000 + (low >>> 0);
- }
- return (high >>> 0) * 0x100000000 + (low >>> 0);
- }
- function writeBigVarint(val, pbf) {
- var low, high;
- if (val >= 0) {
- low = val % 0x100000000 | 0;
- high = val / 0x100000000 | 0;
- } else {
- low = ~(-val % 0x100000000);
- high = ~(-val / 0x100000000);
- if (low ^ 0xffffffff) {
- low = low + 1 | 0;
- } else {
- low = 0;
- high = high + 1 | 0;
- }
- }
- if (val >= 0x10000000000000000 || val < -0x10000000000000000) {
- throw new Error('Given varint doesn\'t fit into 10 bytes');
- }
- pbf.realloc(10);
- writeBigVarintLow(low, high, pbf);
- writeBigVarintHigh(high, pbf);
- }
- function writeBigVarintLow(low, high, pbf) {
- pbf.buf[pbf.pos++] = low & 0x7f | 0x80;
- low >>>= 7;
- pbf.buf[pbf.pos++] = low & 0x7f | 0x80;
- low >>>= 7;
- pbf.buf[pbf.pos++] = low & 0x7f | 0x80;
- low >>>= 7;
- pbf.buf[pbf.pos++] = low & 0x7f | 0x80;
- low >>>= 7;
- pbf.buf[pbf.pos] = low & 0x7f;
- }
- function writeBigVarintHigh(high, pbf) {
- var lsb = (high & 0x07) << 4;
- pbf.buf[pbf.pos++] |= lsb | ((high >>>= 3) ? 0x80 : 0);
- if (!high) return;
- pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0);
- if (!high) return;
- pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0);
- if (!high) return;
- pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0);
- if (!high) return;
- pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0);
- if (!high) return;
- pbf.buf[pbf.pos++] = high & 0x7f;
- }
- function makeRoomForExtraLength(startPos, len, pbf) {
- var extraLen = len <= 0x3fff ? 1 : len <= 0x1fffff ? 2 : len <= 0xfffffff ? 3 : Math.floor(Math.log(len) / (Math.LN2 * 7)); // if 1 byte isn't enough for encoding message length, shift the data to the right
- pbf.realloc(extraLen);
- for (var i = pbf.pos - 1; i >= startPos; i--) {
- pbf.buf[i + extraLen] = pbf.buf[i];
- }
- }
- function _writePackedVarint(arr, pbf) {
- for (var i = 0; i < arr.length; i++) {
- pbf.writeVarint(arr[i]);
- }
- }
- function _writePackedSVarint(arr, pbf) {
- for (var i = 0; i < arr.length; i++) {
- pbf.writeSVarint(arr[i]);
- }
- }
- function _writePackedFloat(arr, pbf) {
- for (var i = 0; i < arr.length; i++) {
- pbf.writeFloat(arr[i]);
- }
- }
- function _writePackedDouble(arr, pbf) {
- for (var i = 0; i < arr.length; i++) {
- pbf.writeDouble(arr[i]);
- }
- }
- function _writePackedBoolean(arr, pbf) {
- for (var i = 0; i < arr.length; i++) {
- pbf.writeBoolean(arr[i]);
- }
- }
- function _writePackedFixed(arr, pbf) {
- for (var i = 0; i < arr.length; i++) {
- pbf.writeFixed32(arr[i]);
- }
- }
- function _writePackedSFixed(arr, pbf) {
- for (var i = 0; i < arr.length; i++) {
- pbf.writeSFixed32(arr[i]);
- }
- }
- function _writePackedFixed2(arr, pbf) {
- for (var i = 0; i < arr.length; i++) {
- pbf.writeFixed64(arr[i]);
- }
- }
- function _writePackedSFixed2(arr, pbf) {
- for (var i = 0; i < arr.length; i++) {
- pbf.writeSFixed64(arr[i]);
- }
- } // Buffer code below from https://github.com/feross/buffer, MIT-licensed
- function readUInt32(buf, pos) {
- return (buf[pos] | buf[pos + 1] << 8 | buf[pos + 2] << 16) + buf[pos + 3] * 0x1000000;
- }
- function writeInt32(buf, val, pos) {
- buf[pos] = val;
- buf[pos + 1] = val >>> 8;
- buf[pos + 2] = val >>> 16;
- buf[pos + 3] = val >>> 24;
- }
- function readInt32(buf, pos) {
- return (buf[pos] | buf[pos + 1] << 8 | buf[pos + 2] << 16) + (buf[pos + 3] << 24);
- }
- function readUtf8(buf, pos, end) {
- var str = '';
- var i = pos;
- while (i < end) {
- var b0 = buf[i];
- var c = null; // codepoint
- var bytesPerSequence = b0 > 0xEF ? 4 : b0 > 0xDF ? 3 : b0 > 0xBF ? 2 : 1;
- if (i + bytesPerSequence > end) break;
- var b1, b2, b3;
- if (bytesPerSequence === 1) {
- if (b0 < 0x80) {
- c = b0;
- }
- } else if (bytesPerSequence === 2) {
- b1 = buf[i + 1];
- if ((b1 & 0xC0) === 0x80) {
- c = (b0 & 0x1F) << 0x6 | b1 & 0x3F;
- if (c <= 0x7F) {
- c = null;
- }
- }
- } else if (bytesPerSequence === 3) {
- b1 = buf[i + 1];
- b2 = buf[i + 2];
- if ((b1 & 0xC0) === 0x80 && (b2 & 0xC0) === 0x80) {
- c = (b0 & 0xF) << 0xC | (b1 & 0x3F) << 0x6 | b2 & 0x3F;
- if (c <= 0x7FF || c >= 0xD800 && c <= 0xDFFF) {
- c = null;
- }
- }
- } else if (bytesPerSequence === 4) {
- b1 = buf[i + 1];
- b2 = buf[i + 2];
- b3 = buf[i + 3];
- if ((b1 & 0xC0) === 0x80 && (b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {
- c = (b0 & 0xF) << 0x12 | (b1 & 0x3F) << 0xC | (b2 & 0x3F) << 0x6 | b3 & 0x3F;
- if (c <= 0xFFFF || c >= 0x110000) {
- c = null;
- }
- }
- }
- if (c === null) {
- c = 0xFFFD;
- bytesPerSequence = 1;
- } else if (c > 0xFFFF) {
- c -= 0x10000;
- str += String.fromCharCode(c >>> 10 & 0x3FF | 0xD800);
- c = 0xDC00 | c & 0x3FF;
- }
- str += String.fromCharCode(c);
- i += bytesPerSequence;
- }
- return str;
- }
- function readUtf8TextDecoder(buf, pos, end) {
- return utf8TextDecoder.decode(buf.subarray(pos, end));
- }
- function writeUtf8(buf, str, pos) {
- for (var i = 0, c, lead; i < str.length; i++) {
- c = str.charCodeAt(i); // code point
- if (c > 0xD7FF && c < 0xE000) {
- if (lead) {
- if (c < 0xDC00) {
- buf[pos++] = 0xEF;
- buf[pos++] = 0xBF;
- buf[pos++] = 0xBD;
- lead = c;
- continue;
- } else {
- c = lead - 0xD800 << 10 | c - 0xDC00 | 0x10000;
- lead = null;
- }
- } else {
- if (c > 0xDBFF || i + 1 === str.length) {
- buf[pos++] = 0xEF;
- buf[pos++] = 0xBF;
- buf[pos++] = 0xBD;
- } else {
- lead = c;
- }
- continue;
- }
- } else if (lead) {
- buf[pos++] = 0xEF;
- buf[pos++] = 0xBF;
- buf[pos++] = 0xBD;
- lead = null;
- }
- if (c < 0x80) {
- buf[pos++] = c;
- } else {
- if (c < 0x800) {
- buf[pos++] = c >> 0x6 | 0xC0;
- } else {
- if (c < 0x10000) {
- buf[pos++] = c >> 0xC | 0xE0;
- } else {
- buf[pos++] = c >> 0x12 | 0xF0;
- buf[pos++] = c >> 0xC & 0x3F | 0x80;
- }
- buf[pos++] = c >> 0x6 & 0x3F | 0x80;
- }
- buf[pos++] = c & 0x3F | 0x80;
- }
- }
- return pos;
- }
- /***/ }),
- /***/ 957:
- /***/ (function(module, exports, __webpack_require__) {
- 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); }
- (function (global, factory) {
- ( false ? 0 : _typeof(exports)) === 'object' && "object" !== 'undefined' ? factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
- (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
- __WEBPACK_AMD_DEFINE_FACTORY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0;
- })(this, function () {
- 'use strict';
- /**
- * @this {Promise}
- */
- function finallyConstructor(callback) {
- var constructor = this.constructor;
- return this.then(function (value) {
- // @ts-ignore
- return constructor.resolve(callback()).then(function () {
- return value;
- });
- }, function (reason) {
- // @ts-ignore
- return constructor.resolve(callback()).then(function () {
- // @ts-ignore
- return constructor.reject(reason);
- });
- });
- } // Store setTimeout reference so promise-polyfill will be unaffected by
- // other code modifying setTimeout (like sinon.useFakeTimers())
- var setTimeoutFunc = setTimeout;
- function isArray(x) {
- return Boolean(x && typeof x.length !== 'undefined');
- }
- function noop() {} // Polyfill for Function.prototype.bind
- function bind(fn, thisArg) {
- return function () {
- fn.apply(thisArg, arguments);
- };
- }
- /**
- * @constructor
- * @param {Function} fn
- */
- function Promise(fn) {
- if (!(this instanceof Promise)) throw new TypeError('Promises must be constructed via new');
- if (typeof fn !== 'function') throw new TypeError('not a function');
- /** @type {!number} */
- this._state = 0;
- /** @type {!boolean} */
- this._handled = false;
- /** @type {Promise|undefined} */
- this._value = undefined;
- /** @type {!Array<!Function>} */
- this._deferreds = [];
- doResolve(fn, this);
- }
- function handle(self, deferred) {
- while (self._state === 3) {
- self = self._value;
- }
- if (self._state === 0) {
- self._deferreds.push(deferred);
- return;
- }
- self._handled = true;
- Promise._immediateFn(function () {
- var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
- if (cb === null) {
- (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
- return;
- }
- var ret;
- try {
- ret = cb(self._value);
- } catch (e) {
- reject(deferred.promise, e);
- return;
- }
- resolve(deferred.promise, ret);
- });
- }
- function resolve(self, newValue) {
- try {
- // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
- if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.');
- if (newValue && (_typeof(newValue) === 'object' || typeof newValue === 'function')) {
- var then = newValue.then;
- if (newValue instanceof Promise) {
- self._state = 3;
- self._value = newValue;
- finale(self);
- return;
- } else if (typeof then === 'function') {
- doResolve(bind(then, newValue), self);
- return;
- }
- }
- self._state = 1;
- self._value = newValue;
- finale(self);
- } catch (e) {
- reject(self, e);
- }
- }
- function reject(self, newValue) {
- self._state = 2;
- self._value = newValue;
- finale(self);
- }
- function finale(self) {
- if (self._state === 2 && self._deferreds.length === 0) {
- Promise._immediateFn(function () {
- if (!self._handled) {
- Promise._unhandledRejectionFn(self._value);
- }
- });
- }
- for (var i = 0, len = self._deferreds.length; i < len; i++) {
- handle(self, self._deferreds[i]);
- }
- self._deferreds = null;
- }
- /**
- * @constructor
- */
- function Handler(onFulfilled, onRejected, promise) {
- this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
- this.onRejected = typeof onRejected === 'function' ? onRejected : null;
- this.promise = promise;
- }
- /**
- * Take a potentially misbehaving resolver function and make sure
- * onFulfilled and onRejected are only called once.
- *
- * Makes no guarantees about asynchrony.
- */
- function doResolve(fn, self) {
- var done = false;
- try {
- fn(function (value) {
- if (done) return;
- done = true;
- resolve(self, value);
- }, function (reason) {
- if (done) return;
- done = true;
- reject(self, reason);
- });
- } catch (ex) {
- if (done) return;
- done = true;
- reject(self, ex);
- }
- }
- Promise.prototype['catch'] = function (onRejected) {
- return this.then(null, onRejected);
- };
- Promise.prototype.then = function (onFulfilled, onRejected) {
- // @ts-ignore
- var prom = new this.constructor(noop);
- handle(this, new Handler(onFulfilled, onRejected, prom));
- return prom;
- };
- Promise.prototype['finally'] = finallyConstructor;
- Promise.all = function (arr) {
- return new Promise(function (resolve, reject) {
- if (!isArray(arr)) {
- return reject(new TypeError('Promise.all accepts an array'));
- }
- var args = Array.prototype.slice.call(arr);
- if (args.length === 0) return resolve([]);
- var remaining = args.length;
- function res(i, val) {
- try {
- if (val && (_typeof(val) === 'object' || typeof val === 'function')) {
- var then = val.then;
- if (typeof then === 'function') {
- then.call(val, function (val) {
- res(i, val);
- }, reject);
- return;
- }
- }
- args[i] = val;
- if (--remaining === 0) {
- resolve(args);
- }
- } catch (ex) {
- reject(ex);
- }
- }
- for (var i = 0; i < args.length; i++) {
- res(i, args[i]);
- }
- });
- };
- Promise.resolve = function (value) {
- if (value && _typeof(value) === 'object' && value.constructor === Promise) {
- return value;
- }
- return new Promise(function (resolve) {
- resolve(value);
- });
- };
- Promise.reject = function (value) {
- return new Promise(function (resolve, reject) {
- reject(value);
- });
- };
- Promise.race = function (arr) {
- return new Promise(function (resolve, reject) {
- if (!isArray(arr)) {
- return reject(new TypeError('Promise.race accepts an array'));
- }
- for (var i = 0, len = arr.length; i < len; i++) {
- Promise.resolve(arr[i]).then(resolve, reject);
- }
- });
- }; // Use polyfill for setImmediate for performance gains
- Promise._immediateFn = // @ts-ignore
- typeof setImmediate === 'function' && function (fn) {
- // @ts-ignore
- setImmediate(fn);
- } || function (fn) {
- setTimeoutFunc(fn, 0);
- };
- Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
- if (typeof console !== 'undefined' && console) {
- console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
- }
- };
- /** @suppress {undefinedVars} */
- var globalNS = function () {
- // the only reliable means to get the global object is
- // `Function('return this')()`
- // However, this causes CSP violations in Chrome apps.
- if (typeof self !== 'undefined') {
- return self;
- }
- if (typeof window !== 'undefined') {
- return window;
- }
- if (typeof __webpack_require__.g !== 'undefined') {
- return __webpack_require__.g;
- }
- throw new Error('unable to locate global object');
- }();
- if (!('Promise' in globalNS)) {
- globalNS['Promise'] = Promise;
- } else if (!globalNS.Promise.prototype['finally']) {
- globalNS.Promise.prototype['finally'] = finallyConstructor;
- }
- });
- /***/ })
- /******/ });
- /************************************************************************/
- /******/ // The module cache
- /******/ var __webpack_module_cache__ = {};
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/ // Check if module is in cache
- /******/ if(__webpack_module_cache__[moduleId]) {
- /******/ return __webpack_module_cache__[moduleId].exports;
- /******/ }
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = __webpack_module_cache__[moduleId] = {
- /******/ // no module.id needed
- /******/ // no module.loaded needed
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /************************************************************************/
- /******/ /* webpack/runtime/compat get default export */
- /******/ !function() {
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = function(module) {
- /******/ var getter = module && module.__esModule ?
- /******/ function() { return module['default']; } :
- /******/ function() { return module; };
- /******/ __webpack_require__.d(getter, { a: getter });
- /******/ return getter;
- /******/ };
- /******/ }();
- /******/
- /******/ /* webpack/runtime/define property getters */
- /******/ !function() {
- /******/ // define getter functions for harmony exports
- /******/ __webpack_require__.d = function(exports, definition) {
- /******/ for(var key in definition) {
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
- /******/ }
- /******/ }
- /******/ };
- /******/ }();
- /******/
- /******/ /* webpack/runtime/global */
- /******/ !function() {
- /******/ __webpack_require__.g = (function() {
- /******/ if (typeof globalThis === 'object') return globalThis;
- /******/ try {
- /******/ return this || new Function('return this')();
- /******/ } catch (e) {
- /******/ if (typeof window === 'object') return window;
- /******/ }
- /******/ })();
- /******/ }();
- /******/
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
- /******/ !function() {
- /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
- /******/ }();
- /******/
- /************************************************************************/
- !function() {
- "use strict";
- // UNUSED EXPORTS: AddressMatchService, AggQueryBuilderParameter, AggregationParameter, AggregationQueryBuilderType, AggregationType, AlongLineDirection, AnalystAreaUnit, AnalystSizeUnit, AreaSolarRadiationParameters, ArrayStatistic, AttributesPopContainer, BaiduCRS, BaiduTileLayer, BufferAnalystParameters, BufferDistance, BufferEndType, BufferRadiusUnit, BufferSetting, BuffersAnalystJobsParameter, BurstPipelineAnalystParameters, CRS, CanvasRenderer, CartoCSSToLeaflet, CartoStyleMap, ChangeTileVersion, ChartQueryFilterParameter, ChartQueryParameters, ChartService, ChartType, ChartView, ChartViewModel, CircleStyle, CityTabsPage, ClientComputationLayer, ClientComputationView, ClientComputationViewModel, ClientType, ClipAnalystMode, ClipParameter, CloudTileLayer, CloverStyle, ColorDictionary, ColorGradientType, ColorSpaceType, ColorsPickerUtil, CommonContainer, CommontypesConversion, CompOpMap, ComponentsUtil, ComputeWeightMatrixParameters, DataFlowLayer, DataFlowService, DataFlowView, DataFormat, DataItemOrderBy, DataItemType, DataReturnMode, DataReturnOption, DataServiceQueryView, DataServiceQueryViewModel, DatasetBufferAnalystParameters, DatasetInfo, DatasetOverlayAnalystParameters, DatasetSurfaceAnalystParameters, DatasetThiessenAnalystParameters, DatasourceConnectionInfo, DefaultStyle, DensityKernelAnalystParameters, DirectionType, DistributedAnalysisView, DistributedAnalysisViewModel, DropDownBox, EchartsLayer, 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, GeoFeatureThemeLayer, GeoHashGridAggParameter, GeoJSONLayerWithName, GeoJsonLayerDataModel, GeoJsonLayersDataModel, GeoRelationAnalystParameters, GeometryBufferAnalystParameters, GeometryOverlayAnalystParameters, GeometrySurfaceAnalystParameters, GeometryThiessenAnalystParameters, GeometryType, GetFeatureMode, GetFeaturesByBoundsParameters, GetFeaturesByBufferParameters, GetFeaturesByGeometryParameters, GetFeaturesByIDsParameters, GetFeaturesBySQLParameters, GetGridCellInfosParameters, GetResolutionFromScaleDpi, GraduatedMode, GraphAxesTextDisplayMode, GraphThemeLayer, Graphic, GraphicLayer, Grid, GridCellInfosService, GridType, IManager, IManagerCreateNodeParam, IManagerServiceBase, IPortal, IPortalAddDataParam, IPortalAddResourceParam, IPortalDataConnectionInfoParam, IPortalDataMetaInfoParam, IPortalDataStoreInfoParam, IPortalQueryParam, IPortalQueryResult, IPortalRegisterServiceParam, IPortalResource, IPortalServiceBase, IPortalShareEntity, IPortalShareParam, IPortalUser, Image, ImageMapLayer, ImageStyle, IndexTabsPageContainer, InterpolationAlgorithmType, InterpolationAnalystParameters, InterpolationIDWAnalystParameters, InterpolationKrigingAnalystParameters, InterpolationRBFAnalystParameters, JoinItem, JoinType, KernelDensityJobParameter, KeyServiceParameter, LabelBackShape, LabelImageCell, LabelMatrixCell, LabelMixedTextStyle, LabelOverLengthMode, LabelSymbolCell, LabelThemeCell, LabelThemeLayer, LayerInfoService, LayerStatus, LayerType, LeafletMapCoordSys, LineSymbolizer, LinkItem, Logo, MapService, MapVLayer, MapVRenderer, MappingParameters, MathExpressionAnalysisParameters, MeasureMode, MeasureParameters, MeasureService, MessageBox, NavTabsPage, NetworkAnalyst3DService, NetworkAnalystService, NonEarthCRS, NonProjection, NormalizeScale, Online, OnlineData, OnlineQueryDatasParameter, OnlineServiceBase, OpenFileView, OpenFileViewModel, OutputSetting, OutputType, OverlapDisplayedOptions, OverlayAnalystParameters, OverlayGeoJobParameter, OverlayOperationType, PaginationContainer, PixelFormat, PointSymbolizer, PointWithMeasure, PolyBase, PopContainer, ProcessingService, QueryByBoundsParameters, QueryByDistanceParameters, QueryByGeometryParameters, QueryBySQLParameters, QueryOption, QueryParameters, QueryService, RangeMode, RangeThemeLayer, RankSymbolThemeLayer, RegionSymbolizer, Route, RouteCalculateMeasureParameters, RouteLocatorParameters, SVGRenderer, SearchMode, SearchView, SecurityManager, Select, ServerColor, ServerFeature, ServerGeometry, ServerInfo, ServerStyle, ServerStyleMap, ServerTextStyle, ServerTheme, ServerType, ServiceBase, ServiceStatus, SetLayerInfoParameters, SetLayerStatusParameters, SetLayersInfoParameters, SideType, SingleObjectQueryJobsParameter, SmoothMethod, SpatialAnalystService, SpatialQueryMode, SpatialRelationType, StatisticAnalystMode, StatisticMode, StopQueryParameters, SummaryAttributesJobsParameter, SummaryMeshJobParameter, SummaryRegionJobParameter, SummaryType, SuperMap, SupplyCenter, SupplyCenterType, SurfaceAnalystMethod, SurfaceAnalystParameters, SurfaceAnalystParametersSetting, Symbolizer, TerrainCurvatureCalculationParameters, TextAlignment, TextSymbolizer, Theme, ThemeDotDensity, ThemeFeature, ThemeFlow, ThemeGraduatedSymbol, ThemeGraduatedSymbolStyle, ThemeGraph, ThemeGraphAxes, ThemeGraphItem, ThemeGraphSize, ThemeGraphText, ThemeGraphTextFormat, ThemeGraphType, ThemeGridRange, ThemeGridRangeItem, ThemeGridUnique, ThemeGridUniqueItem, ThemeLabel, ThemeLabelAlongLine, ThemeLabelBackground, ThemeLabelItem, ThemeLabelText, ThemeLabelUniqueItem, ThemeLayer, ThemeMemoryData, ThemeOffset, ThemeParameters, ThemeRange, ThemeRangeItem, ThemeService, ThemeType, ThemeUnique, ThemeUniqueItem, ThiessenAnalystParameters, TianDiTu_MercatorCRS, TianDiTu_WGS84CRS, TiandituTileLayer, TileVectorLayer, TiledMapLayer, TimeFlowControl, TokenServiceParameter, TopologyValidatorJobsParameter, TopologyValidatorRule, TrafficTransferAnalystService, TransferLine, TransferPathParameters, TransferPreference, TransferSolutionParameters, TransferTactic, TransportationAnalystParameter, TransportationAnalystResultSetting, TurfLayer, TurnType, UGCLayer, UGCLayerType, UGCMapLayer, UGCSubLayer, UnicodeMarker, UniqueThemeLayer, Unit, UpdateEdgeWeightParameters, UpdateTurnNodeWeightParameters, VariogramMode, Vector, VectorClipJobsParameter, VectorFeatureType, VectorGrid, VectorTile, VectorTileFormat, VectorTileJSON, VectorTilePBF, WMTSLayer, WebMap, WebPrintingJobContent, WebPrintingJobCustomItems, WebPrintingJobExportOptions, WebPrintingJobImage, WebPrintingJobLayers, WebPrintingJobLayoutOptions, WebPrintingJobLegendOptions, WebPrintingJobLittleMapOptions, WebPrintingJobNorthArrowOptions, WebPrintingJobParameters, WebPrintingJobScaleBarOptions, WebPrintingJobService, WebPrintingService, addressMatchService, baiduTileLayer, changeTileVersion, chartService, circleStyle, clientComputationLayer, clientComputationView, cloudTileLayer, cloverStyle, crs, dataFlowLayer, dataFlowService, dataFlowView, dataServiceQueryView, dataServiceQueryViewModel, distributedAnalysisView, echartsLayer, featureService, fieldService, geoJSONLayerWithName, getMeterPerMapUnit, graphThemeLayer, graphic, graphicLayer, gridCellInfosService, imageMapLayer, imageStyle, labelThemeLayer, layerInfoService, logo, mapService, mapVLayer, measureService, networkAnalyst3DService, networkAnalystService, nonEarthCRS, nonProjection, openFileView, openFileViewModel, processingService, queryService, rangeThemeLayer, rankSymbolThemeLayer, resolutionToScale, scaleToResolution, searchView, spatialAnalystService, themeFeature, themeService, tiandituTileLayer, tiledMapLayer, tiledVectorLayer, toGeoJSON, toSuperMapGeometry, trafficTransferAnalystService, turfLayer, unicodeMarker, uniqueThemeLayer, webMap, webPrintingJobService, wmtsLayer
- ;// CONCATENATED MODULE: ./src/common/SuperMap.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- var SuperMap = window.SuperMap = window.SuperMap || {};
- SuperMap.Components = window.SuperMap.Components || {};
- ;// CONCATENATED MODULE: ./src/common/REST.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @enum DataFormat
- * @memberOf SuperMap
- * @description 服务请求返回结果数据类型
- * @type {string}
- */
- var DataFormat = SuperMap.DataFormat = {
- /** GEOJSON */
- GEOJSON: "GEOJSON",
- /** ISERVER */
- ISERVER: "ISERVER"
- };
- /**
- * @enum ServerType
- * @memberOf SuperMap
- * @description 服务器类型
- * @type {string}
- */
- var ServerType = SuperMap.ServerType = {
- /** ISERVER */
- ISERVER: "ISERVER",
- /** IPORTAL */
- IPORTAL: "IPORTAL",
- /** ONLINE */
- ONLINE: "ONLINE"
- };
- /**
- * @enum GeometryType
- * @memberOf SuperMap
- * @description 几何对象枚举,定义了一系列几何对象类型。
- * @type {string}
- */
- var GeometryType = SuperMap.GeometryType = {
- /** LINE */
- LINE: "LINE",
- /** LINEM */
- LINEM: "LINEM",
- /** POINT */
- POINT: "POINT",
- /** REGION */
- REGION: "REGION",
- /** POINTEPS */
- POINTEPS: "POINTEPS",
- /** LINEEPS */
- LINEEPS: "LINEEPS",
- /** REGIONEPS */
- REGIONEPS: "REGIONEPS",
- /** ELLIPSE */
- ELLIPSE: "ELLIPSE",
- /** CIRCLE */
- CIRCLE: "CIRCLE",
- /** TEXT */
- TEXT: "TEXT",
- /** RECTANGLE */
- RECTANGLE: "RECTANGLE",
- /** UNKNOWN */
- UNKNOWN: "UNKNOWN",
- /** GEOCOMPOUND */
- GEOCOMPOUND: "GEOCOMPOUND"
- };
- /**
- * @enum QueryOption
- * @memberOf SuperMap
- * @description 查询结果类型枚举,描述查询结果返回类型,包括只返回属性、只返回几何实体以及返回属性和几何实体。
- * @type {string}
- */
- var QueryOption = SuperMap.QueryOption = {
- /** 属性 */
- ATTRIBUTE: "ATTRIBUTE",
- /** 属性和几何对象 */
- ATTRIBUTEANDGEOMETRY: "ATTRIBUTEANDGEOMETRY",
- /** 几何对象 */
- GEOMETRY: "GEOMETRY"
- };
- /**
- * @enum JoinType
- * @memberOf SuperMap
- * @description 关联查询时的关联类型常量。
- * 该类定义了两个表之间的连接类型常量,决定了对两个表之间进行连接查询时,查询结果中得到的记录的情况。
- * @type {string}
- */
- var JoinType = SuperMap.JoinType = {
- /** INNERJOIN */
- INNERJOIN: "INNERJOIN",
- /** LEFTJOIN */
- LEFTJOIN: "LEFTJOIN"
- };
- /**
- * @enum SpatialQueryMode
- * @memberOf SuperMap
- * @description 空间查询模式枚举。该类定义了空间查询操作模式常量。
- * @type {string}
- */
- var SpatialQueryMode = SuperMap.SpatialQueryMode = {
- /** 包含空间查询模式 */
- CONTAIN: "CONTAIN",
- /** 交叉空间查询模式 */
- CROSS: "CROSS",
- /** 分离空间查询模式 */
- DISJOINT: "DISJOINT",
- /** 重合空间查询模式 */
- IDENTITY: "IDENTITY",
- /** 相交空间查询模式 */
- INTERSECT: "INTERSECT",
- /** 无空间查询 */
- NONE: "NONE",
- /** 叠加空间查询模式 */
- OVERLAP: "OVERLAP",
- /** 邻接空间查询模式 */
- TOUCH: "TOUCH",
- /** 被包含空间查询模式 */
- WITHIN: "WITHIN"
- };
- /**
- * @enum SpatialRelationType
- * @memberOf SuperMap
- * @description 数据集对象间的空间关系枚举。
- * 该类定义了数据集对象间的空间关系类型常量。
- * @type {string}
- */
- var SpatialRelationType = SuperMap.SpatialRelationType = {
- /** 包含关系 */
- CONTAIN: "CONTAIN",
- /** 相交关系 */
- INTERSECT: "INTERSECT",
- /** 被包含关系 */
- WITHIN: "WITHIN"
- };
- /**
- * @enum MeasureMode
- * @memberOf SuperMap
- * @type {string}
- * @description 量算模式枚举。
- * 该类定义了两种测量模式:距离测量和面积测量。
- */
- var MeasureMode = SuperMap.MeasureMode = {
- /** 距离测量 */
- DISTANCE: "DISTANCE",
- /** 面积测量 */
- AREA: "AREA"
- };
- /**
- * @enum Unit
- * @memberOf SuperMap
- * @description 距离单位枚举。
- * 该类定义了一系列距离单位类型。
- * @type {string}
- */
- var Unit = SuperMap.Unit = {
- /** 米 */
- METER: "METER",
- /** 千米 */
- KILOMETER: "KILOMETER",
- /** 英里 */
- MILE: "MILE",
- /** 码 */
- YARD: "YARD",
- /** 度 */
- DEGREE: "DEGREE",
- /** 毫米 */
- MILLIMETER: "MILLIMETER",
- /** 厘米 */
- CENTIMETER: "CENTIMETER",
- /** 英寸 */
- INCH: "INCH",
- /** 分米 */
- DECIMETER: "DECIMETER",
- /** 英尺 */
- FOOT: "FOOT",
- /** 秒 */
- SECOND: "SECOND",
- /** 分 */
- MINUTE: "MINUTE",
- /** 弧度 */
- RADIAN: "RADIAN"
- };
- /**
- * @enum BufferRadiusUnit
- * @memberOf SuperMap
- * @description 缓冲区距离单位枚举。
- * 该类定义了一系列缓冲距离单位类型。
- * @type {string}
- */
- var BufferRadiusUnit = SuperMap.BufferRadiusUnit = {
- /** 厘米 */
- CENTIMETER: "CENTIMETER",
- /** 分米 */
- DECIMETER: "DECIMETER",
- /** 英尺 */
- FOOT: "FOOT",
- /** 英寸 */
- INCH: "INCH",
- /** 千米 */
- KILOMETER: "KILOMETER",
- /** 米 */
- METER: "METER",
- /** 英里 */
- MILE: "MILE",
- /** 毫米 */
- MILLIMETER: "MILLIMETER",
- /** 码 */
- YARD: "YARD"
- };
- /**
- * @enum EngineType
- * @memberOf SuperMap
- * @description 数据源引擎类型枚举。
- * @type {string}
- */
- var EngineType = SuperMap.EngineType = {
- /** 影像只读引擎类型,文件引擎,针对通用影像格式如 BMP,JPG,TIFF 以及超图自定义影像格式 SIT 等。 */
- IMAGEPLUGINS: "IMAGEPLUGINS",
- /** OGC 引擎类型,针对于 Web 数据源,Web 引擎,目前支持的类型有 WMS,WFS,WCS。 */
- OGC: "OGC",
- /** Oracle 引擎类型,针对 Oracle 数据源,数据库引擎。 */
- ORACLEPLUS: "ORACLEPLUS",
- /** SDB 引擎类型,文件引擎,即 SDB 数据源。 */
- SDBPLUS: "SDBPLUS",
- /** SQL Server 引擎类型,针对 SQL Server 数据源,数据库引擎 */
- SQLPLUS: "SQLPLUS",
- /** UDB 引擎类型,文件引擎。 */
- UDB: "UDB"
- };
- /**
- * @enum ThemeGraphTextFormat
- * @memberOf SuperMap
- * @description 统计专题图文本显示格式枚举。
- * @type {string}
- */
- var ThemeGraphTextFormat = SuperMap.ThemeGraphTextFormat = {
- /** 标题。以各子项的标题来进行标注。 */
- CAPTION: "CAPTION",
- /** 标题 + 百分数。以各子项的标题和所占的百分比来进行标注。 */
- CAPTION_PERCENT: "CAPTION_PERCENT",
- /** 标题 + 实际数值。以各子项的标题和真实数值来进行标注。 */
- CAPTION_VALUE: "CAPTION_VALUE",
- /** 百分数。以各子项所占的百分比来进行标注。 */
- PERCENT: "PERCENT",
- /** 实际数值。以各子项的真实数值来进行标注。 */
- VALUE: "VALUE"
- };
- /**
- * @enum ThemeGraphType
- * @memberOf SuperMap
- * @description 统计专题图类型枚举。
- * @type {string}
- */
- var ThemeGraphType = SuperMap.ThemeGraphType = {
- /** 面积图。 */
- AREA: "AREA",
- /** 柱状图。 */
- BAR: "BAR",
- /** 三维柱状图。 */
- BAR3D: "BAR3D",
- /** 折线图。 */
- LINE: "LINE",
- /** 饼图。 */
- PIE: "PIE",
- /** 三维饼图。 */
- PIE3D: "PIE3D",
- /** 点状图。 */
- POINT: "POINT",
- /** 环状图。 */
- RING: "RING",
- /** 玫瑰图。 */
- ROSE: "ROSE",
- /** 三维玫瑰图。 */
- ROSE3D: "ROSE3D",
- /** 堆叠柱状图。 */
- STACK_BAR: "STACK_BAR",
- /** 三维堆叠柱状图。 */
- STACK_BAR3D: "STACK_BAR3D",
- /** 阶梯图。 */
- STEP: "STEP"
- };
- /**
- * @enum GraphAxesTextDisplayMode
- * @memberOf SuperMap
- * @description 统计专题图坐标轴文本显示模式。
- * @type {string}
- */
- var GraphAxesTextDisplayMode = SuperMap.GraphAxesTextDisplayMode = {
- /** 显示全部文本。 */
- ALL: "ALL",
- /** 不显示。 */
- NONE: "NONE",
- /** 显示Y轴的文本。 */
- YAXES: "YAXES"
- };
- /**
- * @enum GraduatedMode
- * @memberOf SuperMap
- * @description 专题图分级模式枚举。
- *
- * @type {string}
- */
- var GraduatedMode = SuperMap.GraduatedMode = {
- /** 常量分级模式。 */
- CONSTANT: "CONSTANT",
- /** 对数分级模式。 */
- LOGARITHM: "LOGARITHM",
- /** 平方根分级模式。 */
- SQUAREROOT: "SQUAREROOT"
- };
- /**
- * @enum RangeMode
- * @memberOf SuperMap
- * @description 范围分段专题图分段方式枚举。
- * @type {string}
- */
- var RangeMode = SuperMap.RangeMode = {
- /** 自定义分段法。 */
- CUSTOMINTERVAL: "CUSTOMINTERVAL",
- /** 等距离分段法。 */
- EQUALINTERVAL: "EQUALINTERVAL",
- /** 对数分段法。 */
- LOGARITHM: "LOGARITHM",
- /** 等计数分段法。 */
- QUANTILE: "QUANTILE",
- /** 平方根分段法。 */
- SQUAREROOT: "SQUAREROOT",
- /** 标准差分段法。 */
- STDDEVIATION: "STDDEVIATION"
- };
- /**
- * @enum ThemeType
- * @memberOf SuperMap
- * @description 专题图类型枚举。
- * @type {string}
- */
- var ThemeType = SuperMap.ThemeType = {
- /** 点密度专题图。 */
- DOTDENSITY: "DOTDENSITY",
- /** 等级符号专题图。 */
- GRADUATEDSYMBOL: "GRADUATEDSYMBOL",
- /** 统计专题图。 */
- GRAPH: "GRAPH",
- /** 标签专题图。 */
- LABEL: "LABEL",
- /** 分段专题图。 */
- RANGE: "RANGE",
- /** 単值专题图。 */
- UNIQUE: "UNIQUE"
- };
- /**
- * @enum ColorGradientType
- * @memberOf SuperMap
- * @description 渐变颜色枚举。
- * @type {string}
- */
- var ColorGradientType = SuperMap.ColorGradientType = {
- /** 黑白渐变色。 */
- BLACK_WHITE: "BLACKWHITE",
- /** 蓝黑渐变色。 */
- BLUE_BLACK: "BLUEBLACK",
- /** 蓝红渐变色。 */
- BLUE_RED: "BLUERED",
- /** 蓝白渐变色。 */
- BLUE_WHITE: "BLUEWHITE",
- /** 青黑渐变色。 */
- CYAN_BLACK: "CYANBLACK",
- /** 青蓝渐变色。 */
- CYAN_BLUE: "CYANBLUE",
- /** 青绿渐变色。 */
- CYAN_GREEN: "CYANGREEN",
- /** 青白渐变色。 */
- CYAN_WHITE: "CYANWHITE",
- /** 绿黑渐变色。 */
- GREEN_BLACK: "GREENBLACK",
- /** 绿蓝渐变色。 */
- GREEN_BLUE: "GREENBLUE",
- /** 绿橙紫渐变色。 */
- GREEN_ORANGE_VIOLET: "GREENORANGEVIOLET",
- /** 绿红渐变色。 */
- GREEN_RED: "GREENRED",
- /** 蓝红渐变色。 */
- GREEN_WHITE: "GREENWHITE",
- /** 粉黑渐变色。 */
- PINK_BLACK: "PINKBLACK",
- /** 粉蓝渐变色。 */
- PINK_BLUE: "PINKBLUE",
- /** 粉红渐变色。 */
- PINK_RED: "PINKRED",
- /** 粉白渐变色。 */
- PINK_WHITE: "PINKWHITE",
- /** 彩虹色。 */
- RAIN_BOW: "RAINBOW",
- /** 红黑渐变色。 */
- RED_BLACK: "REDBLACK",
- /** 红白渐变色。 */
- RED_WHITE: "REDWHITE",
- /** 光谱渐变。 */
- SPECTRUM: "SPECTRUM",
- /** 地形渐变,用于三维显示效果较好。 */
- TERRAIN: "TERRAIN",
- /** 黄黑渐变色。 */
- YELLOW_BLACK: "YELLOWBLACK",
- /** 黄蓝渐变色。 */
- YELLOW_BLUE: "YELLOWBLUE",
- /** 黄绿渐变色。 */
- YELLOW_GREEN: "YELLOWGREEN",
- /** 黄红渐变色。 */
- YELLOW_RED: "YELLOWRED",
- /** 黄白渐变色。 */
- YELLOW_WHITE: "YELLOWWHITE"
- };
- /**
- * @enum TextAlignment
- * @memberOf SuperMap
- * @description 文本对齐枚举。
- * @type {string}
- */
- var TextAlignment = SuperMap.TextAlignment = {
- /** 左上角对齐。 */
- TOPLEFT: "TOPLEFT",
- /** 顶部居中对齐。 */
- TOPCENTER: "TOPCENTER",
- /** 右上角对齐。 */
- TOPRIGHT: "TOPRIGHT",
- /** 基准线左对齐。 */
- BASELINELEFT: "BASELINELEFT",
- /** 基准线居中对齐。 */
- BASELINECENTER: "BASELINECENTER",
- /** 基准线右对齐。 */
- BASELINERIGHT: "BASELINERIGHT",
- /** 左下角对齐。 */
- BOTTOMLEFT: "BOTTOMLEFT",
- /** 底部居中对齐。 */
- BOTTOMCENTER: "BOTTOMCENTER",
- /** 右下角对齐。 */
- BOTTOMRIGHT: "BOTTOMRIGHT",
- /** 左中对齐。 */
- MIDDLELEFT: "MIDDLELEFT",
- /** 中心对齐。 */
- MIDDLECENTER: "MIDDLECENTER",
- /** 右中对齐。 */
- MIDDLERIGHT: "MIDDLERIGHT"
- };
- /**
- * @enum FillGradientMode
- * @memberOf SuperMap
- * @description 渐变填充风格的渐变类型枚举。
- * @type {string}
- */
- var FillGradientMode = SuperMap.FillGradientMode = {
- /** 无渐变。 */
- NONE: "NONE",
- /** 线性渐变填充。 */
- LINEAR: "LINEAR",
- /** 辐射渐变填充。 */
- RADIAL: "RADIAL",
- /** 圆锥渐变填充。 */
- CONICAL: "CONICAL",
- /** 四角渐变填充。 */
- SQUARE: "SQUARE"
- };
- /**
- * @enum AlongLineDirection
- * @memberOf SuperMap
- * @description 标签沿线标注方向枚举。
- * @type {string}
- */
- var AlongLineDirection = SuperMap.AlongLineDirection = {
- /** 沿线的法线方向放置标签。 */
- NORMAL: "ALONG_LINE_NORMAL",
- /** 从下到上,从左到右放置。 */
- LB_TO_RT: "LEFT_BOTTOM_TO_RIGHT_TOP",
- /** 从上到下,从左到右放置。 */
- LT_TO_RB: "LEFT_TOP_TO_RIGHT_BOTTOM",
- /** 从下到上,从右到左放置。 */
- RB_TO_LT: "RIGHT_BOTTOM_TO_LEFT_TOP",
- /** 从上到下,从右到左放置。 */
- RT_TO_LB: "RIGHT_TOP_TO_LEFT_BOTTOM"
- };
- /**
- * @enum LabelBackShape
- * @memberOf SuperMap
- * @description 标签专题图中标签背景的形状枚举。
- * @type {string}
- */
- var LabelBackShape = SuperMap.LabelBackShape = {
- /** 菱形背景,即标签背景的形状为菱形。 */
- DIAMOND: "DIAMOND",
- /** 椭圆形背景,即标签背景的行状为椭圆形。 */
- ELLIPSE: "ELLIPSE",
- /** 符号背景,即标签背景的形状为设定的符号。 */
- MARKER: "MARKER",
- /** 空背景,即不使用任何形状作为标签的背景。 */
- NONE: "NONE",
- /** 矩形背景,即标签背景的形状为矩形。 */
- RECT: "RECT",
- /** 圆角矩形背景,即标签背景的形状为圆角矩形。 */
- ROUNDRECT: "ROUNDRECT",
- /** 三角形背景,即标签背景的形状为三角形。 */
- TRIANGLE: "TRIANGLE"
- };
- /**
- * @enum LabelOverLengthMode
- * @memberOf SuperMap
- * @description 标签专题图中超长标签的处理模式枚举。
- * @type {string}
- */
- var LabelOverLengthMode = SuperMap.LabelOverLengthMode = {
- /** 换行显示。 */
- NEWLINE: "NEWLINE",
- /** 对超长标签不进行处理。 */
- NONE: "NONE",
- /** 省略超出部分。 */
- OMIT: "OMIT"
- };
- /**
- * @enum DirectionType
- * @memberOf SuperMap
- * @description 网络分析中方向枚举。
- * 在行驶引导子项中使用。
- * @type {string}
- */
- var DirectionType = SuperMap.DirectionType = {
- /** 东。 */
- EAST: "EAST",
- /** 无方向。 */
- NONE: "NONE",
- /** 北。 */
- NORTH: "NORTH",
- /** 南。 */
- SOURTH: "SOURTH",
- /** 西。 */
- WEST: "WEST"
- };
- /**
- * @enum SideType
- * @memberOf SuperMap
- * @description 行驶位置枚举。
- * 表示在行驶在路的左边、右边或者路上的枚举,该类用在行驶导引子项类中。
- * @type {string}
- */
- var SideType = SuperMap.SideType = {
- /** 路的左侧。 */
- LEFT: "LEFT",
- /** 在路上(即路的中间)。 */
- MIDDLE: "MIDDLE",
- /** 无效值。 */
- NONE: "NONE",
- /** 路的右侧。 */
- RIGHT: "RIGHT"
- };
- /**
- * @enum SupplyCenterType
- * @memberOf SuperMap
- * @description 资源供给中心类型枚举。
- * 该枚举定义了网络分析中资源中心点的类型,主要用于资源分配和选址分区。
- * 资源供给中心点的类型包括非中心,固定中心和可选中心。固定中心用于资源分配分析; 固定中心和可选中心用于选址分析;非中心在两种网络分析时都不予考虑。
- * @type {string}
- */
- var SupplyCenterType = SuperMap.SupplyCenterType = {
- /** 固定中心点。 */
- FIXEDCENTER: "FIXEDCENTER",
- /** 非中心点。 */
- NULL: "NULL",
- /** 可选中心点。 */
- OPTIONALCENTER: "OPTIONALCENTER"
- };
- /**
- * @enum TurnType
- * @memberOf SuperMap
- * @description 转弯方向枚举。
- * 用在行驶引导子项类中,表示转弯的方向。
- * @type {string}
- */
- var TurnType = SuperMap.TurnType = {
- /** 向前直行。 */
- AHEAD: "AHEAD",
- /** 掉头。 */
- BACK: "BACK",
- /** 终点,不拐弯。 */
- END: "END",
- /** 左转弯。 */
- LEFT: "LEFT",
- /** 无效值。 */
- NONE: "NONE",
- /** 右转弯。 */
- RIGHT: "RIGHT"
- };
- /**
- * @enum BufferEndType
- * @memberOf SuperMap
- * @description 缓冲区分析BufferEnd类型。
- * @type {string}
- */
- var BufferEndType = SuperMap.BufferEndType = {
- /** FLAT */
- FLAT: "FLAT",
- /** ROUND */
- ROUND: "ROUND"
- };
- /**
- * @enum OverlayOperationType
- * @memberOf SuperMap
- * @description 叠加分析类型枚举。
- * @type {string}
- */
- var OverlayOperationType = SuperMap.OverlayOperationType = {
- /** 操作数据集(几何对象)裁剪被操作数据集(几何对象)。 */
- CLIP: "CLIP",
- /** 在被操作数据集(几何对象)上擦除掉与操作数据集(几何对象)相重合的部分。 */
- ERASE: "ERASE",
- /**对被操作数据集(几何对象)进行同一操作,即操作执行后,被操作数据集(几何对象)包含来自操作数据集(几何对象)的几何形状。 */
- IDENTITY: "IDENTITY",
- /** 对两个数据集(几何对象)求交,返回两个数据集(几何对象)的交集。 */
- INTERSECT: "INTERSECT",
- /** 对两个面数据集(几何对象)进行合并操作。 */
- UNION: "UNION",
- /** 对两个面数据集(几何对象)进行更新操作。 */
- UPDATE: "UPDATE",
- /** 对两个面数据集(几何对象)进行对称差操作。 */
- XOR: "XOR"
- };
- /**
- * @enum OutputType
- * @memberOf SuperMap
- * @description 分布式分析输出类型枚举。
- * @type {string}
- */
- var OutputType = SuperMap.OutputType = {
- /** INDEXEDHDFS */
- INDEXEDHDFS: "INDEXEDHDFS",
- /** UDB */
- UDB: "UDB",
- /** MONGODB */
- MONGODB: "MONGODB",
- /** PG */
- PG: "PG"
- };
- /**
- * @enum SmoothMethod
- * @memberOf SuperMap
- * @description 光滑方法枚举。
- * 用于从Grid 或DEM数据生成等值线或等值面时对等值线或者等值面的边界线进行平滑处理的方法。
- * @type {string}
- */
- var SmoothMethod = SuperMap.SmoothMethod = {
- /** B 样条法。 */
- BSPLINE: "BSPLINE",
- /** 磨角法。 */
- POLISH: "POLISH"
- };
- /**
- * @enum SurfaceAnalystMethod
- * @memberOf SuperMap
- * @description 表面分析方法枚举。
- * 通过对数据进行表面分析,能够挖掘原始数据所包含的信息,使某些细节明显化,易于分析。
- * @type {string}
- */
- var SurfaceAnalystMethod = SuperMap.SurfaceAnalystMethod = {
- /** 等值线提取。 */
- ISOLINE: "ISOLINE",
- /** 等值面提取。 */
- ISOREGION: "ISOREGION"
- };
- /**
- * @enum DataReturnMode
- * @memberOf SuperMap
- * @description 数据返回模式枚举。
- * 该枚举用于指定空间分析返回结果模式,包含返回数据集标识和记录集、只返回数据集标识(数据集名称@数据源名称)及只返回记录集三种模式。
- * @type {string}
- */
- var DataReturnMode = SuperMap.DataReturnMode = {
- /** 返回结果数据集标识(数据集名称@数据源名称)和记录集(RecordSet)。 */
- DATASET_AND_RECORDSET: "DATASET_AND_RECORDSET",
- /** 只返回数据集标识(数据集名称@数据源名称)。 */
- DATASET_ONLY: "DATASET_ONLY",
- /** 只返回记录集(RecordSet)。 */
- RECORDSET_ONLY: "RECORDSET_ONLY"
- };
- /**
- * @enum EditType
- * @memberOf SuperMap
- * @description 要素集更新模式枚举。
- * 该枚举用于指定数据服务中要素集更新模式,包含添加要素集、更新要素集和删除要素集。
- * @type {string}
- */
- var EditType = SuperMap.EditType = {
- /** 增加操作。 */
- ADD: "add",
- /** 修改操作。 */
- UPDATE: "update",
- /** 删除操作。 */
- DELETE: "delete"
- };
- /**
- * @enum TransferTactic
- * @memberOf SuperMap
- * @description 公交换乘策略枚举。
- * 该枚举用于指定公交服务中要素集更新模式,包含添加要素集、更新要素集和删除要素集。
- * @type {string}
- */
- var TransferTactic = SuperMap.TransferTactic = {
- /** 时间短。 */
- LESS_TIME: "LESS_TIME",
- /** 少换乘。 */
- LESS_TRANSFER: "LESS_TRANSFER",
- /** 少步行。 */
- LESS_WALK: "LESS_WALK",
- /** 距离最短。 */
- MIN_DISTANCE: "MIN_DISTANCE"
- };
- /**
- * @enum TransferPreference
- * @memberOf SuperMap
- * @description 公交换乘策略枚举。
- * 该枚举用于指定交通换乘服务中设置地铁优先、公交优先、不乘地铁、无偏好等偏好设置。
- * @type {string}
- */
- var TransferPreference = SuperMap.TransferPreference = {
- /** 公交汽车优先。 */
- BUS: "BUS",
- /** 地铁优先。 */
- SUBWAY: "SUBWAY",
- /** 不乘坐地铁。 */
- NO_SUBWAY: "NO_SUBWAY",
- /** 无乘车偏好。 */
- NONE: "NONE"
- };
- /**
- * @enum GridType
- * @memberOf SuperMap
- * @description 地图背景格网类型枚举。
- * @type {string}
- */
- var GridType = SuperMap.GridType = {
- /** 十字叉丝。 */
- CROSS: "CROSS",
- /** 网格线。 */
- GRID: "GRID",
- /** 点。 */
- POINT: "POINT"
- };
- /**
- * @enum ColorSpaceType
- * @memberOf SuperMap
- * @description 色彩空间枚举。
- * 由于成色原理的不同,决定了显示器、投影仪这类靠色光直接合成颜色的颜色设备和打印机、
- * 印刷机这类靠使用颜料的印刷设备在生成颜色方式上的区别。
- * 针对上述不同成色方式,SuperMap 提供两种色彩空间,
- * 分别为 RGB 和 CMYK。RGB 主要用于显示系统中,CMYK 主要用于印刷系统中。
- * @type {string}
- */
- var ColorSpaceType = SuperMap.ColorSpaceType = {
- /** 该类型主要在印刷系统使用。 */
- CMYK: "CMYK",
- /** 该类型主要在显示系统中使用。 */
- RGB: "RGB"
- };
- /**
- * @enum LayerType
- * @memberOf SuperMap
- * @description 图层类型。
- * @type {string}
- */
- var LayerType = SuperMap.LayerType = {
- /** SuperMap UGC 类型图层。如矢量图层、栅格(Grid)图层、影像图层。 */
- UGC: "UGC",
- /** WMS 图层。 */
- WMS: "WMS",
- /** WFS 图层。 */
- WFS: "WFS",
- /** 自定义图层。 */
- CUSTOM: "CUSTOM"
- };
- /**
- * @enum UGCLayerType
- * @memberOf SuperMap
- * @description UGC图层类型。
- * @type {string}
- */
- var UGCLayerType = SuperMap.UGCLayerType = {
- /** 专题图层。 */
- THEME: "THEME",
- /** 矢量图层。 */
- VECTOR: "VECTOR",
- /** 栅格图层。。 */
- GRID: "GRID",
- /** 影像图层。 */
- IMAGE: "IMAGE"
- };
- /**
- * @enum StatisticMode
- * @memberOf SuperMap
- * @description 字段统计方法类型。
- * @type {string}
- */
- var StatisticMode = SuperMap.StatisticMode = {
- /** 统计所选字段的平均值。 */
- AVERAGE: "AVERAGE",
- /** 统计所选字段的最大值。 */
- MAX: "MAX",
- /** 统计所选字段的最小值。 */
- MIN: "MIN",
- /** 统计所选字段的标准差 */
- STDDEVIATION: "STDDEVIATION",
- /** 统计所选字段的总和。 */
- SUM: "SUM",
- /** 统计所选字段的方差。 */
- VARIANCE: "VARIANCE"
- };
- /**
- * @enum PixelFormat
- * @memberOf SuperMap
- * @description 栅格与影像数据存储的像素格式枚举。
- * @type {string}
- */
- var PixelFormat = SuperMap.PixelFormat = {
- /** 每个像元用16个比特(即2个字节)表示。 */
- BIT16: "BIT16",
- /** 每个像元用32个比特(即4个字节)表示。 */
- BIT32: "BIT32",
- /** 每个像元用64个比特(即8个字节)表示,只提供给栅格数据集使用。 */
- BIT64: "BIT64",
- /** 每个像元用4个字节来表示,只提供给栅格数据集使用。 */
- SINGLE: "SINGLE",
- /** 每个像元用8个字节来表示,只提供给栅格数据集使用。 */
- DOUBLE: "DOUBLE",
- /** 每个像元用1个比特表示。 */
- UBIT1: "UBIT1",
- /** 每个像元用4个比特来表示。 */
- UBIT4: "UBIT4",
- /** 每个像元用8个比特(即1个字节)来表示。 */
- UBIT8: "UBIT8",
- /** 每个像元用24个比特(即3个字节)来表示。 */
- UBIT24: "UBIT24",
- /** 每个像元用32个比特(即4个字节)来表示。 */
- UBIT32: "UBIT32"
- };
- /**
- * @enum SearchMode
- * @memberOf SuperMap
- * @description 内插时使用的样本点的查找方式枚举
- * @type {string}
- */
- var SearchMode = SuperMap.SearchMode = {
- /** 使用 KDTREE 的固定点数方式查找参与内插分析的点。 */
- KDTREE_FIXED_COUNT: "KDTREE_FIXED_COUNT",
- /** 使用 KDTREE 的定长方式查找参与内插分析的点。 */
- KDTREE_FIXED_RADIUS: "KDTREE_FIXED_RADIUS",
- /** 不进行查找,使用所有的输入点进行内插分析。 */
- NONE: "NONE",
- /** 使用 QUADTREE 方式查找参与内插分析的点,仅对样条(RBF)插值和普通克吕金(Kriging)有用。 */
- QUADTREE: "QUADTREE"
- };
- /**
- * @enum InterpolationAlgorithmType
- * @memberOf SuperMap
- * @description 插值分析的算法的类型
- * @type {string}
- */
- var InterpolationAlgorithmType = SuperMap.InterpolationAlgorithmType = {
- /** 普通克吕金插值法。 */
- KRIGING: "KRIGING",
- /** 简单克吕金插值法。 */
- SimpleKriging: "SimpleKriging",
- /** 泛克吕金插值法。 */
- UniversalKriging: "UniversalKriging"
- };
- /**
- * @enum VariogramMode
- * @memberOf SuperMap
- * @description 克吕金(Kriging)插值时的半变函数类型枚举
- * @type {string}
- */
- var VariogramMode = SuperMap.VariogramMode = {
- /** 指数函数。 */
- EXPONENTIAL: "EXPONENTIAL",
- /** 高斯函数。 */
- GAUSSIAN: "GAUSSIAN",
- /** 球型函数。 */
- SPHERICAL: "SPHERICAL"
- };
- /**
- * @enum Exponent
- * @memberOf SuperMap
- * @description 定义了泛克吕金(UniversalKriging)插值时样点数据中趋势面方程的阶数
- * @type {string}
- */
- var Exponent = SuperMap.Exponent = {
- /** 阶数为1。 */
- EXP1: "EXP1",
- /** 阶数为2。 */
- EXP2: "EXP2"
- };
- /**
- * @enum ClientType
- * @memberOf SuperMap
- * @description token申请的客户端标识类型
- * @type {string}
- */
- var ClientType = SuperMap.ClientType = {
- /** 指定的 IP 地址。 */
- IP: "IP",
- /** 指定的 URL。 */
- REFERER: "Referer",
- /** 发送申请令牌请求的客户端 IP。 */
- REQUESTIP: "RequestIP",
- /** 不做任何验证。 */
- NONE: "NONE",
- /** SERVER。 */
- SERVER: "SERVER",
- /** WEB。 */
- WEB: "WEB"
- };
- /**
- * @enum ChartType
- * @memberOf SuperMap
- * @description 客户端专题图图表类型
- * @type {string}
- */
- var ChartType = SuperMap.ChartType = {
- /** 柱状图。 */
- BAR: "Bar",
- /** 三维柱状图。 */
- BAR3D: "Bar3D",
- /** 圆形图。 */
- CIRCLE: "Circle",
- /** 饼图。 */
- PIE: "Pie",
- /** 散点图。 */
- POINT: "Point",
- /** 折线图。 */
- LINE: "Line",
- /** 环状图。 */
- RING: "Ring"
- };
- /**
- * @enum ClipAnalystMode
- * @memberOf SuperMap
- * @description 裁剪分析模式
- * @type {string}
- */
- var ClipAnalystMode = SuperMap.ClipAnalystMode = {
- /** CLIP。 */
- CLIP: "clip",
- /** INTERSECT。 */
- INTERSECT: "intersect"
- };
- /**
- * @enum AnalystAreaUnit
- * @memberOf SuperMap
- * @description 分布式分析面积单位
- * @type {string}
- */
- var AnalystAreaUnit = SuperMap.AnalystAreaUnit = {
- /** 平方米。 */
- "SQUAREMETER": "SquareMeter",
- /** 平方千米。 */
- "SQUAREKILOMETER": "SquareKiloMeter",
- /** 公顷。 */
- "HECTARE": "Hectare",
- /** 公亩。 */
- "ARE": "Are",
- /** 英亩。 */
- "ACRE": "Acre",
- /** 平方英尺。 */
- "SQUAREFOOT": "SquareFoot",
- /** 平方码。 */
- "SQUAREYARD": "SquareYard",
- /** 平方英里。 */
- "SQUAREMILE": "SquareMile"
- };
- /**
- * @enum AnalystSizeUnit
- * @memberOf SuperMap
- * @description 分布式分析单位
- * @type {string}
- */
- var AnalystSizeUnit = SuperMap.AnalystSizeUnit = {
- /** 米。 */
- "METER": "Meter",
- /** 千米。 */
- "KILOMETER": "Kilometer",
- /** 码。 */
- "YARD": "Yard",
- /** 英尺。 */
- "FOOT": "Foot",
- /** 英里。 */
- "MILE": "Mile"
- };
- /**
- * @enum StatisticAnalystMode
- * @memberOf SuperMap
- * @description 分布式分析统计模式
- * @type {string}
- */
- var StatisticAnalystMode = SuperMap.StatisticAnalystMode = {
- /** 统计所选字段的最大值。 */
- "MAX": "max",
- /** 统计所选字段的最小值。 */
- "MIN": "min",
- /** 统计所选字段的平均值。 */
- "AVERAGE": "average",
- /** 统计所选字段的总和。 */
- "SUM": "sum",
- /** 统计所选字段的方差。 */
- "VARIANCE": "variance",
- /** 统计所选字段的标准差 */
- "STDDEVIATION": "stdDeviation"
- };
- /**
- * @enum SummaryType
- * @memberOf SuperMap
- * @description 分布式分析聚合类型
- * @type {string}
- */
- var SummaryType = SuperMap.SummaryType = {
- /** 格网聚合。 */
- "SUMMARYMESH": "SUMMARYMESH",
- /** 多边形聚合。 */
- "SUMMARYREGION": "SUMMARYREGION"
- };
- /**
- * @enum TopologyValidatorRule
- * @memberOf SuperMap
- * @description 拓扑检查模式枚举。该类定义了拓扑检查操作模式常量。
- * @type {string}
- */
- var TopologyValidatorRule = SuperMap.TopologyValidatorRule = {
- /** 面内无重叠,用于对面数据进行拓扑检查。 */
- REGIONNOOVERLAP: "REGIONNOOVERLAP",
- /** 面与面无重叠,用于对面数据进行拓扑检查。 */
- REGIONNOOVERLAPWITH: "REGIONNOOVERLAPWITH",
- /** 面被面包含,用于对面数据进行拓扑检查。 */
- REGIONCONTAINEDBYREGION: "REGIONCONTAINEDBYREGION",
- /** 面被面覆盖,用于对面数据进行拓扑检查。 */
- REGIONCOVEREDBYREGION: "REGIONCOVEREDBYREGION",
- /** 线与线无重叠,用于对线数据进行拓扑检查。 */
- LINENOOVERLAP: "LINENOOVERLAP",
- /** 线内无重叠,用于对线数据进行拓扑检查。 */
- LINENOOVERLAPWITH: "LINENOOVERLAPWITH",
- /** 点不相同,用于对点数据进行拓扑检查。 */
- POINTNOIDENTICAL: "POINTNOIDENTICAL"
- };
- /**
- * @enum AggregationType
- * @memberOf SuperMap
- * @description 聚合查询枚举类,该类定义了Es数据服务中聚合查询模式常量
- * @type {string}
- */
- var AggregationType = SuperMap.AggregationType = {
- /** 格网聚合类型。 */
- GEOHASH_GRID: "geohash_grid",
- /** 过滤聚合类型。 */
- FILTER: "filter"
- };
- /**
- * @enum AggregationType
- * @memberOf SuperMap
- * @description 聚合查询中filter查询枚举类
- * @type {string}
- */
- var AggregationQueryBuilderType = SuperMap.AggregationQueryBuilderType = {
- /** 范围查询。 */
- GEO_BOUNDING_BOX: "geo_bounding_box"
- };
- /**
- * @enum GetFeatureMode
- * @memberOf SuperMap
- * @description feature 查询方式。
- * @type {string}
- */
- var GetFeatureMode = SuperMap.GetFeatureMode = {
- /** 通过范围查询来获取要素。 */
- BOUNDS: "BOUNDS",
- /** 通过几何对象的缓冲区来获取要素。 */
- BUFFER: "BUFFER",
- /** 通过 ID 来获取要素。 */
- ID: "ID",
- /** 通过空间查询模式来获取要素。 */
- SPATIAL: "SPATIAL",
- /** 通过 SQL 查询来获取要素。 */
- SQL: 'SQL'
- };
- /**
- * @enum RasterFunctionType
- * @memberOf SuperMap
- * @description 栅格分析方法。
- * @type {string}
- */
- var RasterFunctionType = SuperMap.RasterFunctionType = {
- /** 归一化植被指数。 */
- NDVI: "NDVI",
- /** 阴影面分析。 */
- HILLSHADE: "HILLSHADE"
- };
- /**
- * @enum ResourceType
- * @memberOf SuperMap
- * @description iportal资源类型。
- * @version 10.0.1
- * @type {string}
- */
- var ResourceType = SuperMap.ResourceType = {
- /** 地图。 */
- MAP: "MAP",
- /** 服务。 */
- SERVICE: "SERVICE",
- /** 场景。 */
- SCENE: "SCENE",
- /** 数据。 */
- DATA: "DATA",
- /** 洞察。 */
- INSIGHTS_WORKSPACE: "INSIGHTS_WORKSPACE",
- /** 大屏。 */
- MAP_DASHBOARD: "MAP_DASHBOARD"
- };
- /**
- * @enum OrderBy
- * @memberOf SuperMap
- * @description iportal资源排序字段。
- * @version 10.0.1
- * @type {string}
- */
- var OrderBy = SuperMap.OrderBy = {
- /** 按更新时间排序 */
- UPDATETIME: "UPDATETIME",
- /** 按热度(可能是访问量、下载量)排序 */
- HEATLEVEL: "HEATLEVEL",
- /** 按相关性排序 */
- RELEVANCE: "RELEVANCE"
- };
- /**
- * @enum OrderType
- * @memberOf SuperMap
- * @description iportal资源升序还是降序过滤
- * @version 10.0.1
- * @type {string}
- */
- var OrderType = SuperMap.OrderType = {
- /** 升序 */
- ASC: "ASC",
- /** 降序 */
- DESC: "DESC"
- };
- /**
- * @enum SearchType
- * @memberOf SuperMap
- * @description iportal资源查询的范围进行过滤
- * @version 10.0.1
- * @type {string}
- */
- var SearchType = SuperMap.SearchType = {
- /** 公开资源。 */
- PUBLIC: "PUBLIC",
- /** 我的资源。 */
- MY_RES: "MY_RES",
- /** 我的群组资源。 */
- MYGROUP_RES: "MYGROUP_RES",
- /** 我的部门资源。 */
- MYDEPARTMENT_RES: "MYDEPARTMENT_RES",
- /** 分享给我的资源。 */
- SHARETOME_RES: "SHARETOME_RES"
- };
- /**
- * @enum AggregationTypes
- * @memberOf SuperMap
- * @description iportal资源聚合查询的类型
- * @version 10.0.1
- * @type {string}
- */
- var AggregationTypes = SuperMap.AggregationTypes = {
- /** 标签 */
- TAG: "TAG",
- /** 资源类型 */
- TYPE: "TYPE"
- };
- /**
- * @enum PermissionType
- * @memberOf SuperMap
- * @description iportal资源权限类型。
- * @version 10.0.1
- * @type {string}
- */
- var PermissionType = SuperMap.PermissionType = {
- /** 可检索 */
- SEARCH: "SEARCH",
- /** 可查看 */
- READ: "READ",
- /** 可编辑 */
- READWRITE: "READWRITE",
- /** 可删除 */
- DELETE: "DELETE",
- /** 可下载,包括可读、可检索 */
- DOWNLOAD: "DOWNLOAD"
- };
- /**
- * @enum EntityType
- * @memberOf SuperMap
- * @description iportal资源实体类型。
- * @version 10.0.1
- * @type {string}
- */
- var EntityType = SuperMap.EntityType = {
- /** 部门 */
- DEPARTMENT: "DEPARTMENT",
- /** 用户组 */
- GROUP: "GROUP",
- /** 群组 */
- IPORTALGROUP: "IPORTALGROUP",
- /** 角色 */
- ROLE: "ROLE",
- /** 用户 */
- USER: "USER"
- };
- /**
- * @enum DataItemType
- * @memberOf SuperMap
- * @description iportal数据类型。
- * @version 10.0.1
- * @type {string}
- */
- var DataItemType = SuperMap.DataItemType = {
- /** 工作空间 sxwu, smwu, sxw, smw */
- WORKSPACE: "WORKSPACE",
- /** udb 数据源 */
- UDB: "UDB",
- /** shp空间数据 */
- SHP: "SHP",
- /** excel数据 */
- EXCEL: "EXCEL",
- /** csv数据 */
- CSV: "CSV",
- /** geojson数据。 */
- GEOJSON: "GEOJSON",
- /** smtiles */
- SMTILES: "SMTILES",
- /** svtiles */
- SVTILES: "SVTILES",
- /** mbtiles */
- MBTILES: "MBTILES",
- /** tpk */
- TPK: "TPK",
- /** ugc v5 */
- UGCV5: "UGCV5",
- /** UGCV5_MVT */
- UGCV5_MVT: "UGCV5_MVT",
- /** json数据 */
- JSON: "JSON"
- };
- /**
- * @enum WebExportFormatType
- * @memberOf SuperMap
- * @description Web 打印输出的格式。
- * @version 10.0.1
- * @type {string}
- */
- var WebExportFormatType = SuperMap.WebExportFormatType = {
- /** png */
- PNG: "PNG",
- /** pdf */
- PDF: "PDF"
- };
- /**
- * @enum WebScaleOrientationType
- * @memberOf SuperMap
- * @description Web 比例尺的方位样式。
- * @version 10.0.1
- * @type {string}
- */
- var WebScaleOrientationType = SuperMap.WebScaleOrientationType = {
- /** horizontal labels below */
- HORIZONTALLABELSBELOW: "HORIZONTALLABELSBELOW",
- /** horizontal labels above */
- HORIZONTALLABELSABOVE: "HORIZONTALLABELSABOVE",
- /** vertical labels left */
- VERTICALLABELSLEFT: "VERTICALLABELSLEFT",
- /** vertical labels right */
- VERTICALLABELSRIGHT: "VERTICALLABELSRIGHT"
- };
- /**
- * @enum WebScaleType
- * @memberOf SuperMap
- * @description Web 比例尺的样式。
- * @version 10.0.1
- * @type {string}
- */
- var WebScaleType = SuperMap.WebScaleType = {
- /** line */
- LINE: "LINE",
- /** bar */
- BAR: "BAR",
- /** bar sub */
- BAR_SUB: "BAR_SUB"
- };
- /**
- * @enum WebScaleUnit
- * @memberOf SuperMap
- * @description Web 比例尺的单位制。
- * @version 10.0.1
- * @type {string}
- */
- var WebScaleUnit = SuperMap.WebScaleUnit = {
- /** meter */
- METER: "METER",
- /** foot */
- FOOT: "FOOT",
- /** degrees */
- DEGREES: "DEGREES"
- };
- ;// CONCATENATED MODULE: ./src/common/commontypes/Size.js
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Size
- * @category BaseTypes Style
- * @classdesc 此类描绘一对高宽值的实例。
- * @param {number} [w=0.0] - 宽度。
- * @param {number} [h=0.0] - 高度。
- *
- * @example
- * var size = new SuperMap.Size(31,46);
- */
- var Size = /*#__PURE__*/function () {
- function Size(w, h) {
- _classCallCheck(this, Size);
- /**
- * @member {number} [SuperMap.Size.prototype.w=0.0]
- * @description 宽度。
- */
- this.w = w ? parseFloat(w) : 0.0;
- /**
- * @member {number} [SuperMap.Size.prototype.h=0.0]
- * @description 高度。
- */
- this.h = w ? parseFloat(h) : 0.0;
- this.CLASS_NAME = "SuperMap.Size";
- }
- /**
- * @function SuperMap.Size.prototype.toString
- * @description 返回此对象的字符串形式。
- * @example
- * var size = new SuperMap.Size(10,5);
- * var str = size.toString();
- * @returns {string} 例如:"w=10,h=5"。
- */
- _createClass(Size, [{
- key: "toString",
- value: function toString() {
- return "w=" + this.w + ",h=" + this.h;
- }
- /**
- * @function SuperMap.Size.prototype.clone
- * @description 克隆当前size对象。
- * @example
- * var size = new SuperMap.Size(31,46);
- * var size2 = size.clone();
- * @returns {SuperMap.Size} 返回一个新的与当前 size 对象有相同宽、高的 Size 对象。
- */
- }, {
- key: "clone",
- value: function clone() {
- return new Size(this.w, this.h);
- }
- /**
- *
- * @function SuperMap.Size.prototype.equals
- * @description 比较两个 size 对象是否相等。
- * @example
- * var size = new SuperMap.Size(31,46);
- * var size2 = new SuperMap.Size(31,46);
- * var isEquals = size.equals(size2);
- *
- * @param {SuperMap.Size} sz - 用于比较相等的 Size 对象。
- * @returns {boolean} 传入的 size 和当前 size 高宽相等,注意:如果传入的 size 为空则返回 false。
- *
- */
- }, {
- key: "equals",
- value: function equals(sz) {
- var equals = false;
- if (sz != null) {
- equals = this.w === sz.w && this.h === sz.h || isNaN(this.w) && isNaN(this.h) && isNaN(sz.w) && isNaN(sz.h);
- }
- return equals;
- }
- /**
- *
- * @function SuperMap.Size.prototype.destroy
- * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
- * @example
- * var size = new SuperMap.Size(31,46);
- * size.destroy();
- */
- }, {
- key: "destroy",
- value: function destroy() {
- this.w = null;
- this.h = null;
- }
- }]);
- return Size;
- }();
- SuperMap.Size = Size;
- ;// CONCATENATED MODULE: ./src/common/commontypes/Pixel.js
- function Pixel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Pixel_createClass(Constructor, protoProps, staticProps) { if (protoProps) Pixel_defineProperties(Constructor.prototype, protoProps); if (staticProps) Pixel_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Pixel
- * @category BaseTypes Geometry
- * @classdesc 此类用 x,y 坐标描绘屏幕坐标(像素点)。
- * @param {number} [x=0.0] - x 坐标。
- * @param {number} [y=0.0] - y 坐标。
- * @param {SuperMap.Pixel.Mode} [mode=SuperMap.Pixel.Mode.LeftTop] - 坐标模式。
- *
- * @example
- * //单独创建一个对象
- * var pixcel = new SuperMap.Pixel(100,50);
- *
- * //依据 size 创建
- * var size = new SuperMap.Size(21,25);
- * var offset = new SuperMap.Pixel(-(size.w/2), -size.h);
- */
- var Pixel = /*#__PURE__*/function () {
- function Pixel(x, y, mode) {
- Pixel_classCallCheck(this, Pixel);
- /**
- * @member {number} [SuperMap.Pixel.prototype.x=0.0]
- * @description x 坐标。
- */
- this.x = x ? parseFloat(x) : 0.0;
- /**
- * @member {number} [SuperMap.Pixel.prototype.y=0.0]
- * @description y 坐标。
- */
- this.y = y ? parseFloat(y) : 0.0;
- /**
- * @member {SuperMap.Pixel.Mode} [SuperMap.Pixel.prototype.mode=SuperMap.Pixel.Mode.LeftTop]
- * @description 坐标模式,有左上、右上、右下、左下这几种模式,分别表示相对于左上角、右上角、右下角、左下角的坐标。
- */
- this.mode = mode;
- this.CLASS_NAME = "SuperMap.Pixel";
- /**
- * @enum SuperMap.Pixel.Mode
- * @readonly
- * @description 模式。
- * @type {string}
- */
- SuperMap.Pixel.Mode = {
- /** 左上模式。*/
- LeftTop: "lefttop",
- /** 右上模式。 */
- RightTop: "righttop",
- /** 右下模式。 */
- RightBottom: "rightbottom",
- /** 左下模式。 */
- LeftBottom: "leftbottom"
- };
- }
- /**
- * @function SuperMap.Pixel.prototype.toString
- * @description 返回此对象的字符串形式。
- * @example
- *
- * var pixcel = new SuperMap.Pixel(100,50);
- * var str = pixcel.toString();
- *
- * @returns {string} 例如: "x=200.4,y=242.2"
- */
- Pixel_createClass(Pixel, [{
- key: "toString",
- value: function toString() {
- return "x=" + this.x + ",y=" + this.y;
- }
- /**
- * @function SuperMap.Pixel.prototype.clone
- * @description 克隆当前的 pixel 对象。
- * @example
- * var pixcel = new SuperMap.Pixel(100,50);
- * var pixcel2 = pixcel.clone();
- * @returns {SuperMap.Pixel} 返回一个新的与当前 pixel 对象有相同 x、y 坐标的 pixel 对象。
- */
- }, {
- key: "clone",
- value: function clone() {
- return new Pixel(this.x, this.y, this.mode);
- }
- /**
- * @function SuperMap.Pixel.prototype.equals
- * @description 比较两 pixel 是否相等。
- * @example
- * var pixcel = new SuperMap.Pixel(100,50);
- * var pixcel2 = new SuperMap.Pixel(100,50);
- * var isEquals = pixcel.equals(pixcel2);
- *
- * @param {SuperMap.Pixel} px - 用于比较相等的 pixel 对象。
- * @returns {boolean} 如果传入的像素点和当前像素点相同返回 true,如果不同或传入参数为 NULL 则返回 false。
- */
- }, {
- key: "equals",
- value: function equals(px) {
- var equals = false;
- if (px != null) {
- equals = this.x == px.x && this.y == px.y || isNaN(this.x) && isNaN(this.y) && isNaN(px.x) && isNaN(px.y);
- }
- return equals;
- }
- /**
- * @function SuperMap.Pixel.prototype.distanceTo
- * @description 返回两个 pixel 的距离。
- * @example
- * var pixcel = new SuperMap.Pixel(100,50);
- * var pixcel2 = new SuperMap.Pixel(110,30);
- * var distance = pixcel.distanceTo(pixcel2);
- *
- * @param {SuperMap.Pixel} px - 用于计算的一个 pixel。
- * @returns {float} 作为参数传入的像素与当前像素点的距离。
- */
- }, {
- key: "distanceTo",
- value: function distanceTo(px) {
- return Math.sqrt(Math.pow(this.x - px.x, 2) + Math.pow(this.y - px.y, 2));
- }
- /**
- * @function SuperMap.Pixel.prototype.add
- * @description 在原来像素坐标基础上,x 值加上传入的 x 参数,y 值加上传入的 y 参数。
- * @example
- * var pixcel = new SuperMap.Pixel(100,50);
- * //pixcel2是新的对象
- * var pixcel2 = pixcel.add(20,30);
- *
- * @param {number} x - 传入的 x 值。
- * @param {number} y - 传入的 y 值。
- * @returns {SuperMap.Pixel} 返回一个新的 pixel 对象,该 pixel 是由当前的 pixel 与传入的 x,y 相加得到。
- */
- }, {
- key: "add",
- value: function add(x, y) {
- if (x == null || y == null) {
- throw new TypeError('Pixel.add cannot receive null values');
- }
- return new Pixel(this.x + x, this.y + y);
- }
- /**
- * @function SuperMap.Pixel.prototype.offset
- * @description 通过传入的 {@link SuperMap.Pixel} 参数对原屏幕坐标进行偏移。
- * @example
- * var pixcel = new SuperMap.Pixel(100,50);
- * var pixcel2 = new SuperMap.Pixel(130,20);
- * //pixcel3 是新的对象
- * var pixcel3 = pixcel.offset(pixcel2);
- *
- * @param {SuperMap.Pixel} px - 传入的 <SuperMap.Pixel> 对象。
- * @returns {SuperMap.Pixel} 返回一个新的 pixel,该 pixel 是由当前的 pixel 对象的 x,y 值与传入的 Pixel 对象的 x,y 值相加得到。
- */
- }, {
- key: "offset",
- value: function offset(px) {
- var newPx = this.clone();
- if (px) {
- newPx = this.add(px.x, px.y);
- }
- return newPx;
- }
- /**
- *
- * @function SuperMap.Pixel.prototype.destroy
- * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
- * @example
- * var pixcel = new SuperMap.Pixel(100,50);
- * pixcel.destroy();
- */
- }, {
- key: "destroy",
- value: function destroy() {
- this.x = null;
- this.y = null;
- this.mode = null;
- }
- }]);
- return Pixel;
- }();
- SuperMap.Pixel = Pixel;
- ;// CONCATENATED MODULE: ./src/common/commontypes/BaseTypes.js
- function BaseTypes_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- *@namespace SuperMap
- *@category BaseTypes Namespace
- */
- /**
- * @function SuperMap.inherit
- * @description 除了 C 和 P 两个必要参数外,可以传递任意数量的对象,这些对象都将继承C。
- * @memberOf SuperMap
- * @param {Object} C - 继承的类。
- * @param {Object} P - 被继承的父类。
- */
- SuperMap.inherit = function (C, P) {
- var F = function F() {};
- F.prototype = P.prototype;
- C.prototype = new F();
- var i, l, o;
- for (i = 2, l = arguments.length; i < l; i++) {
- o = arguments[i];
- if (typeof o === "function") {
- o = o.prototype;
- }
- SuperMap.Util.extend(C.prototype, o);
- }
- };
- /**
- * @function SuperMap.mixin
- * @description 实现多重继承。
- * @memberOf SuperMap
- * @param {Class|Object} ...mixins - 继承的类。
- */
- SuperMap.mixin = function () {
- for (var _len = arguments.length, mixins = new Array(_len), _key = 0; _key < _len; _key++) {
- mixins[_key] = arguments[_key];
- }
- var Mix = function Mix(options) {
- BaseTypes_classCallCheck(this, Mix);
- for (var index = 0; index < mixins.length; index++) {
- copyProperties(this, new mixins[index](options));
- }
- };
- for (var index = 0; index < mixins.length; index++) {
- var mixin = mixins[index];
- copyProperties(Mix, mixin);
- copyProperties(Mix.prototype, mixin.prototype);
- copyProperties(Mix.prototype, new mixin());
- }
- return Mix;
- function copyProperties(target, source) {
- var ownKeys = Object.getOwnPropertyNames(source);
- if (Object.getOwnPropertySymbols) {
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source));
- }
- for (var index = 0; index < ownKeys.length; index++) {
- var key = ownKeys[index];
- if (key !== "constructor" && key !== "prototype" && key !== "name" && key !== "length") {
- var desc = Object.getOwnPropertyDescriptor(source, key);
- if (window["ActiveXObject"]) {
- Object.defineProperty(target, key, desc || {});
- } else {
- Object.defineProperty(target, key, desc);
- }
- }
- }
- }
- };
- /**
- * @name String
- * @namespace
- * @memberOf SuperMap
- * @category BaseTypes Util
- * @description 字符串操作的一系列常用扩展函数。
- */
- var StringExt = SuperMap.String = {
- /**
- * @function SuperMap.String.startsWith
- * @description 判断目标字符串是否以指定的子字符串开头。
- * @param {string} str - 目标字符串。
- * @param {string} sub - 查找的子字符串。
- * @returns {boolean} 目标字符串以指定的子字符串开头,则返回 true;否则返回 false。
- */
- startsWith: function startsWith(str, sub) {
- return str.indexOf(sub) == 0;
- },
- /**
- * @function SuperMap.String.contains
- * @description 判断目标字符串是否包含指定的子字符串。
- * @param {string} str - 目标字符串。
- * @param {string} sub - 查找的子字符串。
- * @returns {boolean} 目标字符串中包含指定的子字符串,则返回 true;否则返回 false。
- */
- contains: function contains(str, sub) {
- return str.indexOf(sub) != -1;
- },
- /**
- * @function SuperMap.String.trim
- * @description 删除一个字符串的开头和结尾处的所有空白字符。
- * @param {string} str - (可能)存在空白字符填塞的字符串。
- * @returns {string} 删除开头和结尾处空白字符后的字符串。
- */
- trim: function trim(str) {
- return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
- },
- /**
- * @function SuperMap.String.camelize
- * @description 骆驼式("-")连字符的字符串处理。
- * 例如:"chicken-head" becomes "chickenHead",
- * "-chicken-head" becomes "ChickenHead"。
- * @param {string} str - 要处理的字符串,原始内容不应被修改。
- * @returns {string}
- */
- camelize: function camelize(str) {
- var oStringList = str.split('-');
- var camelizedString = oStringList[0];
- for (var i = 1, len = oStringList.length; i < len; i++) {
- var s = oStringList[i];
- camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
- }
- return camelizedString;
- },
- /**
- * @function SuperMap.String.format
- * @description 提供带 ${token} 标记的字符串, 返回 context 对象属性中指定标记的属性值。
- * @example
- * 示例:
- * (code)
- * 1、template = "${value,getValue}";
- * context = {value: {getValue:function(){return Math.max.apply(null,argument);}}};
- * args = [2,23,12,36,21];
- * 返回值:36
- * (end)
- * 示例:
- * (code)
- * 2、template = "$${{value,getValue}}";
- * context = {value: {getValue:function(){return Math.max.apply(null,argument);}}};
- * args = [2,23,12,36,21];
- * 返回值:"${36}"
- * (end)
- * 示例:
- * (code)
- * 3、template = "${a,b}";
- * context = {a: {b:"format"}};
- * args = null;
- * 返回值:"format"
- * (end)
- * 示例:
- * (code)
- * 3、template = "${a,b}";
- * context = null;
- * args = null;
- * 返回值:"${a.b}"
- * (end)
- * @param {string} template - 带标记的字符串将要被替换。参数 template 格式为"${token}",此处的 token 标记会替换为 context["token"] 属性的值。
- * @param {Object} [context=window] - 带有属性的可选对象的属性用于匹配格式化字符串中的标记。如果该参数为空,将使用 window 对象。
- * @param {Array} [args] - 可选参数传递给在 context 对象上找到的函数。
- * @returns {string} 从 context 对象属性中替换字符串标记位的字符串。
- */
- format: function format(template, context, args) {
- if (!context) {
- context = window;
- } // Example matching:
- // str = ${foo.bar}
- // match = foo.bar
- var replacer = function replacer(str, match) {
- var replacement; // Loop through all subs. Example: ${a.b.c}
- // 0 -> replacement = context[a];
- // 1 -> replacement = context[a][b];
- // 2 -> replacement = context[a][b][c];
- var subs = match.split(/\.+/);
- for (var i = 0; i < subs.length; i++) {
- if (i == 0) {
- replacement = context;
- }
- replacement = replacement[subs[i]];
- }
- if (typeof replacement === "function") {
- replacement = args ? replacement.apply(null, args) : replacement();
- } // If replacement is undefined, return the string 'undefined'.
- // This is a workaround for a bugs in browsers not properly
- // dealing with non-participating groups in regular expressions:
- // http://blog.stevenlevithan.com/archives/npcg-javascript
- if (typeof replacement == 'undefined') {
- return 'undefined';
- } else {
- return replacement;
- }
- };
- return template.replace(SuperMap.String.tokenRegEx, replacer);
- },
- /**
- * @member {RegExp} [SuperMap.String.tokenRegEx]
- * @description 寻找带 token 的字符串,默认为 tokenRegEx=/\$\{([\w.]+?)\}/g。
- * @example
- * Examples: ${a}, ${a.b.c}, ${a-b}, ${5}
- */
- tokenRegEx: /\$\{([\w.]+?)\}/g,
- /**
- * @member {RegExp} [SuperMap.String.numberRegEx]
- * @description 判断一个字符串是否只包含一个数值,默认为 numberRegEx=/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/。
- */
- numberRegEx: /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,
- /**
- * @function SuperMap.String.isNumeric
- * @description 判断一个字符串是否只包含一个数值。
- * @example
- * (code)
- * SuperMap.String.isNumeric("6.02e23") // true
- * SuperMap.String.isNumeric("12 dozen") // false
- * SuperMap.String.isNumeric("4") // true
- * SuperMap.String.isNumeric(" 4 ") // false
- * (end)
- * @returns {boolean} 字符串包含唯一的数值,返回 true;否则返回 false。
- */
- isNumeric: function isNumeric(value) {
- return SuperMap.String.numberRegEx.test(value);
- },
- /**
- * @function SuperMap.String.numericIf
- * @description 把一个看似数值型的字符串转化为一个数值。
- * @returns {(number|string)} 如果能转换为数值则返回数值,否则返回字符串本身。
- */
- numericIf: function numericIf(value) {
- return SuperMap.String.isNumeric(value) ? parseFloat(value) : value;
- }
- };
- /**
- * @name Number
- * @memberOf SuperMap
- * @namespace
- * @category BaseTypes Util
- * @description 数值操作的一系列常用扩展函数。
- */
- var NumberExt = SuperMap.Number = {
- /**
- * @member {string} [SuperMap.Number.decimalSeparator='.']
- * @description 格式化数字时默认的小数点分隔符。
- * @constant
- */
- decimalSeparator: ".",
- /**
- * @member {string} [SuperMap.Number.thousandsSeparator=',']
- * @description 格式化数字时默认的千位分隔符。
- * @constant
- */
- thousandsSeparator: ",",
- /**
- * @function SuperMap.Number.limitSigDigs
- * @description 限制浮点数的有效数字位数。
- * @param {number} num - 浮点数。
- * @param {integer} sig - 有效位数。
- * @returns {number} 将数字四舍五入到指定数量的有效位数。
- */
- limitSigDigs: function limitSigDigs(num, sig) {
- var fig = 0;
- if (sig > 0) {
- fig = parseFloat(num.toPrecision(sig));
- }
- return fig;
- },
- /**
- * @function SuperMap.Number.format
- * @description 数字格式化输出。
- * @param {number} num - 数字。
- * @param {integer} [dec=0] - 数字的小数部分四舍五入到指定的位数。设置为 null 值时小数部分不变。
- * @param {string} [tsep=','] - 千位分隔符。
- * @param {string} [dsep='.'] - 小数点分隔符。
- * @returns {string} 数字格式化后的字符串。
- */
- format: function format(num, dec, tsep, dsep) {
- dec = typeof dec != "undefined" ? dec : 0;
- tsep = typeof tsep != "undefined" ? tsep : SuperMap.Number.thousandsSeparator;
- dsep = typeof dsep != "undefined" ? dsep : SuperMap.Number.decimalSeparator;
- if (dec != null) {
- num = parseFloat(num.toFixed(dec));
- }
- var parts = num.toString().split(".");
- if (parts.length === 1 && dec == null) {
- // integer where we do not want to touch the decimals
- dec = 0;
- }
- var integer = parts[0];
- if (tsep) {
- var thousands = /(-?[0-9]+)([0-9]{3})/;
- while (thousands.test(integer)) {
- integer = integer.replace(thousands, "$1" + tsep + "$2");
- }
- }
- var str;
- if (dec == 0) {
- str = integer;
- } else {
- var rem = parts.length > 1 ? parts[1] : "0";
- if (dec != null) {
- rem = rem + new Array(dec - rem.length + 1).join("0");
- }
- str = integer + dsep + rem;
- }
- return str;
- }
- };
- if (!Number.prototype.limitSigDigs) {
- /**
- * APIMethod: Number.limitSigDigs
- * 限制浮点数的有效数字位数.
- * @param {integer} sig -有效位数。
- * @returns {integer} 将数字四舍五入到指定数量的有效位数。
- * 如果传入值 为 null、0、或者是负数, 返回值 0。
- */
- Number.prototype.limitSigDigs = function (sig) {
- return NumberExt.limitSigDigs(this, sig);
- };
- }
- /**
- * @name Function
- * @memberOf SuperMap
- * @namespace
- * @category BaseTypes Util
- * @description 函数操作的一系列常用扩展函数。
- */
- var FunctionExt = SuperMap.Function = {
- /**
- * @function SuperMap.Function.bind
- * @description 绑定函数到对象。方便创建 this 的作用域。
- * @param {function} func - 输入函数。
- * @param {Object} object - 对象绑定到输入函数(作为输入函数的 this 对象)。
- * @returns {function} object 参数作为 func 函数的 this 对象。
- */
- bind: function bind(func, object) {
- // create a reference to all arguments past the second one
- var args = Array.prototype.slice.apply(arguments, [2]);
- return function () {
- // Push on any additional arguments from the actual function call.
- // These will come after those sent to the bind call.
- var newArgs = args.concat(Array.prototype.slice.apply(arguments, [0]));
- return func.apply(object, newArgs);
- };
- },
- /**
- * @function SuperMap.Function.bindAsEventListener
- * @description 绑定函数到对象,在调用该函数时配置并使用事件对象作为第一个参数。
- * @param {function} func - 用于监听事件的函数。
- * @param {Object} object - this 对象的引用。
- * @returns {function}
- */
- bindAsEventListener: function bindAsEventListener(func, object) {
- return function (event) {
- return func.call(object, event || window.event);
- };
- },
- /**
- * @function SuperMap.Function.False
- * @description 该函数仅仅返回 false。该函数主要是避免在 IE8 以下浏览中 DOM 事件句柄的匿名函数问题。
- * @example
- * document.onclick = SuperMap.Function.False;
- * @returns {boolean}
- */
- False: function False() {
- return false;
- },
- /**
- * @function SuperMap.Function.True
- * @description 该函数仅仅返回 true。该函数主要是避免在 IE8 以下浏览中 DOM 事件句柄的匿名函数问题。
- * @example
- * document.onclick = SuperMap.Function.True;
- * @returns {boolean}
- */
- True: function True() {
- return true;
- },
- /**
- * @function SuperMap.Function.Void
- * @description 可重用函数,仅仅返回 "undefined"。
- * @returns {undefined}
- */
- Void: function Void() {}
- };
- /**
- * @name Array
- * @memberOf SuperMap
- * @namespace
- * @category BaseTypes Util
- * @description 数组操作的一系列常用扩展函数。
- */
- var ArrayExt = SuperMap.Array = {
- /**
- * @function SuperMap.Array.filter
- * @description 过滤数组,提供了 ECMA-262 标准中 Array.prototype.filter 函数的扩展。详见:{@link http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/filter}
- * @param {Array} array - 要过滤的数组。
- * @param {function} callback - 数组中的每一个元素调用该函数。</br>
- * 如果函数的返回值为 true,该元素将包含在返回的数组中。该函数有三个参数: 数组中的元素,元素的索引,数组自身。</br>
- * 如果设置了可选参数 caller,在调用 callback 时,使用可选参数 caller 设置为 callback 的参数。</br>
- * @param {Object} [caller] - 在调用 callback 时,使用参数 caller 设置为 callback 的参数。
- * @returns {Array} callback 函数返回 true 时的元素将作为返回数组中的元素。
- */
- filter: function filter(array, callback, caller) {
- var selected = [];
- if (Array.prototype.filter) {
- selected = array.filter(callback, caller);
- } else {
- var len = array.length;
- if (typeof callback != "function") {
- throw new TypeError();
- }
- for (var i = 0; i < len; i++) {
- if (i in array) {
- var val = array[i];
- if (callback.call(caller, val, i, array)) {
- selected.push(val);
- }
- }
- }
- }
- return selected;
- }
- };
- ;// CONCATENATED MODULE: ./src/common/commontypes/Util.js
- 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); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- var Util = SuperMap.Util = SuperMap.Util || {};
- /**
- * @name Util
- * @memberOf SuperMap
- * @namespace
- * @category BaseTypes Util
- * @description common 工具类。
- */
- /**
- * @description 复制源对象的所有属性到目标对象上,源对象上的没有定义的属性在目标对象上也不会被设置。
- * @example
- * 要复制 SuperMap.Size 对象的所有属性到自定义对象上,使用方法如下:
- * var size = new SuperMap.Size(100, 100);
- * var obj = {};
- * SuperMap.Util.extend(obj, size);
- * @param {Object} [destination] - 目标对象。
- * @param {Object} source - 源对象,其属性将被设置到目标对象上。
- * @returns {Object} 目标对象。
- */
- SuperMap.Util.extend = function (destination, source) {
- destination = destination || {};
- if (source) {
- for (var property in source) {
- var value = source[property];
- if (value !== undefined) {
- destination[property] = value;
- }
- }
- /**
- * IE doesn't include the toString property when iterating over an object's
- * properties with the for(property in object) syntax. Explicitly check if
- * the source has its own toString property.
- */
- /*
- * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
- * prototype object" when calling hawOwnProperty if the source object
- * is an instance of window.Event.
- */
- var sourceIsEvt = typeof window.Event === "function" && source instanceof window.Event;
- if (!sourceIsEvt && source.hasOwnProperty && source.hasOwnProperty("toString")) {
- destination.toString = source.toString;
- }
- }
- return destination;
- };
- /**
- * @description 对象拷贝。
- * @param {Object} [des] - 目标对象。
- * @param {Object} soc - 源对象。
- */
- SuperMap.Util.copy = function (des, soc) {
- des = des || {};
- var v;
- if (soc) {
- for (var p in des) {
- v = soc[p];
- if (typeof v !== 'undefined') {
- des[p] = v;
- }
- }
- }
- };
- /**
- * @description 销毁对象,将其属性置空。
- * @param {Object} [obj] - 目标对象。
- */
- SuperMap.Util.reset = function (obj) {
- obj = obj || {};
- for (var p in obj) {
- if (obj.hasOwnProperty(p)) {
- if (_typeof(obj[p]) === "object" && obj[p] instanceof Array) {
- for (var i in obj[p]) {
- if (obj[p][i].destroy) {
- obj[p][i].destroy();
- }
- }
- obj[p].length = 0;
- } else if (_typeof(obj[p]) === "object" && obj[p] instanceof Object) {
- if (obj[p].destroy) {
- obj[p].destroy();
- }
- }
- obj[p] = null;
- }
- }
- };
- /**
- * @description 获取 HTML 元素数组。
- * @returns {Array.<HTMLElement>} HTML 元素数组。
- */
- SuperMap.Util.getElement = function () {
- var elements = [];
- for (var i = 0, len = arguments.length; i < len; i++) {
- var element = arguments[i];
- if (typeof element === 'string') {
- element = document.getElementById(element);
- }
- if (arguments.length === 1) {
- return element;
- }
- elements.push(element);
- }
- return elements;
- };
- /**
- * @description instance of 的跨浏览器实现。
- * @param {Object} o - 对象。
- * @returns {boolean} 是否是页面元素。
- */
- SuperMap.Util.isElement = function (o) {
- return !!(o && o.nodeType === 1);
- };
- /**
- * @description 判断一个对象是否是数组。
- * @param {Object} a - 对象。
- * @returns {boolean} 是否是数组。
- */
- SuperMap.Util.isArray = function (a) {
- return Object.prototype.toString.call(a) === '[object Array]';
- };
- /**
- * @description 从数组中删除某一项。
- * @param {Array} array - 数组。
- * @param {Object} item - 数组中要删除的一项。
- * @returns {Array} 执行删除操作后的数组。
- */
- SuperMap.Util.removeItem = function (array, item) {
- for (var i = array.length - 1; i >= 0; i--) {
- if (array[i] === item) {
- array.splice(i, 1); //break;more than once??
- }
- }
- return array;
- };
- /**
- * @description 获取某对象再数组中的索引值。
- * @param {Array} array - 数组。
- * @param {Object} obj - 对象。
- * @returns {number} 某对象再数组中的索引值。
- */
- SuperMap.Util.indexOf = function (array, obj) {
- if (array == null) {
- return -1;
- } else {
- // use the build-in function if available.
- if (typeof array.indexOf === "function") {
- return array.indexOf(obj);
- } else {
- for (var i = 0, len = array.length; i < len; i++) {
- if (array[i] === obj) {
- return i;
- }
- }
- return -1;
- }
- }
- };
- /**
- * @description 修改某 DOM 元素的许多属性。
- * @param {HTMLElement} element - 待修改的 DOM 元素。
- * @param {string} [id] - DOM 元素的 ID。
- * @param {SuperMap.Pixel} [px] - 包含 DOM 元素的 style 属性的 left 和 top 属性。
- * @param {SuperMap.Size} [sz] - 包含 DOM 元素的 width 和 height 属性。
- * @param {string} [position] - DOM 元素的 position 属性。
- * @param {string} [border] - DOM 元素的 style 属性的 border 属性。
- * @param {string} [overflow] - DOM 元素的 style 属性的 overflow 属性。
- * @param {number} [opacity] - 不透明度值。取值范围为(0.0 - 1.0)。
- */
- SuperMap.Util.modifyDOMElement = function (element, id, px, sz, position, border, overflow, opacity) {
- if (id) {
- element.id = id;
- }
- if (px) {
- element.style.left = px.x + "px";
- element.style.top = px.y + "px";
- }
- if (sz) {
- element.style.width = sz.w + "px";
- element.style.height = sz.h + "px";
- }
- if (position) {
- element.style.position = position;
- }
- if (border) {
- element.style.border = border;
- }
- if (overflow) {
- element.style.overflow = overflow;
- }
- if (parseFloat(opacity) >= 0.0 && parseFloat(opacity) < 1.0) {
- element.style.filter = 'alpha(opacity=' + opacity * 100 + ')';
- element.style.opacity = opacity;
- } else if (parseFloat(opacity) === 1.0) {
- element.style.filter = '';
- element.style.opacity = '';
- }
- };
- /**
- * @description Takes an object and copies any properties that don't exist from
- * another properties, by analogy with SuperMap.Util.extend() from
- * Prototype.js.
- *
- * @param {Object} [to] - 目标对象。
- * @param {Object} from - 源对象。Any properties of this object that
- * are undefined in the to object will be set on the to object.
- *
- * @returns {Object} A reference to the to object. Note that the to argument is modified
- * in place and returned by this function.
- */
- SuperMap.Util.applyDefaults = function (to, from) {
- to = to || {};
- /*
- * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
- * prototype object" when calling hawOwnProperty if the source object is an
- * instance of window.Event.
- */
- var fromIsEvt = typeof window.Event === "function" && from instanceof window.Event;
- for (var key in from) {
- if (to[key] === undefined || !fromIsEvt && from.hasOwnProperty && from.hasOwnProperty(key) && !to.hasOwnProperty(key)) {
- to[key] = from[key];
- }
- }
- /**
- * IE doesn't include the toString property when iterating over an object's
- * properties with the for(property in object) syntax. Explicitly check if
- * the source has its own toString property.
- */
- if (!fromIsEvt && from && from.hasOwnProperty && from.hasOwnProperty('toString') && !to.hasOwnProperty('toString')) {
- to.toString = from.toString;
- }
- return to;
- };
- /**
- * @description 将参数对象转换为 HTTP 的 GET 请求中的参数字符串。例如:"key1=value1&key2=value2&key3=value3"。
- * @param {Object} params - 参数对象。
- * @returns {string} HTTP 的 GET 请求中的参数字符串。
- */
- SuperMap.Util.getParameterString = function (params) {
- var paramsArray = [];
- for (var key in params) {
- var value = params[key];
- if (value != null && typeof value !== 'function') {
- var encodedValue;
- if (Array.isArray(value) || value.toString() === '[object Object]') {
- encodedValue = encodeURIComponent(JSON.stringify(value));
- } else {
- /* value is a string; simply encode */
- encodedValue = encodeURIComponent(value);
- }
- paramsArray.push(encodeURIComponent(key) + "=" + encodedValue);
- }
- }
- return paramsArray.join("&");
- };
- /**
- * @description 给 URL 追加查询参数。
- * @param {string} url - 待追加参数的 URL 字符串。
- * @param {string} paramStr - 待追加的查询参数。
- * @returns {string} 新的 URL。
- */
- SuperMap.Util.urlAppend = function (url, paramStr) {
- var newUrl = url;
- if (paramStr) {
- if (paramStr.indexOf('?') === 0) {
- paramStr = paramStr.substring(1);
- }
- var parts = (url + " ").split(/[?&]/);
- newUrl += parts.pop() === " " ? paramStr : parts.length ? "&" + paramStr : "?" + paramStr;
- }
- return newUrl;
- };
- /**
- * @description 给 URL 追加 path 参数。
- * @param {string} url - 待追加参数的 URL 字符串。
- * @param {string} paramStr - 待追加的path参数。
- * @returns {string} 新的 URL。
- */
- SuperMap.Util.urlPathAppend = function (url, pathStr) {
- var newUrl = url;
- if (!pathStr) {
- return newUrl;
- }
- if (pathStr.indexOf('/') === 0) {
- pathStr = pathStr.substring(1);
- }
- var parts = url.split('?');
- if (parts[0].indexOf('/', parts[0].length - 1) < 0) {
- parts[0] += '/';
- }
- newUrl = "".concat(parts[0]).concat(pathStr).concat(parts.length > 1 ? "?".concat(parts[1]) : '');
- return newUrl;
- };
- /**
- * @description 为了避免浮点精度错误而保留的有效位数。
- * @type {number}
- * @default 14
- */
- SuperMap.Util.DEFAULT_PRECISION = 14;
- /**
- * @description 将字符串以接近的精度转换为数字。
- * @param {string} number - 字符串。
- * @param {number} [precision=14] - 精度。
- * @returns {number} 数字。
- */
- SuperMap.Util.toFloat = function (number, precision) {
- if (precision == null) {
- precision = SuperMap.Util.DEFAULT_PRECISION;
- }
- if (typeof number !== "number") {
- number = parseFloat(number);
- }
- return precision === 0 ? number : parseFloat(number.toPrecision(precision));
- };
- /**
- * @description 角度转弧度。
- * @param {number} x - 角度。
- * @returns {number} 弧度。
- */
- SuperMap.Util.rad = function (x) {
- return x * Math.PI / 180;
- };
- /**
- * @description 从 URL 字符串中解析出参数对象。
- * @param {string} url - URL。
- * @returns {Object} 解析出的参数对象。
- */
- SuperMap.Util.getParameters = function (url) {
- // if no url specified, take it from the location bar
- url = url === null || url === undefined ? window.location.href : url; //parse out parameters portion of url string
- var paramsString = "";
- if (SuperMap.String.contains(url, '?')) {
- var start = url.indexOf('?') + 1;
- var end = SuperMap.String.contains(url, "#") ? url.indexOf('#') : url.length;
- paramsString = url.substring(start, end);
- }
- var parameters = {};
- var pairs = paramsString.split(/[&;]/);
- for (var i = 0, len = pairs.length; i < len; ++i) {
- var keyValue = pairs[i].split('=');
- if (keyValue[0]) {
- var key = keyValue[0];
- try {
- key = decodeURIComponent(key);
- } catch (err) {
- key = unescape(key);
- } // being liberal by replacing "+" with " "
- var value = (keyValue[1] || '').replace(/\+/g, " ");
- try {
- value = decodeURIComponent(value);
- } catch (err) {
- value = unescape(value);
- } // follow OGC convention of comma delimited values
- value = value.split(","); //if there's only one value, do not return as array
- if (value.length == 1) {
- value = value[0];
- }
- parameters[key] = value;
- }
- }
- return parameters;
- };
- /**
- * @description 不断递增计数变量,用于生成唯一 ID。
- * @type {number}
- * @default 0
- */
- SuperMap.Util.lastSeqID = 0;
- /**
- * @description 创建唯一 ID 值。
- * @param {string} [prefix] - 前缀。
- * @returns {string} 唯一的 ID 值。
- */
- SuperMap.Util.createUniqueID = function (prefix) {
- if (prefix == null) {
- prefix = "id_";
- }
- SuperMap.Util.lastSeqID += 1;
- return prefix + SuperMap.Util.lastSeqID;
- };
- /**
- * @memberOf SuperMap
- * @description 每单位的英尺数。
- * @type {Object}
- * @constant
- */
- SuperMap.INCHES_PER_UNIT = {
- 'inches': 1.0,
- 'ft': 12.0,
- 'mi': 63360.0,
- 'm': 39.3701,
- 'km': 39370.1,
- 'dd': 4374754,
- 'yd': 36
- };
- SuperMap.INCHES_PER_UNIT.in = SuperMap.INCHES_PER_UNIT.inches;
- SuperMap.INCHES_PER_UNIT.degrees = SuperMap.INCHES_PER_UNIT.dd;
- SuperMap.INCHES_PER_UNIT.nmi = 1852 * SuperMap.INCHES_PER_UNIT.m; // Units from CS-Map
- SuperMap.METERS_PER_INCH = 0.02540005080010160020;
- SuperMap.Util.extend(SuperMap.INCHES_PER_UNIT, {
- "Inch": SuperMap.INCHES_PER_UNIT.inches,
- "Meter": 1.0 / SuperMap.METERS_PER_INCH,
- //EPSG:9001
- "Foot": 0.30480060960121920243 / SuperMap.METERS_PER_INCH,
- //EPSG:9003
- "IFoot": 0.30480000000000000000 / SuperMap.METERS_PER_INCH,
- //EPSG:9002
- "ClarkeFoot": 0.3047972651151 / SuperMap.METERS_PER_INCH,
- //EPSG:9005
- "SearsFoot": 0.30479947153867624624 / SuperMap.METERS_PER_INCH,
- //EPSG:9041
- "GoldCoastFoot": 0.30479971018150881758 / SuperMap.METERS_PER_INCH,
- //EPSG:9094
- "IInch": 0.02540000000000000000 / SuperMap.METERS_PER_INCH,
- "MicroInch": 0.00002540000000000000 / SuperMap.METERS_PER_INCH,
- "Mil": 0.00000002540000000000 / SuperMap.METERS_PER_INCH,
- "Centimeter": 0.01000000000000000000 / SuperMap.METERS_PER_INCH,
- "Kilometer": 1000.00000000000000000000 / SuperMap.METERS_PER_INCH,
- //EPSG:9036
- "Yard": 0.91440182880365760731 / SuperMap.METERS_PER_INCH,
- "SearsYard": 0.914398414616029 / SuperMap.METERS_PER_INCH,
- //EPSG:9040
- "IndianYard": 0.91439853074444079983 / SuperMap.METERS_PER_INCH,
- //EPSG:9084
- "IndianYd37": 0.91439523 / SuperMap.METERS_PER_INCH,
- //EPSG:9085
- "IndianYd62": 0.9143988 / SuperMap.METERS_PER_INCH,
- //EPSG:9086
- "IndianYd75": 0.9143985 / SuperMap.METERS_PER_INCH,
- //EPSG:9087
- "IndianFoot": 0.30479951 / SuperMap.METERS_PER_INCH,
- //EPSG:9080
- "IndianFt37": 0.30479841 / SuperMap.METERS_PER_INCH,
- //EPSG:9081
- "IndianFt62": 0.3047996 / SuperMap.METERS_PER_INCH,
- //EPSG:9082
- "IndianFt75": 0.3047995 / SuperMap.METERS_PER_INCH,
- //EPSG:9083
- "Mile": 1609.34721869443738887477 / SuperMap.METERS_PER_INCH,
- "IYard": 0.91440000000000000000 / SuperMap.METERS_PER_INCH,
- //EPSG:9096
- "IMile": 1609.34400000000000000000 / SuperMap.METERS_PER_INCH,
- //EPSG:9093
- "NautM": 1852.00000000000000000000 / SuperMap.METERS_PER_INCH,
- //EPSG:9030
- "Lat-66": 110943.316488932731 / SuperMap.METERS_PER_INCH,
- "Lat-83": 110946.25736872234125 / SuperMap.METERS_PER_INCH,
- "Decimeter": 0.10000000000000000000 / SuperMap.METERS_PER_INCH,
- "Millimeter": 0.00100000000000000000 / SuperMap.METERS_PER_INCH,
- "Dekameter": 10.00000000000000000000 / SuperMap.METERS_PER_INCH,
- "Decameter": 10.00000000000000000000 / SuperMap.METERS_PER_INCH,
- "Hectometer": 100.00000000000000000000 / SuperMap.METERS_PER_INCH,
- "GermanMeter": 1.0000135965 / SuperMap.METERS_PER_INCH,
- //EPSG:9031
- "CaGrid": 0.999738 / SuperMap.METERS_PER_INCH,
- "ClarkeChain": 20.1166194976 / SuperMap.METERS_PER_INCH,
- //EPSG:9038
- "GunterChain": 20.11684023368047 / SuperMap.METERS_PER_INCH,
- //EPSG:9033
- "BenoitChain": 20.116782494375872 / SuperMap.METERS_PER_INCH,
- //EPSG:9062
- "SearsChain": 20.11676512155 / SuperMap.METERS_PER_INCH,
- //EPSG:9042
- "ClarkeLink": 0.201166194976 / SuperMap.METERS_PER_INCH,
- //EPSG:9039
- "GunterLink": 0.2011684023368047 / SuperMap.METERS_PER_INCH,
- //EPSG:9034
- "BenoitLink": 0.20116782494375872 / SuperMap.METERS_PER_INCH,
- //EPSG:9063
- "SearsLink": 0.2011676512155 / SuperMap.METERS_PER_INCH,
- //EPSG:9043
- "Rod": 5.02921005842012 / SuperMap.METERS_PER_INCH,
- "IntnlChain": 20.1168 / SuperMap.METERS_PER_INCH,
- //EPSG:9097
- "IntnlLink": 0.201168 / SuperMap.METERS_PER_INCH,
- //EPSG:9098
- "Perch": 5.02921005842012 / SuperMap.METERS_PER_INCH,
- "Pole": 5.02921005842012 / SuperMap.METERS_PER_INCH,
- "Furlong": 201.1684023368046 / SuperMap.METERS_PER_INCH,
- "Rood": 3.778266898 / SuperMap.METERS_PER_INCH,
- "CapeFoot": 0.3047972615 / SuperMap.METERS_PER_INCH,
- "Brealey": 375.00000000000000000000 / SuperMap.METERS_PER_INCH,
- "ModAmFt": 0.304812252984505969011938 / SuperMap.METERS_PER_INCH,
- "Fathom": 1.8288 / SuperMap.METERS_PER_INCH,
- "NautM-UK": 1853.184 / SuperMap.METERS_PER_INCH,
- "50kilometers": 50000.0 / SuperMap.METERS_PER_INCH,
- "150kilometers": 150000.0 / SuperMap.METERS_PER_INCH
- }); //unit abbreviations supported by PROJ.4
- SuperMap.Util.extend(SuperMap.INCHES_PER_UNIT, {
- "mm": SuperMap.INCHES_PER_UNIT.Meter / 1000.0,
- "cm": SuperMap.INCHES_PER_UNIT.Meter / 100.0,
- "dm": SuperMap.INCHES_PER_UNIT.Meter * 100.0,
- "km": SuperMap.INCHES_PER_UNIT.Meter * 1000.0,
- "kmi": SuperMap.INCHES_PER_UNIT.nmi,
- //International Nautical Mile
- "fath": SuperMap.INCHES_PER_UNIT.Fathom,
- //International Fathom
- "ch": SuperMap.INCHES_PER_UNIT.IntnlChain,
- //International Chain
- "link": SuperMap.INCHES_PER_UNIT.IntnlLink,
- //International Link
- "us-in": SuperMap.INCHES_PER_UNIT.inches,
- //U.S. Surveyor's Inch
- "us-ft": SuperMap.INCHES_PER_UNIT.Foot,
- //U.S. Surveyor's Foot
- "us-yd": SuperMap.INCHES_PER_UNIT.Yard,
- //U.S. Surveyor's Yard
- "us-ch": SuperMap.INCHES_PER_UNIT.GunterChain,
- //U.S. Surveyor's Chain
- "us-mi": SuperMap.INCHES_PER_UNIT.Mile,
- //U.S. Surveyor's Statute Mile
- "ind-yd": SuperMap.INCHES_PER_UNIT.IndianYd37,
- //Indian Yard
- "ind-ft": SuperMap.INCHES_PER_UNIT.IndianFt37,
- //Indian Foot
- "ind-ch": 20.11669506 / SuperMap.METERS_PER_INCH //Indian Chain
- });
- /**
- * @memberOf SuperMap
- * @member [SuperMap.DOTS_PER_INCH=96]
- * @description 分辨率与比例尺之间转换的常量。
- * @type {Object}
- */
- SuperMap.DOTS_PER_INCH = 96;
- /**
- * @param {number} scale - 比例尺。
- * @returns {number} 返回正常的 scale 值。
- */
- SuperMap.Util.normalizeScale = function (scale) {
- var normScale = scale > 1.0 ? 1.0 / scale : scale;
- return normScale;
- };
- /**
- * @description 比例尺转分辨率。
- * @param {number} scale - 比例尺。
- * @param {string} [units='degrees'] - 比例尺单位。
- * @returns {number} 分辨率。
- */
- SuperMap.Util.getResolutionFromScale = function (scale, units) {
- var resolution;
- if (scale) {
- if (units == null) {
- units = "degrees";
- }
- var normScale = SuperMap.Util.normalizeScale(scale);
- resolution = 1 / (normScale * SuperMap.INCHES_PER_UNIT[units] * SuperMap.DOTS_PER_INCH);
- }
- return resolution;
- };
- /**
- * @description 分辨率转比例尺。
- * @param {number} resolution - 分辨率。
- * @param {string} [units='degrees'] - 分辨率单位。
- * @returns {number} 比例尺。
- */
- SuperMap.Util.getScaleFromResolution = function (resolution, units) {
- if (units == null) {
- units = "degrees";
- }
- var scale = resolution * SuperMap.INCHES_PER_UNIT[units] * SuperMap.DOTS_PER_INCH;
- return scale;
- };
- /**
- * @memberOf SuperMap
- * @description 如果 userAgent 捕获到浏览器使用的是 Gecko 引擎则返回 true。
- * @constant
- */
- SuperMap.IS_GECKO = function () {
- var ua = navigator.userAgent.toLowerCase();
- return ua.indexOf("webkit") === -1 && ua.indexOf("gecko") !== -1;
- }();
- /**
- * @memberOf SuperMap
- * @description 浏览器名称,依赖于 userAgent 属性,BROWSER_NAME 可以是空,或者以下浏览器:
- * * "opera" -- Opera
- * * "msie" -- Internet Explorer
- * * "safari" -- Safari
- * * "firefox" -- Firefox
- * * "mozilla" -- Mozilla
- * @constant
- */
- SuperMap.Browser = function () {
- var name = '',
- version = '',
- device = 'pc',
- uaMatch; //以下进行测试
- var ua = navigator.userAgent.toLowerCase();
- if (ua.indexOf("msie") > -1 || ua.indexOf("trident") > -1 && ua.indexOf("rv") > -1) {
- name = 'msie';
- uaMatch = ua.match(/msie ([\d.]+)/) || ua.match(/rv:([\d.]+)/);
- } else if (ua.indexOf("chrome") > -1) {
- name = 'chrome';
- uaMatch = ua.match(/chrome\/([\d.]+)/);
- } else if (ua.indexOf("firefox") > -1) {
- name = 'firefox';
- uaMatch = ua.match(/firefox\/([\d.]+)/);
- } else if (ua.indexOf("opera") > -1) {
- name = 'opera';
- uaMatch = ua.match(/version\/([\d.]+)/);
- } else if (ua.indexOf("safari") > -1) {
- name = 'safari';
- uaMatch = ua.match(/version\/([\d.]+)/);
- }
- version = uaMatch ? uaMatch[1] : '';
- if (ua.indexOf("ipad") > -1 || ua.indexOf("ipod") > -1 || ua.indexOf("iphone") > -1) {
- device = 'apple';
- } else if (ua.indexOf("android") > -1) {
- uaMatch = ua.match(/version\/([\d.]+)/);
- version = uaMatch ? uaMatch[1] : '';
- device = 'android';
- }
- return {
- name: name,
- version: version,
- device: device
- };
- }();
- /**
- * @description 获取浏览器相关信息。支持的浏览器包括:Opera,Internet Explorer,Safari,Firefox。
- * @returns {Object} 获取浏览器名称、版本、设备名称。对应的属性分别为 name, version, device。
- */
- SuperMap.Util.getBrowser = function () {
- return SuperMap.Browser;
- };
- /**
- * @description 浏览器是否支持 Canvas。
- * @returns {boolean} 获取当前浏览器是否支持 HTML5 Canvas。
- */
- SuperMap.Util.isSupportCanvas = function () {
- var checkRes = true,
- broz = SuperMap.Util.getBrowser();
- if (document.createElement("canvas").getContext) {
- if (broz.name === 'firefox' && parseFloat(broz.version) < 5) {
- checkRes = false;
- }
- if (broz.name === 'safari' && parseFloat(broz.version) < 4) {
- checkRes = false;
- }
- if (broz.name === 'opera' && parseFloat(broz.version) < 10) {
- checkRes = false;
- }
- if (broz.name === 'msie' && parseFloat(broz.version) < 9) {
- checkRes = false;
- }
- } else {
- checkRes = false;
- }
- return checkRes;
- }();
- /**
- * @description 判断;浏览器是否支持 Canvas。
- * @returns {boolean} 获取当前浏览器是否支持 HTML5 Canvas 。
- */
- SuperMap.Util.supportCanvas = function () {
- return SuperMap.Util.isSupportCanvas;
- }; //将服务端的地图单位转成SuperMap的地图单位
- SuperMap.INCHES_PER_UNIT.degree = SuperMap.INCHES_PER_UNIT.dd;
- SuperMap.INCHES_PER_UNIT.meter = SuperMap.INCHES_PER_UNIT.m;
- SuperMap.INCHES_PER_UNIT.foot = SuperMap.INCHES_PER_UNIT.ft;
- SuperMap.INCHES_PER_UNIT.inch = SuperMap.INCHES_PER_UNIT.inches;
- SuperMap.INCHES_PER_UNIT.mile = SuperMap.INCHES_PER_UNIT.mi;
- SuperMap.INCHES_PER_UNIT.kilometer = SuperMap.INCHES_PER_UNIT.km;
- SuperMap.INCHES_PER_UNIT.yard = SuperMap.INCHES_PER_UNIT.yd;
- /**
- * @description 判断一个 URL 请求是否在当前域中。
- * @param {string} url - URL 请求字符串。
- * @returns {boolean} URL 请求是否在当前域中。
- */
- SuperMap.Util.isInTheSameDomain = function (url) {
- if (!url) {
- return true;
- }
- var index = url.indexOf("//");
- var documentUrl = document.location.toString();
- var documentIndex = documentUrl.indexOf("//");
- if (index === -1) {
- return true;
- } else {
- var protocol;
- var substring = protocol = url.substring(0, index);
- var documentSubString = documentUrl.substring(documentIndex + 2);
- documentIndex = documentSubString.indexOf("/");
- var documentPortIndex = documentSubString.indexOf(":");
- var documentDomainWithPort = documentSubString.substring(0, documentIndex); //var documentPort;
- var documentprotocol = document.location.protocol;
- if (documentPortIndex !== -1) {// documentPort = +documentSubString.substring(documentPortIndex, documentIndex);
- } else {
- documentDomainWithPort += ':' + (documentprotocol.toLowerCase() === 'http:' ? 80 : 443);
- }
- if (documentprotocol.toLowerCase() !== substring.toLowerCase()) {
- return false;
- }
- substring = url.substring(index + 2);
- var portIndex = substring.indexOf(":");
- index = substring.indexOf("/");
- var domainWithPort = substring.substring(0, index);
- var domain;
- if (portIndex !== -1) {
- domain = substring.substring(0, portIndex);
- } else {
- domain = substring.substring(0, index);
- domainWithPort += ':' + (protocol.toLowerCase() === 'http:' ? 80 : 443);
- }
- var documentDomain = document.domain;
- if (domain === documentDomain && domainWithPort === documentDomainWithPort) {
- return true;
- }
- }
- return false;
- };
- /**
- * @description 计算 iServer 服务的 REST 图层的显示分辨率,需要从 iServer 的 REST 图层表述中获取 viewBounds、viewer、scale、coordUnit、datumAxis 五个参数,来进行计算。
- * @param {SuperMap.Bounds} viewBounds - 地图的参照可视范围,即地图初始化时默认的地图显示范围。
- * @param {SuperMap.Size} viewer - 地图初始化时默认的地图图片的尺寸。
- * @param {number} scale - 地图初始化时默认的显示比例尺。
- * @param {string} [coordUnit='degrees'] - 投影坐标系统的地图单位。
- * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则系统默认为 WGS84 参考系的椭球体长半轴 6378137。
- * @returns {number} 返回图层显示分辨率。
- */
- SuperMap.Util.calculateDpi = function (viewBounds, viewer, scale, coordUnit, datumAxis) {
- //10000 是 0.1毫米与米的转换。DPI的计算公式:Viewer / DPI * 0.0254 * 10000 = ViewBounds * scale ,公式中的10000是为了提高计算结果的精度,以下出现的ratio皆为如此。
- if (!viewBounds || !viewer || !scale) {
- return;
- }
- var ratio = 10000,
- rvbWidth = viewBounds.getWidth(),
- rvbHeight = viewBounds.getHeight(),
- rvWidth = viewer.w,
- rvHeight = viewer.h; //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
- datumAxis = datumAxis || 6378137;
- coordUnit = coordUnit || "degrees";
- var dpi;
- if (coordUnit.toLowerCase() === "degree" || coordUnit.toLowerCase() === "degrees" || coordUnit.toLowerCase() === "dd") {
- var num1 = rvbWidth / rvWidth,
- num2 = rvbHeight / rvHeight,
- resolution = num1 > num2 ? num1 : num2;
- dpi = 0.0254 * ratio / resolution / scale / (Math.PI * 2 * datumAxis / 360) / ratio;
- } else {
- var _resolution = rvbWidth / rvWidth;
- dpi = 0.0254 * ratio / _resolution / scale / ratio;
- }
- return dpi;
- };
- /**
- * @description 将对象转换成 JSON 字符串。
- * @param {Object} obj - 要转换成 JSON 的 Object 对象。
- * @returns {string} 返回转换后的 JSON 对象。
- */
- SuperMap.Util.toJSON = function (obj) {
- var objInn = obj;
- if (objInn == null) {
- return null;
- }
- switch (objInn.constructor) {
- case String:
- //s = "'" + str.replace(/(["\\])/g, "\\$1") + "'"; string含有单引号出错
- objInn = '"' + objInn.replace(/(["\\])/g, '\\$1') + '"';
- objInn = objInn.replace(/\n/g, "\\n");
- objInn = objInn.replace(/\r/g, "\\r");
- objInn = objInn.replace("<", "<");
- objInn = objInn.replace(">", ">");
- objInn = objInn.replace(/%/g, "%25");
- objInn = objInn.replace(/&/g, "%26");
- return objInn;
- case Array:
- var arr = [];
- for (var i = 0, len = objInn.length; i < len; i++) {
- arr.push(SuperMap.Util.toJSON(objInn[i]));
- }
- return "[" + arr.join(",") + "]";
- case Number:
- return isFinite(objInn) ? String(objInn) : null;
- case Boolean:
- return String(objInn);
- case Date:
- 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() + "}";
- return dateStr;
- default:
- if (objInn["toJSON"] != null && typeof objInn["toJSON"] === "function") {
- return objInn.toJSON();
- }
- if (_typeof(objInn) === "object") {
- if (objInn.length) {
- var _arr2 = [];
- for (var _i = 0, _len = objInn.length; _i < _len; _i++) {
- _arr2.push(SuperMap.Util.toJSON(objInn[_i]));
- }
- return "[" + _arr2.join(",") + "]";
- }
- var _arr = [];
- for (var attr in objInn) {
- //为解决SuperMap.Geometry类型头json时堆栈溢出的问题,attr == "parent"时不进行json转换
- if (typeof objInn[attr] !== "function" && attr !== "CLASS_NAME" && attr !== "parent") {
- _arr.push("'" + attr + "':" + SuperMap.Util.toJSON(objInn[attr]));
- }
- }
- if (_arr.length > 0) {
- return "{" + _arr.join(",") + "}";
- } else {
- return "{}";
- }
- }
- return objInn.toString();
- }
- };
- /**
- * @description 根据比例尺和 dpi 计算屏幕分辨率。
- * @param {number} scale - 比例尺。
- * @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
- * @param {string} [coordUnit] - 投影坐标系统的地图单位。
- * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
- * @returns {number} 返回当前比例尺下的屏幕分辨率。
- */
- SuperMap.Util.getResolutionFromScaleDpi = function (scale, dpi, coordUnit, datumAxis) {
- var resolution = null,
- ratio = 10000; //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
- datumAxis = datumAxis || 6378137;
- coordUnit = coordUnit || "";
- if (scale > 0 && dpi > 0) {
- scale = SuperMap.Util.normalizeScale(scale);
- if (coordUnit.toLowerCase() === "degree" || coordUnit.toLowerCase() === "degrees" || coordUnit.toLowerCase() === "dd") {
- //scale = SuperMap.Util.normalizeScale(scale);
- resolution = 0.0254 * ratio / dpi / scale / (Math.PI * 2 * datumAxis / 360) / ratio;
- return resolution;
- } else {
- resolution = 0.0254 * ratio / dpi / scale / ratio;
- return resolution;
- }
- }
- return -1;
- };
- /**
- * @description 根据 resolution、dpi、coordUnit 和 datumAxis 计算比例尺。
- * @param {number} resolution - 用于计算比例尺的地图分辨率。
- * @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
- * @param {string} [coordUnit] - 投影坐标系统的地图单位。
- * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
- * @returns {number} 返回当前屏幕分辨率下的比例尺。
- */
- SuperMap.Util.getScaleFromResolutionDpi = function (resolution, dpi, coordUnit, datumAxis) {
- var scale = null,
- ratio = 10000; //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
- datumAxis = datumAxis || 6378137;
- coordUnit = coordUnit || "";
- if (resolution > 0 && dpi > 0) {
- if (coordUnit.toLowerCase() === "degree" || coordUnit.toLowerCase() === "degrees" || coordUnit.toLowerCase() === "dd") {
- scale = 0.0254 * ratio / dpi / resolution / (Math.PI * 2 * datumAxis / 360) / ratio;
- return scale;
- } else {
- scale = 0.0254 * ratio / dpi / resolution / ratio;
- return scale;
- }
- }
- return -1;
- };
- /**
- * @description 转换查询结果。
- * @param {Object} result - 查询结果。
- * @returns {Object} 转换后的查询结果。
- */
- SuperMap.Util.transformResult = function (result) {
- if (result.responseText && typeof result.responseText === "string") {
- result = JSON.parse(result.responseText);
- }
- return result;
- };
- /**
- * @description 属性拷贝,不拷贝方法类名(CLASS_NAME)等。
- * @param {Object} [destination] - 拷贝目标。
- * @param {Object} source - 源对象。
- *
- */
- SuperMap.Util.copyAttributes = function (destination, source) {
- destination = destination || {};
- if (source) {
- for (var property in source) {
- var value = source[property];
- if (value !== undefined && property !== "CLASS_NAME" && typeof value !== "function") {
- destination[property] = value;
- }
- }
- }
- return destination;
- };
- /**
- * @description 将源对象上的属性拷贝到目标对象上。(不拷贝 CLASS_NAME 和方法)
- * @param {Object} [destination] - 目标对象。
- * @param {Object} source - 源对象。
- * @param {Array.<string>} clip - 源对象中禁止拷贝到目标对象的属性,目的是防止目标对象上不可修改的属性被篡改。
- *
- */
- SuperMap.Util.copyAttributesWithClip = function (destination, source, clip) {
- destination = destination || {};
- if (source) {
- for (var property in source) {
- //去掉禁止拷贝的属性
- var isInClip = false;
- if (clip && clip.length) {
- for (var i = 0, len = clip.length; i < len; i++) {
- if (property === clip[i]) {
- isInClip = true;
- break;
- }
- }
- }
- if (isInClip === true) {
- continue;
- }
- var value = source[property];
- if (value !== undefined && property !== "CLASS_NAME" && typeof value !== "function") {
- destination[property] = value;
- }
- }
- }
- return destination;
- };
- /**
- * @description 克隆一个 Object 对象
- * @param {Object} obj - 需要克隆的对象。
- * @returns {Object} 返回对象的拷贝对象,注意是新的对象,不是指向。
- */
- SuperMap.Util.cloneObject = function (obj) {
- // Handle the 3 simple types, and null or undefined
- if (null === obj || "object" !== _typeof(obj)) {
- return obj;
- } // Handle Date
- if (obj instanceof Date) {
- var copy = new Date();
- copy.setTime(obj.getTime());
- return copy;
- } // Handle Array
- if (obj instanceof Array) {
- var _copy = obj.slice(0);
- return _copy;
- } // Handle Object
- if (obj instanceof Object) {
- var _copy2 = {};
- for (var attr in obj) {
- if (obj.hasOwnProperty(attr)) {
- _copy2[attr] = SuperMap.Util.cloneObject(obj[attr]);
- }
- }
- return _copy2;
- }
- throw new Error("Unable to copy obj! Its type isn't supported.");
- };
- /**
- * @description 判断两条线段是不是有交点。
- * @param {SuperMap.Geometry.Point} a1 - 第一条线段的起始节点。
- * @param {SuperMap.Geometry.Point} a2 - 第一条线段的结束节点。
- * @param {SuperMap.Geometry.Point} b1 - 第二条线段的起始节点。
- * @param {SuperMap.Geometry.Point} b2 - 第二条线段的结束节点。
- * @returns {Object} 如果相交返回交点,如果不相交返回两条线段的位置关系。
- */
- SuperMap.Util.lineIntersection = function (a1, a2, b1, b2) {
- var intersectValue = null;
- var k1;
- var k2;
- var b = (b2.x - b1.x) * (a1.y - b1.y) - (b2.y - b1.y) * (a1.x - b1.x);
- var a = (a2.x - a1.x) * (a1.y - b1.y) - (a2.y - a1.y) * (a1.x - b1.x);
- var ab = (b2.y - b1.y) * (a2.x - a1.x) - (b2.x - b1.x) * (a2.y - a1.y); //ab==0代表两条线断的斜率一样
- if (ab != 0) {
- k1 = b / ab;
- k2 = a / ab;
- if (k1 >= 0 && k2 <= 1 && k1 <= 1 && k2 >= 0) {
- intersectValue = new SuperMap.Geometry.Point(a1.x + k1 * (a2.x - a1.x), a1.y + k1 * (a2.y - a1.y));
- } else {
- intersectValue = "No Intersection";
- }
- } else {
- if (b == 0 && a == 0) {
- var maxy = Math.max(a1.y, a2.y);
- var miny = Math.min(a1.y, a2.y);
- var maxx = Math.max(a1.x, a2.x);
- var minx = Math.min(a1.x, a2.x);
- 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) {
- intersectValue = "Coincident"; //重合
- } else {
- intersectValue = "Parallel"; //平行
- }
- } else {
- intersectValue = "Parallel"; //平行
- }
- }
- return intersectValue;
- };
- /**
- * @description 获取文本外接矩形宽度与高度。
- * @param {SuperMap.ThemeStyle} style - 文本样式。
- * @param {string} text - 文本内容。
- * @param {Object} element - DOM 元素。
- * @returns {Object} 返回裁剪后的宽度,高度信息。
- */
- SuperMap.Util.getTextBounds = function (style, text, element) {
- document.body.appendChild(element);
- element.style.width = 'auto';
- element.style.height = 'auto';
- if (style.fontSize) {
- element.style.fontSize = style.fontSize;
- }
- if (style.fontFamily) {
- element.style.fontFamily = style.fontFamily;
- }
- if (style.fontWeight) {
- element.style.fontWeight = style.fontWeight;
- }
- element.style.position = 'relative';
- element.style.visibility = 'hidden'; //fix 在某些情况下,element内的文本变成竖起排列,导致宽度计算不正确的bug
- element.style.display = 'inline-block';
- element.innerHTML = text;
- var textWidth = element.clientWidth;
- var textHeight = element.clientHeight;
- document.body.removeChild(element);
- return {
- textWidth: textWidth,
- textHeight: textHeight
- };
- };
- ;// CONCATENATED MODULE: ./src/common/commontypes/LonLat.js
- function LonLat_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function LonLat_createClass(Constructor, protoProps, staticProps) { if (protoProps) LonLat_defineProperties(Constructor.prototype, protoProps); if (staticProps) LonLat_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.LonLat
- * @category BaseTypes Geometry
- * @classdesc 这个类用来表示经度和纬度对。
- * @param {number} [lon=0.0] - 地图单位上的 X 轴坐标,如果地图是地理投影,则此值是经度,否则,此值是地图地理位置的 x 坐标。
- * @param {number} [lat=0.0] - 地图单位上的 Y 轴坐标,如果地图是地理投影,则此值是纬度,否则,此值是地图地理位置的 y 坐标。
- * @param {Array.<float>} [location] - 如果要同时设置,则使用传入横纵坐标组成的数组。
- * @example
- * var lonLat = new SuperMap.LonLat(30,45);
- */
- var LonLat = /*#__PURE__*/function () {
- function LonLat(lon, lat) {
- LonLat_classCallCheck(this, LonLat);
- if (Util.isArray(lon)) {
- lat = lon[1];
- lon = lon[0];
- }
- /**
- * @member {float} [SuperMap.LonLat.prototype.lon=0.0]
- * @description 地图的单位的 X 轴(横轴)坐标。
- */
- this.lon = lon ? Util.toFloat(lon) : 0.0;
- /**
- * @member {float} [SuperMap.LonLat.prototype.lat=0.0]
- * @description 地图的单位的 Y 轴(纵轴)坐标。
- */
- this.lat = lat ? Util.toFloat(lat) : 0.0;
- this.CLASS_NAME = "SuperMap.LonLat";
- }
- /**
- * @function SuperMap.LonLat.prototype.toString
- * @description 返回此对象的字符串形式
- * @example
- * var lonLat = new SuperMap.LonLat(100,50);
- * var str = lonLat.toString();
- * @returns {string} 例如: "lon=100,lat=50"
- */
- LonLat_createClass(LonLat, [{
- key: "toString",
- value: function toString() {
- return "lon=" + this.lon + ",lat=" + this.lat;
- }
- /**
- * @function SuperMap.LonLat.prototype.toShortString
- * @description 将经度纬度转换成简单字符串。
- * @example
- * var lonLat = new SuperMap.LonLat(100,50);
- * var str = lonLat.toShortString();
- * @returns {string} 返回处理后的经纬度字符串。例如:"100,50"
- */
- }, {
- key: "toShortString",
- value: function toShortString() {
- return this.lon + "," + this.lat;
- }
- /**
- * @function SuperMap.LonLat.prototype.clone
- * @description 复制坐标对象,并返回复制后的新对象。
- * @example
- * var lonLat1 = new SuperMap.LonLat(100,50);
- * var lonLat2 = lonLat1.clone();
- * @returns {SuperMap.LonLat} 返回相同坐标值的新的坐标对象。
- */
- }, {
- key: "clone",
- value: function clone() {
- return new LonLat(this.lon, this.lat);
- }
- /**
- * @function SuperMap.LonLat.prototype.add
- * @description 在已有坐标对象的经纬度基础上加上新的坐标经纬度,并返回新的坐标对象。
- * @example
- * var lonLat1 = new SuperMap.LonLat(100,50);
- * //lonLat2 是新的对象
- * var lonLat2 = lonLat1.add(100,50);
- * @param {float} lon - 传入的经度参数。
- * @param {float} lat - 传入的纬度参数。
- * @returns {SuperMap.LonLat} 返回一个新的 LonLat 对象,此对象的经纬度是由传入的经纬度与当前的经纬度相加所得。
- */
- }, {
- key: "add",
- value: function add(lon, lat) {
- if (lon == null || lat == null) {
- throw new TypeError('LonLat.add cannot receive null values');
- }
- return new LonLat(this.lon + Util.toFloat(lon), this.lat + Util.toFloat(lat));
- }
- /**
- * @function SuperMap.LonLat.prototype.equals
- * @description 判断两个坐标对象是否相等。
- * @example
- * var lonLat1 = new SuperMap.LonLat(100,50);
- * var lonLat2 = new SuperMap.LonLat(100,50);
- * var isEquals = lonLat1.equals(lonLat2);
- * @param {SuperMap.LonLat} ll - 需要进行比较的坐标对象。
- * @returns {boolean} 如果LonLat对象的经纬度和传入的经纬度一致则返回true,不一
- * 致或传入的ll参数为NULL则返回false。
- */
- }, {
- key: "equals",
- value: function equals(ll) {
- var equals = false;
- if (ll != null) {
- equals = this.lon === ll.lon && this.lat === ll.lat || isNaN(this.lon) && isNaN(this.lat) && isNaN(ll.lon) && isNaN(ll.lat);
- }
- return equals;
- }
- /**
- * @function SuperMap.LonLat.prototype.wrapDateLine
- * @description 通过传入的范围对象对坐标对象转换到该范围内。
- * 如果经度小于给定范围最小精度,则在原经度基础上加上范围宽度,直到精度在范围内为止,如果经度大于给定范围则在原经度基础上减去范围宽度。
- * 即指将不在经度范围内的坐标转换到范围以内(只会转换 lon,不会转换 lat,主要用于转移到日界线以内)。
- * @example
- * var lonLat1 = new SuperMap.LonLat(420,50);
- * var lonLat2 = lonLat1.wrapDateLine(
- * new SuperMap.Bounds(-180,-90,180,90)
- * );
- * @param {SuperMap.Bounds} maxExtent - 最大边界的范围。
- * @returns {SuperMap.LonLat} 将坐标转换到范围对象以内,并返回新的坐标。
- */
- }, {
- key: "wrapDateLine",
- value: function wrapDateLine(maxExtent) {
- var newLonLat = this.clone();
- if (maxExtent) {
- //shift right?
- while (newLonLat.lon < maxExtent.left) {
- newLonLat.lon += maxExtent.getWidth();
- } //shift left?
- while (newLonLat.lon > maxExtent.right) {
- newLonLat.lon -= maxExtent.getWidth();
- }
- }
- return newLonLat;
- }
- /**
- *
- * @function SuperMap.LonLat.prototype.destroy
- * @description 销毁此对象。
- * 销毁后此对象的所有属性为 null,而不是初始值。
- * @example
- * var lonLat = new SuperMap.LonLat(100,50);
- * lonLat.destroy();
- */
- }, {
- key: "destroy",
- value: function destroy() {
- this.lon = null;
- this.lat = null;
- }
- /**
- * @function SuperMap.LonLat.fromString
- * @description 通过字符串生成一个 {@link SuperMap.LonLat} 对象。
- * @example
- * var str = "100,50";
- * var lonLat = SuperMap.LonLat.fromString(str);
- * @param {string} str - 字符串的格式:Lon+","+Lat。如:"100,50"。
- * @returns {SuperMap.LonLat} 返回一个 {@link SuperMap.LonLat} 对象。
- */
- }], [{
- key: "fromString",
- value: function fromString(str) {
- var pair = str.split(",");
- return new LonLat(pair[0], pair[1]);
- }
- /**
- * @function SuperMap.LonLat.fromArray
- * @description 通过数组生成一个 <SuperMap.LonLat> 对象。
- * @param {Array.<float>} arr - 数组的格式,长度只能为2,:[Lon,Lat]。如:[5,-42]。
- * @returns {SuperMap.LonLat} 返回一个 <SuperMap.LonLat> 对象。
- */
- }, {
- key: "fromArray",
- value: function fromArray(arr) {
- var gotArr = Util.isArray(arr),
- lon = gotArr && arr[0],
- lat = gotArr && arr[1];
- return new LonLat(lon, lat);
- }
- }]);
- return LonLat;
- }();
- ;// CONCATENATED MODULE: ./src/common/commontypes/Bounds.js
- function Bounds_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Bounds_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bounds_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bounds_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Bounds
- * @category BaseTypes Geometry
- * @classdesc 表示边界类实例。使用 bounds 之前需要设置 left,bottom,right,top 四个属性,这些属性的初始值为 null。
- * @param {number} [left] - 左边界,注意考虑宽度,理论上小于 right 值。
- * @param {number} [bottom] - 下边界。考虑高度,理论上小于 top 值。
- * @param {number} [right] - 右边界。
- * @param {number} [top] - 上边界。
- * @param {Array.<number>} [array] - [left, bottom, right, top],如果同时传多个参数,则使用左下右上组成的数组。
- * @example
- * var bounds = new SuperMap.Bounds();
- * bounds.extend(new SuperMap.LonLat(4,5));
- * bounds.extend(new SuperMap.LonLat(5,6));
- * bounds.toBBOX(); // returns 4,5,5,6
- */
- var Bounds = /*#__PURE__*/function () {
- function Bounds(left, bottom, right, top) {
- Bounds_classCallCheck(this, Bounds);
- if (Util.isArray(left)) {
- top = left[3];
- right = left[2];
- bottom = left[1];
- left = left[0];
- }
- /**
- * @member {number} SuperMap.Bounds.prototype.left
- * @description 最小的水平坐标系。
- */
- this.left = left != null ? Util.toFloat(left) : this.left;
- /**
- * @member {number} SuperMap.Bounds.prototype.bottom
- * @description 最小的垂直坐标系。
- */
- this.bottom = bottom != null ? Util.toFloat(bottom) : this.bottom;
- /**
- * @member {number} SuperMap.Bounds.prototype.right
- * @description 最大的水平坐标系。
- */
- this.right = right != null ? Util.toFloat(right) : this.right;
- /**
- * @member {number} SuperMap.Bounds.prototype.top
- * @description 最大的垂直坐标系。
- */
- this.top = top != null ? Util.toFloat(top) : this.top;
- /**
- * @member {SuperMap.LonLat} SuperMap.Bounds.prototype.centerLonLat
- * @description bounds 的地图空间的中心点。用 getCenterLonLat() 获得。
- */
- this.centerLonLat = null;
- this.CLASS_NAME = "SuperMap.Bounds";
- }
- /**
- * @function SuperMap.Bounds.prototype.clone
- * @description 复制当前 bounds 对象。
- * @example
- * var bounds1 = new SuperMap.Bounds(-180,-90,180,90);
- * var bounds2 = bounds1.clone();
- * @returns {SuperMap.Bounds} 返回一个克隆的 bounds。
- */
- Bounds_createClass(Bounds, [{
- key: "clone",
- value: function clone() {
- return new Bounds(this.left, this.bottom, this.right, this.top);
- }
- /**
- * @function SuperMap.Bounds.prototype.equals
- * @description 判断两个 bounds 对象是否相等。
- * @example
- * var bounds1 = new SuperMap.Bounds(-180,-90,180,90);
- * var bounds2 = new SuperMap.Bounds(-180,-90,180,90);
- * var isEquals = bounds1.equals(bounds2);
- * @param {SuperMap.Bounds} bounds - 需要进行计较的 bounds。
- * @returns {boolean} 如果 bounds 对象的边和传入的 bounds 一致则返回 true,不一致或传入的 bounds 参数为 NULL 则返回 false。
- */
- }, {
- key: "equals",
- value: function equals(bounds) {
- var equals = false;
- if (bounds != null) {
- equals = this.left === bounds.left && this.right === bounds.right && this.top === bounds.top && this.bottom === bounds.bottom;
- }
- return equals;
- }
- /**
- * @function SuperMap.Bounds.prototype.toString
- * @description 返回此对象的字符串形式。
- * @example
- * var bounds = new SuperMap.Bounds(-180,-90,180,90);
- * var str = bounds.toString();
- * @returns {string} 边界对象的字符串表示形式(left,bottom,right,top),例如: "-180,-90,180,90"。
- */
- }, {
- key: "toString",
- value: function toString() {
- return [this.left, this.bottom, this.right, this.top].join(",");
- }
- /**
- * @function SuperMap.Bounds.prototype.toArray
- * @description 边界对象的数组表示形式。
- * @example
- * var bounds = new SuperMap.Bounds(-180,-90,100,80);
- * //array1 = [-180,-90,100,80];
- * var array1 = bounds.toArray();
- * //array1 = [-90,-180,80,100];
- * var array2 = bounds.toArray(true);
- * @param {boolean} [reverseAxisOrder=false] - 是否反转轴顺序。
- * 如果设为 true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
- * @returns {Array.<number>} left, bottom, right, top 数组。
- */
- }, {
- key: "toArray",
- value: function toArray(reverseAxisOrder) {
- if (reverseAxisOrder === true) {
- return [this.bottom, this.left, this.top, this.right];
- } else {
- return [this.left, this.bottom, this.right, this.top];
- }
- }
- /**
- * @function SuperMap.Bounds.prototype.toBBOX
- * @description 取小数点后 decimal 位数字进行四舍五入再转换为 BBOX 字符串。
- * @example
- * var bounds = new SuperMap.Bounds(-1.1234567,-1.7654321,1.4444444,1.5555555);
- * //str1 = "-1.123457,-1.765432,1.444444,1.555556";
- * var str1 = bounds.toBBOX();
- * //str2 = "-1.1,-1.8,1.4,1.6";
- * var str2 = bounds.toBBOX(1);
- * //str2 = "-1.8,-1.1,1.6,1.4";
- * var str2 = bounds.toBBOX(1,true);
- * @param {integer} [decimal=6] - 边界方位坐标的有效数字个数。
- * @param {boolean} [reverseAxisOrder=false] - 是否是反转轴顺序。
- * 如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
- * @returns {string} 边界对象的字符串表示形式,如:"5,42,10,45"。
- */
- }, {
- key: "toBBOX",
- value: function toBBOX(decimal, reverseAxisOrder) {
- if (decimal == null) {
- decimal = 6;
- }
- var mult = Math.pow(10, decimal);
- var xmin = Math.round(this.left * mult) / mult;
- var ymin = Math.round(this.bottom * mult) / mult;
- var xmax = Math.round(this.right * mult) / mult;
- var ymax = Math.round(this.top * mult) / mult;
- if (reverseAxisOrder === true) {
- return ymin + "," + xmin + "," + ymax + "," + xmax;
- } else {
- return xmin + "," + ymin + "," + xmax + "," + ymax;
- }
- }
- /**
- * @function SuperMap.Bounds.prototype.toGeometry
- * @description 基于当前边界范围创建一个新的多边形对象。
- * @example
- * var bounds = new SuperMap.Bounds(-180,-90,100,80);
- * //SuperMap.Geometry.Polygon对象
- * var geo = bounds.toGeometry();
- * @returns {SuperMap.Geometry.Polygon} 基于当前 bounds 坐标创建的新的多边形。
- */
- // toGeometry() {
- // return new Polygon([
- // new LinearRing([
- // new Point(this.left, this.bottom),
- // new Point(this.right, this.bottom),
- // new Point(this.right, this.top),
- // new Point(this.left, this.top)
- // ])
- // ]);
- // }
- /**
- * @function SuperMap.Bounds.prototype.getWidth
- * @description 获取 bounds 的宽度。
- * @example
- * var bounds = new SuperMap.Bounds(-180,-90,100,80);
- * //width = 280;
- * var width = bounds.getWidth();
- * @returns {float} 获取当前 bounds 的宽度(right 减去 left)。
- */
- }, {
- key: "getWidth",
- value: function getWidth() {
- return this.right - this.left;
- }
- /**
- * @function SuperMap.Bounds.prototype.getHeight
- * @description 获取 bounds 的高度。
- * @example
- * var bounds = new SuperMap.Bounds(-180,-90,100,80);
- * //height = 170;
- * var height = bounds.getHeight();
- * @returns {float} 返回边界高度(top 减去 bottom)。
- */
- }, {
- key: "getHeight",
- value: function getHeight() {
- return this.top - this.bottom;
- }
- /**
- * @function SuperMap.Bounds.prototype.getSize
- * @description 获取边框大小。
- * @example
- * var bounds = new SuperMap.Bounds(-180,-90,100,80);
- * var size = bounds.getSize();
- * @returns {SuperMap.Size} 返回边框大小。
- */
- }, {
- key: "getSize",
- value: function getSize() {
- return new Size(this.getWidth(), this.getHeight());
- }
- /**
- * @function SuperMap.Bounds.prototype.getCenterPixel
- * @description 获取像素格式的范围中心点。
- * @example
- * var bounds = new SuperMap.Bounds(-180,-90,100,80);
- * var pixel = bounds.getCenterPixel();
- * @returns {SuperMap.Pixel} 返回像素格式的当前范围的中心点。
- */
- }, {
- key: "getCenterPixel",
- value: function getCenterPixel() {
- return new Pixel((this.left + this.right) / 2, (this.bottom + this.top) / 2);
- }
- /**
- * @function SuperMap.Bounds.prototype.getCenterLonLat
- * @description 获取地理格式的范围中心点。
- * @example
- * var bounds = new SuperMap.Bounds(-180,-90,100,80);
- * var lonlat = bounds.getCenterLonLat();
- * @returns {SuperMap.LonLat} 返回当前地理范围的中心点。
- */
- }, {
- key: "getCenterLonLat",
- value: function getCenterLonLat() {
- if (!this.centerLonLat) {
- this.centerLonLat = new LonLat((this.left + this.right) / 2, (this.bottom + this.top) / 2);
- }
- return this.centerLonLat;
- }
- /**
- * @function SuperMap.Bounds.prototype.scale
- * @description 按照比例扩大/缩小出一个新的 bounds。
- * @example
- * var bounds = new SuperMap.Bounds(-50,-50,40,40);
- * var bounds2 = bounds.scale(2);
- * @param {float} [ratio=1] - 需要扩大的比例。
- * @param {(SuperMap.Pixel|SuperMap.LonLat)} [origin] - 扩大时的基准点,默认为当前 bounds 的中心点。
- * @returns {SuperMap.Bounds} 返回通过 ratio、origin 计算得到的新的边界范围。
- */
- }, {
- key: "scale",
- value: function scale(ratio, origin) {
- ratio = ratio ? ratio : 1;
- if (origin == null) {
- origin = this.getCenterLonLat();
- }
- var origx, origy; // get origin coordinates
- if (origin.CLASS_NAME === "SuperMap.LonLat") {
- origx = origin.lon;
- origy = origin.lat;
- } else {
- origx = origin.x;
- origy = origin.y;
- }
- var left = (this.left - origx) * ratio + origx;
- var bottom = (this.bottom - origy) * ratio + origy;
- var right = (this.right - origx) * ratio + origx;
- var top = (this.top - origy) * ratio + origy;
- return new Bounds(left, bottom, right, top);
- }
- /**
- * @function SuperMap.Bounds.prototype.add
- * @description 在当前的 Bounds 上按照传入的坐标点进行平移,返回新的范围。
- * @example
- * var bounds1 = new SuperMap.Bounds(-50,-50,40,40);
- * //bounds2 是新的 bounds
- * var bounds2 = bounds.add(20,10);
- * @param {float} x - 传入坐标点的 x 坐标。
- * @param {float} y - 传入坐标点的 y 坐标。
- * @returns {SuperMap.Bounds} 返回一个新的 bounds,此 bounds 的坐标是由传入的 x,y 参数与当前 bounds 坐标计算所得。
- */
- }, {
- key: "add",
- value: function add(x, y) {
- if (x == null || y == null) {
- throw new TypeError('Bounds.add cannot receive null values');
- }
- return new Bounds(this.left + x, this.bottom + y, this.right + x, this.top + y);
- }
- /**
- * @function SuperMap.Bounds.prototype.extend
- * @description 在当前 bounds 上扩展 bounds,支持 point,lanlat 和 bounds。扩展后的 bounds 的范围是两者的结合。
- * @example
- * var bounds1 = new SuperMap.Bounds(-50,-50,40,40);
- * //bounds 改变
- * bounds.extend(new SuperMap.LonLat(50,60));
- * @param {(SuperMap.Geometry.Point|SuperMap.LonLat|SuperMap.Bounds)} object - 可以是 point、lonlat 和 bounds。
- */
- }, {
- key: "extend",
- value: function extend(object) {
- var bounds = null;
- if (object) {
- // clear cached center location
- switch (object.CLASS_NAME) {
- case "SuperMap.LonLat":
- bounds = new Bounds(object.lon, object.lat, object.lon, object.lat);
- break;
- case "SuperMap.Geometry.Point":
- bounds = new Bounds(object.x, object.y, object.x, object.y);
- break;
- case "SuperMap.Bounds":
- bounds = object;
- break;
- }
- if (bounds) {
- this.centerLonLat = null;
- if (this.left == null || bounds.left < this.left) {
- this.left = bounds.left;
- }
- if (this.bottom == null || bounds.bottom < this.bottom) {
- this.bottom = bounds.bottom;
- }
- if (this.right == null || bounds.right > this.right) {
- this.right = bounds.right;
- }
- if (this.top == null || bounds.top > this.top) {
- this.top = bounds.top;
- }
- }
- }
- }
- /**
- * @function SuperMap.Bounds.prototype.containsLonLat
- * @description 判断传入的坐标是否在范围内。
- * @example
- * var bounds1 = new SuperMap.Bounds(-50,-50,40,40);
- * //isContains1 = true
- * //这里的第二个参数可以直接为 boolean 类型,也就是inclusive
- * var isContains1 = bounds.containsLonLat(new SuperMap.LonLat(40,40),true);
- *
- * //(40,40)在范围内,同样(40+360,40)也在范围内
- * var bounds2 = new SuperMap.Bounds(-50,-50,40,40);
- * //isContains2 = true;
- * var isContains2 = bounds2.containsLonLat(
- * new SuperMap.LonLat(400,40),
- * {
- * inclusive:true,
- * //全球的范围
- * worldBounds: new SuperMap.Bounds(-180,-90,180,90)
- * }
- * );
- * @param {(SuperMap.LonLat|Object)} ll - <SuperMap.LonLat> 对象或者是一个包含 'lon' 与 'lat' 属性的对象。
- * @param {Object} options - 可选参数。
- * @param {boolean} [options.inclusive=true] - 是否包含边界。
- * @param {SuperMap.Bounds} [options.worldBounds] - 如果提供 worldBounds 参数, 如果 ll 参数提供的坐标超出了世界边界(worldBounds),
- * 但是通过日界线的转化可以被包含, 它将被认为是包含在该范围内的。
- * @returns {boolean} 传入坐标是否包含在范围内。
- */
- }, {
- key: "containsLonLat",
- value: function containsLonLat(ll, options) {
- if (typeof options === "boolean") {
- options = {
- inclusive: options
- };
- }
- options = options || {};
- var contains = this.contains(ll.lon, ll.lat, options.inclusive),
- worldBounds = options.worldBounds; //日界线以外的也有可能算包含,
- if (worldBounds && !contains) {
- var worldWidth = worldBounds.getWidth();
- var worldCenterX = (worldBounds.left + worldBounds.right) / 2; //这一步很关键
- var worldsAway = Math.round((ll.lon - worldCenterX) / worldWidth);
- contains = this.containsLonLat({
- lon: ll.lon - worldsAway * worldWidth,
- lat: ll.lat
- }, {
- inclusive: options.inclusive
- });
- }
- return contains;
- }
- /**
- * @function SuperMap.Bounds.prototype.containsPixel
- * @description 判断传入的像素是否在范围内。直接匹配大小,不涉及像素和地理转换。
- * @example
- * var bounds = new SuperMap.Bounds(-50,-50,40,40);
- * //isContains = true
- * var isContains = bounds.containsPixel(new SuperMap.Pixel(40,40),true);
- * @param {SuperMap.Pixel} px - 提供的像素参数。
- * @param {boolean} [inclusive=true] - 是否包含边界。
- * @returns {boolean} 传入的 pixel 在当前边界范围之内。
- */
- }, {
- key: "containsPixel",
- value: function containsPixel(px, inclusive) {
- return this.contains(px.x, px.y, inclusive);
- }
- /**
- * @function SuperMap.Bounds.prototype.contains
- * @description 判断传入的 x,y 坐标值是否在范围内。
- * @example
- * var bounds = new SuperMap.Bounds(-50,-50,40,40);
- * //isContains = true
- * var isContains = bounds.contains(40,40,true);
- * @param {float} x - 传入的 x 坐标值。
- * @param {float} y - 传入的 y 坐标值。
- * @param {boolean} [inclusive=true] - 是否包含边界。
- * @returns {boolean} 传入的 x,y 坐标是否在当前范围内。
- */
- }, {
- key: "contains",
- value: function contains(x, y, inclusive) {
- //set default
- if (inclusive == null) {
- inclusive = true;
- }
- if (x == null || y == null) {
- return false;
- } //x = Util.toFloat(x);
- //y = Util.toFloat(y);
- var contains = false;
- if (inclusive) {
- contains = x >= this.left && x <= this.right && y >= this.bottom && y <= this.top;
- } else {
- contains = x > this.left && x < this.right && y > this.bottom && y < this.top;
- }
- return contains;
- }
- /**
- * @function SuperMap.Bounds.prototype.intersectsBounds
- * @description 判断目标边界范围是否与当前边界范围相交。如果两个边界范围中的任意
- * 边缘相交或者一个边界包含了另外一个就认为这两个边界相交。
- * @example
- * var bounds = new SuperMap.Bounds(-180,-90,100,80);
- * var isIntersects = bounds.intersectsBounds(
- * new SuperMap.Bounds(-170,-90,120,80)
- * );
- * @param {SuperMap.Bounds} bounds - 目标边界。
- * @param {Object} options - 参数。
- * @param {boolean} [options.inclusive=true] - 边缘重合也看成相交。如果是false,
- * 两个边界范围没有重叠部分仅仅是在边缘相接(重合),
- * 这种情况被认为没有相交。
- * @param {SuperMap.Bounds} [options.worldBounds] - 提供了 worldBounds 参数, 如果他们相交时
- * 是在全球范围内, 两个边界将被视为相交。这仅适用于交叉或完全不在世界范围的边界。
- * @returns {boolean} 传入的 bounds 对象与当前 bounds 相交。
- */
- }, {
- key: "intersectsBounds",
- value: function intersectsBounds(bounds, options) {
- if (typeof options === "boolean") {
- options = {
- inclusive: options
- };
- }
- options = options || {};
- if (options.worldBounds) {
- var self = this.wrapDateLine(options.worldBounds);
- bounds = bounds.wrapDateLine(options.worldBounds);
- } else {
- self = this;
- }
- if (options.inclusive == null) {
- options.inclusive = true;
- }
- var intersects = false;
- 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,
- // then the bounds don't *really* intersect.
- if (options.inclusive || !mightTouch) {
- // otherwise, if one of the boundaries even partially contains another,
- // inclusive of the edges, then they do intersect.
- var inBottom = bounds.bottom >= self.bottom && bounds.bottom <= self.top || self.bottom >= bounds.bottom && self.bottom <= bounds.top;
- var inTop = bounds.top >= self.bottom && bounds.top <= self.top || self.top > bounds.bottom && self.top < bounds.top;
- var inLeft = bounds.left >= self.left && bounds.left <= self.right || self.left >= bounds.left && self.left <= bounds.right;
- var inRight = bounds.right >= self.left && bounds.right <= self.right || self.right >= bounds.left && self.right <= bounds.right;
- intersects = (inBottom || inTop) && (inLeft || inRight);
- } // document me
- if (options.worldBounds && !intersects) {
- var world = options.worldBounds;
- var width = world.getWidth();
- var selfCrosses = !world.containsBounds(self);
- var boundsCrosses = !world.containsBounds(bounds);
- if (selfCrosses && !boundsCrosses) {
- bounds = bounds.add(-width, 0);
- intersects = self.intersectsBounds(bounds, {
- inclusive: options.inclusive
- });
- } else if (boundsCrosses && !selfCrosses) {
- self = self.add(-width, 0);
- intersects = bounds.intersectsBounds(self, {
- inclusive: options.inclusive
- });
- }
- }
- return intersects;
- }
- /**
- * @function SuperMap.Bounds.prototype.containsBounds
- * @description 判断目标边界是否被当前边界包含在内。
- * @example
- * var bounds = new SuperMap.Bounds(-180,-90,100,80);
- * var isContains = bounds.containsBounds(
- * new SuperMap.Bounds(-170,-90,100,80),true,true
- * );
- * @param {SuperMap.Bounds} bounds - 目标边界。
- * @param {boolean} [partial=false] - 目标边界的任意部分都包含在当前边界中则被认为是包含关系。
- * 如果设为 false,整个目标边界全部被包含在当前边界范围内。
- * @param {boolean} [inclusive=true] - 边缘共享被视为包含。
- * @returns {boolean} 传入的边界被当前边界包含。
- */
- }, {
- key: "containsBounds",
- value: function containsBounds(bounds, partial, inclusive) {
- if (partial == null) {
- partial = false;
- }
- if (inclusive == null) {
- inclusive = true;
- }
- var bottomLeft = this.contains(bounds.left, bounds.bottom, inclusive);
- var bottomRight = this.contains(bounds.right, bounds.bottom, inclusive);
- var topLeft = this.contains(bounds.left, bounds.top, inclusive);
- var topRight = this.contains(bounds.right, bounds.top, inclusive);
- return partial ? bottomLeft || bottomRight || topLeft || topRight : bottomLeft && bottomRight && topLeft && topRight;
- }
- /**
- * @function SuperMap.Bounds.prototype.determineQuadrant
- * @description 判断传入坐标是否在 bounds 范围内的象限。以 bounds 中心点为坐标原点。
- * @example
- * var bounds = new SuperMap.Bounds(-180,-90,100,80);
- * //str = "tr";
- * var str = bounds.determineQuadrant(
- * new SuperMap.LonLat(20,20)
- * );
- * @param {SuperMap.LonLat} lonlat - 传入的坐标对象。
- * @returns {string} 传入坐标所在的象限("br" "tr" "tl" "bl" 分别对应"右下","右上","左上" "左下")。
- */
- }, {
- key: "determineQuadrant",
- value: function determineQuadrant(lonlat) {
- var quadrant = "";
- var center = this.getCenterLonLat();
- quadrant += lonlat.lat < center.lat ? "b" : "t";
- quadrant += lonlat.lon < center.lon ? "l" : "r";
- return quadrant;
- }
- /**
- * @function SuperMap.Bounds.prototype.wrapDateLine
- * @description 将当前 bounds 移动到最大边界范围内部(所谓的内部是相交或者内部)。
- * @example
- * var bounds = new SuperMap.Bounds(380,-40,400,-20);
- * var maxExtent = new SuperMap.Bounds(-180,-90,100,80);
- * //新的bounds
- * var newBounds = bounds.wrapDateLine(maxExtent);
- * @param {SuperMap.Bounds} maxExtent - 最大的边界范围(一般是全球范围)。
- * @param {Object} options - 可选选项参数。
- * @param {float} [options.leftTolerance=0] - left 允许的误差。
- * @param {float} [options.rightTolerance=0] - right 允许的误差。
- * @returns {SuperMap.Bounds} 克隆当前边界。如果当前边界完全在最大范围之外此函数则返回一个不同值的边界,
- * 若落在最大边界的左边,则给当前的bounds值加上最大范围的宽度,即向右移动,
- * 若落在右边,则向左移动,即给当前的bounds值加上负的最大范围的宽度。
- */
- }, {
- key: "wrapDateLine",
- value: function wrapDateLine(maxExtent, options) {
- options = options || {};
- var leftTolerance = options.leftTolerance || 0;
- var rightTolerance = options.rightTolerance || 0;
- var newBounds = this.clone();
- if (maxExtent) {
- var width = maxExtent.getWidth(); //如果 newBounds 在 maxExtent 的左边,那么一直向右移动,直到相交或者包含为止,每次移动width
- //shift right?
- while (newBounds.left < maxExtent.left && newBounds.right - rightTolerance <= maxExtent.left) {
- newBounds = newBounds.add(width, 0);
- } //如果 newBounds 在 maxExtent 的右边,那么一直向左移动,直到相交或者包含为止,每次移动width
- //shift left?
- while (newBounds.left + leftTolerance >= maxExtent.right && newBounds.right > maxExtent.right) {
- newBounds = newBounds.add(-width, 0);
- } //如果和右边相交,左边又在内部,那么再次向左边移动一次
- // crosses right only? force left
- var newLeft = newBounds.left + leftTolerance;
- if (newLeft < maxExtent.right && newLeft > maxExtent.left && newBounds.right - rightTolerance > maxExtent.right) {
- newBounds = newBounds.add(-width, 0);
- }
- }
- return newBounds;
- }
- /**
- * @function SuperMap.Bounds.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- * @example
- * var bounds = new SuperMap.Bounds(-180,-90,100,80);
- * var obj = bounds.toServerJSONObject();
- * @returns {Object} 返回 JSON 格式的 Object 对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- var jsonObject = {
- rightTop: {
- x: this.right,
- y: this.top
- },
- leftBottom: {
- x: this.left,
- y: this.bottom
- },
- left: this.left,
- right: this.right,
- top: this.top,
- bottom: this.bottom
- };
- return jsonObject;
- }
- /**
- *
- * @function SuperMap.Bounds.prototype.destroy
- * @description 销毁此对象。
- * 销毁后此对象的所有属性为 null,而不是初始值。
- * @example
- * var bounds = new SuperMap.Bounds(-180,-90,100,80);
- * bounds.destroy();
- */
- }, {
- key: "destroy",
- value: function destroy() {
- this.left = null;
- this.right = null;
- this.top = null;
- this.bottom = null;
- this.centerLonLat = null;
- }
- /**
- * @function SuperMap.Bounds.fromString
- * @description 通过字符串参数创建新的 bounds 的构造函数。
- * @example
- * var bounds = SuperMap.Bounds.fromString("-180,-90,100,80");
- * @param {string} str - 边界字符串,用逗号隔开(e.g. <i>"5,42,10,45"</i>)。
- * @param {boolean} [reverseAxisOrder=false] - 是否反转轴顺序。
- * 如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
- * @returns {SuperMap.Bounds} 返回给定的字符串创建的新的边界对象。
- */
- }], [{
- key: "fromString",
- value: function fromString(str, reverseAxisOrder) {
- var bounds = str.split(",");
- return Bounds.fromArray(bounds, reverseAxisOrder);
- }
- /**
- * @function SuperMap.Bounds.fromArray
- * @description 通过边界框数组创建 Bounds。
- * @example
- * var bounds = SuperMap.Bounds.fromArray([-180,-90,100,80]);
- * @param {Array.<float>} bbox - 边界值数组。(e.g. <i>[5,42,10,45]</i>)。
- * @param {boolean} [reverseAxisOrder=false] - 是否是反转轴顺序。如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
- * @returns {SuperMap.Bounds} 返回根据传入的数组创建的新的边界对象。
- */
- }, {
- key: "fromArray",
- value: function fromArray(bbox, reverseAxisOrder) {
- return reverseAxisOrder === true ? new Bounds(bbox[1], bbox[0], bbox[3], bbox[2]) : new Bounds(bbox[0], bbox[1], bbox[2], bbox[3]);
- }
- /**
- * @function SuperMap.Bounds.fromSize
- * @description 通过传入的边界大小来创建新的边界。
- * @example
- * var bounds = SuperMap.Bounds.fromSize(new SuperMap.Size(20,10));
- * @param {SuperMap.Size} size - 传入的边界大小。
- * @returns {SuperMap.Bounds} 返回根据传入的边界大小的创建新的边界。
- */
- }, {
- key: "fromSize",
- value: function fromSize(size) {
- return new Bounds(0, size.h, size.w, 0);
- }
- /**
- * @function SuperMap.Bounds.oppositeQuadrant
- * @description 反转象限。"t"和"b" 交换,"r"和"l"交换, 如:"tl"变为"br"。
- * @param {string} quadrant - 代表象限的字符串,如:"tl"。
- * @returns {string} 反转后的象限。
- */
- }, {
- key: "oppositeQuadrant",
- value: function oppositeQuadrant(quadrant) {
- var opp = "";
- opp += quadrant.charAt(0) === 't' ? 'b' : 't';
- opp += quadrant.charAt(1) === 'l' ? 'r' : 'l';
- return opp;
- }
- }]);
- return Bounds;
- }();
- SuperMap.Bounds = Bounds;
- ;// CONCATENATED MODULE: ./src/common/commontypes/Geometry.js
- function Geometry_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Geometry_createClass(Constructor, protoProps, staticProps) { if (protoProps) Geometry_defineProperties(Constructor.prototype, protoProps); if (staticProps) Geometry_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- // import {WKT} from '../format/WKT';
- // import {Vector} from './Vector';
- /**
- * @class SuperMap.Geometry
- * @category BaseTypes Geometry
- * @classdesc 几何对象类,描述地理对象的几何图形。
- */
- var Geometry = /*#__PURE__*/function () {
- function Geometry() {
- Geometry_classCallCheck(this, Geometry);
- this.CLASS_NAME = "SuperMap.Geometry";
- /**
- * @member {string} SuperMap.Geometry.prototype.id
- * @description 此几何对象的唯一标示符。
- *
- */
- this.id = Util.createUniqueID(this.CLASS_NAME + "_");
- /**
- * @member {SuperMap.Geometry} SuperMap.Geometry.prototype.parent
- * @description This is set when a Geometry is added as component
- * of another geometry
- */
- this.parent = null;
- /**
- * @member {SuperMap.Bounds} SuperMap.Geometry.prototype.bounds
- * @description 几何对象的范围。
- *
- */
- this.bounds = null;
- /**
- * @member {interger} SuperMap.Geometry.prototype.SRID
- * @description 投影坐标参数。通过该参数,服务器判断 Geometry 对象的坐标参考系是否与数据集相同,如果不同,则在数据入库前进行投影变换。
- * @example
- * var geometry= new SuperMap.Geometry();
- * geometry. SRID=4326;
- *
- */
- this.SRID = null;
- }
- /**
- * @function SuperMap.Geometry.prototype.destroy
- * @description 解构 Geometry 类,释放资源。
- */
- Geometry_createClass(Geometry, [{
- key: "destroy",
- value: function destroy() {
- this.id = null;
- this.bounds = null;
- this.SRID = null;
- }
- /**
- * @function SuperMap.Geometry.prototype.clone
- * @description 创建克隆的几何图形。克隆的几何图形不设置非标准的属性。
- * @returns {SuperMap.Geometry} 克隆的几何图形。
- */
- }, {
- key: "clone",
- value: function clone() {
- return new Geometry();
- }
- /**
- * @function SuperMap.Geometry.prototype.setBounds
- * @description 设置此几何对象的 bounds。
- * @param {SuperMap.Bounds} bounds - 范围。
- */
- }, {
- key: "setBounds",
- value: function setBounds(bounds) {
- if (bounds) {
- this.bounds = bounds.clone();
- }
- }
- /**
- * @function SuperMap.Geometry.prototype.clearBounds
- * @description 清除几何对象的 bounds。
- * 如果该对象有父类,也会清除父类几何对象的 bounds。
- */
- }, {
- key: "clearBounds",
- value: function clearBounds() {
- this.bounds = null;
- if (this.parent) {
- this.parent.clearBounds();
- }
- }
- /**
- * @function SuperMap.Geometry.prototype.extendBounds
- * @description Extend the existing bounds to include the new bounds.
- * If geometry's bounds is not yet set, then set a new Bounds.
- *
- * @param {SuperMap.Bounds} newBounds - 范围。
- */
- }, {
- key: "extendBounds",
- value: function extendBounds(newBounds) {
- var bounds = this.getBounds();
- if (!bounds) {
- this.setBounds(newBounds);
- } else {
- this.bounds.extend(newBounds);
- }
- }
- /**
- * @function SuperMap.Geometry.prototype.getBounds
- * @description 获得几何图形的边界。如果没有设置边界,可通过计算获得。
- * @returns {SuperMap.Bounds} 返回的几何对象的边界。
- */
- }, {
- key: "getBounds",
- value: function getBounds() {
- if (this.bounds == null) {
- this.calculateBounds();
- }
- return this.bounds;
- }
- /**
- * @function SuperMap.Geometry.prototype.calculateBounds
- * @description 重新计算几何图形的边界(需要在子类中实现此方法)。
- */
- }, {
- key: "calculateBounds",
- value: function calculateBounds() {//
- // This should be overridden by subclasses.
- //
- }
- /**
- * @function SuperMap.Geometry.prototype.getVertices
- * @description 返回几何图形的所有顶点的列表(需要在子类中实现此方法)。
- * @param {boolean} [nodes] - 如果是 true,线则只返回线的末端点,如果 false,仅仅返回顶点,如果没有设置,则返回顶点。
- * @returns {Array} 几何图形的顶点列表。
- */
- }, {
- key: "getVertices",
- value: function getVertices(nodes) {// eslint-disable-line no-unused-vars
- }
- /**
- * @function SuperMap.Geometry.prototype.getArea
- * @description 计算几何对象的面积 ,此方法需要在子类中定义。
- * @returns {float} The area of the collection by summing its parts
- */
- }, {
- key: "getArea",
- value: function getArea() {
- //to be overridden by geometries that actually have an area
- //
- return 0.0;
- } // /**
- // * @function SuperMap.Geometry.prototype.toString
- // * @description 返回geometry对象的字符串表述,需要引入{@link SuperMap.Format.WKT}。此方法只能在子类实现,在父类使用会报错。
- // * @returns {string} geometry对象的字符串表述(Well-Known Text)
- // */
- // toString() {
- // var string;
- // if (WKT) {
- // var wkt = new WKT();
- // string = wkt.write(new Vector(this));
- // } else {
- // string = Object.prototype.toString.call(this);
- // }
- // return string;
- // }
- }]);
- return Geometry;
- }();
- SuperMap.Geometry = Geometry;
- ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Collection.js
- 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); }
- function Collection_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Collection_createClass(Constructor, protoProps, staticProps) { if (protoProps) Collection_defineProperties(Constructor.prototype, protoProps); if (staticProps) Collection_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (Collection_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Geometry.Collection
- * @classdesc 几何对象集合类,存储在本地的 components 属性中(可作为参数传递给构造函数)。<br>
- * 随着新的几何图形添加到集合中,将不能被克隆,当移动几何图形时,需要指定参照物。<br>
- * getArea 和 getLength 函数只能通过遍历存储几何对象的 components 数组,总计所有几何图形的面积和长度。
- * @category BaseTypes Geometry
- * @extends {SuperMap.Geometry}
- * @param {Array.<SuperMap.Geometry>} components - 几何对象数组。
- * @example
- * var point1 = new SuperMap.Geometry.Point(10,20);
- * var point2 = new SuperMap.Geometry.Point(30,40);
- * var col = new SuperMap.Geometry.Collection([point1,point2]);
- */
- var Collection = /*#__PURE__*/function (_Geometry) {
- _inherits(Collection, _Geometry);
- var _super = _createSuper(Collection);
- function Collection(components) {
- var _this;
- Collection_classCallCheck(this, Collection);
- _this = _super.call(this);
- /**
- * @description 存储几何对象的数组。
- * @member {Array.<SuperMap.Geometry>} SuperMap.Geometry.Collection.prototype.components
- */
- _this.components = [];
- /**
- * @member {Array.<string>} SuperMap.Geometry.Collection.prototype.componentTypes
- * @description components 存储的的几何对象所支持的几何类型数组,为空表示类型不受限制。
- */
- _this.componentTypes = null;
- if (components != null) {
- _this.addComponents(components);
- }
- _this.CLASS_NAME = "SuperMap.Geometry.Collection";
- _this.geometryType = "Collection";
- return _this;
- }
- /**
- * @function SuperMap.Geometry.Collection.prototype.destroy
- * @description 销毁几何图形。
- */
- Collection_createClass(Collection, [{
- key: "destroy",
- value: function destroy() {
- this.components.length = 0;
- this.components = null;
- _get(_getPrototypeOf(Collection.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.Geometry.Collection.prototype.clone
- * @description 克隆当前几何对象。
- * @returns {SuperMap.Geometry.Collection} 克隆的几何对象集合。
- */
- }, {
- key: "clone",
- value: function clone() {
- var geometry = new Collection();
- for (var i = 0, len = this.components.length; i < len; i++) {
- geometry.addComponent(this.components[i].clone());
- } // catch any randomly tagged-on properties
- Util.applyDefaults(geometry, this);
- return geometry;
- }
- /**
- * @function SuperMap.Geometry.Collection.prototype.getComponentsString
- * @description 获取 components 字符串。
- * @returns {string} components 字符串。
- */
- }, {
- key: "getComponentsString",
- value: function getComponentsString() {
- var strings = [];
- for (var i = 0, len = this.components.length; i < len; i++) {
- strings.push(this.components[i].toShortString());
- }
- return strings.join(",");
- }
- /**
- * @function SuperMap.Geometry.Collection.prototype.calculateBounds
- * @description 通过遍历数组重新计算边界,在遍历每一子项中时调用 extend 方法。
- */
- }, {
- key: "calculateBounds",
- value: function calculateBounds() {
- this.bounds = null;
- var bounds = new Bounds();
- var components = this.components;
- if (components) {
- for (var i = 0, len = components.length; i < len; i++) {
- bounds.extend(components[i].getBounds());
- }
- } // to preserve old behavior, we only set bounds if non-null
- // in the future, we could add bounds.isEmpty()
- if (bounds.left != null && bounds.bottom != null && bounds.right != null && bounds.top != null) {
- this.setBounds(bounds);
- }
- }
- /**
- * @function SuperMap.Geometry.Collection.prototype.addComponents
- * @description 给几何图形对象添加元素。
- * @param {Array.<SuperMap.Geometry>} components - 几何对象组件。
- * @example
- * var collection = new SuperMap.Geometry.Collection();
- * collection.addComponents(new SuerpMap.Geometry.Point(10,10));
- */
- }, {
- key: "addComponents",
- value: function addComponents(components) {
- if (!Util.isArray(components)) {
- components = [components];
- }
- for (var i = 0, len = components.length; i < len; i++) {
- this.addComponent(components[i]);
- }
- }
- /**
- * @function SuperMap.Geometry.Collection.prototype.addComponent
- * @description 添加一个几何对象到集合中。如果设置了 componentTypes 类型,则添加的几何对象必须是 componentTypes 中的类型。
- * @param {SuperMap.Geometry} component - 待添加的几何对象。
- * @param {int} [index] - 几何对象插入的位置。
- * @returns {boolean} 是否添加成功。
- */
- }, {
- key: "addComponent",
- value: function addComponent(component, index) {
- var added = false;
- if (component) {
- if (this.componentTypes == null || Util.indexOf(this.componentTypes, component.CLASS_NAME) > -1) {
- if (index != null && index < this.components.length) {
- var components1 = this.components.slice(0, index);
- var components2 = this.components.slice(index, this.components.length);
- components1.push(component);
- this.components = components1.concat(components2);
- } else {
- this.components.push(component);
- }
- component.parent = this;
- this.clearBounds();
- added = true;
- }
- }
- return added;
- }
- /**
- * @function SuperMap.Geometry.Collection.prototype.removeComponents
- * @description 清除几何对象。
- * @param {Array.<SuperMap.Geometry>} components - 需要清除的几何对象。
- * @returns {boolean} 元素是否被删除。
- */
- }, {
- key: "removeComponents",
- value: function removeComponents(components) {
- var removed = false;
- if (!Util.isArray(components)) {
- components = [components];
- }
- for (var i = components.length - 1; i >= 0; --i) {
- removed = this.removeComponent(components[i]) || removed;
- }
- return removed;
- }
- /**
- * @function SuperMap.Geometry.Collection.prototype.removeComponent
- * @description 从集合中移除一个几何对象。
- * @param {SuperMap.Geometry} component - 要移除的几何对象。
- * @returns {boolean} 几何对象是否移除成功。
- */
- }, {
- key: "removeComponent",
- value: function removeComponent(component) {
- Util.removeItem(this.components, component); // clearBounds() so that it gets recalculated on the next call
- // to this.getBounds();
- this.clearBounds();
- return true;
- }
- /**
- * @function SuperMap.Geometry.Collection.prototype.getArea
- * @description 计算几何对象的面积。注意,这个方法在 {@link SuperMap.Geometry.Polygon} 类中需要重写。
- * @returns {number} 几何图形的面积,是几何对象中所有组成部分的面积之和。
- */
- }, {
- key: "getArea",
- value: function getArea() {
- var area = 0.0;
- for (var i = 0, len = this.components.length; i < len; i++) {
- area += this.components[i].getArea();
- }
- return area;
- }
- /**
- * @function SuperMap.Geometry.Collection.prototype.equals
- * @description 判断两个几何图形是否相等。如果所有的 components 具有相同的坐标,则认为是相等的。
- * @param {SuperMap.Geometry} geometry - 需要判断的几何图形。
- * @returns {boolean} 输入的几何图形与当前几何图形是否相等。
- */
- }, {
- key: "equals",
- value: function equals(geometry) {
- var equivalent = true;
- if (!geometry || !geometry.CLASS_NAME || this.CLASS_NAME !== geometry.CLASS_NAME) {
- equivalent = false;
- } else if (!Util.isArray(geometry.components) || geometry.components.length !== this.components.length) {
- equivalent = false;
- } else {
- for (var i = 0, len = this.components.length; i < len; ++i) {
- if (!this.components[i].equals(geometry.components[i])) {
- equivalent = false;
- break;
- }
- }
- }
- return equivalent;
- }
- /**
- * @function SuperMap.Geometry.Collection.prototype.getVertices
- * @description 返回几何对象的所有结点的列表。
- * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false,则返回非端点的顶点如果没有设置此参数,则返回所有顶点。
- * @returns {Array} 几何对象的顶点列表。
- */
- }, {
- key: "getVertices",
- value: function getVertices(nodes) {
- var vertices = [];
- for (var i = 0, len = this.components.length; i < len; ++i) {
- Array.prototype.push.apply(vertices, this.components[i].getVertices(nodes));
- }
- return vertices;
- }
- }]);
- return Collection;
- }(Geometry);
- SuperMap.Geometry.Collection = Collection;
- ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiPoint.js
- 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); }
- function MultiPoint_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function MultiPoint_createClass(Constructor, protoProps, staticProps) { if (protoProps) MultiPoint_defineProperties(Constructor.prototype, protoProps); if (staticProps) MultiPoint_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function MultiPoint_setPrototypeOf(o, p) { MultiPoint_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiPoint_setPrototypeOf(o, p); }
- 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); }; }
- function MultiPoint_possibleConstructorReturn(self, call) { if (call && (MultiPoint_typeof(call) === "object" || typeof call === "function")) { return call; } return MultiPoint_assertThisInitialized(self); }
- function MultiPoint_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function MultiPoint_getPrototypeOf(o) { MultiPoint_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiPoint_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Geometry.MultiPoint
- * @classdesc 几何对象多点类。
- * @category BaseTypes Geometry
- * @extends {SuperMap.Geometry.Collection}
- * @param {Array.<SuperMap.Geometry.Point>} components - 点对象数组。
- * @example
- * var point1 = new SuperMap.Geometry.Point(5,6);
- * var poine2 = new SuperMap.Geometry.Point(7,8);
- * var multiPoint = new SuperMap.Geometry.MultiPoint([point1,point2]);
- */
- var MultiPoint = /*#__PURE__*/function (_Collection) {
- MultiPoint_inherits(MultiPoint, _Collection);
- var _super = MultiPoint_createSuper(MultiPoint);
- function MultiPoint(components) {
- var _this;
- MultiPoint_classCallCheck(this, MultiPoint);
- _this = _super.call(this, components);
- /**
- * @member {Array.<string>} [SuperMap.Geometry.MultiPoint.prototype.componentTypes=["SuperMap.Geometry.Point"]]
- * @description components 存储的的几何对象所支持的几何类型数组。
- * @readonly
- */
- _this.componentTypes = ["SuperMap.Geometry.Point"];
- _this.CLASS_NAME = "SuperMap.Geometry.MultiPoint";
- _this.geometryType = "MultiPoint";
- return _this;
- }
- /**
- * @function SuperMap.Geometry.MultiPoint.prototype.addPoint
- * @description 添加点,封装了 {@link SuperMap.Geometry.Collection|SuperMap.Geometry.Collection.addComponent} 方法。
- * @param {SuperMap.Geometry.Point} point - 添加的点。
- * @param {integer} [index] - 下标。
- */
- MultiPoint_createClass(MultiPoint, [{
- key: "addPoint",
- value: function addPoint(point, index) {
- this.addComponent(point, index);
- }
- /**
- * @function SuperMap.Geometry.MultiPoint.prototype.removePoint
- * @description 移除点,封装了 {@link SuperMap.Geometry.Collection|SuperMap.Geometry.Collection.removeComponent} 方法。
- * @param {SuperMap.Geometry.Point} point - 移除的点对象。
- */
- }, {
- key: "removePoint",
- value: function removePoint(point) {
- this.removeComponent(point);
- }
- }]);
- return MultiPoint;
- }(Collection);
- SuperMap.Geometry.MultiPoint = MultiPoint;
- ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Curve.js
- 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); }
- function Curve_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); }
- function Curve_setPrototypeOf(o, p) { Curve_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Curve_setPrototypeOf(o, p); }
- 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); }; }
- function Curve_possibleConstructorReturn(self, call) { if (call && (Curve_typeof(call) === "object" || typeof call === "function")) { return call; } return Curve_assertThisInitialized(self); }
- function Curve_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Curve_getPrototypeOf(o) { Curve_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Curve_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Geometry.Curve
- * @classdesc 几何对象曲线类。
- * @category BaseTypes Geometry
- * @extends {SuperMap.Geometry.MultiPoint}
- * @param {Array.<SuperMap.Geometry.Point>} components - 几何对象数组。
- * @example
- * var point1 = new SuperMap.Geometry.Point(10,20);
- * var point2 = new SuperMap.Geometry.Point(30,40);
- * var curve = new SuperMap.Geometry.Curve([point1,point2]);
- */
- var Curve = /*#__PURE__*/function (_MultiPoint) {
- Curve_inherits(Curve, _MultiPoint);
- var _super = Curve_createSuper(Curve);
- function Curve(components) {
- var _this;
- Curve_classCallCheck(this, Curve);
- _this = _super.call(this, components);
- /**
- * @member {Array.<string>} [SuperMap.Geometry.Curve.prototype.componentType=["SuperMap.Geometry.Point", "SuperMap.PointWithMeasure"]]
- * @description components 存储的的几何对象所支持的几何类型数组。
- * @readonly
- */
- _this.componentTypes = ["SuperMap.Geometry.Point", "SuperMap.PointWithMeasure"];
- _this.CLASS_NAME = "SuperMap.Geometry.Curve";
- _this.geometryType = "Curve";
- return _this;
- }
- return Curve;
- }(MultiPoint);
- SuperMap.Geometry.Curve = Curve;
- ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Point.js
- 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); }
- function Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Point_createClass(Constructor, protoProps, staticProps) { if (protoProps) Point_defineProperties(Constructor.prototype, protoProps); if (staticProps) Point_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Point_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function Point_setPrototypeOf(o, p) { Point_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Point_setPrototypeOf(o, p); }
- 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); }; }
- function Point_possibleConstructorReturn(self, call) { if (call && (Point_typeof(call) === "object" || typeof call === "function")) { return call; } return Point_assertThisInitialized(self); }
- function Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Point_getPrototypeOf(o) { Point_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Point_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Geometry.Point
- * @classdesc 点几何对象类。
- * @category BaseTypes Geometry
- * @extends {SuperMap.Geometry}
- * @param {float} x - x 坐标。
- * @param {float} y - y 坐标。
- * @param {string} [type = 'Point'] - 用来存储点的类型。
- * @param {float} [tag] - 用来存储额外的属性,比如差值分析中的 Z 值。
- * @example
- * var point = new SuperMap.Geometry.Point(-111.04, 45.68);
- */
- var Point = /*#__PURE__*/function (_Geometry) {
- Point_inherits(Point, _Geometry);
- var _super = Point_createSuper(Point);
- function Point(x, y, type, tag) {
- var _this;
- Point_classCallCheck(this, Point);
- _this = _super.call(this, x, y, type, tag);
- /**
- * @member {float} SuperMap.Geometry.Point.prototype.x
- * @description 横坐标。
- */
- _this.x = parseFloat(x);
- /**
- * @member {float} SuperMap.Geometry.Point.prototype.y
- * @description 纵坐标。
- */
- _this.y = parseFloat(y);
- /**
- * @member {string} SuperMap.Geometry.Point.prototype.tag
- * @description 用来存储额外的属性,比如差值分析中的 Z 值。
- */
- _this.tag = tag || tag == 0 ? parseFloat(tag) : null;
- /**
- * @member {string} SuperMap.Geometry.Point.prototype.tag
- * @description 用来存储点的类型
- */
- _this.type = type || "Point";
- _this.CLASS_NAME = "SuperMap.Geometry.Point";
- _this.geometryType = "Point";
- return _this;
- }
- /**
- * @function SuperMap.Geometry.Point.prototype.clone
- * @description 克隆点对象。
- * @returns {SuperMap.Geometry.Point} 克隆后的点对象。
- */
- Point_createClass(Point, [{
- key: "clone",
- value: function clone(obj) {
- if (obj == null) {
- obj = new Point(this.x, this.y);
- } // catch any randomly tagged-on properties
- Util.applyDefaults(obj, this);
- return obj;
- }
- /**
- * @function SuperMap.Geometry.Point.prototype.calculateBounds
- * @description 计算点对象的范围。
- */
- }, {
- key: "calculateBounds",
- value: function calculateBounds() {
- this.bounds = new Bounds(this.x, this.y, this.x, this.y);
- }
- /**
- * @function SuperMap.Geometry.Point.prototype.equals
- * @description 判断两个点对象是否相等。如果两个点对象具有相同的坐标,则认为是相等的。
- * @example
- * var point= new SuperMap.Geometry.Point(0,0);
- * var point1={x:0,y:0};
- * var result= point.equals(point1);
- * @param {SuperMap.Geometry.Point} geom - 需要判断的点对象。
- * @returns {boolean} 两个点对象是否相等(true 为相等,false 为不等)。
- */
- }, {
- key: "equals",
- value: function equals(geom) {
- var equals = false;
- if (geom != null) {
- equals = this.x === geom.x && this.y === geom.y || isNaN(this.x) && isNaN(this.y) && isNaN(geom.x) && isNaN(geom.y);
- }
- return equals;
- }
- /**
- * @function SuperMap.Geometry.Point.prototype.move
- * @description 沿着 x、y 轴的正方向上按照给定的位移移动点对象,move 不仅改变了几何对象的位置并且清理了边界缓存。
- * @param {float} x - x 轴正方向上的偏移量。
- * @param {float} y - y 轴正方向上偏移量。
- */
- }, {
- key: "move",
- value: function move(x, y) {
- this.x = this.x + x;
- this.y = this.y + y;
- this.clearBounds();
- }
- /**
- * @function SuperMap.Geometry.Point.prototype.toShortString
- * @returns {string} 字符串代表点对象。(ex. <i>"5, 42"</i>)
- */
- }, {
- key: "toShortString",
- value: function toShortString() {
- return this.x + ", " + this.y;
- }
- /**
- * @function SuperMap.Geometry.Point.prototype.destroy
- * @description 释放点对象的资源。
- */
- }, {
- key: "destroy",
- value: function destroy() {
- this.x = null;
- this.y = null;
- this.tag = null;
- Point_get(Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.Geometry.Point.prototype.getVertices
- * @description 返回点对象的所有顶点的列表。
- * @param {boolean} [nodes] - 对于点对象此参数不起作用,直接返回点。
- * @returns {Array} 几何图形的顶点列表。
- */
- }, {
- key: "getVertices",
- value: function getVertices(nodes) {
- // eslint-disable-line no-unused-vars
- return [this];
- }
- }]);
- return Point;
- }(Geometry);
- SuperMap.Geometry.Point = Point;
- ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/LineString.js
- 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); }
- function LineString_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function LineString_createClass(Constructor, protoProps, staticProps) { if (protoProps) LineString_defineProperties(Constructor.prototype, protoProps); if (staticProps) LineString_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function LineString_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = LineString_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function LineString_setPrototypeOf(o, p) { LineString_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LineString_setPrototypeOf(o, p); }
- 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); }; }
- function LineString_possibleConstructorReturn(self, call) { if (call && (LineString_typeof(call) === "object" || typeof call === "function")) { return call; } return LineString_assertThisInitialized(self); }
- function LineString_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function LineString_getPrototypeOf(o) { LineString_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LineString_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Geometry.LineString
- * @classdesc 几何对象线串类。
- * @category BaseTypes Geometry
- * @param {Array.<SuperMap.Geometry.Point>} points - 用来生成线串的点数组。
- * @extends {SuperMap.Geometry.Curve}
- * @example
- * var points = [new SuperMap.Geometry.Point(4933.319287022352, -3337.3849141502124),
- * new SuperMap.Geometry.Point(4960.9674060199022, -3349.3316322355736),
- * new SuperMap.Geometry.Point(5006.0235999418364, -3358.8890067038628),
- * new SuperMap.Geometry.Point(5075.3145648369318, -3378.0037556404409),
- * new SuperMap.Geometry.Point(5305.19551436013, -3376.9669111768926)],
- * var roadLine = new SuperMap.Geometry.LineString(points);
- */
- var LineString = /*#__PURE__*/function (_Curve) {
- LineString_inherits(LineString, _Curve);
- var _super = LineString_createSuper(LineString);
- function LineString(points) {
- var _this;
- LineString_classCallCheck(this, LineString);
- _this = _super.call(this, points);
- _this.CLASS_NAME = "SuperMap.Geometry.LineString";
- _this.geometryType = "LineString";
- return _this;
- }
- /**
- * @function SuperMap.Geometry.LineString.prototype.removeComponent
- * @description 只有在线串上有三个或更多的点的时候,才会允许移除点(否则结果将会是单一的点)。
- * @param {SuperMap.Geometry.Point} point - 将被删除的点。
- * @returns {boolean} 删除的点。
- */
- LineString_createClass(LineString, [{
- key: "removeComponent",
- value: function removeComponent(point) {
- // eslint-disable-line no-unused-vars
- var removed = this.components && this.components.length > 2;
- if (removed) {
- LineString_get(LineString_getPrototypeOf(LineString.prototype), "removeComponent", this).apply(this, arguments);
- }
- return removed;
- }
- /**
- * @function SuperMap.Geometry.LineString.prototype.getSortedSegments
- * @returns {Array} An array of segment objects. Segment objects have properties
- * x1, y1, x2, and y2. The start point is represented by x1 and y1.
- * The end point is represented by x2 and y2. Start and end are
- * ordered so that x1 < x2.
- */
- }, {
- key: "getSortedSegments",
- value: function getSortedSegments() {
- var numSeg = this.components.length - 1;
- var segments = new Array(numSeg),
- point1,
- point2;
- for (var i = 0; i < numSeg; ++i) {
- point1 = this.components[i];
- point2 = this.components[i + 1];
- if (point1.x < point2.x) {
- segments[i] = {
- x1: point1.x,
- y1: point1.y,
- x2: point2.x,
- y2: point2.y
- };
- } else {
- segments[i] = {
- x1: point2.x,
- y1: point2.y,
- x2: point1.x,
- y2: point1.y
- };
- }
- } // more efficient to define this somewhere static
- function byX1(seg1, seg2) {
- return seg1.x1 - seg2.x1;
- }
- return segments.sort(byX1);
- }
- /**
- * @function SuperMap.Geometry.LineString.prototype.getVertices
- * @description 返回几何图形的所有顶点的列表。
- * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false,则返回非端点的顶点。如果没有设置此参数,则返回所有顶点。
- * @returns {Array} 几何图形的顶点列表。
- */
- }, {
- key: "getVertices",
- value: function getVertices(nodes) {
- var vertices;
- if (nodes === true) {
- vertices = [this.components[0], this.components[this.components.length - 1]];
- } else if (nodes === false) {
- vertices = this.components.slice(1, this.components.length - 1);
- } else {
- vertices = this.components.slice();
- }
- return vertices;
- }
- /**
- * @function SuperMap.Geometry.LineString.calculateCircle
- * @description 三点画圆弧。
- * @param {Array.<SuperMap.Geometry.Point>} points - 传入的待计算的初始点串。
- * @returns {Array.<SuperMap.Geometry.Point>} 计算出相应的圆弧控制点。
- * @example
- * var points = [];
- * points.push(new SuperMap.Geometry.Point(-50,30));
- * points.push(new SuperMap.Geometry.Point(-30,50));
- * points.push(new SuperMap.Geometry.Point(2,60));
- * var circle = SuperMap.Geometry.LineString.calculateCircle(points);
- */
- }], [{
- key: "calculateCircle",
- value: function calculateCircle(points) {
- if (points.length < 3) {
- return points;
- }
- var centerPoint = {},
- p1 = points[0],
- p2 = points[1],
- p3 = points[2];
- var R = 0,
- dStep = 0,
- direc = true,
- dRotation = 0,
- dRotationBegin = 0,
- dRotationAngle = 0,
- nSegmentCount = 72,
- circlePoints = [];
- var KTan13 = (p3.y - p1.y) / (p3.x - p1.x);
- var B13 = p3.y - KTan13 * p3.x;
- 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) {
- circlePoints.push(p1);
- circlePoints.push(p2);
- circlePoints.push(p3);
- } else {
- 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));
- 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));
- var F = 4 * ((p2.x - p1.x) * (p3.y - p1.y) - (p3.x - p1.x) * (p2.y - p1.y));
- centerPoint.x = D / F;
- centerPoint.y = E / F;
- R = Math.sqrt((p1.x - centerPoint.x) * (p1.x - centerPoint.x) + (p1.y - centerPoint.y) * (p1.y - centerPoint.y));
- var dis = (p1.x - p3.x) * (p1.x - p3.x) + (p1.y - p3.y) * (p1.y - p3.y);
- var cons = (2 * R * R - dis) / (2 * R * R);
- cons = cons >= 1 ? 1 : cons;
- cons = cons <= -1 ? -1 : cons;
- dRotationAngle = Math.acos(cons) * 180 / Math.PI;
- if (p3.x == p1.x) {
- dRotationAngle = centerPoint.x > p1.x && p2.x > p1.x || centerPoint.x < p1.x && p2.x < p1.x ? 360 - dRotationAngle : dRotationAngle;
- } else {
- 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;
- }
- dStep = dRotationAngle / 72;
- if (p3.y != p1.y) {
- if (p3.x == p1.x) {
- if (p3.y > p1.y) {
- if (p2.x < p1.x) {
- direc = false;
- }
- } else {
- if (p2.x > p1.x) {
- direc = false;
- }
- }
- } else if (p3.x < p1.x) {
- if (p2.y < KTan13 * p2.x + B13) {
- direc = false;
- }
- } else {
- if (p2.y > KTan13 * p2.x + B13) {
- direc = false;
- }
- }
- } else {
- if (p3.x > p1.x) {
- if (p2.y > p1.y) {
- direc = false;
- }
- } else {
- if (p2.y < p1.y) {
- direc = false;
- }
- }
- }
- var K10 = (p1.y - centerPoint.y) / (p1.x - centerPoint.x);
- var atan10 = K10 >= 0 ? Math.atan(K10) * 180 / Math.PI : Math.abs(Math.atan(K10) * 180 / Math.PI) + 90;
- var CY = Math.abs(centerPoint.y);
- if (p1.y == CY && CY == p3.y) {
- if (p1.x < p3.x) {
- atan10 = atan10 + 180;
- }
- }
- var newPY = p1.y - centerPoint.y;
- circlePoints.push(p1);
- for (var i = 1; i < nSegmentCount; i++) {
- dRotation = dStep * i;
- dRotationBegin = atan10;
- if (direc) {
- if (newPY >= 0) {
- if (K10 >= 0) {
- dRotationBegin = dRotationBegin + dRotation;
- } else {
- dRotationBegin = 180 - (dRotationBegin - 90) + dRotation;
- }
- } else {
- if (K10 > 0) {
- dRotationBegin = dRotationBegin - 180 + dRotation;
- } else {
- dRotationBegin = 90 - dRotationBegin + dRotation;
- }
- }
- } else {
- if (newPY >= 0) {
- if (K10 >= 0) {
- dRotationBegin = dRotationBegin - dRotation;
- } else {
- dRotationBegin = 180 - (dRotationBegin - 90) - dRotation;
- }
- } else {
- if (K10 >= 0) {
- dRotationBegin = dRotationBegin - 180 - dRotation;
- } else {
- dRotationBegin = 90 - dRotationBegin - dRotation;
- }
- }
- }
- dRotationBegin = dRotationBegin * Math.PI / 180;
- var x = centerPoint.x + R * Math.cos(dRotationBegin);
- var y = centerPoint.y + R * Math.sin(dRotationBegin);
- circlePoints.push(new Point(x, y));
- }
- circlePoints.push(p3);
- }
- return circlePoints;
- }
- /**
- * @function SuperMap.Geometry.LineString.createLineEPS
- * @description 根据点的类型画出不同类型的曲线。
- * 点的类型有三种:LTypeArc,LTypeCurve,NONE。
- * @param {Array.<SuperMap.Geometry.Point>} points - 传入的待计算的初始点串。
- * @returns {Array.<SuperMap.Geometry.Point>} 计算出相应的 lineEPS 控制点。
- * @example
- * var points = [];
- * points.push(new SuperMap.Geometry.Point(-50,30));
- * points.push(new SuperMap.Geometry.Point(-30,50,"LTypeArc"));
- * points.push(new SuperMap.Geometry.Point(2,60));
- * points.push(new SuperMap.Geometry.Point(8,20));
- * var lineEPS = SuperMap.Geometry.LineString.createLineEPS(points);
- */
- }, {
- key: "createLineEPS",
- value: function createLineEPS(points) {
- var list = [],
- len = points.length;
- if (len < 2) {
- return points;
- }
- for (var i = 0; i < len;) {
- var type = points[i].type;
- if (type == 'LTypeArc') {
- var listObj = LineString.createLineArc(list, i, len, points);
- list = listObj[0];
- i = listObj[1];
- } else {
- list.push(points[i]);
- i++;
- }
- }
- return list;
- }
- }, {
- key: "createLineArc",
- value: function createLineArc(list, i, len, points) {
- if (i == 0) {
- var bezierPtsObj = LineString.addPointEPS(points, i, len, 'LTypeArc');
- Array.prototype.push.apply(list, bezierPtsObj[0]);
- i = bezierPtsObj[1] + 1;
- } else if (i == len - 1) {
- var bezierP = [points[i - 1], points[i]],
- bezierPts = LineString.calculateCircle(bezierP);
- Array.prototype.push.apply(list, bezierPts);
- i++;
- } else {
- var _bezierPtsObj = LineString.addPointEPS(points, i, len, 'LTypeArc');
- list.pop();
- Array.prototype.push.apply(list, _bezierPtsObj[0]);
- i = _bezierPtsObj[1] + 1;
- }
- return [list, i];
- }
- }, {
- key: "addPointEPS",
- value: function addPointEPS(points, i, len, type) {
- var bezierP = [],
- j = i + 1;
- if (i == 0) {
- Array.prototype.push.apply(bezierP, [points[i], points[i + 1]]);
- } else if (i == len - 1) {
- Array.prototype.push.apply(bezierP, [points[i - 1], points[i]]);
- } else {
- Array.prototype.push.apply(bezierP, [points[i - 1], points[i], points[i + 1]]);
- }
- var bezierPts;
- if (type == 'LTypeCurve') {
- bezierPts = LineString.calculatePointsFBZN(bezierP);
- } else if (type == 'LTypeArc') {
- bezierPts = LineString.calculateCircle(bezierP);
- }
- return [bezierPts, j];
- }
- }]);
- return LineString;
- }(Curve);
- SuperMap.Geometry.LineString = LineString;
- ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/GeoText.js
- 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); }
- function GeoText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GeoText_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoText_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoText_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GeoText_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoText_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GeoText_setPrototypeOf(o, p) { GeoText_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoText_setPrototypeOf(o, p); }
- 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); }; }
- function GeoText_possibleConstructorReturn(self, call) { if (call && (GeoText_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoText_assertThisInitialized(self); }
- function GeoText_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GeoText_getPrototypeOf(o) { GeoText_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoText_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Geometry.GeoText
- * @classdesc 文本标签类。
- * @category BaseTypes Geometry
- * @extends {SuperMap.Geometry}
- * @param {float} x - x 坐标。
- * @param {float} y - y 坐标。
- * @param {string} text - 标签中的文本内容。
- */
- var GeoText = /*#__PURE__*/function (_Geometry) {
- GeoText_inherits(GeoText, _Geometry);
- var _super = GeoText_createSuper(GeoText);
- function GeoText(x, y, text) {
- var _this;
- GeoText_classCallCheck(this, GeoText);
- _this = _super.call(this, x, y, text);
- /**
- * @member {float} SuperMap.Geometry.GeoText.prototype.x
- * @description 横坐标。
- */
- _this.x = parseFloat(x);
- /**
- * @member {float} SuperMap.Geometry.GeoText.prototype.y
- * @description 纵坐标。
- */
- _this.y = parseFloat(y);
- /**
- * @member {string} SuperMap.Geometry.GeoText.prototype.text
- * @description 标签中的文本内容。
- */
- _this.text = text.toString();
- /**
- * @member {Object} SuperMap.Geometry.GeoText.prototype.bsInfo
- * @description 标签范围的基础信息。
- * @property {number} w - bounds 的宽。
- * @property {number} h - bounds 的高度。
- */
- _this.bsInfo = {
- "h": null,
- "w": null
- };
- _this.element = document.createElement('span');
- _this.CLASS_NAME = "SuperMap.Geometry.GeoText";
- _this.geometryType = "GeoText";
- return _this;
- }
- /**
- * @function SuperMap.Geometry.GeoText.prototype.destroy
- * @description 销毁文本标签类。
- */
- GeoText_createClass(GeoText, [{
- key: "destroy",
- value: function destroy() {
- GeoText_get(GeoText_getPrototypeOf(GeoText.prototype), "destroy", this).call(this);
- this.x = null;
- this.y = null;
- this.text = null;
- }
- /**
- * @function SuperMap.Geometry.GeoText.prototype.getCentroid
- * @description 获取标签对象的质心。
- * @returns {SuperMap.Geometry.Point} 标签对象的质心。
- */
- }, {
- key: "getCentroid",
- value: function getCentroid() {
- return new Point(this.x, this.y);
- }
- /**
- * @function SuperMap.Geometry.GeoText.prototype.clone
- * @description 克隆标签对象。
- * @returns {SuperMap.Geometry.GeoText} 克隆后的标签对象。
- */
- }, {
- key: "clone",
- value: function clone(obj) {
- if (obj == null) {
- obj = new GeoText(this.x, this.y, this.text);
- }
- Util.applyDefaults(obj, this);
- return obj;
- }
- /**
- * @function SuperMap.Geometry.GeoText.prototype.calculateBounds
- * @description 计算标签对象的范围。
- */
- }, {
- key: "calculateBounds",
- value: function calculateBounds() {
- this.bounds = new Bounds(this.x, this.y, this.x, this.y);
- }
- /**
- * @function SuperMap.Geometry.GeoText.prototype.getLabelPxBoundsByLabel
- * @description 根据绘制好的标签获取文字标签的像素范围,参数的单位是像素;此方法相对于 getLabelPxBoundsByText 效率较低,但支持所有格式的文本。
- * @param {Object} locationPixel - 标签的位置点,该对象含有属性 x(横坐标),属性 y(纵坐标)。
- * @param {string} labelWidth - 标签的宽度,如:“90px”。
- * @param {string} labelHeight - 标签的高度。
- * @param {Object} style - 标签的 style。
- * @returns {SuperMap.Bounds} 标签的像素范围。
- */
- }, {
- key: "getLabelPxBoundsByLabel",
- value: function getLabelPxBoundsByLabel(locationPixel, labelWidth, labelHeight, style) {
- var labelPxBounds, left, bottom, top, right;
- var locationPx = Util.cloneObject(locationPixel); //计算文本行数
- var theText = style.label || this.text;
- var textRows = theText.split('\n');
- var laberRows = textRows.length; //处理文字对齐
- labelWidth = parseFloat(labelWidth);
- labelHeight = parseFloat(labelHeight);
- if (laberRows > 1) {
- labelHeight = parseFloat(labelHeight) * laberRows;
- }
- if (style.labelAlign && style.labelAlign !== "cm") {
- switch (style.labelAlign) {
- case "lt":
- locationPx.x += labelWidth / 2;
- locationPx.y += labelHeight / 2;
- break;
- case "lm":
- locationPx.x += labelWidth / 2;
- break;
- case "lb":
- locationPx.x += labelWidth / 2;
- locationPx.y -= labelHeight / 2;
- break;
- case "ct":
- locationPx.y += labelHeight / 2;
- break;
- case "cb":
- locationPx.y -= labelHeight / 2;
- break;
- case "rt":
- locationPx.x -= labelWidth / 2;
- locationPx.y += labelHeight / 2;
- break;
- case "rm":
- locationPx.x -= labelWidth / 2;
- break;
- case "rb":
- locationPx.x -= labelWidth / 2;
- locationPx.y -= labelHeight / 2;
- break;
- default:
- break;
- }
- }
- this.bsInfo.h = labelHeight;
- this.bsInfo.w = labelWidth; //bounds的四边
- left = locationPx.x - parseFloat(labelWidth) / 2;
- bottom = locationPx.y + parseFloat(labelHeight) / 2;
- right = locationPx.x + parseFloat(labelWidth) / 2;
- top = locationPx.y - parseFloat(labelHeight) / 2;
- labelPxBounds = new Bounds(left, bottom, right, top);
- return labelPxBounds;
- }
- /**
- * @function SuperMap.Geometry.GeoText.prototype.getLabelPxBoundsByText
- * @description 根据文本内容获取文字标签的像素范围。
- * @param {Object} locationPixel - 标签的位置点,该对象含有属性 x(横坐标),属性 y(纵坐标)。
- * @param {Object} style - 标签的样式。
- * @returns {SuperMap.Bounds} 标签的像素范围。
- */
- }, {
- key: "getLabelPxBoundsByText",
- value: function getLabelPxBoundsByText(locationPixel, style) {
- var labelPxBounds, left, bottom, top, right;
- var labelSize = this.getLabelPxSize(style);
- var locationPx = Util.cloneObject(locationPixel); //处理文字对齐
- if (style.labelAlign && style.labelAlign !== "cm") {
- switch (style.labelAlign) {
- case "lt":
- locationPx.x += labelSize.w / 2;
- locationPx.y += labelSize.h / 2;
- break;
- case "lm":
- locationPx.x += labelSize.w / 2;
- break;
- case "lb":
- locationPx.x += labelSize.w / 2;
- locationPx.y -= labelSize.h / 2;
- break;
- case "ct":
- locationPx.y += labelSize.h / 2;
- break;
- case "cb":
- locationPx.y -= labelSize.h / 2;
- break;
- case "rt":
- locationPx.x -= labelSize.w / 2;
- locationPx.y += labelSize.h / 2;
- break;
- case "rm":
- locationPx.x -= labelSize.w / 2;
- break;
- case "rb":
- locationPx.x -= labelSize.w / 2;
- locationPx.y -= labelSize.h / 2;
- break;
- default:
- break;
- }
- }
- this.bsInfo.h = labelSize.h;
- this.bsInfo.w = labelSize.w;
- left = locationPx.x - labelSize.w / 2;
- bottom = locationPx.y + labelSize.h / 2; //处理斜体字
- if (style.fontStyle && style.fontStyle === "italic") {
- right = locationPx.x + labelSize.w / 2 + parseInt(parseFloat(style.fontSize) / 2);
- } else {
- right = locationPx.x + labelSize.w / 2;
- }
- top = locationPx.y - labelSize.h / 2;
- labelPxBounds = new Bounds(left, bottom, right, top);
- return labelPxBounds;
- }
- /**
- * @function SuperMap.Geometry.GeoText.prototype.getLabelPxSize
- * @description 获取 label 的像素大小。
- * @param {Object} style - 标签样式。
- * @returns {Object} 标签大小对象,属性 w 表示标签的宽度,属性 h 表示标签的高度。
- */
- }, {
- key: "getLabelPxSize",
- value: function getLabelPxSize(style) {
- var text,
- //文本内容
- fontSize,
- //字体大小
- spacing = 1,
- //两个字符间的间距(单位:px)
- lineSpacing = 0.2,
- bgstrokeWidth = parseFloat(style.strokeWidth); //标签背景框边框的宽度
- text = style.label || this.text;
- if (style.fontSize) {
- fontSize = parseFloat(style.fontSize);
- } else {
- fontSize = parseFloat("12px");
- } //标签宽高
- var labelW, labelH;
- var textRows = text.split('\n');
- var numRows = textRows.length;
- if (numRows > 1) {
- labelH = fontSize * numRows + numRows + bgstrokeWidth + lineSpacing * fontSize;
- } else {
- labelH = fontSize + bgstrokeWidth + lineSpacing * fontSize + 1;
- } //取最大宽度
- labelW = 0;
- if (this.labelWTmp && labelW < this.labelWTmp) {
- labelW = this.labelWTmp;
- }
- for (var i = 0; i < numRows; i++) {
- var textCharC = this.getTextCount(textRows[i]);
- var labelWTmp = this.labelWTmp = Util.getTextBounds(style, textRows[i], this.element).textWidth + textCharC.textC * spacing + bgstrokeWidth;
- if (labelW < labelWTmp) {
- labelW = labelWTmp;
- }
- }
- var labelSize = new Object(); //标签大小
- labelSize.h = labelH;
- labelSize.w = labelW;
- return labelSize;
- }
- /**
- * @function SuperMap.Geometry.GeoText.prototype.getTextCount
- * @description 获取 text 中的字符个数。
- * @param {string} text - 字符串。
- * @returns {Object} 字符个数统计结果,属性 cnC 表示中文字符个数,属性 enC 表示英文字符个数,属性 textC 表示字符总个数。
- */
- }, {
- key: "getTextCount",
- value: function getTextCount(text) {
- var textCharCount = {};
- var cnCount = 0;
- var enCount = 0;
- for (var i = 0; i < text.length; i++) {
- if (text.charCodeAt(i) > 255) {
- //遍历判断字符串中每个字符的Unicode码,大于255则为中文
- cnCount++;
- } else {
- enCount++;
- }
- } //中午字符个数
- textCharCount.cnC = cnCount; //英文字符个数
- textCharCount.enC = enCount; //字符总个数
- textCharCount.textC = text.length;
- return textCharCount;
- }
- }]);
- return GeoText;
- }(Geometry);
- SuperMap.Geometry.GeoText = GeoText;
- ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/LinearRing.js
- 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); }
- function LinearRing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function LinearRing_createClass(Constructor, protoProps, staticProps) { if (protoProps) LinearRing_defineProperties(Constructor.prototype, protoProps); if (staticProps) LinearRing_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function LinearRing_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = LinearRing_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function LinearRing_setPrototypeOf(o, p) { LinearRing_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LinearRing_setPrototypeOf(o, p); }
- 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); }; }
- function LinearRing_possibleConstructorReturn(self, call) { if (call && (LinearRing_typeof(call) === "object" || typeof call === "function")) { return call; } return LinearRing_assertThisInitialized(self); }
- function LinearRing_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function LinearRing_getPrototypeOf(o) { LinearRing_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LinearRing_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Geometry.LinearRing
- * @classdesc 几何对象线环类,是一个特殊的封闭的线串,在每次 addPoint/removePoint 之后会通过添加一个点(此点是复制的第一个点得到的)
- * 作为最后的一个点来自动关闭线环。
- * @category BaseTypes Geometry
- * @extends {SuperMap.Geometry.LineString}
- * @param {Array.<SuperMap.Geometry.Point>} points - 组成线性环的点。
- * @example
- * var points = [new SuperMap.Geometry.Point(4933.319287022352, -3337.3849141502124),
- * new SuperMap.Geometry.Point(4960.9674060199022, -3349.3316322355736),
- * new SuperMap.Geometry.Point(5006.0235999418364, -3358.8890067038628),
- * new SuperMap.Geometry.Point(5075.3145648369318, -3378.0037556404409),
- * new SuperMap.Geometry.Point(5305.19551436013, -3376.9669111768926)],
- * var linearRing = new SuperMap.Geometry.LinearRing(points);
- */
- var LinearRing = /*#__PURE__*/function (_LineString) {
- LinearRing_inherits(LinearRing, _LineString);
- var _super = LinearRing_createSuper(LinearRing);
- function LinearRing(points) {
- var _this;
- LinearRing_classCallCheck(this, LinearRing);
- _this = _super.call(this, points);
- /**
- * @member {Array.<string>} [SuperMap.Geometry.LinearRing.prototype.componentTypes=["SuperMap.Geometry.Point"]]
- * @description components 存储的的几何对象所支持的几何类型数组,为空表示类型不受限制。
- * @readonly
- */
- _this.componentTypes = ["SuperMap.Geometry.Point"];
- _this.CLASS_NAME = "SuperMap.Geometry.LinearRing";
- _this.geometryType = "LinearRing";
- return _this;
- }
- /**
- * @function SuperMap.Geometry.LinearRing.prototype.addComponent
- * @description 添加一个点到几何图形数组中,如果这个点将要被添加到组件数组的末端,并且与数组中已经存在的最后一个点相同,
- * 重复的点是不能被添加的。这将影响未关闭环的关闭。
- * 这个方法可以通过将非空索引(组件数组的下标)作为第二个参数重写。
- * @param {SuperMap.Geometry.Point} point - 点对象。
- * @param {integer} [index] - 插入组件数组的下标。
- * @returns {boolean} 点对象是否添加成功。
- */
- LinearRing_createClass(LinearRing, [{
- key: "addComponent",
- value: function addComponent(point, index) {
- var added = false; //remove last point
- var lastPoint = this.components.pop(); // given an index, add the point
- // without an index only add non-duplicate points
- if (index != null || !point.equals(lastPoint)) {
- added = LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, arguments);
- } //append copy of first point
- var firstPoint = this.components[0];
- LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, [firstPoint]);
- return added;
- }
- /**
- * @function SuperMap.Geometry.LinearRing.prototype.removeComponent
- * @description 从几何组件中删除一个点。
- * @param {SuperMap.Geometry.Point} point - 点对象。
- * @returns {boolean} 点对象是否删除。
- */
- }, {
- key: "removeComponent",
- value: function removeComponent(point) {
- // eslint-disable-line no-unused-vars
- var removed = this.components && this.components.length > 3;
- if (removed) {
- //remove last point
- this.components.pop(); //remove our point
- LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "removeComponent", this).apply(this, arguments); //append copy of first point
- var firstPoint = this.components[0];
- LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, [firstPoint]);
- }
- return removed;
- }
- /**
- * @function SuperMap.Geometry.LinearRing.prototype.getArea
- * @description 获得当前几何对象区域大小,如果是沿顺时针方向的环则是正值,否则为负值。
- * @returns {float} 环的面积。
- */
- }, {
- key: "getArea",
- value: function getArea() {
- var area = 0.0;
- if (this.components && this.components.length > 2) {
- var sum = 0.0;
- for (var i = 0, len = this.components.length; i < len - 1; i++) {
- var b = this.components[i];
- var c = this.components[i + 1];
- sum += (b.x + c.x) * (c.y - b.y);
- }
- area = -sum / 2.0;
- }
- return area;
- }
- /**
- * @function SuperMap.Geometry.LinearRing.prototype.getVertices
- * @description 返回几何图形的所有点的列表。
- * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false ,则返回非端点的顶点,如果没有设置此参数,则返回所有顶点。
- * @returns {Array} 几何对象所有点的列表。
- */
- }, {
- key: "getVertices",
- value: function getVertices(nodes) {
- return nodes === true ? [] : this.components.slice(0, this.components.length - 1);
- }
- }]);
- return LinearRing;
- }(LineString);
- SuperMap.Geometry.LinearRing = LinearRing;
- ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiLineString.js
- 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); }
- function MultiLineString_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); }
- function MultiLineString_setPrototypeOf(o, p) { MultiLineString_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiLineString_setPrototypeOf(o, p); }
- 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); }; }
- function MultiLineString_possibleConstructorReturn(self, call) { if (call && (MultiLineString_typeof(call) === "object" || typeof call === "function")) { return call; } return MultiLineString_assertThisInitialized(self); }
- function MultiLineString_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function MultiLineString_getPrototypeOf(o) { MultiLineString_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiLineString_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Geometry.MultiLineString
- * @classdesc 几何对象多线类。
- * @category BaseTypes Geometry
- * @extends {SuperMap.Geometry.Collection}
- * @param {Array.<SuperMap.Geometry.LineString>} components - LineString 数组。
- * @example
- * var multi = new SuperMap.Geometry.MultiLineString([
- * new SuperMap.Geometry.LineString([
- * new SuperMap.Geometry.Point(1, 0),
- * new SuperMap.Geometry.Point(0, 1)
- * ])
- * ]);
- */
- var MultiLineString = /*#__PURE__*/function (_Collection) {
- MultiLineString_inherits(MultiLineString, _Collection);
- var _super = MultiLineString_createSuper(MultiLineString);
- function MultiLineString(components) {
- var _this;
- MultiLineString_classCallCheck(this, MultiLineString);
- _this = _super.call(this, components);
- /**
- * @member {Array.<string>} [SuperMap.Geometry.MultiLineString.prototype.componentTypes=["SuperMap.Geometry.LineString"]]
- * @description components 存储的的几何对象所支持的几何类型数组。
- * @readonly
- */
- _this.componentTypes = ["SuperMap.Geometry.LineString"];
- _this.CLASS_NAME = "SuperMap.Geometry.MultiLineString";
- _this.geometryType = "MultiLineString";
- return _this;
- }
- return MultiLineString;
- }(Collection);
- SuperMap.Geometry.MultiLineString = MultiLineString;
- ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiPolygon.js
- 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); }
- function MultiPolygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); }
- function MultiPolygon_setPrototypeOf(o, p) { MultiPolygon_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiPolygon_setPrototypeOf(o, p); }
- 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); }; }
- function MultiPolygon_possibleConstructorReturn(self, call) { if (call && (MultiPolygon_typeof(call) === "object" || typeof call === "function")) { return call; } return MultiPolygon_assertThisInitialized(self); }
- function MultiPolygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function MultiPolygon_getPrototypeOf(o) { MultiPolygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiPolygon_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Geometry.MultiPolygon
- * @classdesc 几何对象多多边形类。
- * @category BaseTypes Geometry
- * @extends {SuperMap.Geometry.Collection}
- * @param {Array.<SuperMap.Geometry.Polygon>} components - 形成 MultiPolygon 的多边形数组。
- * @example
- * var points1 = [new SuperMap.Geometry.Point(10,10),new SuperMap.Geometry.Point(0,0)];
- * 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)];
- *
- * var linearRing1 = new SuperMap.Geometry.LinearRing(points1);
- * var linearRing2 = new SuperMap.Geometry.LinearRing(points2);
- *
- * var polygon1 = new SuperMap.Geometry.Polygon([linearRing1]);
- * var polygon2 = new SuperMap.Geometry.Polygon([linearRing2]);
- *
- * var multiPolygon1 = new SuperMap.Geometry.MultiPolygon([polygon1,polygon2]);
- */
- var MultiPolygon = /*#__PURE__*/function (_Collection) {
- MultiPolygon_inherits(MultiPolygon, _Collection);
- var _super = MultiPolygon_createSuper(MultiPolygon);
- function MultiPolygon(components) {
- var _this;
- MultiPolygon_classCallCheck(this, MultiPolygon);
- _this = _super.call(this, components);
- /**
- * @member {Array.<string>} [SuperMap.Geometry.MultiPolygon.prototype.componentTypes=["SuperMap.Geometry.Polygon"]]
- * @description components 存储的的几何对象所支持的几何类型数组。
- * @readonly
- */
- _this.componentTypes = ["SuperMap.Geometry.Polygon"];
- _this.CLASS_NAME = "SuperMap.Geometry.MultiPolygon";
- _this.geometryType = "MultiPolygon";
- return _this;
- }
- return MultiPolygon;
- }(Collection);
- SuperMap.Geometry.MultiPolygon = MultiPolygon;
- ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Polygon.js
- 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); }
- function Polygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Polygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) Polygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) Polygon_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Polygon_setPrototypeOf(o, p) { Polygon_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Polygon_setPrototypeOf(o, p); }
- 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); }; }
- function Polygon_possibleConstructorReturn(self, call) { if (call && (Polygon_typeof(call) === "object" || typeof call === "function")) { return call; } return Polygon_assertThisInitialized(self); }
- function Polygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Polygon_getPrototypeOf(o) { Polygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Polygon_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Geometry.Polygon
- * @classdesc 多边形几何对象类。
- * @category BaseTypes Geometry
- * @extends {SuperMap.Geometry.Collection}
- * @param {Array.<SuperMap.Geometry.LinearRing>} components - 用来生成多边形的线环数组。
- * @example
- * var points =[new SuperMap.Geometry.Point(0,4010338),
- * new SuperMap.Geometry.Point(1063524,4010338),
- * new SuperMap.Geometry.Point(1063524,3150322),
- * new SuperMap.Geometry.Point(0,3150322)
- * ],
- * var linearRings = new SuperMap.Geometry.LinearRing(points),
- * var region = new SuperMap.Geometry.Polygon([linearRings]);
- */
- var Polygon = /*#__PURE__*/function (_Collection) {
- Polygon_inherits(Polygon, _Collection);
- var _super = Polygon_createSuper(Polygon);
- function Polygon(components) {
- var _this;
- Polygon_classCallCheck(this, Polygon);
- _this = _super.call(this, components);
- /**
- * @member {Array.<string>} [SuperMap.Geometry.Polygon.prototype.componentTypes=["SuperMap.Geometry.LinearRing"]]
- * @description components 存储的的几何对象所支持的几何类型数组。
- * @readonly
- */
- _this.componentTypes = ["SuperMap.Geometry.LinearRing"];
- _this.CLASS_NAME = "SuperMap.Geometry.Polygon";
- _this.geometryType = "Polygon";
- return _this;
- }
- /**
- * @function SuperMap.Geometry.Polygon.prototype.getArea
- * @description 获得区域面积,从区域的外部口径减去计此区域内部口径算所得的面积。
- * @returns {float} 几何对象的面积。
- */
- Polygon_createClass(Polygon, [{
- key: "getArea",
- value: function getArea() {
- var area = 0.0;
- if (this.components && this.components.length > 0) {
- area += Math.abs(this.components[0].getArea());
- for (var i = 1, len = this.components.length; i < len; i++) {
- area -= Math.abs(this.components[i].getArea());
- }
- }
- return area;
- }
- }]);
- return Polygon;
- }(Collection);
- SuperMap.Geometry.Polygon = Polygon;
- ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Rectangle.js
- 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); }
- function Rectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Rectangle_createClass(Constructor, protoProps, staticProps) { if (protoProps) Rectangle_defineProperties(Constructor.prototype, protoProps); if (staticProps) Rectangle_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Rectangle_setPrototypeOf(o, p) { Rectangle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Rectangle_setPrototypeOf(o, p); }
- 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); }; }
- function Rectangle_possibleConstructorReturn(self, call) { if (call && (Rectangle_typeof(call) === "object" || typeof call === "function")) { return call; } return Rectangle_assertThisInitialized(self); }
- function Rectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Rectangle_getPrototypeOf(o) { Rectangle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Rectangle_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Geometry.Rectangle
- * @classdesc 矩形几何对象类。
- * @category BaseTypes Geometry
- * @param {float} x - 矩形左下角点的横坐标。
- * @param {float} y - 矩形左下角点的纵坐标。
- * @param {float} width - 矩形的宽度。
- * @param {float} height - 矩形的高度。
- * @extends {SuperMap.Geometry}
- * @example
- * //x 为矩形左下角点的横坐标;y 为矩形左下角点的纵坐标;w 为矩形的宽度;h 为矩形的高度
- * var x = 1;
- * var y = 2;
- * var w = 10;
- * var h = 20;
- * var recttangle = new SuperMap.Geometry.Rectangle(x, y, w, h);
- */
- var Rectangle = /*#__PURE__*/function (_Geometry) {
- Rectangle_inherits(Rectangle, _Geometry);
- var _super = Rectangle_createSuper(Rectangle);
- function Rectangle(x, y, width, height) {
- var _this;
- Rectangle_classCallCheck(this, Rectangle);
- _this = _super.call(this, x, y, width, height);
- /**
- * @member {float} SuperMap.Geometry.Rectangle.prototype.x
- * @description 矩形左下角点的横坐标。
- */
- _this.x = x;
- /**
- * @member {float} SuperMap.Geometry.Rectangle.prototype.y
- * @description 矩形左下角点的纵坐标。
- */
- _this.y = y;
- /**
- * @member {float} SuperMap.Geometry.Rectangle.prototype.width
- * @description 矩形的宽度。
- */
- _this.width = width;
- /**
- * @member {float} SuperMap.Geometry.Rectangle.prototype.height
- * @description 矩形的高度。
- */
- _this.height = height;
- _this.CLASS_NAME = "SuperMap.Geometry.Rectangle";
- _this.geometryType = "Rectangle";
- return _this;
- }
- /**
- * @function SuperMap.Geometry.Rectangle.prototype.calculateBounds
- * @description 计算出此矩形对象的 bounds。
- */
- Rectangle_createClass(Rectangle, [{
- key: "calculateBounds",
- value: function calculateBounds() {
- this.bounds = new Bounds(this.x, this.y, this.x + this.width, this.y + this.height);
- }
- /**
- * @function SuperMap.Geometry.Rectangle.prototype.getArea
- * @description 获取矩形对象的面积。
- * @returns {float} 矩形对象面积。
- */
- }, {
- key: "getArea",
- value: function getArea() {
- var area = this.width * this.height;
- return area;
- }
- }]);
- return Rectangle;
- }(Geometry);
- SuperMap.Geometry.Rectangle = Rectangle;
- ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/common/commontypes/Credential.js
- function Credential_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Credential_createClass(Constructor, protoProps, staticProps) { if (protoProps) Credential_defineProperties(Constructor.prototype, protoProps); if (staticProps) Credential_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Credential
- * @category Security
- * @classdesc SuperMap 的安全证书类,其中包括 token 等安全验证信息。</br>
- * 需要使用用户名和密码在:"http://localhost:8090/iserver/services/security/tokens" 下申请 value。</br>
- * 获得形如:"2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ.." 的 value。</br>
- * 目前支持的功能包括:地图服务、专题图、量算、查询、公交换乘、空间分析、网络分析,不支持轮询功能。</br>
- * @param {string} value - 访问受安全限制的服务时用于通过安全认证的验证信息。
- * @param {string} [name='token'] - 验证信息前缀,name=value 部分的 name 部分。
- * @example
- * var pixcel = new SuperMap.Credential("valueString","token");
- * pixcel.destroy();
- */
- var Credential = /*#__PURE__*/function () {
- function Credential(value, name) {
- Credential_classCallCheck(this, Credential);
- /**
- * @member {string} SuperMap.Bounds.prototype.value
- * @description 访问受安全限制的服务时用于通过安全认证的验证信息。
- */
- this.value = value ? value : "";
- /**
- * @member {string} [SuperMap.Bounds.prototype.name='token']
- * @description 验证信息前缀,name=value 部分的 name 部分。
- */
- this.name = name ? name : "token";
- this.CLASS_NAME = "SuperMap.Credential";
- }
- /**
- * @function SuperMap.Credential.prototype.getUrlParameters
- * @example
- * var credential = new SuperMap.Credential("valueString","token");
- * //这里 str = "token=valueString";
- * var str = credential.getUrlParameters();
- * @returns {string} 返回安全信息组成的 url 片段。
- */
- Credential_createClass(Credential, [{
- key: "getUrlParameters",
- value: function getUrlParameters() {
- //当需要其他安全信息的时候,则需要return this.name + "=" + this.value + "&" + "...";的形式添加。
- return this.name + "=" + this.value;
- }
- /**
- * @function SuperMap.Bounds.prototype.getValue
- * @description 获取 value。
- * @example
- * var credential = new SuperMap.Credential("2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..","token");
- * //这里 str = "2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..";
- * var str = credential.getValue();
- * @returns {string} 返回 value 字符串,在 iServer 服务下该 value 值即为 token 值。
- */
- }, {
- key: "getValue",
- value: function getValue() {
- return this.value;
- }
- /**
- *
- * @function SuperMap.Credential.prototype.destroy
- * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
- * @example
- * var credential = new SuperMap.Credential("valueString","token");
- * credential.destroy();
- */
- }, {
- key: "destroy",
- value: function destroy() {
- this.value = null;
- this.name = null;
- }
- }]);
- return Credential;
- }();
- /**
- * @member {SuperMap.Credential} SuperMap.Credential.CREDENTIAL
- * @description 这个对象保存一个安全类的实例,在服务端需要安全验证的时候必须进行设置。
- * @constant
- * @example
- * 代码实例:
- * // 当iServer启用服务安全的时候,下边的代码是必须的。安全证书类能够接收一个value和一个name参数。
- * var value = "(以iServer为例,这里是申请的token值)";
- * var name = "token";
- * // 默认name参数为token,所以当使用iServer服务的时候可以不进行设置。
- * SuperMap.Credential.CREDENTIAL = new SuperMap.Credential(value, name);
- *
- */
- Credential.CREDENTIAL = null;
- SuperMap.Credential = Credential;
- ;// CONCATENATED MODULE: ./src/common/commontypes/Date.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @name Date
- * @memberOf SuperMap
- * @namespace
- * @category BaseTypes Util
- * @description 包含 parse、toISOString 方法的实现,两个方法用来解析 RFC 3339 日期,遵循 ECMAScript 5 规范。
- */
- var DateExt = SuperMap.Date = {
- /**
- * @description 生成代表一个具体的日期字符串,该日期遵循 ISO 8601 标准(详情查看{@link http://tools.ietf.org/html/rfc3339})。
- * @example
- * var dateString = SuperMap.Date.toISOString(new Date());
- * @param {Date} date - 日期对象。
- * @returns {string} 一个代表日期的字符串。(例如 "2010-08-07T16:58:23.123Z")。
- */
- toISOString: function () {
- //标准的Date会存在toISOString方法,可以直接调用
- if ("toISOString" in Date.prototype) {
- return function (date) {
- return date.toISOString();
- };
- } else {
- // 部分浏览器没有,就得自己组合,组合后的字符串规则不变
- var pad = function pad(num, len) {
- var str = num + "";
- while (str.length < len) {
- str = "0" + str;
- }
- return str;
- };
- return function (date) {
- var str;
- if (isNaN(date.getTime())) {
- // ECMA-262 says throw RangeError, Firefox returns
- // "Invalid Date"
- str = "Invalid Date";
- } else {
- 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";
- }
- return str;
- };
- }
- }(),
- /**
- * @description 从一个字符串生成一个日期对象。
- * @example
- * var date = SuperMap.Date.parse("2010-08-07");
- * @param {string} str - 代表日期的字符串。(例如: "2010", "2010-08", "2010-08-07", "2010-08-07T16:58:23.123Z","2010-08-07T11:58:23.123-06")。
- * @returns {Date} 日期对象,如果字符串无法被解析,则返回一个无效的日期。(例如 isNaN(date.getTime()))。
- */
- parse: function parse(str) {
- var date;
- 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)?$/);
- if (match && (match[1] || match[7])) {
- // must have at least year or time
- var year = parseInt(match[1], 10) || 0;
- var month = parseInt(match[2], 10) - 1 || 0;
- var day = parseInt(match[3], 10) || 1;
- date = new Date(Date.UTC(year, month, day)); // optional time
- var type = match[7];
- if (type) {
- var hours = parseInt(match[4], 10);
- var minutes = parseInt(match[5], 10);
- var secFrac = parseFloat(match[6]);
- var seconds = secFrac | 0;
- var milliseconds = Math.round(1000 * (secFrac - seconds));
- date.setUTCHours(hours, minutes, seconds, milliseconds); // check offset
- if (type !== "Z") {
- var hoursOffset = parseInt(type, 10);
- var minutesOffset = parseInt(match[8], 10) || 0;
- var offset = -1000 * (60 * (hoursOffset * 60) + minutesOffset * 60);
- date = new Date(date.getTime() + offset);
- }
- }
- } else {
- date = new Date("invalid");
- }
- return date;
- }
- };
- ;// CONCATENATED MODULE: ./src/common/commontypes/Event.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @name Event
- * @memberOf SuperMap
- * @namespace
- * @description 事件处理函数.
- */
- var Event = SuperMap.Event = {
- /**
- * @description A hash table cache of the event observers. Keyed by element._eventCacheID
- * @type {boolean}
- * @default false
- */
- observers: false,
- /**
- * @description KEY_SPACE
- * @type {number}
- * @default 32
- */
- KEY_SPACE: 32,
- /**
- * @description KEY_BACKSPACE
- * @type {number}
- * @default 8
- */
- KEY_BACKSPACE: 8,
- /**
- * @description KEY_TAB
- * @type {number}
- * @default 9
- */
- KEY_TAB: 9,
- /**
- * @description KEY_RETURN
- * @type {number}
- * @default 13
- */
- KEY_RETURN: 13,
- /**
- * @description KEY_ESC
- * @type {number}
- * @default 27
- */
- KEY_ESC: 27,
- /**
- * @description KEY_LEFT
- * @type {number}
- * @default 37
- */
- KEY_LEFT: 37,
- /**
- * @description KEY_UP
- * @type {number}
- * @default 38
- */
- KEY_UP: 38,
- /**
- * @description KEY_RIGHT
- * @type {number}
- * @default 39
- */
- KEY_RIGHT: 39,
- /**
- * @description KEY_DOWN
- * @type {number}
- * @default 40
- */
- KEY_DOWN: 40,
- /**
- * @description KEY_DELETE
- * @type {number}
- * @default 46
- */
- KEY_DELETE: 46,
- /**
- * @description Cross browser event element detection.
- * @param {Event} event - The event
- * @returns {HTMLElement} The element that caused the event
- */
- element: function element(event) {
- return event.target || event.srcElement;
- },
- /**
- * @description Determine whether event was caused by a single touch
- * @param {Event} event - The event
- * @returns {boolean}
- */
- isSingleTouch: function isSingleTouch(event) {
- return event.touches && event.touches.length === 1;
- },
- /**
- * @description Determine whether event was caused by a multi touch
- * @param {Event} event - The event
- * @returns {boolean}
- */
- isMultiTouch: function isMultiTouch(event) {
- return event.touches && event.touches.length > 1;
- },
- /**
- * @description Determine whether event was caused by a left click.
- * @param {Event} event - The event
- * @returns {boolean}
- */
- isLeftClick: function isLeftClick(event) {
- return event.which && event.which === 1 || event.button && event.button === 1;
- },
- /**
- * @description Determine whether event was caused by a right mouse click.
- * @param {Event} event - The event
- * @returns {boolean}
- */
- isRightClick: function isRightClick(event) {
- return event.which && event.which === 3 || event.button && event.button === 2;
- },
- /**
- * @description Stops an event from propagating.
- * @param {Event} event - The event
- * @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
- */
- stop: function stop(event, allowDefault) {
- if (!allowDefault) {
- if (event.preventDefault) {
- event.preventDefault();
- } else {
- event.returnValue = false;
- }
- }
- if (event.stopPropagation) {
- event.stopPropagation();
- } else {
- event.cancelBubble = true;
- }
- },
- /**
- * @param {Event} event - The event。
- * @param {string} tagName - html 标签名。
- * @returns {HTMLElement} The first node with the given tagName, starting from the node the event was triggered on and traversing the DOM upwards
- */
- findElement: function findElement(event, tagName) {
- var element = SuperMap.Event.element(event);
- while (element.parentNode && (!element.tagName || element.tagName.toUpperCase() != tagName.toUpperCase())) {
- element = element.parentNode;
- }
- return element;
- },
- /**
- * @description 监听事件,注册事件处理方法。
- * @param {(HTMLElement|string)} elementParam - 待监听的 DOM 对象或者其 ID 标识。
- * @param {string} name - 监听事件的类别名称。
- * @param {function} observer - 注册的事件处理方法。
- * @param {boolean} [useCapture=false] - 是否捕获。
- */
- observe: function observe(elementParam, name, observer, useCapture) {
- var element = Util.getElement(elementParam);
- useCapture = useCapture || false;
- if (name === 'keypress' && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.attachEvent)) {
- name = 'keydown';
- } //if observers cache has not yet been created, create it
- if (!this.observers) {
- this.observers = {};
- } //if not already assigned, make a new unique cache ID
- if (!element._eventCacheID) {
- var idPrefix = "eventCacheID_";
- if (element.id) {
- idPrefix = element.id + "_" + idPrefix;
- }
- element._eventCacheID = Util.createUniqueID(idPrefix);
- }
- var cacheID = element._eventCacheID; //if there is not yet a hash entry for this element, add one
- if (!this.observers[cacheID]) {
- this.observers[cacheID] = [];
- } //add a new observer to this element's list
- this.observers[cacheID].push({
- 'element': element,
- 'name': name,
- 'observer': observer,
- 'useCapture': useCapture
- }); //add the actual browser event listener
- if (element.addEventListener) {
- if (name === 'mousewheel') {
- // https://www.chromestatus.com/features/6662647093133312
- element.addEventListener(name, observer, {
- useCapture: useCapture,
- passive: false
- });
- } else {
- element.addEventListener(name, observer, useCapture);
- }
- } else if (element.attachEvent) {
- element.attachEvent('on' + name, observer);
- }
- },
- /**
- * @description Given the id of an element to stop observing, cycle through the
- * element's cached observers, calling stopObserving on each one,
- * skipping those entries which can no longer be removed.
- *
- * @param {(HTMLElement|string)} elementParam -
- */
- stopObservingElement: function stopObservingElement(elementParam) {
- var element = Util.getElement(elementParam);
- var cacheID = element._eventCacheID;
- this._removeElementObservers(SuperMap.Event.observers[cacheID]);
- },
- /**
- * @param {Array.<Object>} elementObservers - Array of (element, name,
- * observer, usecapture) objects,
- * taken directly from hashtable
- */
- _removeElementObservers: function _removeElementObservers(elementObservers) {
- if (elementObservers) {
- for (var i = elementObservers.length - 1; i >= 0; i--) {
- var entry = elementObservers[i];
- var args = new Array(entry.element, entry.name, entry.observer, entry.useCapture);
- SuperMap.Event.stopObserving.apply(this, args);
- }
- }
- },
- /**
- * @description 移除事件监听和注册的事件处理方法。注意:事件的移除和监听相对应,移除时的各属性信息必须监听时
- * 保持一致才能确保事件移除成功。
- * @param {(HTMLElement|string)} elementParam - 被监听的 DOM 元素或者其 ID。
- * @param {string} name - 需要移除的被监听事件名称。
- * @param {function} observer - 需要移除的事件处理方法。
- * @param {boolean} [useCapture=false] - 是否捕获。
- * @returns {boolean} Whether or not the event observer was removed
- */
- stopObserving: function stopObserving(elementParam, name, observer, useCapture) {
- useCapture = useCapture || false;
- var element = Util.getElement(elementParam);
- var cacheID = element._eventCacheID;
- if (name === 'keypress') {
- if (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.detachEvent) {
- name = 'keydown';
- }
- } // find element's entry in this.observers cache and remove it
- var foundEntry = false;
- var elementObservers = SuperMap.Event.observers[cacheID];
- if (elementObservers) {
- // find the specific event type in the element's list
- var i = 0;
- while (!foundEntry && i < elementObservers.length) {
- var cacheEntry = elementObservers[i];
- if (cacheEntry.name === name && cacheEntry.observer === observer && cacheEntry.useCapture === useCapture) {
- elementObservers.splice(i, 1);
- if (elementObservers.length == 0) {
- delete SuperMap.Event.observers[cacheID];
- }
- foundEntry = true;
- break;
- }
- i++;
- }
- } //actually remove the event listener from browser
- if (foundEntry) {
- if (element.removeEventListener) {
- element.removeEventListener(name, observer, useCapture);
- } else if (element && element.detachEvent) {
- element.detachEvent('on' + name, observer);
- }
- }
- return foundEntry;
- },
- /**
- * @description Cycle through all the element entries in the events cache and call
- * stopObservingElement on each.
- */
- unloadCache: function unloadCache() {
- // check for SuperMap.Event before checking for observers, because
- // SuperMap.Event may be undefined in IE if no map instance was
- // created
- if (SuperMap.Event && SuperMap.Event.observers) {
- for (var cacheID in SuperMap.Event.observers) {
- var elementObservers = SuperMap.Event.observers[cacheID];
- SuperMap.Event._removeElementObservers.apply(this, [elementObservers]);
- }
- SuperMap.Event.observers = false;
- }
- },
- CLASS_NAME: "SuperMap.Event"
- };
- SuperMap.Event = Event;
- /* prevent memory leaks in IE */
- SuperMap.Event.observe(window, 'unload', SuperMap.Event.unloadCache, false);
- ;// CONCATENATED MODULE: ./src/common/commontypes/Events.js
- 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); }
- function Events_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Events_createClass(Constructor, protoProps, staticProps) { if (protoProps) Events_defineProperties(Constructor.prototype, protoProps); if (staticProps) Events_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Events
- * @classdesc 事件类。
- * @param {Object} object - 当前事件对象被添加到的 JS 对象。
- * @param {HTMLElement} element - 响应浏览器事件的 DOM 元素。
- * @param {Array.<string>} eventTypes - 自定义应用事件的数组。
- * @param {boolean} [fallThrough=false] - 是否允许事件处理之后向上传递(冒泡),为 false 的时候阻止事件冒泡。
- * @param {Object} options - 事件对象选项。
- */
- var Events = /*#__PURE__*/function () {
- function Events(object, element, eventTypes, fallThrough, options) {
- Events_classCallCheck(this, Events);
- /**
- * @member {Array.<string>} SuperMap.Events.prototype.BROWSER_EVENTS
- * @description 支持的事件。
- * @constant
- * @default [
- "mouseover", "mouseout","mousedown", "mouseup", "mousemove",
- "click", "dblclick", "rightclick", "dblrightclick","resize",
- "focus", "blur","touchstart", "touchmove", "touchend","keydown",
- "MSPointerDown", "MSPointerUp", "pointerdown", "pointerup",
- "MSGestureStart", "MSGestureChange", "MSGestureEnd","contextmenu"
- ]
- */
- 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"];
- /**
- * @member {Object} SuperMap.Events.prototype.listeners
- * @description Hashtable of Array(function): events listener functions
- */
- this.listeners = {};
- /**
- * @member {Object} SuperMap.Events.prototype.object
- * @description 发布应用程序事件的对象。
- */
- this.object = object;
- /**
- * @member {HTMLElement} SuperMap.Events.prototype.element
- * @description 接受浏览器事件的 DOM 节点。
- */
- this.element = null;
- /**
- * @member {Array.<string>} SuperMap.Events.prototype.eventTypes
- * @description 支持的事件类型列表。
- */
- this.eventTypes = [];
- /**
- * @member {function} SuperMap.Events.prototype.eventHandler
- * @description 绑定在元素上的事件处理器对象。
- */
- this.eventHandler = null;
- /**
- * @member {boolean} [SuperMap.Events.prototype.fallThrough=false]
- * @description 是否允许事件处理之后向上传递(冒泡),为 false 的时候阻止事件冒泡。
- */
- this.fallThrough = fallThrough;
- /**
- * @member {boolean} [SuperMap.Events.prototype.includeXY=false]
- * @description 判断是否让 xy 属性自动创建到浏览器上的鼠标事件,一般设置为 false,如果设置为 true,鼠标事件将会在事件传递过程中自动产生 xy 属性。
- * 可根据事件对象的 'evt.object' 属性在相关的事件句柄上调用 getMousePosition 函数。这个选项习惯默认为 false 的原因在于,当创建一个
- * 事件对象,其主要目的是管理。在一个 div 的相对定位的鼠标事件,将其设为 true 也是有意义的。这个选项也可以用来控制是否抵消缓存。如果
- * 设为 false 不抵消,如果设为 true,用 this.clearMouseCache() 清除缓存偏移(边界元素偏移,元素在页面的位置偏移)。
- * @example
- * function named(evt) {
- * this.xy = this.object.events.getMousePosition(evt);
- * }
- */
- this.includeXY = false;
- /**
- * @member {Object} SuperMap.Events.prototype.extensions
- * @description 事件扩展。Keys 代表事件类型,values 代表事件对象。
- * @example
- * 以扩展 "foostart" 和 "fooend" 事件为例。展示替换 css 属性为 foo 的元素的 click 事件。
- *
- * SuperMap.Events.foostart = SuperMap.Class({
- * initialize: function(target) {
- * this.target = target;
- * this.target.register("click", this, this.doStuff, {extension: true});
- * // only required if extension provides more than one event type
- * this.target.extensions["foostart"] = true;
- * this.target.extensions["fooend"] = true;
- * },
- * destroy: function() {
- * var target = this.target;
- * target.unregister("click", this, this.doStuff);
- * delete this.target;
- * // only required if extension provides more than one event type
- * delete target.extensions["foostart"];
- * delete target.extensions["fooend"];
- * },
- * doStuff: function(evt) {
- * var propagate = true;
- * if (SuperMap.Event.element(evt).className === "foo") {
- * propagate = false;
- * var target = this.target;
- * target.triggerEvent("foostart");
- * window.setTimeout(function() {
- * target.triggerEvent("fooend");
- * }, 1000);
- * }
- * return propagate;
- * }
- * });
- * // only required if extension provides more than one event type
- * SuperMap.Events.fooend = SuperMap.Events.foostart;
- */
- this.extensions = {};
- /**
- * @member {Object} SuperMap.Events.prototype.extensionCount
- */
- this.extensionCount = {};
- /**
- * @member {Object} SuperMap.Events.prototype.clearMouseListener
- */
- this.clearMouseListener = null;
- Util.extend(this, options);
- if (eventTypes != null) {
- for (var i = 0, len = eventTypes.length; i < len; i++) {
- this.addEventType(eventTypes[i]);
- }
- }
- if (element != null) {
- this.attachToElement(element);
- }
- this.CLASS_NAME = "SuperMap.Events";
- }
- /**
- * @function SuperMap.Events.prototype.destroy
- * @description 移除当前要素 element 上的所有事件监听和处理。
- */
- Events_createClass(Events, [{
- key: "destroy",
- value: function destroy() {
- for (var e in this.extensions) {
- if (typeof this.extensions[e] !== "boolean") {
- this.extensions[e].destroy();
- }
- }
- this.extensions = null;
- if (this.element) {
- Event.stopObservingElement(this.element);
- if (this.element.hasScrollEvent) {
- Event.stopObserving(window, "scroll", this.clearMouseListener);
- }
- }
- this.element = null;
- this.listeners = null;
- this.object = null;
- this.eventTypes = null;
- this.fallThrough = null;
- this.eventHandler = null;
- }
- /**
- * @function SuperMap.Events.prototype.addEventType
- * @description 在此事件对象中添加新的事件类型,如果这个事件类型已经添加过了,则不做任何事情。
- * @param {string} eventName - 事件名。
- */
- }, {
- key: "addEventType",
- value: function addEventType(eventName) {
- if (!this.listeners[eventName]) {
- this.eventTypes.push(eventName);
- this.listeners[eventName] = [];
- }
- }
- /**
- * @function SuperMap.Events.prototype.attachToElement
- * @description 给 DOM 元素绑定浏览器事件。
- * @param {HTMLDOMElement} element - 绑定浏览器事件的 DOM 元素。
- */
- }, {
- key: "attachToElement",
- value: function attachToElement(element) {
- if (this.element) {
- Event.stopObservingElement(this.element);
- } else {
- // keep a bound copy of handleBrowserEvent() so that we can
- // pass the same function to both Event.observe() and .stopObserving()
- this.eventHandler = FunctionExt.bindAsEventListener(this.handleBrowserEvent, this); // to be used with observe and stopObserving
- this.clearMouseListener = FunctionExt.bind(this.clearMouseCache, this);
- }
- this.element = element;
- for (var i = 0, len = this.BROWSER_EVENTS.length; i < len; i++) {
- var eventType = this.BROWSER_EVENTS[i]; // every browser event has a corresponding application event
- // (whether it's listened for or not).
- this.addEventType(eventType); // use Prototype to register the event cross-browser
- Event.observe(element, eventType, this.eventHandler);
- } // disable dragstart in IE so that mousedown/move/up works normally
- Event.observe(element, "dragstart", Event.stop);
- }
- /**
- * @function SuperMap.Events.prototype.on
- * @description 在一个相同的范围内注册监听器的方法,此方法调用 register 函数。
- * @example
- * // 注册一个 "loadstart" 监听事件
- * events.on({"loadstart": loadStartListener});
- *
- * // 同样注册一个 "loadstart" 监听事件
- * events.register("loadstart", undefined, loadStartListener);
- *
- * // 同时为对象注册多个监听事件
- * events.on({
- * "loadstart": loadStartListener,
- * "loadend": loadEndListener,
- * scope: object
- * });
- *
- * // 同时为对象注册多个监听事件,多次调用 register 方法
- * events.register("loadstart", object, loadStartListener);
- * events.register("loadend", object, loadEndListener);
- *
- *
- * @param {Object} object - 添加监听的对象。
- */
- }, {
- key: "on",
- value: function on(object) {
- for (var type in object) {
- if (type !== "scope" && object.hasOwnProperty(type)) {
- this.register(type, object.scope, object[type]);
- }
- }
- }
- /**
- * @function SuperMap.Events.prototype.register
- * @description 在事件对象上注册一个事件。当事件被触发时,'func' 函数被调用,假设我们触发一个事件,
- * 指定 SuperMap.Bounds 作为 "obj",当事件被触发时,回调函数的上下文作为 Bounds 对象。
- * @param {string} type - 事件注册者的名字。
- * @param {Object} [obj=this.object] - 对象绑定的回调。
- * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
- * @param {(boolean|Object)} [priority] - 当为 true 时将新的监听加在事件队列的前面。
- */
- }, {
- key: "register",
- value: function register(type, obj, func, priority) {
- if (type in Events && !this.extensions[type]) {
- this.extensions[type] = new Events[type](this);
- }
- if (func != null && Util.indexOf(this.eventTypes, type) !== -1) {
- if (obj == null) {
- obj = this.object;
- }
- var listeners = this.listeners[type];
- if (!listeners) {
- listeners = [];
- this.listeners[type] = listeners;
- this.extensionCount[type] = 0;
- }
- var listener = {
- obj: obj,
- func: func
- };
- if (priority) {
- listeners.splice(this.extensionCount[type], 0, listener);
- if (Events_typeof(priority) === "object" && priority.extension) {
- this.extensionCount[type]++;
- }
- } else {
- listeners.push(listener);
- }
- }
- }
- /**
- * @function SuperMap.Events.prototype.registerPriority
- * @description 相同的注册方法,但是在前面增加新的监听者事件查询而代替到方法的结束。
- * @param {string} type - 事件注册者的名字。
- * @param {Object} [obj=this.object] - 对象绑定方面的回调。
- * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
- */
- }, {
- key: "registerPriority",
- value: function registerPriority(type, obj, func) {
- this.register(type, obj, func, true);
- }
- /**
- * @function SuperMap.Events.prototype.un
- * @description 在一个相同的范围内取消注册监听器的方法,此方法调用 unregister 函数。
- * @example
- * // 移除 "loadstart" 事件监听
- * events.un({"loadstart": loadStartListener});
- *
- * // 使用 "unregister" 方法移除 "loadstart" 事件监听
- * events.unregister("loadstart", undefined, loadStartListener);
- *
- * // 取消对象多个事件监听
- * events.un({
- * "loadstart": loadStartListener,
- * "loadend": loadEndListener,
- * scope: object
- * });
- *
- * // 取消对象多个事件监听,多次调用unregister方法。
- * events.unregister("loadstart", object, loadStartListener);
- * events.unregister("loadend", object, loadEndListener);
- *
- * @param {Object} object - 移除监听的对象。
- */
- }, {
- key: "un",
- value: function un(object) {
- for (var type in object) {
- if (type !== "scope" && object.hasOwnProperty(type)) {
- this.unregister(type, object.scope, object[type]);
- }
- }
- }
- /**
- * @function SuperMap.Events.prototype.unregister
- * @description 取消注册。
- * @param {string} type - 事件类型。
- * @param {Object} [obj=this.object] - 对象绑定方面的回调。
- * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
- */
- }, {
- key: "unregister",
- value: function unregister(type, obj, func) {
- if (obj == null) {
- obj = this.object;
- }
- var listeners = this.listeners[type];
- if (listeners != null) {
- for (var i = 0, len = listeners.length; i < len; i++) {
- if (listeners[i].obj === obj && listeners[i].func === func) {
- listeners.splice(i, 1);
- break;
- }
- }
- }
- }
- /**
- * @function SuperMap.Events.prototype.remove
- * @description 删除某个事件类型的所有监听,如果该事件类型没有注册,则不做任何操作。
- * @param {string} type - 事件类型。
- */
- }, {
- key: "remove",
- value: function remove(type) {
- if (this.listeners[type] != null) {
- this.listeners[type] = [];
- }
- }
- /**
- * @function SuperMap.Events.prototype.triggerEvent
- * @description 触发一个特定的注册事件。
- * @param {string} type - 触发事件类型。
- * @param {Event} evt - 事件对象。
- * @returns {boolean} 返回监听对象,如果返回是 false,则停止监听。
- */
- }, {
- key: "triggerEvent",
- value: function triggerEvent(type, evt) {
- var listeners = this.listeners[type]; // fast path
- if (!listeners || listeners.length == 0) {
- return undefined;
- } // prep evt object with object & div references
- if (evt == null) {
- evt = {};
- }
- evt.object = this.object;
- evt.element = this.element;
- if (!evt.type) {
- evt.type = type;
- } // execute all callbacks registered for specified type
- // get a clone of the listeners array to
- // allow for splicing during callbacks
- listeners = listeners.slice();
- var continueChain;
- for (var i = 0, len = listeners.length; i < len; i++) {
- var callback = listeners[i]; // bind the context to callback.obj
- continueChain = callback.func.apply(callback.obj, [evt]);
- if (continueChain != undefined && continueChain === false) {
- // if callback returns false, execute no more callbacks.
- break;
- }
- } // don't fall through to other DOM elements
- if (!this.fallThrough) {
- Event.stop(evt, true);
- }
- return continueChain;
- }
- /**
- * @function SuperMap.Events.prototype.handleBrowserEvent
- * @description 对 triggerEvent 函数的包装,给事件对象设置了 xy 属性(即当前鼠标点的 xy 坐标)。
- * @param {Event} evt - 事件对象。
- */
- }, {
- key: "handleBrowserEvent",
- value: function handleBrowserEvent(evt) {
- var type = evt.type,
- listeners = this.listeners[type];
- if (!listeners || listeners.length == 0) {
- // noone's listening, bail out
- return;
- } // add clientX & clientY to all events - corresponds to average x, y
- var touches = evt.touches;
- if (touches && touches[0]) {
- var x = 0;
- var y = 0;
- var num = touches.length;
- var touch;
- for (var i = 0; i < num; ++i) {
- touch = touches[i];
- x += touch.clientX;
- y += touch.clientY;
- }
- evt.clientX = x / num;
- evt.clientY = y / num;
- }
- if (this.includeXY) {
- evt.xy = this.getMousePosition(evt);
- }
- this.triggerEvent(type, evt);
- }
- /**
- * @function SuperMap.Events.prototype.clearMouseCache
- * @description 清除鼠标缓存。
- */
- }, {
- key: "clearMouseCache",
- value: function clearMouseCache() {
- this.element.scrolls = null;
- this.element.lefttop = null;
- var body = document.body;
- if (body && !((body.scrollTop != 0 || body.scrollLeft != 0) && navigator.userAgent.match(/iPhone/i))) {
- this.element.offsets = null;
- }
- }
- /**
- * @function SuperMap.Events.prototype.getMousePosition
- * @param {Event} evt - 事件对象。
- * @returns {SuperMap.Pixel} 当前的鼠标的 xy 坐标点。
- */
- }, {
- key: "getMousePosition",
- value: function getMousePosition(evt) {
- if (!this.includeXY) {
- this.clearMouseCache();
- } else if (!this.element.hasScrollEvent) {
- Event.observe(window, "scroll", this.clearMouseListener);
- this.element.hasScrollEvent = true;
- }
- if (!this.element.scrolls) {
- var viewportElement = Util.getViewportElement();
- this.element.scrolls = [viewportElement.scrollLeft, viewportElement.scrollTop];
- }
- if (!this.element.lefttop) {
- this.element.lefttop = [document.documentElement.clientLeft || 0, document.documentElement.clientTop || 0];
- }
- if (!this.element.offsets) {
- this.element.offsets = Util.pagePosition(this.element);
- }
- 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]);
- }
- }]);
- return Events;
- }();
- SuperMap.Events = Events;
- 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"];
- ;// CONCATENATED MODULE: ./src/common/commontypes/Feature.js
- function Feature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Feature_createClass(Constructor, protoProps, staticProps) { if (protoProps) Feature_defineProperties(Constructor.prototype, protoProps); if (staticProps) Feature_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature
- * @category BaseTypes Geometry
- * @classdesc 要素类组合了地理和属性,Feature 类同时具有 marker 和 lonlat 属性。
- * @param {SuperMap.Layer} layer - 图层。
- * @param {SuperMap.LonLat} lonlat - 经纬度。
- * @param {Object} data - 数据对象。
- */
- var Feature = /*#__PURE__*/function () {
- function Feature(layer, lonlat, data) {
- Feature_classCallCheck(this, Feature);
- this.CLASS_NAME = "SuperMap.Feature";
- /**
- * @deprecated
- * @member {SuperMap.Layer} SuperMap.Feature.prototype.layer
- * @description 图层。
- */
- this.layer = layer;
- /**
- * @member {string} SuperMap.Feature.prototype.id
- * @description 要素 ID。
- */
- this.id = Util.createUniqueID(this.CLASS_NAME + "_");
- /**
- * @member {SuperMap.LonLat} SuperMap.Feature.prototype.lonlat
- * @description 经纬度。
- *
- */
- this.lonlat = lonlat;
- /**
- * @member {Object} SuperMap.Feature.prototype.data
- * @description 数据对象。
- */
- this.data = data != null ? data : {};
- }
- /**
- * @function SuperMap.Feature.prototype.destroy
- * @description 释放相关资源。
- */
- Feature_createClass(Feature, [{
- key: "destroy",
- value: function destroy() {
- this.id = null;
- this.lonlat = null;
- this.data = null;
- }
- }]);
- return Feature;
- }();
- SuperMap.Feature = Feature;
- ;// CONCATENATED MODULE: ./src/common/commontypes/Vector.js
- 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); }
- function Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Vector_createClass(Constructor, protoProps, staticProps) { if (protoProps) Vector_defineProperties(Constructor.prototype, protoProps); if (staticProps) Vector_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Vector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Vector_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function Vector_setPrototypeOf(o, p) { Vector_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Vector_setPrototypeOf(o, p); }
- 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); }; }
- function Vector_possibleConstructorReturn(self, call) { if (call && (Vector_typeof(call) === "object" || typeof call === "function")) { return call; } return Vector_assertThisInitialized(self); }
- function Vector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Vector_getPrototypeOf(o) { Vector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Vector_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.Vector
- * @category BaseTypes Geometry
- * @classdesc 矢量要素类。该类具有 Geometry 属性存放几何信息,
- * attributes 属性存放非几何信息,另外还包含了 style 属性,用来定义矢量要素的样式,
- * 其中,默认的样式在 {@link SuperMap.Feature.Vector.style} 类中定义,如果没有特别的指定将使用默认的样式。
- * @extends {SuperMap.Feature}
- * @param {SuperMap.Geometry} geometry - 代表要素的几何形状。
- * @param {Object} [attributes] - 描述要素的任意的可序列化属性,将要映射到 attributes 属性中的对象。
- * @param {Object} [style] - 样式对象。
- * @example
- * var geometry = new SuperMap.Geometry.Point(-115,10);
- * var style = {
- * strokeColor:"#339933",
- * strokeOpacity:1,
- * strokeWidth:3,
- * pointRadius:6
- * }
- * var pointFeature = new SuperMap.Feature.Vector(geometry,null,style);
- * vectorLayer.addFeatures(pointFeature);
- */
- var Vector = /*#__PURE__*/function (_Feature) {
- Vector_inherits(Vector, _Feature);
- var _super = Vector_createSuper(Vector);
- function Vector(geometry, attributes, style) {
- var _this;
- Vector_classCallCheck(this, Vector);
- _this = _super.call(this, null, null, attributes);
- /**
- * @member {string} SuperMap.Feature.Vector.prototype.fid
- * @description fid
- */
- _this.fid = null;
- /**
- * @member {SuperMap.Geometry} SuperMap.Feature.Vector.prototype.geometry
- * @description 该属性用于存放几何信息。
- */
- _this.geometry = geometry ? geometry : null;
- /**
- * @member {Object} SuperMap.Feature.Vector.prototype.attributes
- * @description 描述要素的任意的可序列化属性。
- */
- _this.attributes = {};
- if (attributes) {
- _this.attributes = Util.extend(_this.attributes, attributes);
- }
- /**
- * @member {SuperMap.Bounds} SuperMap.Feature.Vector.prototype.bounds
- * @description The box bounding that feature's geometry, that
- * property can be set by an <SuperMap.Format> object when
- * deserializing the feature, so in most cases it represents an
- * information set by the server.
- */
- _this.bounds = null;
- /**
- * @member {string} SuperMap.Feature.Vector.prototype.state
- * @description state
- */
- _this.state = null;
- /**
- * @member {Object} SuperMap.Feature.Vector.prototype.style
- * @description 要素的样式属性,地图查询返回的 feature 的 style,8C 变为null。
- */
- _this.style = style ? style : null;
- /**
- * @member {string} SuperMap.Feature.Vector.prototype.url
- * @description 如果设置了这个属性,在更新或者删除要素时需要考虑 {@link SuperMap.HTTP} 。
- */
- _this.url = null;
- _this.lonlat = null;
- _this.CLASS_NAME = "SuperMap.Feature.Vector"; // TRASH THIS
- SuperMap.State = {
- /** states */
- UNKNOWN: 'Unknown',
- INSERT: 'Insert',
- UPDATE: 'Update',
- DELETE: 'Delete'
- };
- Vector.style = {
- 'default': {
- fillColor: "#ee9900",
- fillOpacity: 0.4,
- hoverFillColor: "white",
- hoverFillOpacity: 0.8,
- strokeColor: "#ee9900",
- strokeOpacity: 1,
- strokeWidth: 1,
- strokeLinecap: "round",
- strokeDashstyle: "solid",
- hoverStrokeColor: "red",
- hoverStrokeOpacity: 1,
- hoverStrokeWidth: 0.2,
- pointRadius: 6,
- hoverPointRadius: 1,
- hoverPointUnit: "%",
- pointerEvents: "visiblePainted",
- cursor: "inherit",
- fontColor: "#000000",
- labelAlign: "cm",
- labelOutlineColor: "white",
- labelOutlineWidth: 3
- },
- 'select': {
- fillColor: "blue",
- fillOpacity: 0.4,
- hoverFillColor: "white",
- hoverFillOpacity: 0.8,
- strokeColor: "blue",
- strokeOpacity: 1,
- strokeWidth: 2,
- strokeLinecap: "round",
- strokeDashstyle: "solid",
- hoverStrokeColor: "red",
- hoverStrokeOpacity: 1,
- hoverStrokeWidth: 0.2,
- pointRadius: 6,
- hoverPointRadius: 1,
- hoverPointUnit: "%",
- pointerEvents: "visiblePainted",
- cursor: "pointer",
- fontColor: "#000000",
- labelAlign: "cm",
- labelOutlineColor: "white",
- labelOutlineWidth: 3
- },
- 'temporary': {
- fillColor: "#66cccc",
- fillOpacity: 0.2,
- hoverFillColor: "white",
- hoverFillOpacity: 0.8,
- strokeColor: "#66cccc",
- strokeOpacity: 1,
- strokeLinecap: "round",
- strokeWidth: 2,
- strokeDashstyle: "solid",
- hoverStrokeColor: "red",
- hoverStrokeOpacity: 1,
- hoverStrokeWidth: 0.2,
- pointRadius: 6,
- hoverPointRadius: 1,
- hoverPointUnit: "%",
- pointerEvents: "visiblePainted",
- //cursor:"inherit",
- cursor: "default",
- fontColor: "#000000",
- labelAlign: "cm",
- labelOutlineColor: "white",
- labelOutlineWidth: 3
- },
- 'delete': {
- display: "none"
- }
- };
- return _this;
- }
- /**
- * @function SuperMap.Feature.Vector.prototype.destroy
- * @description nullify references to prevent circular references and memory leaks
- */
- Vector_createClass(Vector, [{
- key: "destroy",
- value: function destroy() {
- if (this.layer) {
- this.layer.removeFeatures(this);
- this.layer = null;
- }
- this.geometry = null;
- Vector_get(Vector_getPrototypeOf(Vector.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.Feature.Vector.prototype.clone
- * @description Create a clone of this vector feature. Does not set any non-standard
- * properties.
- * @returns {SuperMap.Feature.Vector} An exact clone of this vector feature.
- */
- }, {
- key: "clone",
- value: function clone() {
- return new Vector(this.geometry ? this.geometry.clone() : null, this.attributes, this.style);
- }
- /**
- * @function SuperMap.Feature.Vector.prototype.toState
- * @description 设置新状态。
- * @param {string} state - 状态。
- */
- }, {
- key: "toState",
- value: function toState(state) {
- if (state === SuperMap.State.UPDATE) {
- switch (this.state) {
- case SuperMap.State.UNKNOWN:
- case SuperMap.State.DELETE:
- this.state = state;
- break;
- case SuperMap.State.UPDATE:
- case SuperMap.State.INSERT:
- break;
- }
- } else if (state === SuperMap.State.INSERT) {
- switch (this.state) {
- case SuperMap.State.UNKNOWN:
- break;
- default:
- this.state = state;
- break;
- }
- } else if (state === SuperMap.State.DELETE) {
- switch (this.state) {
- case SuperMap.State.INSERT:
- // the feature should be destroyed
- break;
- case SuperMap.State.DELETE:
- break;
- case SuperMap.State.UNKNOWN:
- case SuperMap.State.UPDATE:
- this.state = state;
- break;
- }
- } else if (state === SuperMap.State.UNKNOWN) {
- this.state = state;
- }
- }
- }]);
- return Vector;
- }(Feature);
- /**
- *
- * @typedef {Object} SuperMap.Feature.Vector.style
- * @description SuperMap.features 有大量的样式属性,如果没有特别的指定将使用默认的样式,
- * 大部分样式通过 SVG 标准定义属性。
- * - fill properties 资料介绍:{@link http://www.w3.org/TR/SVG/painting.html#FillProperties}
- * - stroke properties 资料介绍:{@link http://www.w3.org/TR/SVG/painting.html#StrokeProperties}
- * @property {boolean} [fill] - 不需要填充则设置为 false。
- * @property {string} [fillColor='#ee9900'] - 十六进制填充颜色。
- * @property {number} [fillOpacity=0.4] - 填充不透明度。
- * @property {boolean} [stroke] - 不需要描边则设为 false。
- * @property {string} [strokeColor='#ee9900'] - 十六进制描边颜色。
- * @property {number} [strokeOpacity=0.4] - 描边的不透明度(0-1)。
- * @property {number} [strokeWidth=1] - 像素描边宽度。
- * @property {string} [strokeLinecap='round'] - strokeLinecap 有三种类型 butt,round,square。
- * @property {string} [strokeDashstyle='solid'] - 有 dot,dash,dashdot,longdash,longdashdot,solid 几种样式。
- * @property {boolean} [graphic] - 不需要则设置为 false。
- * @property {number} [pointRadius=6] - 像素点半径。
- * @property {string} [pointerEvents='visiblePainted'] - pointerEvents。
- * @property {string} [cursor] - cursor。
- * @property {boolean} [allowRotate='false'] - 是否允许图标随着运行方向旋转。用于时空数据图层。
- * @property {string} [externalGraphic] - 连接到用来渲染点的外部的图形。
- * @property {number} [graphicWidth] - 外部图表的像素宽度。
- * @property {number} [graphicHeight] - 外部图表的高宽度。
- * @property {number} [graphicOpacity] - 外部图表的不透明度(0-1)。
- * @property {number} [graphicXOffset] - 外部图表沿着x方向的偏移量。
- * @property {number} [graphicYOffset] - 外部图表沿着y方向的偏移量 Pixel。
- * @property {number} [rotation] - 一个图表沿着其中心点(或者偏移中心指定点)在顺时针方向旋转。
- * @property {number} [graphicZIndex] - 渲染时使用的索引值。
- * @property {string} [graphicName='circle'] - 渲染点时图标使用的名字。支持"circle" , "square", "star", "x", "cross", "triangle"。
- * @property {string} [graphicTitle] - 外部图表的提示框。
- * @property {string} [backgroundGraphic] - 外部图表的背景。
- * @property {number} [backgroundGraphicZIndex] - 背景图渲染时使用的索引值。
- * @property {number} [backgroundXOffset] - 背景图在 x 轴的偏移量。
- * @property {number} [backgroundYOffset] - 背景图在 y 轴的偏移量。
- * @property {number} [backgroundHeight] - 背景图的高度。如果没有设置,将用 graphicHeight。
- * @property {number} [backgroundWidth] - 背景图的宽度。如果没有设置,将用 graphicWidth。
- * @property {boolean} [isUnicode=false] - 这个属性要配合 label 属性来用,当为 true时,label 就可以使用 unicode 编码,
- * 比如 "a" 的 unicode 十六进制编码为 61,则 label 属性可以为 "a",其中 "&#" 为前缀,标志这个为 unicode 编码,
- * "x" 是指 16 进制,这时页面显示的是 "a";当此值为 false 的时候,label 的内容会被直接输出,
- * 比如,label 为 "a",这时页面显示的也是 "a"。
- * @property {string} [label] - 可选的标签文本。
- * @property {string} [labelAlign='cm'] - 标签对齐,是由两个字符组成的字符串,如:"lt", "cm", "rb",
- * 其中第一个字符代表水平方向上的对齐,"l"=left, "c"=center, "r"=right;
- * 第二个字符代表垂直方向上的对齐,"t"=top, "m"=middle, "b"=bottom。
- * @property {number} [labelXOffset] - 标签在 x 轴方向的偏移量。
- * @property {number} [labelYOffset] - 标签在 y 轴方向的偏移量。
- * @property {boolean} [labelSelect=false] - 如果设为 true,标签可以选用 SelectFeature 或者 similar 控件。
- * @property {string} [fontColor='#000000'] - 标签字体颜色。
- * @property {number} [fontOpacity] - 标签透明度 (0-1)。
- * @property {string} [fontFamily] - 标签的字体类型。
- * @property {string} [fontSize] - 标签的字体大小。
- * @property {string} [fontStyle] - 标签的字体样式。
- * @property {string} [fontWeight] - 标签的字体粗细。
- * @property {string} [display] - 如果 display 属性设置为 “none”,符号将没有任何效果。
- * @example
- * // label的用法如下:
- * function addGeoTest(){
- * var geometry = new SuperMap.Geometry.Point(105, 35);
- * var pointFeature = new SuperMap.Feature.Vector(geometry);
- * var styleTest = {
- * label:"supermap",
- * fontColor:"#0000ff",
- * fontOpacity:"0.5",
- * fontFamily:"隶书",
- * fontSize:"8em",
- * fontWeight:"bold",
- * fontStyle:"italic",
- * labelSelect:"true",
- * }
- * pointFeature.style = styleTest;
- * vectorLayer.addFeatures([pointFeature]);
- * }
- */
- SuperMap.Feature.Vector = Vector;
- ;// CONCATENATED MODULE: ./src/common/commontypes/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/common/format/Format.js
- function Format_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Format_createClass(Constructor, protoProps, staticProps) { if (protoProps) Format_defineProperties(Constructor.prototype, protoProps); if (staticProps) Format_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Format
- * @classdesc 读写各种格式的格式类基类。其子类应该包含并实现 read 和 write 方法。
- * @category BaseTypes Format
- * @param {Object} options - 可选参数。
- * @param {boolean} [options.keepData=false] - 如果设置为 true, data 属性会指向被解析的对象(例如 JSON 或 xml 数据对象)。
- * @param {Object} [options.data] - 当 keepData 属性设置为 true,这是传递给 read 操作的要被解析的字符串。
- */
- var Format = /*#__PURE__*/function () {
- function Format(options) {
- Format_classCallCheck(this, Format);
- /**
- * @member {Object} SuperMap.Format.prototype.data
- * @description 当 keepData 属性设置为 true,这是传递给 read 操作的要被解析的字符串。
- */
- this.data = null;
- /**
- * APIProperty: keepData
- * @member {Object} [SuperMap.Format.prototype.keepData=false]
- * @description 保持最近读到的数据的引用(通过 <data> 属性)。
- */
- this.keepData = false;
- Util.extend(this, options);
- this.options = options;
- this.CLASS_NAME = "SuperMap.Format";
- }
- /**
- * @function SuperMap.Format.prototype.destroy
- * @description 销毁该格式类,释放相关资源。
- */
- Format_createClass(Format, [{
- key: "destroy",
- value: function destroy() {//用来销毁该格式类,释放相关资源
- }
- /**
- * @function SuperMap.Format.prototype.read
- * @description 来从字符串中读取数据。
- * @param {string} data - 读取的数据。
- */
- }, {
- key: "read",
- value: function read(data) {// eslint-disable-line no-unused-vars
- //用来从字符串中读取数据
- }
- /**
- * @function SuperMap.Format.prototype.write
- * @description 将对象写成字符串。
- * @param {Object} object - 可序列化的对象。
- * @returns {string} 对象被写成字符串。
- */
- }, {
- key: "write",
- value: function write(object) {// eslint-disable-line no-unused-vars
- //用来写字符串
- }
- }]);
- return Format;
- }();
- SuperMap.Format = SuperMap.Format || Format;
- ;// CONCATENATED MODULE: ./src/common/format/JSON.js
- 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); }
- function JSON_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function JSON_createClass(Constructor, protoProps, staticProps) { if (protoProps) JSON_defineProperties(Constructor.prototype, protoProps); if (staticProps) JSON_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function JSON_setPrototypeOf(o, p) { JSON_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return JSON_setPrototypeOf(o, p); }
- 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); }; }
- function JSON_possibleConstructorReturn(self, call) { if (call && (JSON_typeof(call) === "object" || typeof call === "function")) { return call; } return JSON_assertThisInitialized(self); }
- function JSON_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function JSON_getPrototypeOf(o) { JSON_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return JSON_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Format.JSON
- * @classdesc 安全的读写 JSON 的解析类。使用 {@link SuperMap.Format.JSON} 构造函数创建新实例。
- * @category BaseTypes Format
- * @param {Object} [options] - 参数。
- * @param {string} [options.indent=" "] - 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
- * @param {string} [options.space=" "] - 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
- * @param {string} [options.newline="\n"] - 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
- * @param {number} [options.level=0] - 用于格式化输出, 表示的是缩进级别。
- * @param {boolean} [options.pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
- * @param {boolean} [options.nativeJSON] - 需要被注册的监听器对象。
- * @extends {SuperMap.Format}
- */
- var JSONFormat = /*#__PURE__*/function (_Format) {
- JSON_inherits(JSONFormat, _Format);
- var _super = JSON_createSuper(JSONFormat);
- function JSONFormat(options) {
- var _this;
- JSON_classCallCheck(this, JSONFormat);
- _this = _super.call(this, options);
- /**
- * @member {string} [SuperMap.Format.JSON.prototype.indent=" "]
- * @description 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
- */
- _this.indent = " ";
- /**
- * @member {string} [SuperMap.Format.JSON.prototype.space=" "]
- * @description 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
- */
- _this.space = " ";
- /**
- * @member {string} [SuperMap.Format.JSON.prototype.newline="\n"]
- * @description 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
- */
- _this.newline = "\n";
- /**
- * @member {integer} [SuperMap.Format.JSON.prototype.level=0]
- * @description 用于格式化输出, 表示的是缩进级别。
- */
- _this.level = 0;
- /**
- * @member {boolean} [SuperMap.Format.JSON.prototype.pretty=false]
- * @description 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
- */
- _this.pretty = false;
- /**
- * @member {boolean} SuperMap.Format.JSON.prototype.nativeJSON
- * @description 判断浏览器是否原生支持 JSON 格式数据。
- */
- _this.nativeJSON = function () {
- return !!(window.JSON && typeof JSON.parse === "function" && typeof JSON.stringify === "function");
- }();
- _this.CLASS_NAME = "SuperMap.Format.JSON";
- /**
- * @member SuperMap.Format.JSON.prototype.serialize
- * @description 提供一些类型对象转 JSON 字符串的方法。
- */
- _this.serialize = {
- /**
- * @function SuperMap.Format.JSON.serialize.object
- * @description 把对象转换为 JSON 字符串。
- * @param {Object} object - 可序列化的对象。
- * @returns {string} JSON 字符串。
- */
- 'object': function object(_object) {
- // three special objects that we want to treat differently
- if (_object == null) {
- return "null";
- }
- if (_object.constructor === Date) {
- return this.serialize.date.apply(this, [_object]);
- }
- if (_object.constructor === Array) {
- return this.serialize.array.apply(this, [_object]);
- }
- var pieces = ['{'];
- this.level += 1;
- var key, keyJSON, valueJSON;
- var addComma = false;
- for (key in _object) {
- if (_object.hasOwnProperty(key)) {
- // recursive calls need to allow for sub-classing
- keyJSON = this.write.apply(this, [key, this.pretty]);
- valueJSON = this.write.apply(this, [_object[key], this.pretty]);
- if (keyJSON != null && valueJSON != null) {
- if (addComma) {
- pieces.push(',');
- }
- pieces.push(this.writeNewline(), this.writeIndent(), keyJSON, ':', this.writeSpace(), valueJSON);
- addComma = true;
- }
- }
- }
- this.level -= 1;
- pieces.push(this.writeNewline(), this.writeIndent(), '}');
- return pieces.join('');
- },
- /**
- * @function SuperMap.Format.JSON.serialize.array
- * @description 把数组转换成 JSON 字符串。
- * @param {Array} array - 可序列化的数组。
- * @returns {string} JSON 字符串。
- */
- 'array': function array(_array) {
- var json;
- var pieces = ['['];
- this.level += 1;
- for (var i = 0, len = _array.length; i < len; ++i) {
- // recursive calls need to allow for sub-classing
- json = this.write.apply(this, [_array[i], this.pretty]);
- if (json != null) {
- if (i > 0) {
- pieces.push(',');
- }
- pieces.push(this.writeNewline(), this.writeIndent(), json);
- }
- }
- this.level -= 1;
- pieces.push(this.writeNewline(), this.writeIndent(), ']');
- return pieces.join('');
- },
- /**
- * @function SuperMap.Format.JSON.serialize.string
- * @description 把字符串转换成 JSON 字符串。
- * @param {string} string - 可序列化的字符串。
- * @returns {string} JSON 字符串。
- */
- 'string': function string(_string) {
- // If the string contains no control characters, no quote characters, and no
- // backslash characters, then we can simply slap some quotes around it.
- // Otherwise we must also replace the offending characters with safe
- // sequences.
- var m = {
- '\b': '\\b',
- '\t': '\\t',
- '\n': '\\n',
- '\f': '\\f',
- '\r': '\\r',
- '"': '\\"',
- '\\': '\\\\'
- };
- /*eslint-disable no-control-regex*/
- if (/["\\\x00-\x1f]/.test(_string)) {
- return '"' + _string.replace(/([\x00-\x1f\\"])/g, function (a, b) {
- var c = m[b];
- if (c) {
- return c;
- }
- c = b.charCodeAt();
- return "\\u00" + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
- }) + '"';
- }
- return '"' + _string + '"';
- },
- /**
- * @function SuperMap.Format.JSON.serialize.number
- * @description 把数字转换成 JSON 字符串。
- * @param {number} number - 可序列化的数字。
- * @returns {string} JSON 字符串。
- */
- 'number': function number(_number) {
- return isFinite(_number) ? String(_number) : "null";
- },
- /**
- * @function SuperMap.Format.JSON.serialize.boolean
- * @description Transform a boolean into a JSON string.
- * @param {boolean} bool - The boolean to be serialized.
- * @returns {string} A JSON string representing the boolean.
- */
- 'boolean': function boolean(bool) {
- return String(bool);
- },
- /**
- * @function SuperMap.Format.JSON.serialize.object
- * @description 将日期对象转换成 JSON 字符串。
- * @param {Date} date - 可序列化的日期对象。
- * @returns {string} JSON 字符串。
- */
- 'date': function date(_date) {
- function format(number) {
- // Format integers to have at least two digits.
- return number < 10 ? '0' + number : number;
- }
- return '"' + _date.getFullYear() + '-' + format(_date.getMonth() + 1) + '-' + format(_date.getDate()) + 'T' + format(_date.getHours()) + ':' + format(_date.getMinutes()) + ':' + format(_date.getSeconds()) + '"';
- }
- };
- return _this;
- }
- /**
- * @function SuperMap.Format.JSON.prototype.read
- * @description 将一个符合 JSON 结构的字符串进行解析。
- * @param {string} json - 符合 JSON 结构的字符串。
- * @param {function} filter - 过滤方法,最终结果的每一个键值对都会调用该过滤方法,并在对应的值的位置替换成该方法返回的值。
- * @returns {Object} 对象,数组,字符串或数字。
- */
- JSON_createClass(JSONFormat, [{
- key: "read",
- value: function read(json, filter) {
- var object;
- if (this.nativeJSON) {
- try {
- object = JSON.parse(json, filter);
- } catch (e) {// Fall through if the regexp test fails.
- }
- }
- if (this.keepData) {
- this.data = object;
- }
- return object;
- }
- /**
- * @function SuperMap.Format.JSON.prototype.write
- * @description 序列化一个对象到一个符合 JSON 格式的字符串。
- * @param {(object|string|Array|number|boolean)} value - 需要被序列化的对象,数组,字符串,数字,布尔值。
- * @param {boolean} [pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
- * @returns {string} 符合 JSON 格式的字符串。
- *
- */
- }, {
- key: "write",
- value: function write(value, pretty) {
- this.pretty = !!pretty;
- var json = null;
- var type = JSON_typeof(value);
- if (this.serialize[type]) {
- try {
- json = !this.pretty && this.nativeJSON ? JSON.stringify(value) : this.serialize[type].apply(this, [value]);
- } catch (err) {//SuperMap.Console.error("Trouble serializing: " + err);
- }
- }
- return json;
- }
- /**
- * @function SuperMap.Format.JSON.prototype.writeIndent
- * @description 根据缩进级别输出一个缩进字符串。
- * @private
- * @returns {string} 一个适当的缩进字符串。
- */
- }, {
- key: "writeIndent",
- value: function writeIndent() {
- var pieces = [];
- if (this.pretty) {
- for (var i = 0; i < this.level; ++i) {
- pieces.push(this.indent);
- }
- }
- return pieces.join('');
- }
- /**
- * @function SuperMap.Format.JSON.prototype.writeNewline
- * @description 在格式化输出模式情况下输出代表新一行的字符串。
- * @private
- * @returns {string} 代表新的一行的字符串。
- */
- }, {
- key: "writeNewline",
- value: function writeNewline() {
- return this.pretty ? this.newline : '';
- }
- /**
- * @function SuperMap.Format.JSON.prototype.writeSpace
- * @private
- * @description 在格式化输出模式情况下输出一个代表空格的字符串。
- * @returns {string} 一个空格。
- */
- }, {
- key: "writeSpace",
- value: function writeSpace() {
- return this.pretty ? this.space : '';
- }
- }]);
- return JSONFormat;
- }(Format);
- SuperMap.Format.JSON = JSONFormat;
- ;// CONCATENATED MODULE: ./src/common/iServer/ServerColor.js
- function ServerColor_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ServerColor_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerColor_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerColor_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ServerColor
- * @category iServer Map Theme
- * @classdesc 颜色类。该类使用三原色( RGB )来表达颜色。
- * @param {Object} options - 参数。
- * @param {number} [options.red=255] - 获取或设置红色值。
- * @param {number} [options.green=0] - 获取或设置绿色值。
- * @param {number} [options.blue=0] - 获取或设置蓝色值。
- */
- var ServerColor = /*#__PURE__*/function () {
- function ServerColor(red, green, blue) {
- ServerColor_classCallCheck(this, ServerColor);
- /**
- * @member {number} [SuperMap.ServerColor.prototype.red=255]
- * @description 获取或设置红色值。
- */
- this.red = !red && red != 0 ? 255 : red;
- /**
- * @member {number} [SuperMap.ServerColor.prototype.green=0]
- * @description 获取或设置绿色值。
- */
- this.green = green || 0;
- /**
- * @member {number} [SuperMap.ServerColor.prototype.blue=0]
- * @description 获取或设置蓝色值。
- */
- this.blue = blue || 0;
- this.CLASS_NAME = "SuperMap.ServerColor";
- }
- /**
- * @function SuperMap.ServerColor.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ServerColor_createClass(ServerColor, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.red = null;
- me.green = null;
- me.blue = null;
- }
- /**
- * @function SuperMap.ServerColor.formJson
- * @description 将 JSON 对象转化为 ServerColor 对象。
- * @param {Object} jsonObject - 要转换的 JSON 对象。
- * @returns {SuperMap.ServerColor} 转化后的 ServerColor 对象。
- */
- }], [{
- key: "fromJson",
- value: function fromJson(jsonObject) {
- if (!jsonObject) {
- return;
- }
- var color = new ServerColor();
- var red = 255;
- if (jsonObject.red !== null) {
- red = Number(jsonObject.red);
- }
- color.red = red;
- var green = 0;
- if (jsonObject.green !== null) {
- green = Number(jsonObject.green);
- }
- color.green = green;
- var blue = 0;
- if (jsonObject.blue !== null) {
- blue = Number(jsonObject.blue);
- }
- color.blue = blue;
- return color;
- }
- }]);
- return ServerColor;
- }();
- SuperMap.ServerColor = ServerColor;
- ;// CONCATENATED MODULE: ./src/common/iServer/ServerStyle.js
- function ServerStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ServerStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerStyle_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ServerStyle
- * @category iServer Map Theme
- * @classdesc 服务端矢量要素风格类。
- * @description 该类用于定义点状符号、线状符号、填充符号风格及其相关属性。
- * @param {Object} options - 参数。
- * @param {SuperMap.FillGradientMode} options.fillGradientMode - 渐变填充风格的渐变类型。
- * @param {SuperMap.ServerColor} [options.fillBackColor=[255,255,255]] - 填充背景颜色。
- * @param {boolean} [options.fillBackOpaque=false] - 背景是否不透明。
- * @param {SuperMap.ServerColor} [options.fillForeColor=[255,0,0]] - 填充颜色。
- * @param {number} [options.fillGradientAngle=0] - 渐变填充的旋转角度。
- * @param {number} [options.fillGradientOffsetRatioX=0] - 渐变填充中心点相对于填充区域范围中心点的水平偏移百分比。
- * @param {number} [options.fillGradientOffsetRatioY=0] - 填充中心点相对于填充区域范围中心点的垂直偏移百分比。
- * @param {number} [options.fillOpaqueRate=100] - 填充不透明度。
- * @param {number} [options.fillSymbolID=0] - 填充符号的编码。
- * @param {SuperMap.ServerColor} [options.lineColor] - 矢量要素的边线颜色。默认 lineColor = new ServerColor(0, 0, 0)。
- * @param {number} [options.lineSymbolID=0] - 线状符号的编码。
- * @param {number} [options.lineWidth=1] - 边线的宽度。
- * @param {number} [options.markerAngle=0] - 点状符号的旋转角度。
- * @param {number} [options.markerSize=1] - 点状符号的大小。
- * @param {number} [options.markerSymbolID=-1] - 点状符号的编码。
- */
- var ServerStyle = /*#__PURE__*/function () {
- function ServerStyle(options) {
- ServerStyle_classCallCheck(this, ServerStyle);
- /**
- * @member {SuperMap.ServerColor} SuperMap.ServerStyle.prototype.fillBackColor
- * @description 填充背景颜色。当填充模式为渐变填充时,该颜色为填充终止色。
- */
- this.fillBackColor = new ServerColor(255, 255, 255);
- /**
- * @member {boolean} [SuperMap.ServerStyle.prototype.fillBackOpaque=false]
- * @description 背景是否不透明。false 表示透明。
- */
- this.fillBackOpaque = false;
- /**
- * @member {SuperMap.ServerColor} SuperMap.ServerStyle.prototype.fillForeColor
- * @description 填充颜色。当填充模式为渐变填充时,该颜色为填充起始颜色。
- */
- this.fillForeColor = new ServerColor(255, 0, 0);
- /**
- * @member {SuperMap.FillGradientMode} SuperMap.ServerStyle.prototype.fillGradientMode
- * @description 渐变填充风格的渐变类型。
- */
- this.fillGradientMode = null;
- /**
- * @member {number} SuperMap.ServerStyle.prototype.fillGradientAngle -
- * @description 渐变填充的旋转角度。单位为度,精确到 0.1 度,逆时针方向为正方向。
- */
- this.fillGradientAngle = 0;
- /**
- * @member {number} SuperMap.ServerStyle.prototype.fillGradientOffsetRatioX
- * @description 渐变填充中心点相对于填充区域范围中心点的水平偏移百分比。它们的关系如下:设填充区域范围中心点的坐标为(x0, y0),
- * 填充中心点的坐标为(x, y),填充区域范围的宽度为 a,水平偏移百分比为 dx,则 x=x0 + a*dx/100。
- */
- this.fillGradientOffsetRatioX = 0;
- /**
- * @member {number} SuperMap.ServerStyle.prototype.fillGradientOffsetRatioY
- * @description 填充中心点相对于填充区域范围中心点的垂直偏移百分比。它们的关系如下:<br>
- * 设填充区域范围中心点的坐标为(x0, y0),填充中心点的坐标为(x, y),填充区域范围的高度为 b,垂直偏移百分比为 dy,则 y=y0 + b*dx/100。
- */
- this.fillGradientOffsetRatioY = 0;
- /**
- * @member {number} [SuperMap.ServerStyle.prototype.fillOpaqueRate=100]
- * @description 填充不透明度。合法值为 0 - 100 的数值。其中为 0 表示完全透明;
- * 100 表示完全不透明。赋值小于 0 时按照 0 处理,大于 100 时按照 100 处理。
- */
- this.fillOpaqueRate = 100;
- /**
- * @member {number} SuperMap.ServerStyle.prototype.fillSymbolID
- * @description 填充符号的编码。此编码用于唯一标识各普通填充风格的填充符号。
- * 关于填充符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
- */
- this.fillSymbolID = 0;
- /**
- * @member {SuperMap.ServerColor} SuperMap.ServerStyle.prototype.lineColor
- * @description 矢量要素的边线颜色。如果等级符号是点符号,点符号的颜色由 lineColor 控制。
- */
- this.lineColor = new ServerColor(0, 0, 0);
- /**
- * @member {number} [SuperMap.ServerStyle.prototype.lineSymbolID=0]
- * @description 线状符号的编码。此编码用于唯一标识各普通填充风格的填充符号。
- * 关于线状符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
- */
- this.lineSymbolID = 0;
- /**
- * @member {number} [SuperMap.ServerStyle.prototype.lineWidth=1.0]
- * @description 边线的宽度。单位为毫米,精度到 0.1。
- */
- this.lineWidth = 1;
- /**
- * @member {number} [SuperMap.ServerStyle.prototype.markerAngle=0]
- * @description 点状符号的旋转角度。以度为单位,精确到 0.1 度,逆时针方向为正方向。
- */
- this.markerAngle = 0;
- /**
- * @member {number} [SuperMap.ServerStyle.prototype.markerSize=1.0]
- * @description 点状符号的大小。单位为毫米,精度为 0.1。当该属性设置为0时,采用符号默认大小 1.0 显示。
- * 当该属性设置为非法值时,交由服务器默认处理。
- */
- this.markerSize = 1;
- /**
- * @member {number} [SuperMap.ServerStyle.prototype.markerSymbolID=-1]
- * @description 点状符号的编码。此编码用于唯一标识各点状符号。
- * 关于线状符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
- */
- this.markerSymbolID = -1;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ServerStyle";
- }
- /**
- * @function SuperMap.ServerStyle.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ServerStyle_createClass(ServerStyle, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- if (me.fillBackColor) {
- me.fillBackColor.destroy();
- me.fillBackColor = null;
- }
- me.fillBackOpaque = null;
- if (me.fillForeColor) {
- me.fillForeColor.destroy();
- me.fillForeColor = null;
- }
- me.fillGradientMode = null;
- me.fillGradientAngle = null;
- me.fillGradientOffsetRatioX = null;
- me.fillGradientOffsetRatioY = null;
- me.fillOpaqueRate = null;
- me.fillSymbolID = null;
- if (me.lineColor) {
- me.lineColor.destroy();
- me.lineColor = null;
- }
- me.lineSymbolID = null;
- me.lineWidth = null;
- me.markerAngle = null;
- me.markerSize = null;
- me.markerSymbolID = null;
- }
- /**
- * @function SuperMap.ServerStyle.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- * @returns {Object} 对应的 JSON 格式对象.
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- var styleObj = {};
- styleObj = Util.copyAttributes(styleObj, this); //暂时先忽略serverColor往Json的转换
- return styleObj;
- }
- /**
- * @function SuperMap.ServerStyle.fromJson
- * @description 将JSON对象转换为 SuperMap.ServerStyle 对象。
- * @param jsonObject - {Object} 要转换的 JSON 对象。
- * @returns {SuperMap.ServerStyle} 转化后的 SuperMap.ServerStyle 对象。
- */
- }], [{
- key: "fromJson",
- value: function fromJson(jsonObject) {
- if (!jsonObject) {
- return;
- }
- return new ServerStyle({
- fillBackColor: ServerColor.fromJson(jsonObject.fillBackColor),
- fillBackOpaque: jsonObject.fillBackOpaque,
- fillForeColor: ServerColor.fromJson(jsonObject.fillForeColor),
- fillGradientMode: jsonObject.fillGradientMode,
- fillGradientAngle: jsonObject.fillGradientAngle,
- fillGradientOffsetRatioX: jsonObject.fillGradientOffsetRatioX,
- fillGradientOffsetRatioY: jsonObject.fillGradientOffsetRatioY,
- fillOpaqueRate: jsonObject.fillOpaqueRate,
- fillSymbolID: jsonObject.fillSymbolID,
- lineColor: ServerColor.fromJson(jsonObject.lineColor),
- lineSymbolID: jsonObject.lineSymbolID,
- lineWidth: jsonObject.lineWidth,
- markerAngle: jsonObject.markerAngle,
- markerSize: jsonObject.markerSize,
- markerSymbolID: jsonObject.markerSymbolID
- });
- }
- }]);
- return ServerStyle;
- }();
- SuperMap.ServerStyle = ServerStyle;
- ;// CONCATENATED MODULE: ./src/common/iServer/PointWithMeasure.js
- 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); }
- function PointWithMeasure_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function PointWithMeasure_createClass(Constructor, protoProps, staticProps) { if (protoProps) PointWithMeasure_defineProperties(Constructor.prototype, protoProps); if (staticProps) PointWithMeasure_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function PointWithMeasure_setPrototypeOf(o, p) { PointWithMeasure_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return PointWithMeasure_setPrototypeOf(o, p); }
- 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); }; }
- function PointWithMeasure_possibleConstructorReturn(self, call) { if (call && (PointWithMeasure_typeof(call) === "object" || typeof call === "function")) { return call; } return PointWithMeasure_assertThisInitialized(self); }
- function PointWithMeasure_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function PointWithMeasure_getPrototypeOf(o) { PointWithMeasure_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PointWithMeasure_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.PointWithMeasure
- * @category iServer SpatialAnalyst
- * @classdesc 路由点类。路由点是指具有线性度量值 (Measure) 的二维地理坐标点。
- * @param {Object} options - 参数。
- * @param {number} options.measure - 度量值,即路由对象属性值 M。
- * @param {number} options.x - 获取当前点对象在地理坐标系下的 X 坐标值。
- * @param {number} options.y - 获取当前点对象在地理坐标系下的 Y 坐标值。
- * @extends {SuperMap.Geometry.Point}
- */
- var PointWithMeasure = /*#__PURE__*/function (_Point) {
- PointWithMeasure_inherits(PointWithMeasure, _Point);
- var _super = PointWithMeasure_createSuper(PointWithMeasure);
- function PointWithMeasure(options) {
- var _this;
- PointWithMeasure_classCallCheck(this, PointWithMeasure);
- _this = _super.call(this, options);
- /**
- * @member {number} SuperMap.PointWithMeasure.prototype.measure
- * @description 度量值,即路由对象属性值 M。
- */
- _this.measure = null;
- if (options) {
- Util.extend(PointWithMeasure_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.PointWithMeasure";
- return _this;
- }
- /**
- * @function SuperMap.PointWithMeasure.prototype.equals
- * @description 判断两个路由点对象是否相等。如果两个路由点对象具有相同的坐标以及度量值,则认为是相等的。
- * @param {SuperMap.PointWithMeasure} geom - 需要判断的路由点对象。
- * @returns {boolean} 两个路由点对象是否相等(true 为相等,false 为不等)。
- */
- PointWithMeasure_createClass(PointWithMeasure, [{
- key: "equals",
- value: function equals(geom) {
- var equals = false;
- if (geom != null) {
- var isValueEquals = this.x === geom.x && this.y === geom.y && this.measure === geom.measure;
- var isNaNValue = isNaN(this.x) && isNaN(this.y) && isNaN(this.measure);
- var isNaNGeometry = isNaN(geom.x) && isNaN(geom.y) && isNaN(geom.measure);
- equals = isValueEquals || isNaNValue && isNaNGeometry;
- }
- return equals;
- }
- /**
- * @function SuperMap.PointWithMeasure.prototype.toJson
- * @description 转换为 JSON 对象。
- * */
- }, {
- key: "toJson",
- value: function toJson() {
- var result = "{";
- if (this.measure != null && this.measure != undefined) {
- result += "\"measure\":" + this.measure + ",";
- }
- result += "\"x\":" + this.x + ",";
- result += "\"y\":" + this.y;
- result += "}";
- return result;
- }
- /**
- * @function SuperMap.PointWithMeasure.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- }, {
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.measure = null;
- me.x = null;
- me.y = null;
- }
- /**
- * @function SuperMap.PointWithMeasure.fromJson
- * @description 将 JSON 对象转换为{@link SuperMap.PointWithMeasure} 对象。
- * @param {Object} jsonObject - JSON 对象表示的路由点。
- * @returns {SuperMap.PointWithMeasure} 转化后的 PointWithMeasure 对象。
- */
- }], [{
- key: "fromJson",
- value: function fromJson(jsonObject) {
- if (!jsonObject) {
- return;
- }
- return new PointWithMeasure({
- x: jsonObject.x,
- y: jsonObject.y,
- measure: jsonObject.measure
- });
- }
- }]);
- return PointWithMeasure;
- }(Point);
- SuperMap.PointWithMeasure = PointWithMeasure;
- ;// CONCATENATED MODULE: ./src/common/iServer/Route.js
- 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); }
- function Route_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Route_createClass(Constructor, protoProps, staticProps) { if (protoProps) Route_defineProperties(Constructor.prototype, protoProps); if (staticProps) Route_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Route_setPrototypeOf(o, p) { Route_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Route_setPrototypeOf(o, p); }
- 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); }; }
- function Route_possibleConstructorReturn(self, call) { if (call && (Route_typeof(call) === "object" || typeof call === "function")) { return call; } return Route_assertThisInitialized(self); }
- function Route_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Route_getPrototypeOf(o) { Route_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Route_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Route
- * @category iServer SpatialAnalyst
- * @classdesc 路由对象类。路由对象为一系列有序的带有属性值 M 的 x,y 坐标对,其中 M 值为该结点的距离属性(到已知点的距离)。
- * @param {Array.<SuperMap.Geometry>} points - 形成路由对象的线数组。
- * @param {Object} options - 参数。
- * @param {number} options.id - 路由对象在数据库中的 id。
- * @param {number} options.length - 路由对象的长度。单位与数据集的单位相同。
- * @param {number} [options.maxM] - 最大线性度量值,即所有结点到起始点的量算距离中最大值。
- * @param {number} [options.minM] - 最小线性度量值,即所有结点到起始点的量算距离中最小值。
- * @param {string} [options.type] - 数据类型,如:"LINEM"。
- * @extends {SuperMap.Geometry.Collection}
- */
- var Route = /*#__PURE__*/function (_Collection) {
- Route_inherits(Route, _Collection);
- var _super = Route_createSuper(Route);
- function Route(points, options) {
- var _this;
- Route_classCallCheck(this, Route);
- _this = _super.call(this, points, options);
- /**
- * @member {number} SuperMap.Route.prototype.id
- * @description 路由对象在数据库中的 ID。
- */
- _this.id = null;
- /**
- * @member {number} SuperMap.Route.prototype.center
- * @description 路由对象的中心点。
- */
- _this.center = null;
- /**
- * @member {string} SuperMap.Route.prototype.style
- * @description 路由对象的样式。
- */
- _this.style = null;
- /**
- * @member {number} SuperMap.Route.prototype.length
- * @description 路由对象的长度。单位与数据集的单位相同。
- */
- _this.length = null;
- /**
- * @member {number} SuperMap.Route.prototype.maxM
- * @description 最大线性度量值,即所有结点到起始点的量算距离中最大值。
- */
- _this.maxM = null;
- /**
- * @member {number} SuperMap.Route.prototype.minM
- * @description 最小线性度量值,即所有结点到起始点的量算距离中最小值。
- */
- _this.minM = null;
- /**
- * @member {Array.<number>} SuperMap.Route.prototype.parts
- * @description 服务端几何对象中各个子对象所包含的节点个数。
- */
- _this.parts = null;
- /**
- * @member {Array.<Object>} SuperMap.Route.prototype.points
- * @description 路由对象的所有路由点。
- * @example
- * (start code)
- * [
- * {
- * "measure": 0,
- * "y": -4377.027184298267,
- * "x": 4020.0045221720466
- * },
- * {
- * "measure": 37.33288381391519,
- * "y": -4381.569363260499,
- * "x": 4057.0600591960642
- * }
- * ]
- * (end)
- */
- _this.points = null;
- /**
- * @member {string} SuperMap.Route.prototype.type
- * @description 服务端几何对象类型。
- */
- _this.type = null;
- /**
- * @member {Array.<string>} [SuperMap.Route.prototype.componentTypes=SuperMap.Geometry.LineString]
- * @description components 存储的的几何对象所支持的几何类型数组。
- */
- _this.componentTypes = ["SuperMap.Geometry.LinearRing", "SuperMap.Geometry.LineString"];
- if (options) {
- Util.extend(Route_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.Route";
- _this.geometryType = "LINEM";
- return _this;
- }
- /**
- *
- * @function SuperMap.Route.prototype.toJson
- * @description 转换为 JSON 对象。
- * @returns {Object} JSON 对象。
- */
- Route_createClass(Route, [{
- key: "toJson",
- value: function toJson() {
- var result = "{";
- if (this.id != null && this.id != undefined) {
- result += "\"id\":" + this.id + ",";
- }
- if (this.center != null && this.center != undefined) {
- result += "\"center\":" + this.center + ",";
- }
- if (this.style != null && this.style != undefined) {
- result += "\"style\":" + this.style + ",";
- }
- if (this.length != null && this.length != undefined) {
- result += "\"length\":" + this.length + ",";
- }
- if (this.maxM != null && this.maxM != undefined) {
- result += "\"maxM\":" + this.maxM + ",";
- }
- if (this.minM != null && this.minM != undefined) {
- result += "\"minM\":" + this.minM + ",";
- }
- if (this.type != null && this.type != undefined) {
- result += "\"type\":\"" + this.type + "\",";
- }
- if (this.parts != null && this.parts != undefined) {
- result += "\"parts\":[" + this.parts[0];
- for (var i = 1; i < this.parts.length; i++) {
- result += "," + this.parts[i];
- }
- result += "],";
- }
- if (this.components != null && this.components.length > 0) {
- result += "\"points\":[";
- for (var j = 0, len = this.components.length; j < len; j++) {
- for (var k = 0, len2 = this.components[j].components.length; k < len2; k++) {
- result += this.components[j].components[k].toJson() + ",";
- }
- }
- result = result.replace(/,$/g, '');
- result += "]";
- }
- result = result.replace(/,$/g, '');
- result += "}";
- return result;
- }
- /**
- * @function SuperMap.Route.prototype.destroy
- * @override
- */
- }, {
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.id = null;
- me.center = null;
- me.style = null;
- me.length = null;
- me.maxM = null;
- me.minM = null;
- me.type = null;
- me.parts = null;
- me.components.length = 0;
- me.components = null;
- me.componentTypes = null;
- }
- /**
- * @function SuperMap.Route.fromJson
- * @description 将 JSON 对象转换为 SuperMap.Route 对象。
- * @param {Object} [jsonObject] - JSON 对象表示的路由对象。
- * @returns {SuperMap.Route} 转化后的 Route 对象。
- */
- }], [{
- key: "fromJson",
- value: function fromJson(jsonObject) {
- if (!jsonObject) {
- return;
- }
- var geoParts = jsonObject.parts || [],
- geoPoints = jsonObject.points || [],
- len = geoParts.length,
- lineList = [];
- if (len > 0) {
- for (var i = 0, pointIndex = 0, pointList = []; i < len; i++) {
- for (var j = 0; j < geoParts[i]; j++) {
- pointList.push(PointWithMeasure.fromJson(geoPoints[pointIndex + j]));
- }
- pointIndex += geoParts[i]; //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
- if (pointList[0].equals(pointList[geoParts[i] - 1])) {
- lineList.push(new LinearRing(pointList));
- } else {
- lineList.push(new LineString(pointList));
- }
- pointList = [];
- }
- } else {
- return null;
- }
- return new Route(lineList, {
- id: jsonObject.id,
- center: jsonObject.center,
- style: jsonObject.style,
- length: jsonObject.length,
- maxM: jsonObject.maxM,
- minM: jsonObject.minM,
- type: jsonObject.type,
- parts: jsonObject.parts
- });
- }
- }]);
- return Route;
- }(Collection);
- SuperMap.Route = Route;
- ;// CONCATENATED MODULE: ./src/common/iServer/ServerGeometry.js
- function ServerGeometry_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ServerGeometry_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerGeometry_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerGeometry_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ServerGeometry
- * @category iServer
- * @classdesc 服务端几何对象类。该类描述几何对象(矢量)的特征数据(坐标点对、几何对象的类型等)。基于服务端的空间分析、空间关系运算、查询等 GIS 服务功能使用服务端几何对象。
- * @param {Object} options - 参数。
- * @param {string} options.id - 服务端几何对象唯一标识符。
- * @param {Array.<number>} options.parts - 服务端几何对象中各个子对象所包含的节点个数。
- * @param {Array.<SuperMap.Geometry.Point>} options.points - 组成几何对象的节点的坐标对数组。
- * @param {SuperMap.GeometryType} options.type - 几何对象的类型。
- * @param {SuperMap.ServerStyle} [options.style] - 服务端几何对象的风格。
- */
- var ServerGeometry = /*#__PURE__*/function () {
- function ServerGeometry(options) {
- ServerGeometry_classCallCheck(this, ServerGeometry);
- /**
- * @member {string} SuperMap.ServerGeometry.prototype.id
- * @description 服务端几何对象唯一标识符。
- */
- this.id = 0;
- /**
- * @member {SuperMap.ServerStyle} [SuperMap.ServerGeometry.prototype.style]
- * @description 服务端几何对象的风格(ServerStyle)。
- */
- this.style = null;
- /**
- * @member {Array.<number>} SuperMap.ServerGeometry.prototype.parts
- * @description 服务端几何对象中各个子对象所包含的节点个数。<br>
- * 1.几何对象从结构上可以分为简单几何对象和复杂几何对象。
- * 简单几何对象与复杂几何对象的区别:简单的几何对象一般为单一对象,
- * 而复杂的几何对象由多个简单对象组成或经过一定的空间运算之后产生,
- * 如:矩形为简单的区域对象,而中空的矩形为复杂的区域对象。<br>
- * 2.通常情况,一个简单几何对象的子对象就是它本身,
- * 因此对于简单对象来说的该字段为长度为1的整型数组,
- * 该字段的值就是这个简单对象节点的个数。
- * 如果一个几何对象是由几个简单对象组合而成的,
- * 例如,一个岛状几何对象由 3 个简单的多边形组成而成,
- * 那么这个岛状的几何对象的 Parts 字段值就是一个长度为 3 的整型数组,
- * 数组中每个成员的值分别代表这三个多边形所包含的节点个数。
- */
- this.parts = null;
- /**
- * @member {Array.<SuperMap.Geometry.Point>} SuperMap.ServerGeometry.prototype.points
- * @description 组成几何对象的节点的坐标对数组。<br>
- * 1.所有几何对象(点、线、面)都是由一些简单的点坐标组成的,
- * 该字段存放了组成几何对象的点坐标的数组。
- * 对于简单的面对象,他的起点和终点的坐标点相同。<br>
- * 2.对于复杂的几何对象,根据 Parts 属性来确定每一个组成复杂几何对象的简单对象所对应的节点的个数,
- * 从而确定 Points 字段中坐标对的分配归属问题。
- */
- this.points = null;
- /**
- * @member {SuperMap.GeometryType} SuperMap.ServerGeometry.prototype.type
- * @description 几何对象的类型(GeometryType)。
- */
- this.type = null;
- /**
- * @member {Object} SuperMap.ServerGeometry.prototype.prjCoordSys
- * @description 投影坐标参数,现仅在缓冲区分析中有效。
- */
- this.prjCoordSys = null;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = 'SuperMap.ServerGeometry';
- }
- /**
- * @function SuperMap.ServerGeometry.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ServerGeometry_createClass(ServerGeometry, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.id = null;
- me.style = null;
- me.parts = null;
- me.partTopo = null;
- me.points = null;
- me.type = null;
- me.prjCoordSys = null;
- }
- /**
- * @function SuperMap.ServerGeometry.prototype.toGeometry
- * @description 将服务端几何对象 ServerGeometry 转换为客户端几何对象 Geometry。
- * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
- */
- }, {
- key: "toGeometry",
- value: function toGeometry() {
- var me = this,
- geoType = me.type;
- switch (geoType.toUpperCase()) {
- case GeometryType.POINT:
- return me.toGeoPoint();
- case GeometryType.LINE:
- return me.toGeoLine();
- case GeometryType.LINEM:
- return me.toGeoLinem();
- case GeometryType.REGION:
- return me.toGeoRegion();
- case GeometryType.POINTEPS:
- return me.toGeoPoint();
- case GeometryType.LINEEPS:
- return me.toGeoLineEPS();
- case GeometryType.REGIONEPS:
- return me.toGeoRegionEPS();
- case GeometryType.GEOCOMPOUND:
- return me.transformGeoCompound();
- }
- }
- /**
- * @function SuperMap.ServerGeometry.prototype.toGeoPoint
- * @description 将服务端的点几何对象转换为客户端几何对象。包括 Point、MultiPoint。
- * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
- */
- }, {
- key: "toGeoPoint",
- value: function toGeoPoint() {
- var me = this,
- geoParts = me.parts || [],
- geoPoints = me.points || [],
- len = geoParts.length;
- if (len > 0) {
- if (len === 1) {
- return new Point(geoPoints[0].x, geoPoints[0].y);
- } else {
- var pointList = [];
- for (var i = 0; i < len; i++) {
- pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
- }
- return new MultiPoint(pointList);
- }
- } else {
- return null;
- }
- }
- /**
- * @function SuperMap.ServerGeometry.prototype.toGeoLine
- * @description 将服务端的线几何对象转换为客户端几何对象。包括 LinearRing、LineString、MultiLineString。
- * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
- */
- }, {
- key: "toGeoLine",
- value: function toGeoLine() {
- var me = this,
- geoParts = me.parts || [],
- geoPoints = me.points || [],
- len = geoParts.length;
- if (len > 0) {
- if (len === 1) {
- var pointList = [];
- for (var i = 0; i < geoParts[0]; i++) {
- pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
- } //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
- if (pointList[0].equals(pointList[geoParts[0] - 1])) {
- return new LinearRing(pointList);
- } else {
- return new LineString(pointList);
- }
- } else {
- var lineList = [];
- for (var _i = 0; _i < len; _i++) {
- var _pointList = [];
- for (var j = 0; j < geoParts[_i]; j++) {
- _pointList.push(new Point(geoPoints[j].x, geoPoints[j].y));
- }
- lineList.push(new LineString(_pointList));
- geoPoints.splice(0, geoParts[_i]);
- }
- return new MultiLineString(lineList);
- }
- } else {
- return null;
- }
- }
- /**
- * @function SuperMap.ServerGeometry.prototype.toGeoLineEPS
- * @description 将服务端的线几何对象转换为客户端几何对象。包括 LinearRing、LineString、MultiLineString。
- * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
- */
- }, {
- key: "toGeoLineEPS",
- value: function toGeoLineEPS() {
- var me = this,
- geoParts = me.parts || [],
- geoPoints = me.points || [],
- i,
- j,
- pointList,
- lineList,
- lineEPS,
- len = geoParts.length;
- if (len > 0) {
- if (len === 1) {
- for (i = 0, pointList = []; i < geoParts[0]; i++) {
- pointList.push(new Point(geoPoints[i].x, geoPoints[i].y, geoPoints[i].type));
- } //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
- if (pointList[0].equals(pointList[geoParts[0] - 1])) {
- lineEPS = LineString.createLineEPS(pointList);
- return new LinearRing(lineEPS);
- } else {
- lineEPS = LineString.createLineEPS(pointList);
- return new LineString(lineEPS);
- }
- } else {
- for (i = 0, lineList = []; i < len; i++) {
- for (j = 0, pointList = []; j < geoParts[i]; j++) {
- pointList.push(new Point(geoPoints[j].x, geoPoints[j].y));
- }
- lineEPS = LineString.createLineEPS(pointList);
- lineList.push(new LineString(lineEPS));
- geoPoints.splice(0, geoParts[i]);
- }
- return new MultiLineString(lineList);
- }
- } else {
- return null;
- }
- }
- /**
- * @function SuperMap.ServerGeometry.prototype.toGeoLine
- * @description 将服务端的路由线几何对象转换为客户端几何对象。包括 LinearRing、LineString、MultiLineString。
- * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
- */
- }, {
- key: "toGeoLinem",
- value: function toGeoLinem() {
- var me = this;
- return Route.fromJson(me);
- }
- /**
- * @function SuperMap.ServerGeometry.prototype.toGeoRegion
- * @description 将服务端的面几何对象转换为客户端几何对象。类型为 Polygon。
- * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
- */
- }, {
- key: "toGeoRegion",
- value: function toGeoRegion() {
- var me = this,
- geoParts = me.parts || [],
- geoTopo = me.partTopo || [],
- geoPoints = me.points || [],
- len = geoParts.length;
- if (len <= 0) {
- return null;
- }
- var polygonArray = [];
- var pointList = [];
- if (len == 1) {
- for (var i = 0; i < geoPoints.length; i++) {
- pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
- }
- polygonArray.push(new Polygon([new LinearRing(pointList)]));
- return new MultiPolygon(polygonArray);
- } //处理复杂面
- var CCWArray = [];
- var areaArray = [];
- var polygonArrayTemp = [];
- var polygonBounds = []; //polyon岛洞标识数组,初始都是岛。
- var CCWIdent = [];
- for (var _i2 = 0, pointIndex = 0; _i2 < len; _i2++) {
- for (var j = 0; j < geoParts[_i2]; j++) {
- pointList.push(new Point(geoPoints[pointIndex + j].x, geoPoints[pointIndex + j].y));
- }
- pointIndex += geoParts[_i2];
- var polygon = new Polygon([new LinearRing(pointList)]);
- pointList = [];
- polygonArrayTemp.push(polygon);
- if (geoTopo.length === 0) {
- polygonBounds.push(polygon.getBounds());
- }
- CCWIdent.push(1);
- areaArray.push(polygon.getArea());
- } //根据面积排序
- ServerGeometry.bubbleSort(areaArray, polygonArrayTemp, geoTopo, polygonBounds); //iServer 9D新增字段
- if (geoTopo.length === 0) {
- //岛洞底层判断原则:将所有的子对象按照面积排序,面积最大的直接判定为岛(1),从面积次大的开始处理,
- // 如果发现该对象在某个面积大于它的对象之中(即被包含),则根据包含它的对象的标识(1 or -1),指定其标识(-1 or 1),
- // 依次处理完所有对象,就得到了一个标识数组,1表示岛,-1表示洞
- //目标polygon索引列表 -1标示没有被任何polygon包含,
- var targetArray = [];
- for (var _i3 = 1; _i3 < polygonArrayTemp.length; _i3++) {
- for (var _j = _i3 - 1; _j >= 0; _j--) {
- targetArray[_i3] = -1;
- if (polygonBounds[_j].containsBounds(polygonBounds[_i3])) {
- CCWIdent[_i3] = CCWIdent[_j] * -1;
- if (CCWIdent[_i3] < 0) {
- targetArray[_i3] = _j;
- }
- break;
- }
- }
- }
- for (var _i4 = 0; _i4 < polygonArrayTemp.length; _i4++) {
- if (CCWIdent[_i4] > 0) {
- polygonArray.push(polygonArrayTemp[_i4]);
- } else {
- polygonArray[targetArray[_i4]].components = polygonArray[targetArray[_i4]].components.concat(polygonArrayTemp[_i4].components); //占位
- polygonArray.push('');
- }
- }
- } else {
- //根据面积排序
- //ServerGeometry.bubbleSort(areaArray, polygonArrayTemp,geoTopo);
- polygonArray = new Array();
- for (var _i5 = 0; _i5 < polygonArrayTemp.length; _i5++) {
- if (geoTopo[_i5] && geoTopo[_i5] == -1) {
- CCWArray = CCWArray.concat(polygonArrayTemp[_i5].components);
- } else {
- if (CCWArray.length > 0 && polygonArray.length > 0) {
- polygonArray[polygonArray.length - 1].components = polygonArray[polygonArray.length - 1].components.concat(CCWArray);
- CCWArray = [];
- }
- polygonArray.push(polygonArrayTemp[_i5]);
- }
- if (_i5 == len - 1) {
- var polyLength = polygonArray.length;
- if (polyLength) {
- polygonArray[polyLength - 1].components = polygonArray[polyLength - 1].components.concat(CCWArray);
- } else {
- for (var k = 0, length = CCWArray.length; k < length; k++) {
- polygonArray.push(new Polygon(CCWArray));
- }
- }
- }
- }
- }
- return new MultiPolygon(polygonArray);
- }
- /**
- * @function SuperMap.ServerGeometry.prototype.toGeoRegionEPS
- * @description 将服务端的面几何对象转换为客户端几何对象。类型为 Polygon。
- * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
- */
- }, {
- key: "toGeoRegionEPS",
- value: function toGeoRegionEPS() {
- var me = this,
- geoParts = me.parts || [],
- geoTopo = me.partTopo || [],
- geoPoints = me.points || [],
- len = geoParts.length;
- if (len <= 0) {
- return null;
- }
- var polygonArray = [];
- var pointList = [];
- var lineEPS;
- if (len == 1) {
- for (var i = 0; i < geoPoints.length; i++) {
- pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
- }
- lineEPS = LineString.createLineEPS(pointList);
- polygonArray.push(new Polygon([new LinearRing(lineEPS)]));
- return new MultiPolygon(polygonArray);
- } //处理复杂面
- var CCWArray = [];
- var areaArray = [];
- var polygonArrayTemp = [];
- var polygonBounds = []; //polyon岛洞标识数组,初始都是岛。
- var CCWIdent = [];
- for (var _i6 = 0, pointIndex = 0; _i6 < len; _i6++) {
- for (var j = 0; j < geoParts[_i6]; j++) {
- pointList.push(new Point(geoPoints[pointIndex + j].x, geoPoints[pointIndex + j].y));
- }
- pointIndex += geoParts[_i6];
- lineEPS = LineString.createLineEPS(pointList);
- var polygon = new Polygon([new LinearRing(lineEPS)]);
- pointList = [];
- polygonArrayTemp.push(polygon);
- if (geoTopo.length === 0) {
- polygonBounds.push(polygon.getBounds());
- }
- CCWIdent.push(1);
- areaArray.push(polygon.getArea());
- } //根据面积排序
- ServerGeometry.bubbleSort(areaArray, polygonArrayTemp, geoTopo, polygonBounds); //iServer 9D新增字段
- if (geoTopo.length === 0) {
- //岛洞底层判断原则:将所有的子对象按照面积排序,面积最大的直接判定为岛(1),从面积次大的开始处理,
- // 如果发现该对象在某个面积大于它的对象之中(即被包含),则根据包含它的对象的标识(1 or -1),指定其标识(-1 or 1),
- // 依次处理完所有对象,就得到了一个标识数组,1表示岛,-1表示洞
- //目标polygon索引列表 -1标示没有被任何polygon包含,
- var targetArray = [];
- for (var _i7 = 1; _i7 < polygonArrayTemp.length; _i7++) {
- for (var _j2 = _i7 - 1; _j2 >= 0; _j2--) {
- targetArray[_i7] = -1;
- if (polygonBounds[_j2].containsBounds(polygonBounds[_i7])) {
- CCWIdent[_i7] = CCWIdent[_j2] * -1;
- if (CCWIdent[_i7] < 0) {
- targetArray[_i7] = _j2;
- }
- break;
- }
- }
- }
- for (var _i8 = 0; _i8 < polygonArrayTemp.length; _i8++) {
- if (CCWIdent[_i8] > 0) {
- polygonArray.push(polygonArrayTemp[_i8]);
- } else {
- polygonArray[targetArray[_i8]].components = polygonArray[targetArray[_i8]].components.concat(polygonArrayTemp[_i8].components); //占位
- polygonArray.push('');
- }
- }
- } else {
- //根据面积排序
- polygonArray = new Array();
- for (var _i9 = 0; _i9 < polygonArrayTemp.length; _i9++) {
- if (geoTopo[_i9] && geoTopo[_i9] == -1) {
- CCWArray = CCWArray.concat(polygonArrayTemp[_i9].components);
- } else {
- if (CCWArray.length > 0 && polygonArray.length > 0) {
- polygonArray[polygonArray.length - 1].components = polygonArray[polygonArray.length - 1].components.concat(CCWArray);
- CCWArray = [];
- }
- polygonArray.push(polygonArrayTemp[_i9]);
- }
- if (_i9 == len - 1) {
- var polyLength = polygonArray.length;
- if (polyLength) {
- polygonArray[polyLength - 1].components = polygonArray[polyLength - 1].components.concat(CCWArray);
- } else {
- for (var k = 0, length = CCWArray.length; k < length; k++) {
- polygonArray.push(new Polygon(CCWArray));
- }
- }
- }
- }
- }
- return new MultiPolygon(polygonArray);
- }
- }, {
- key: "transformGeoCompound",
- value: function transformGeoCompound() {
- var me = this,
- geoParts = me.geoParts || [],
- len = geoParts.length;
- if (len <= 0) {
- return null;
- }
- var geometryList = [];
- for (var index = 0; index < len; index++) {
- var geometry = geoParts[index];
- geometryList.push(new ServerGeometry(geometry).toGeometry());
- }
- return new Collection(geometryList);
- }
- /**
- * @function SuperMap.ServerGeometry.prototype.fromJson
- * @description 将 JSON 对象表示服务端几何对象转换为 ServerGeometry。
- * @param {Object} jsonObject - 要转换的 JSON 对象。
- * @returns {SuperMap.ServerGeometry} 转换后的 ServerGeometry 对象。
- */
- }], [{
- key: "fromJson",
- value: function fromJson(jsonObject) {
- if (!jsonObject) {
- return;
- }
- return new ServerGeometry({
- id: jsonObject.id,
- style: ServerStyle.fromJson(jsonObject.style),
- parts: jsonObject.parts,
- partTopo: jsonObject.partTopo,
- points: jsonObject.points,
- center: jsonObject.center,
- length: jsonObject.length,
- maxM: jsonObject.maxM,
- minM: jsonObject.minM,
- type: jsonObject.type
- });
- }
- /**
- * @function SuperMap.ServerGeometry.prototype.fromGeometry
- * @description 将客户端 Geometry 转换成服务端 ServerGeometry。
- * @param {SuperMap.Geometry} geometry - 要转换的客户端 Geometry 对象。
- * @returns {SuperMap.ServerGeometry} 转换后的 ServerGeometry 对象。
- */
- }, {
- key: "fromGeometry",
- value: function fromGeometry(geometry) {
- if (!geometry) {
- return;
- }
- var id = 0,
- parts = [],
- points = [],
- type = null,
- icomponents = geometry.components,
- className = geometry.CLASS_NAME,
- prjCoordSys = {
- epsgCode: geometry.SRID
- };
- if (!isNaN(geometry.id)) {
- id = geometry.id;
- } //坑爹的改法,没法,为了支持态势标绘,有时间就得全改
- if (className != 'SuperMap.Geometry.LinearRing' && className != 'SuperMap.Geometry.LineString' && (geometry instanceof MultiPoint || geometry instanceof MultiLineString)) {
- var ilen = icomponents.length;
- for (var i = 0; i < ilen; i++) {
- var partPointsCount = icomponents[i].getVertices().length;
- parts.push(partPointsCount);
- for (var j = 0; j < partPointsCount; j++) {
- points.push(new Point(icomponents[i].getVertices()[j].x, icomponents[i].getVertices()[j].y));
- }
- } //这里className不是多点就全部是算线
- type = className == 'SuperMap.Geometry.MultiPoint' ? GeometryType.POINT : GeometryType.LINE;
- } else if (geometry instanceof MultiPolygon) {
- var _ilen = icomponents.length;
- for (var _i10 = 0; _i10 < _ilen; _i10++) {
- var polygon = icomponents[_i10],
- linearRingOfPolygon = polygon.components,
- linearRingOfPolygonLen = linearRingOfPolygon.length;
- for (var _j3 = 0; _j3 < linearRingOfPolygonLen; _j3++) {
- var _partPointsCount = linearRingOfPolygon[_j3].getVertices().length + 1;
- parts.push(_partPointsCount);
- for (var k = 0; k < _partPointsCount - 1; k++) {
- points.push(new Point(linearRingOfPolygon[_j3].getVertices()[k].x, linearRingOfPolygon[_j3].getVertices()[k].y));
- }
- points.push(new Point(linearRingOfPolygon[_j3].getVertices()[0].x, linearRingOfPolygon[_j3].getVertices()[0].y));
- }
- }
- type = GeometryType.REGION;
- } else if (geometry instanceof Polygon) {
- var _ilen2 = icomponents.length;
- for (var _i11 = 0; _i11 < _ilen2; _i11++) {
- var _partPointsCount2 = icomponents[_i11].getVertices().length + 1;
- parts.push(_partPointsCount2);
- for (var _j4 = 0; _j4 < _partPointsCount2 - 1; _j4++) {
- points.push(new Point(icomponents[_i11].getVertices()[_j4].x, icomponents[_i11].getVertices()[_j4].y));
- }
- points.push(new Point(icomponents[_i11].getVertices()[0].x, icomponents[_i11].getVertices()[0].y));
- }
- type = GeometryType.REGION;
- } else {
- var geometryVerticesCount = geometry.getVertices().length;
- for (var _j5 = 0; _j5 < geometryVerticesCount; _j5++) {
- points.push(new Point(geometry.getVertices()[_j5].x, geometry.getVertices()[_j5].y));
- }
- if (geometry instanceof LinearRing) {
- points.push(new Point(geometry.getVertices()[0].x, geometry.getVertices()[0].y));
- geometryVerticesCount++;
- }
- parts.push(geometryVerticesCount);
- type = geometry instanceof Point ? GeometryType.POINT : GeometryType.LINE;
- }
- return new ServerGeometry({
- id: id,
- style: null,
- parts: parts,
- points: points,
- type: type,
- prjCoordSys: prjCoordSys
- });
- }
- /**
- * @function SuperMap.ServerGeometry.prototype.IsClockWise
- * @description 判断 linearRing 中的点的顺序。返回值大于 0,逆时针;小于 0,顺时针。
- * @param {SuperMap.Geometry} geometry - 要转换的客户端 Geometry 对象。
- * @returns {number} 返回值大于 0,逆时针;小于 0,顺时针。
- */
- }, {
- key: "IsClockWise",
- value: function IsClockWise(points) {
- var length = points.length;
- if (length < 3) {
- return 0.0;
- }
- var s = points[0].y * (points[length - 1].x - points[1].x);
- points.push(points[0]);
- for (var i = 1; i < length; i++) {
- s += points[i].y * (points[i - 1].x - points[i + 1].x);
- }
- return s * 0.5;
- }
- }, {
- key: "bubbleSort",
- value: function bubbleSort(areaArray, pointList, geoTopo, polygonBounds) {
- for (var i = 0; i < areaArray.length; i++) {
- for (var j = 0; j < areaArray.length; j++) {
- if (areaArray[i] > areaArray[j]) {
- var d = areaArray[j];
- areaArray[j] = areaArray[i];
- areaArray[i] = d;
- var b = pointList[j];
- pointList[j] = pointList[i];
- pointList[i] = b;
- if (geoTopo && geoTopo.length > 0) {
- var c = geoTopo[j];
- geoTopo[j] = geoTopo[i];
- geoTopo[i] = c;
- }
- if (polygonBounds && polygonBounds.length > 0) {
- var f = polygonBounds[j];
- polygonBounds[j] = polygonBounds[i];
- polygonBounds[i] = f;
- }
- }
- }
- }
- }
- }]);
- return ServerGeometry;
- }();
- SuperMap.ServerGeometry = ServerGeometry;
- ;// CONCATENATED MODULE: ./src/common/format/GeoJSON.js
- 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); }
- function GeoJSON_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GeoJSON_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoJSON_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoJSON_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GeoJSON_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoJSON_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GeoJSON_setPrototypeOf(o, p) { GeoJSON_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoJSON_setPrototypeOf(o, p); }
- 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); }; }
- function GeoJSON_possibleConstructorReturn(self, call) { if (call && (GeoJSON_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoJSON_assertThisInitialized(self); }
- function GeoJSON_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GeoJSON_getPrototypeOf(o) { GeoJSON_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoJSON_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Format.GeoJSON
- * @classdesc GeoJSON 的读和写。使用 {@link SuperMap.Format.GeoJSON} 构造器创建一个 GeoJSON 解析器。
- * @category BaseTypes Format
- * @param {Object} [options] - 参数。
- * @param {string} [options.indent=" "] - 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
- * @param {string} [options.space=" "] - 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
- * @param {string} [options.newline="\n"] - 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
- * @param {number} [options.level=0] - 用于格式化输出, 表示的是缩进级别。
- * @param {boolean} [options.pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
- * @param {boolean} [options.nativeJSON] - 需要被注册的监听器对象。
- * @param {boolean} [options.ignoreExtraDims=true] - 忽略维度超过 2 的几何要素。
- * @extends {SuperMap.Format.JSON}
- */
- var GeoJSON = /*#__PURE__*/function (_JSONFormat) {
- GeoJSON_inherits(GeoJSON, _JSONFormat);
- var _super = GeoJSON_createSuper(GeoJSON);
- function GeoJSON(options) {
- var _this;
- GeoJSON_classCallCheck(this, GeoJSON);
- _this = _super.call(this, options);
- /**
- * @member {boolean} [SuperMap.Format.GeoJSON.prototype.ignoreExtraDims=true]
- * @description 忽略维度超过 2 的几何要素。
- */
- _this.ignoreExtraDims = true;
- _this.CLASS_NAME = "SuperMap.Format.GeoJSON";
- /**
- * @member {Object} SuperMap.Format.GeoJSON.prototype.parseCoords
- * @private
- * @description 一个属性名对应着 GeoJSON 对象的几何类型的对象。每个属性其实都是一个实际上做解析用的方法。
- */
- _this.parseCoords = {
- /**
- * @function SuperMap.Format.GeoJSON.parseCoords.point
- * @description 将一组坐标转成一个 {@link SuperMap.Geometry} 对象。
- * @param {Object} array - GeoJSON 片段中的一组坐标。
- * @returns {SuperMap.Geometry} 一个几何对象。
- */
- "point": function point(array) {
- if (this.ignoreExtraDims === false && array.length != 2) {
- throw "Only 2D points are supported: " + array;
- }
- return new Point(array[0], array[1]);
- },
- /**
- * @function SuperMap.Format.GeoJSON.parseCoords.multipoint
- * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
- * @param {Object} array - GeoJSON 片段中的坐标组数组。
- * @returns {SuperMap.Geometry} 一个几何对象。
- */
- "multipoint": function multipoint(array) {
- var points = [];
- var p = null;
- for (var i = 0, len = array.length; i < len; ++i) {
- try {
- p = this.parseCoords["point"].apply(this, [array[i]]);
- } catch (err) {
- throw err;
- }
- points.push(p);
- }
- return new MultiPoint(points);
- },
- /**
- * @function SuperMap.Format.GeoJSON.parseCoords.linestring
- * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
- * @param {Object} array - GeoJSON 片段中的坐标组数组。
- * @returns {SuperMap.Geometry} 一个几何对象。
- */
- "linestring": function linestring(array) {
- var points = [];
- var p = null;
- for (var i = 0, len = array.length; i < len; ++i) {
- try {
- p = this.parseCoords["point"].apply(this, [array[i]]);
- } catch (err) {
- throw err;
- }
- points.push(p);
- }
- return new LineString(points);
- },
- /**
- * @function SuperMap.Format.GeoJSON.parseCoords.multilinestring
- * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
- * @param {Object} array - GeoJSON 片段中的坐标组数组。
- * @returns {SuperMap.Geometry} 一个几何对象。
- */
- "multilinestring": function multilinestring(array) {
- var lines = [];
- var l = null;
- for (var i = 0, len = array.length; i < len; ++i) {
- try {
- l = this.parseCoords["linestring"].apply(this, [array[i]]);
- } catch (err) {
- throw err;
- }
- lines.push(l);
- }
- return new MultiLineString(lines);
- },
- /**
- * @function SuperMap.Format.GeoJSON.parseCoords.polygon
- * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
- * @returns {SuperMap.Geometry} 一个几何对象。
- */
- "polygon": function polygon(array) {
- var rings = [];
- var r, l;
- for (var i = 0, len = array.length; i < len; ++i) {
- try {
- l = this.parseCoords["linestring"].apply(this, [array[i]]);
- } catch (err) {
- throw err;
- }
- r = new LinearRing(l.components);
- rings.push(r);
- }
- return new Polygon(rings);
- },
- /**
- * @function SuperMap.Format.GeoJSON.parseCoords.multipolygon
- * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
- * @param {Object} array - GeoJSON 片段中的坐标组数组。
- * @returns {SuperMap.Geometry} 一个几何对象。
- */
- "multipolygon": function multipolygon(array) {
- var polys = [];
- var p = null;
- for (var i = 0, len = array.length; i < len; ++i) {
- try {
- p = this.parseCoords["polygon"].apply(this, [array[i]]);
- } catch (err) {
- throw err;
- }
- polys.push(p);
- }
- return new MultiPolygon(polys);
- },
- /**
- * @function SuperMap.Format.GeoJSON.parseCoords.box
- * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
- * @param {Object} array - GeoJSON 片段中的坐标组数组。
- * @returns {SuperMap.Geometry} 一个几何对象。
- */
- "box": function box(array) {
- if (array.length != 2) {
- throw "GeoJSON box coordinates must have 2 elements";
- }
- 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])])]);
- }
- };
- /**
- * @member {Object} SuperMap.Format.GeoJSON.prototype.extract
- * @private
- * @description 一个属性名对应着GeoJSON类型的对象。其值为相应的实际的解析方法。
- */
- _this.extract = {
- /**
- * @function SuperMap.Format.GeoJSON.extract.feature
- * @description 返回一个表示单个要素对象的 GeoJSON 的一部分。
- * @param {SuperMap.ServerFeature} feature - iServer 要素对象。
- * @returns {Object} 一个表示点的对象。
- */
- 'feature': function feature(_feature) {
- var geom = this.extract.geometry.apply(this, [_feature.geometry]);
- var json = {
- "type": "Feature",
- "properties": this.createAttributes(_feature),
- "geometry": geom
- };
- if (_feature.geometry && _feature.geometry.type === 'TEXT') {
- json.properties.texts = _feature.geometry.texts;
- json.properties.textStyle = _feature.geometry.textStyle;
- }
- if (_feature.fid) {
- json.id = _feature.fid;
- }
- if (_feature.ID) {
- json.id = _feature.ID;
- }
- return json;
- },
- /**
- * @function SuperMap.Format.GeoJSON.extract.geometry
- * @description 返回一个表示单个几何对象的 GeoJSON 的一部分。
- * @param {Object} geometry - iServer 几何对象。
- * @returns {Object} 一个表示几何体的对象。
- */
- 'geometry': function geometry(_geometry) {
- if (_geometry == null) {
- return null;
- }
- if (!_geometry.parts && _geometry.points) {
- _geometry.parts = [_geometry.points.length];
- }
- var geo = _geometry.hasOwnProperty('geometryType') ? _geometry : new ServerGeometry(_geometry).toGeometry() || _geometry;
- var geometryType = geo.geometryType || geo.type;
- var data;
- if (geometryType === "LinearRing") {
- geometryType = "LineString";
- }
- if (geometryType === "LINEM") {
- geometryType = "MultiLineString";
- }
- data = this.extract[geometryType.toLowerCase()].apply(this, [geo]);
- geometryType = geometryType === 'TEXT' ? 'Point' : geometryType;
- var json;
- if (geometryType === "Collection") {
- json = {
- "type": "GeometryCollection",
- "geometries": data
- };
- } else {
- json = {
- "type": geometryType,
- "coordinates": data
- };
- }
- return json;
- },
- /**
- * @function SuperMap.Format.GeoJSON.extract.point
- * @description 从一个点对象中返回一个坐标组。
- * @param {SuperMap.Geometry.Point} point - 一个点对象。
- * @returns {Array} 一个表示一个点的坐标组。
- */
- 'point': function point(_point) {
- var p = [_point.x, _point.y];
- for (var name in _point) {
- if (name !== "x" && name !== "y" && _point[name] !== null && !isNaN(_point[name])) {
- p.push(_point[name]);
- }
- }
- return p;
- },
- /**
- * @function SuperMap.Format.GeoJSON.extract.point
- * @description 从一个文本对象中返回一个坐标组。
- * @param {Object} geo - 一个文本对象。
- * @returns {Array} 一个表示一个点的坐标组。
- */
- 'text': function text(geo) {
- return [geo.points[0].x, geo.points[0].y];
- },
- /**
- * @function SuperMap.Format.GeoJSON.extract.multipoint
- * @description 从一个多点对象中返一个坐标组数组。
- * @param {SuperMap.Geometry.MultiPoint} multipoint - 多点对象。
- * @returns {Array} 一个表示多点的坐标组数组。
- */
- 'multipoint': function multipoint(_multipoint) {
- var array = [];
- for (var i = 0, len = _multipoint.components.length; i < len; ++i) {
- array.push(this.extract.point.apply(this, [_multipoint.components[i]]));
- }
- return array;
- },
- /**
- * @function SuperMap.Format.GeoJSON.extract.linestring
- * @description 从一个线对象中返回一个坐标组数组。
- * @param {SuperMap.Geometry.Linestring} linestring - 线对象。
- * @returns {Array} 一个表示线对象的坐标组数组。
- */
- 'linestring': function linestring(_linestring) {
- var array = [];
- for (var i = 0, len = _linestring.components.length; i < len; ++i) {
- array.push(this.extract.point.apply(this, [_linestring.components[i]]));
- }
- return array;
- },
- /**
- * @function SuperMap.Format.GeoJSON.extract.multilinestring
- * @description 从一个多线对象中返回一个线数组。
- * @param {SuperMap.Geometry.MultiLinestring} multilinestring - 多线对象。
- *
- * @returns {Array} 一个表示多线的线数组。
- */
- 'multilinestring': function multilinestring(_multilinestring) {
- var array = [];
- for (var i = 0, len = _multilinestring.components.length; i < len; ++i) {
- array.push(this.extract.linestring.apply(this, [_multilinestring.components[i]]));
- }
- return array;
- },
- /**
- * @function SuperMap.Format.GeoJSON.extract.polygon
- * @description 从一个面对象中返回一组线环。
- * @param {SuperMap.Geometry.Polygon} polygon - 面对象。
- * @returns {Array} 一组表示面的线环。
- */
- 'polygon': function polygon(_polygon) {
- var array = [];
- for (var i = 0, len = _polygon.components.length; i < len; ++i) {
- array.push(this.extract.linestring.apply(this, [_polygon.components[i]]));
- }
- return array;
- },
- /**
- * @function SuperMap.Format.GeoJSON.extract.multipolygon
- * @description 从一个多面对象中返回一组面。
- * @param {SuperMap.Geometry.MultiPolygon} multipolygon - 多面对象。
- * @returns {Array} 一组表示多面的面。
- */
- 'multipolygon': function multipolygon(_multipolygon) {
- var array = [];
- for (var i = 0, len = _multipolygon.components.length; i < len; ++i) {
- array.push(this.extract.polygon.apply(this, [_multipolygon.components[i]]));
- }
- return array;
- },
- /**
- * @function SuperMap.Format.GeoJSON.extract.collection
- * @description 从一个几何要素集合中一组几何要素数组。
- * @param {SuperMap.Geometry.Collection} collection - 几何要素集合。
- * @returns {Array} 一组表示几何要素集合的几何要素数组。
- */
- 'collection': function collection(_collection) {
- var len = _collection.components.length;
- var array = new Array(len);
- for (var i = 0; i < len; ++i) {
- array[i] = this.extract.geometry.apply(this, [_collection.components[i]]);
- }
- return array;
- }
- };
- return _this;
- }
- /**
- * @function SuperMap.Format.GeoJSON.prototype.read
- * @description 将 GeoJSON 对象或者GeoJSON 对象字符串转换为 SuperMap Feature 对象。
- * @param {GeoJSONObject} json - GeoJSON 对象。
- * @param {string} [type='FeaureCollection'] - 可选的字符串,它决定了输出的格式。支持的值有:"Geometry","Feature",和 "FeatureCollection",如果此值为null。
- * @param {Function} filter - 对象中每个层次每个键值对都会调用此函数得出一个结果。每个值都会被 filter 函数的结果所替换掉。这个函数可被用来将某些对象转化成某个类相应的对象,或者将日期字符串转化成Date对象。
- * @returns {Object} 返回值依赖于 type 参数的值。
- * -如果 type 等于 "FeatureCollection",返回值将会是 {@link SuperMap.Feature.Vector} 数组。
- * -如果 type 为 "Geometry",输入的 JSON 对象必须表示一个唯一的几何体,然后返回值就会是 {@link SuperMap.Feature.Geometry}。
- * -如果 type 为 "Feature",输入的 JSON 对象也必须表示的一个要素,这样返回值才会是 {@link SuperMap.Feature.Vector}。
- */
- GeoJSON_createClass(GeoJSON, [{
- key: "read",
- value: function read(json, type, filter) {
- type = type ? type : "FeatureCollection";
- var results = null;
- var obj = null;
- if (typeof json == "string") {
- obj = GeoJSON_get(GeoJSON_getPrototypeOf(GeoJSON.prototype), "read", this).call(this, json, filter);
- } else {
- obj = json;
- }
- if (!obj) {//SuperMap.Console.error("Bad JSON: " + json);
- } else if (typeof obj.type != "string") {//SuperMap.Console.error("Bad GeoJSON - no type: " + json);
- } else if (this.isValidType(obj, type)) {
- switch (type) {
- case "Geometry":
- try {
- results = this.parseGeometry(obj);
- } catch (err) {//SuperMap.Console.error(err);
- }
- break;
- case "Feature":
- try {
- results = this.parseFeature(obj);
- results.type = "Feature";
- } catch (err) {//SuperMap.Console.error(err);
- }
- break;
- case "FeatureCollection":
- // for type FeatureCollection, we allow input to be any type
- results = [];
- switch (obj.type) {
- case "Feature":
- try {
- results.push(this.parseFeature(obj));
- } catch (err) {
- results = null; //SuperMap.Console.error(err);
- }
- break;
- case "FeatureCollection":
- for (var i = 0, len = obj.features.length; i < len; ++i) {
- try {
- results.push(this.parseFeature(obj.features[i]));
- } catch (err) {
- results = null; // SuperMap.Console.error(err);
- }
- }
- break;
- default:
- try {
- var geom = this.parseGeometry(obj);
- results.push(new Vector(geom));
- } catch (err) {
- results = null; //SuperMap.Console.error(err);
- }
- }
- break;
- default:
- break;
- }
- }
- return results;
- }
- /**
- * @function SuperMap.Format.GeoJSON.prototype.write
- * @description iServer Geometry JSON 对象 转 GeoJSON对象字符串。
- * @param {Object} obj - iServer Geometry JSON 对象。
- * @param {boolean} [pretty=false] - 是否使用换行和缩进来控制输出。
- * @returns {GeoJSONObject} 一个 GeoJSON 字符串,它表示了输入的几何对象,要素对象,或者要素对象数组。
- */
- }, {
- key: "write",
- value: function write(obj, pretty) {
- return GeoJSON_get(GeoJSON_getPrototypeOf(GeoJSON.prototype), "write", this).call(this, this.toGeoJSON(obj), pretty);
- }
- /**
- * @function SuperMap.Format.GeoJSON.prototype.fromGeoJSON
- * @version 9.1.1
- * @description 将 GeoJSON 对象或者GeoJSON 对象字符串转换为iServer Feature JSON。
- * @param {GeoJSONObject} json - GeoJSON 对象。
- * @param {string} [type='FeaureCollection'] - 可选的字符串,它决定了输出的格式。支持的值有:"Geometry","Feature",和 "FeatureCollection",如果此值为null。
- * @param {Function} filter - 对象中每个层次每个键值对都会调用此函数得出一个结果。每个值都会被 filter 函数的结果所替换掉。这个函数可被用来将某些对象转化成某个类相应的对象,或者将日期字符串转化成Date对象。
- * @returns {Object} iServer Feature JSON。
- */
- }, {
- key: "fromGeoJSON",
- value: function fromGeoJSON(json, type, filter) {
- var _this2 = this;
- var feature = this.read(json, type, filter);
- if (!Util.isArray(feature)) {
- return this._toiSevrerFeature(feature);
- }
- return feature.map(function (element) {
- return _this2._toiSevrerFeature(element);
- });
- }
- /**
- * @function SuperMap.Format.GeoJSON.prototype.toGeoJSON
- * @version 9.1.1
- * @description 将 iServer Feature JSON 对象转换为 GeoJSON 对象。
- * @param {Object} obj - iServer Feature JSON。
- * @returns {GeoJSONObject} GeoJSON 对象。
- */
- }, {
- key: "toGeoJSON",
- value: function toGeoJSON(obj) {
- var geojson = {
- "type": null
- };
- if (Util.isArray(obj)) {
- geojson.type = "FeatureCollection";
- var numFeatures = obj.length;
- geojson.features = new Array(numFeatures);
- for (var i = 0; i < numFeatures; ++i) {
- var element = obj[i];
- if (isGeometry(element)) {
- var feature = {};
- feature.geometry = element;
- geojson.features[i] = this.extract.feature.apply(this, [feature]);
- } else {
- geojson.features[i] = this.extract.feature.apply(this, [element]);
- }
- }
- } else if (isGeometry(obj)) {
- var _feature2 = {};
- _feature2.geometry = obj;
- geojson = this.extract.feature.apply(this, [_feature2]);
- } else {
- geojson = this.extract.feature.apply(this, [obj]);
- }
- function isGeometry(input) {
- return input.hasOwnProperty("parts") && input.hasOwnProperty("points") || input.hasOwnProperty("geoParts");
- }
- return geojson;
- }
- /**
- * @function SuperMap.Format.GeoJSON.prototype.isValidType
- * @description 检查一个 GeoJSON 对象是否和给定的类型相符的合法的对象。
- * @returns {boolean} GeoJSON 是否是给定类型的合法对象。
- * @private
- */
- }, {
- key: "isValidType",
- value: function isValidType(obj, type) {
- var valid = false;
- switch (type) {
- case "Geometry":
- if (Util.indexOf(["Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection"], obj.type) == -1) {// unsupported geometry type
- //SuperMap.Console.error("Unsupported geometry type: " +
- // obj.type);
- } else {
- valid = true;
- }
- break;
- case "FeatureCollection":
- // allow for any type to be converted to a feature collection
- valid = true;
- break;
- default:
- // for Feature types must match
- if (obj.type == type) {
- valid = true;
- } else {//SuperMap.Console.error("Cannot convert types from " +
- //obj.type + " to " + type);
- }
- }
- return valid;
- }
- /**
- * @function SuperMap.Format.GeoJSON.prototype.parseFeature
- * @description 将一个 GeoJSON 中的 feature 转化成 {@link SuperMap.Feature.Vector}> 对象。
- * @private
- * @param {GeoJSONObject} obj - 从 GeoJSON 对象中创建一个对象。
- * @returns {SuperMap.Feature.Vector} 一个要素。
- */
- }, {
- key: "parseFeature",
- value: function parseFeature(obj) {
- var feature, geometry, attributes, bbox;
- attributes = obj.properties ? obj.properties : {};
- bbox = obj.geometry && obj.geometry.bbox || obj.bbox;
- try {
- geometry = this.parseGeometry(obj.geometry);
- } catch (err) {
- // deal with bad geometries
- throw err;
- }
- feature = new Vector(geometry, attributes);
- if (bbox) {
- feature.bounds = Bounds.fromArray(bbox);
- }
- if (obj.id) {
- feature.fid = obj.id;
- }
- return feature;
- }
- /**
- * @function SuperMap.Format.GeoJSON.prototype.parseGeometry
- * @description 将一个 GeoJSON 中的几何要素转化成 {@link SuperMap.Geometry} 对象。
- * @param {GeoJSONObject} obj - 从 GeoJSON 对象中创建一个对象。
- * @returns {SuperMap.Geometry} 一个几何要素。
- * @private
- */
- }, {
- key: "parseGeometry",
- value: function parseGeometry(obj) {
- if (obj == null) {
- return null;
- }
- var geometry;
- if (obj.type == "GeometryCollection") {
- if (!Util.isArray(obj.geometries)) {
- throw "GeometryCollection must have geometries array: " + obj;
- }
- var numGeom = obj.geometries.length;
- var components = new Array(numGeom);
- for (var i = 0; i < numGeom; ++i) {
- components[i] = this.parseGeometry.apply(this, [obj.geometries[i]]);
- }
- geometry = new Collection(components);
- } else {
- if (!Util.isArray(obj.coordinates)) {
- throw "Geometry must have coordinates array: " + obj;
- }
- if (!this.parseCoords[obj.type.toLowerCase()]) {
- throw "Unsupported geometry type: " + obj.type;
- }
- try {
- geometry = this.parseCoords[obj.type.toLowerCase()].apply(this, [obj.coordinates]);
- } catch (err) {
- // deal with bad coordinates
- throw err;
- }
- }
- return geometry;
- }
- /**
- * @function SuperMap.Format.GeoJSON.prototype.createCRSObject
- * @description 从一个要素对象中创建一个坐标参考系对象。
- * @param {SuperMap.Feature.Vector} object - 要素对象。
- * @private
- * @returns {GeoJSONObject} 一个可作为 GeoJSON 对象的 CRS 属性使用的对象。
- */
- }, {
- key: "createCRSObject",
- value: function createCRSObject(object) {
- var proj = object.layer.projection.toString();
- var crs = {};
- if (proj.match(/epsg:/i)) {
- var code = parseInt(proj.substring(proj.indexOf(":") + 1));
- if (code == 4326) {
- crs = {
- "type": "name",
- "properties": {
- "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
- }
- };
- } else {
- crs = {
- "type": "name",
- "properties": {
- "name": "EPSG:" + code
- }
- };
- }
- }
- return crs;
- }
- }, {
- key: "_toiSevrerFeature",
- value: function _toiSevrerFeature(feature) {
- var attributes = feature.attributes;
- var attrNames = [];
- var attrValues = [];
- for (var attr in attributes) {
- attrNames.push(attr);
- attrValues.push(attributes[attr]);
- }
- var newFeature = {
- fieldNames: attrNames,
- fieldValues: attrValues,
- geometry: ServerGeometry.fromGeometry(feature.geometry)
- };
- newFeature.geometry.id = feature.fid;
- return newFeature;
- }
- }, {
- key: "createAttributes",
- value: function createAttributes(feature) {
- if (!feature) {
- return null;
- }
- var attr = {};
- processFieldsAttributes(feature, attr);
- var exceptKeys = ["fieldNames", "fieldValues", "geometry", "stringID", "ID"];
- for (var key in feature) {
- if (exceptKeys.indexOf(key) > -1) {
- continue;
- }
- attr[key] = feature[key];
- }
- function processFieldsAttributes(feature, attributes) {
- if (!(feature.hasOwnProperty("fieldNames") && feature.hasOwnProperty("fieldValues"))) {
- return;
- }
- var names = feature.fieldNames,
- values = feature.fieldValues;
- for (var i in names) {
- attributes[names[i]] = values[i];
- }
- }
- return attr;
- }
- }]);
- return GeoJSON;
- }(JSONFormat);
- SuperMap.Format.GeoJSON = GeoJSON;
- ;// CONCATENATED MODULE: ./src/common/format/WKT.js
- 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); }
- function WKT_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function WKT_createClass(Constructor, protoProps, staticProps) { if (protoProps) WKT_defineProperties(Constructor.prototype, protoProps); if (staticProps) WKT_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function WKT_setPrototypeOf(o, p) { WKT_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WKT_setPrototypeOf(o, p); }
- 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); }; }
- function WKT_possibleConstructorReturn(self, call) { if (call && (WKT_typeof(call) === "object" || typeof call === "function")) { return call; } return WKT_assertThisInitialized(self); }
- function WKT_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function WKT_getPrototypeOf(o) { WKT_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WKT_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Format.WKT
- * @classdesc 用于读写常见文本的类。通过 {@link SuperMap.Format.WKT} 构造器来创建一个新的实例。
- * @category BaseTypes Format
- * @extends {SuperMap.Format}
- * @param {Object} options - 可选的选项对象,其属性将被设置到实例。option 具体配置项继承自 {@link SuperMap.Format}。
- */
- var WKT = /*#__PURE__*/function (_Format) {
- WKT_inherits(WKT, _Format);
- var _super = WKT_createSuper(WKT);
- function WKT(options) {
- var _this;
- WKT_classCallCheck(this, WKT);
- _this = _super.call(this, options);
- _this.regExes = {
- 'typeStr': /^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,
- 'spaces': /\s+/,
- 'parenComma': /\)\s*,\s*\(/,
- 'doubleParenComma': /\)\s*\)\s*,\s*\(\s*\(/,
- // can't use {2} here
- 'trimParens': /^\s*\(?(.*?)\)?\s*$/
- };
- _this.CLASS_NAME = "SuperMap.Format.WKT";
- /**
- * @private
- * @description Object with properties corresponding to the geometry types.
- * Property values are functions that do the actual data extraction.
- */
- _this.extract = {
- /**
- * @description Return a space delimited string of point coordinates.
- * @param {SuperMap.Geometry.Point} point
- * @returns {string} A string of coordinates representing the point
- */
- 'point': function point(_point) {
- return _point.x + ' ' + _point.y;
- },
- /**
- * @description Return a comma delimited string of point coordinates from a multipoint.
- * @param {SuperMap.Geometry.MultiPoint} multipoint
- * @returns {string} A string of point coordinate strings representing
- * the multipoint
- */
- 'multipoint': function multipoint(_multipoint) {
- var array = [];
- for (var i = 0, len = _multipoint.components.length; i < len; ++i) {
- array.push('(' + this.extract.point.apply(this, [_multipoint.components[i]]) + ')');
- }
- return array.join(',');
- },
- /**
- * @description Return a comma delimited string of point coordinates from a line.
- * @param {SuperMap.Geometry.LineString} linestring
- * @returns {string} A string of point coordinate strings representing
- * the linestring
- */
- 'linestring': function linestring(_linestring) {
- var array = [];
- for (var i = 0, len = _linestring.components.length; i < len; ++i) {
- array.push(this.extract.point.apply(this, [_linestring.components[i]]));
- }
- return array.join(',');
- },
- /**
- * @description Return a comma delimited string of linestring strings from a multilinestring.
- * @param {SuperMap.Geometry.MultiLineString} multilinestring
- * @returns {string} A string of of linestring strings representing
- * the multilinestring
- */
- 'multilinestring': function multilinestring(_multilinestring) {
- var array = [];
- for (var i = 0, len = _multilinestring.components.length; i < len; ++i) {
- array.push('(' + this.extract.linestring.apply(this, [_multilinestring.components[i]]) + ')');
- }
- return array.join(',');
- },
- /**
- * @description Return a comma delimited string of linear ring arrays from a polygon.
- * @param {SuperMap.Geometry.Polygon} polygon
- * @returns {string} An array of linear ring arrays representing the polygon
- */
- 'polygon': function polygon(_polygon) {
- var array = [];
- for (var i = 0, len = _polygon.components.length; i < len; ++i) {
- array.push('(' + this.extract.linestring.apply(this, [_polygon.components[i]]) + ')');
- }
- return array.join(',');
- },
- /**
- * @description Return an array of polygon arrays from a multipolygon.
- * @param {SuperMap.Geometry.MultiPolygon} multipolygon
- * @returns {string} An array of polygon arrays representing
- * the multipolygon
- */
- 'multipolygon': function multipolygon(_multipolygon) {
- var array = [];
- for (var i = 0, len = _multipolygon.components.length; i < len; ++i) {
- array.push('(' + this.extract.polygon.apply(this, [_multipolygon.components[i]]) + ')');
- }
- return array.join(',');
- },
- /**
- * @description Return the WKT portion between 'GEOMETRYCOLLECTION(' and ')' for an <SuperMap.Geometry.Collection>
- * @param {SuperMap.Geometry.Collection} collection
- * @returns {string} internal WKT representation of the collection
- */
- 'collection': function collection(_collection) {
- var array = [];
- for (var i = 0, len = _collection.components.length; i < len; ++i) {
- array.push(this.extractGeometry.apply(this, [_collection.components[i]]));
- }
- return array.join(',');
- }
- };
- /**
- * @private
- * @description Object with properties corresponding to the geometry types.
- * Property values are functions that do the actual parsing.
- */
- _this.parse = {
- /**
- * @private
- * @description Return point feature given a point WKT fragment.
- * @param {string} str A WKT fragment representing the point
- * @returns {SuperMap.Feature.Vector} A point feature
- *
- */
- 'point': function point(str) {
- var coords = StringExt.trim(str).split(this.regExes.spaces);
- return new Vector(new Point(coords[0], coords[1]));
- },
- /**
- * @description Return a multipoint feature given a multipoint WKT fragment.
- * @param {string} A WKT fragment representing the multipoint
- * @returns {SuperMap.Feature.Vector} A multipoint feature
- * @private
- */
- 'multipoint': function multipoint(str) {
- var point;
- var points = StringExt.trim(str).split(',');
- var components = [];
- for (var i = 0, len = points.length; i < len; ++i) {
- point = points[i].replace(this.regExes.trimParens, '$1');
- components.push(this.parse.point.apply(this, [point]).geometry);
- }
- return new Vector(new MultiPoint(components));
- },
- /**
- * @description Return a linestring feature given a linestring WKT fragment.
- * @param {string} A WKT fragment representing the linestring
- * @returns {SuperMap.Feature.Vector} A linestring feature
- * @private
- */
- 'linestring': function linestring(str) {
- var points = StringExt.trim(str).split(',');
- var components = [];
- for (var i = 0, len = points.length; i < len; ++i) {
- components.push(this.parse.point.apply(this, [points[i]]).geometry);
- }
- return new Vector(new LineString(components));
- },
- /**
- * @description Return a multilinestring feature given a multilinestring WKT fragment.
- * @param {string} A WKT fragment representing the multilinestring
- * @returns {SuperMap.Feature.Vector} A multilinestring feature
- * @private
- */
- 'multilinestring': function multilinestring(str) {
- var line;
- var lines = StringExt.trim(str).split(this.regExes.parenComma);
- var components = [];
- for (var i = 0, len = lines.length; i < len; ++i) {
- line = lines[i].replace(this.regExes.trimParens, '$1');
- components.push(this.parse.linestring.apply(this, [line]).geometry);
- }
- return new Vector(new MultiLineString(components));
- },
- /**
- * @description Return a polygon feature given a polygon WKT fragment.
- * @param {string} A WKT fragment representing the polygon
- * @returns {SuperMap.Feature.Vector} A polygon feature
- * @private
- */
- 'polygon': function polygon(str) {
- var ring, linestring, linearring;
- var rings = StringExt.trim(str).split(this.regExes.parenComma);
- var components = [];
- for (var i = 0, len = rings.length; i < len; ++i) {
- ring = rings[i].replace(this.regExes.trimParens, '$1');
- linestring = this.parse.linestring.apply(this, [ring]).geometry;
- linearring = new LinearRing(linestring.components);
- components.push(linearring);
- }
- return new Vector(new Polygon(components));
- },
- /**
- * @private
- * @description Return a multipolygon feature given a multipolygon WKT fragment.
- * @param {string} A WKT fragment representing the multipolygon
- * @returns {SuperMap.Feature.Vector} A multipolygon feature
- *
- */
- 'multipolygon': function multipolygon(str) {
- var polygon;
- var polygons = StringExt.trim(str).split(this.regExes.doubleParenComma);
- var components = [];
- for (var i = 0, len = polygons.length; i < len; ++i) {
- polygon = polygons[i].replace(this.regExes.trimParens, '$1');
- components.push(this.parse.polygon.apply(this, [polygon]).geometry);
- }
- return new Vector(new MultiPolygon(components));
- },
- /**
- * @description Return an array of features given a geometrycollection WKT fragment.
- * @param {string} A WKT fragment representing the geometrycollection
- * @returns {Array} An array of SuperMap.Feature.Vector
- * @private
- */
- 'geometrycollection': function geometrycollection(str) {
- // separate components of the collection with |
- str = str.replace(/,\s*([A-Za-z])/g, '|$1');
- var wktArray = StringExt.trim(str).split('|');
- var components = [];
- for (var i = 0, len = wktArray.length; i < len; ++i) {
- components.push(this.read(wktArray[i]));
- }
- return components;
- }
- };
- return _this;
- }
- /**
- * @function SuperMap.Format.WKT.prototype.read
- * @description Deserialize a WKT string and return a vector feature or an
- * array of vector features. Supports WKT for POINT, MULTIPOINT,
- * LINESTRING, MULTILINESTRING, POLYGON, MULTIPOLYGON, and
- * GEOMETRYCOLLECTION.
- * @param {string} wkt - A WKT string
- * @returns {SuperMap.Feature.Vector|Array} A feature or array of features for
- * GEOMETRYCOLLECTION WKT.
- */
- WKT_createClass(WKT, [{
- key: "read",
- value: function read(wkt) {
- var features, type, str;
- wkt = wkt.replace(/[\n\r]/g, " ");
- var matches = this.regExes.typeStr.exec(wkt);
- if (matches) {
- type = matches[1].toLowerCase();
- str = matches[2];
- if (this.parse[type]) {
- features = this.parse[type].apply(this, [str]);
- }
- }
- return features;
- }
- /**
- * @function SuperMap.Format.WKT.prototype.write
- * @description Serialize a feature or array of features into a WKT string.
- * @param {(SuperMap.Feature.Vector|Array)} features - A feature or array of features
- * @returns {string} The WKT string representation of the input geometries
- */
- }, {
- key: "write",
- value: function write(features) {
- var collection, geometry, isCollection;
- if (features.constructor === Array) {
- collection = features;
- isCollection = true;
- } else {
- collection = [features];
- isCollection = false;
- }
- var pieces = [];
- if (isCollection) {
- pieces.push('GEOMETRYCOLLECTION(');
- }
- for (var i = 0, len = collection.length; i < len; ++i) {
- if (isCollection && i > 0) {
- pieces.push(',');
- }
- geometry = collection[i].geometry;
- pieces.push(this.extractGeometry(geometry));
- }
- if (isCollection) {
- pieces.push(')');
- }
- return pieces.join('');
- }
- /**
- * @function SuperMap.Format.WKT.prototype.extractGeometry
- * @description Entry point to construct the WKT for a single Geometry object.
- * @param {SuperMap.Geometry} geometry
- * @returns {string} A WKT string of representing the geometry
- */
- }, {
- key: "extractGeometry",
- value: function extractGeometry(geometry) {
- var type = geometry.CLASS_NAME.split('.')[2].toLowerCase();
- if (!this.extract[type]) {
- return null;
- }
- var wktType = type === 'collection' ? 'GEOMETRYCOLLECTION' : type.toUpperCase();
- var data = wktType + '(' + this.extract[type].apply(this, [geometry]) + ')';
- return data;
- }
- }]);
- return WKT;
- }(Format);
- SuperMap.Format.WKT = WKT;
- ;// CONCATENATED MODULE: ./src/common/format/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/common/control/TimeControlBase.js
- function TimeControlBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function TimeControlBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) TimeControlBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) TimeControlBase_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.TimeControlBase
- * @classdesc 时间控制基类类。
- * @category Control
- * @param {Object} options - 该类开放的可选属性。
- * @param {number} [options.speed=1] - 速度。不能小于 0,(每帧渲染的数据之间的间隔为1),设置越大速度越快。
- * @param {number} [options.frequency=1000] - 刷新频率(单位 ms),服务器刷新的时间间隔。
- * @param {number} [options.startTime=0] - 起始时间,必须为数字,且小于等于 endTime。如果不设置,初始化时为 0,建议设置。
- * @param {number} [options.endTime] - 结束时间,必须为数字,且大于等于 startTime。如果不设置,初始化时以当前时间进行设置,建议设置。
- * @param {boolean} [options.repeat=true] - 是否重复循环。
- * @param {boolean} [options.reverse=false] - 是否反向。
- */
- var TimeControlBase = /*#__PURE__*/function () {
- function TimeControlBase(options) {
- TimeControlBase_classCallCheck(this, TimeControlBase);
- //设置步长,刷新频率、开始结束时间、是否循环、是否反向
- var me = this;
- options = options || {};
- /**
- * @member {number} [SuperMap.TimeControlBase.prototype.speed=1]
- * @description 步长,必须为非负数,默认为1(表示前后两次渲染的数据之间的间隔为1)
- */
- this.speed = options.speed && options.speed >= 0 ? options.speed : 1;
- /**
- * @member {number} [SuperMap.TimeControlBase.prototype.frequency=1000]
- * @description 刷新频率(单位ms),服务器刷新的时间间隔。
- */
- this.frequency = options.speed && options.frequency >= 0 ? options.frequency : 1000;
- /**
- * @member {number} [SuperMap.TimeControlBase.prototype.startTime=0]
- * @description 记录的起始时间,必须为数字,
- * 如果不设置,初始化时为0,建议设置
- */
- this.startTime = options.startTime && options.startTime != null ? options.startTime : 0;
- /**
- * @member {number} SuperMap.TimeControlBase.prototype.endTime
- * @description 记录的结束时间,必须为数字,
- * 如果不设置,初始化时以当前时间进行设置,建议设置
- */
- this.endTime = options.endTime && options.endTime != null && options.endTime >= me.startTime ? options.endTime : +new Date();
- /**
- * @member {boolean} [SuperMap.TimeControlBase.prototype.repeat=true]
- * @description 是否重复循环。
- */
- this.repeat = options.repeat !== undefined ? options.repeat : true;
- /**
- * @member {boolean} [SuperMap.TimeControlBase.prototype.reverse=false]
- * @description 是否反向。
- */
- this.reverse = options.reverse !== undefined ? options.reverse : false;
- /**
- * @member {number} SuperMap.TimeControlBase.prototype.currentTime
- * @description 记录近期的时间,也就是当前帧运行到的时间。
- */
- this.currentTime = null;
- /**
- * @member {number} SuperMap.TimeControlBase.prototype.oldTime
- * @description 记录上一帧的时间,也就是之前运行到的时间。
- */
- this.oldTime = null;
- /**
- * @member {boolean} [SuperMap.TimeControlBase.prototype.running=false]
- * @description 记录当前是否处于运行中。
- */
- this.running = false;
- /**
- * @private
- * @member {Array.<string>} SuperMap.TimeControlBase.prototype.EVENT_TYPES
- * @description 此类支持的事件类型。
- *
- */
- this.EVENT_TYPES = ["start", "pause", "stop"];
- /**
- * @private
- * @member {SuperMap.Events} SuperMap.TimeControlBase.prototype.events
- * @description 事件
- */
- me.events = new Events(this, null, this.EVENT_TYPES);
- me.speed = Number(me.speed);
- me.frequency = Number(me.frequency);
- me.startTime = Number(me.startTime);
- me.endTime = Number(me.endTime);
- me.startTime = Date.parse(new Date(me.startTime));
- me.endTime = Date.parse(new Date(me.endTime)); //初始化当前时间
- me.currentTime = me.startTime;
- this.CLASS_NAME = "SuperMap.TimeControlBase";
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.updateOptions
- * @param {Object} options - 设置参数得可选参数。设置步长,刷新频率、开始结束时间、是否循环、是否反向。
- */
- TimeControlBase_createClass(TimeControlBase, [{
- key: "updateOptions",
- value: function updateOptions(options) {
- //设置步长,刷新频率、开始结束时间、是否循环、是否反向
- var me = this;
- options = options || {};
- if (options.speed && options.speed >= 0) {
- me.speed = options.speed;
- me.speed = Number(me.speed);
- }
- if (options.speed && options.frequency >= 0) {
- me.frequency = options.frequency;
- me.frequency = Number(me.frequency);
- }
- if (options.startTime && options.startTime != null) {
- me.startTime = options.startTime;
- me.startTime = Date.parse(new Date(me.startTime));
- }
- if (options.endTime && options.endTime != null && options.endTime >= me.startTime) {
- me.endTime = options.endTime;
- me.endTime = Date.parse(new Date(me.endTime));
- }
- if (options.repeat != null) {
- me.repeat = options.repeat;
- }
- if (options.reverse != null) {
- me.reverse = options.reverse;
- }
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.start
- * @description 开始。
- */
- }, {
- key: "start",
- value: function start() {
- var me = this;
- if (!me.running) {
- me.running = true;
- me.tick();
- me.events.triggerEvent('start', me.currentTime);
- }
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.pause
- * @description 暂停。
- */
- }, {
- key: "pause",
- value: function pause() {
- var me = this;
- me.running = false;
- me.events.triggerEvent('pause', me.currentTime);
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.stop
- * @description 停止,停止后返回起始状态。
- */
- }, {
- key: "stop",
- value: function stop() {
- var me = this; //停止时 时间设置为开始时间
- me.currentTime = me.startTime; //如果正在运行,修改为初始时间即可绘制一帧
- if (me.running) {
- me.running = false;
- }
- me.events.triggerEvent('stop', me.currentTime);
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.toggle
- * @description 开关切换,切换的是开始和暂停。
- */
- }, {
- key: "toggle",
- value: function toggle() {
- var me = this;
- if (me.running) {
- me.pause();
- } else {
- me.start();
- }
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.setSpeed
- * @description 设置步长。
- * @param {number} [speed=1] - 步长,必须为非负数。
- * @returns {boolean} true 代表设置成功,false 设置失败(speed 小于 0 时失败)。
- */
- }, {
- key: "setSpeed",
- value: function setSpeed(speed) {
- var me = this;
- if (speed >= 0) {
- me.speed = speed;
- return true;
- }
- return false;
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.getSpeed
- * @description 获取步长。
- * @returns {number} 返回当前的步长
- */
- }, {
- key: "getSpeed",
- value: function getSpeed() {
- return this.speed;
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.setFrequency
- * @description 设置刷新频率。
- * @param {number} [frequency=1000] - 刷新频率,单位为 ms。
- * @returns {boolean} true 代表设置成功,false 设置失败(frequency 小于 0 时失败)。
- */
- }, {
- key: "setFrequency",
- value: function setFrequency(frequency) {
- var me = this;
- if (frequency >= 0) {
- me.frequency = frequency;
- return true;
- }
- return false;
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.getFrequency
- * @description 获取刷新频率。
- * @returns {number} 返回当前的刷新频率。
- */
- }, {
- key: "getFrequency",
- value: function getFrequency() {
- return this.frequency;
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.setStartTime
- * @description 设置起始时间,设置完成后如果当前时间小于起始时间,则从起始时间开始。
- * @param {number} startTime - 需要设置的起始时间。
- * @returns {boolean} true 代表设置成功,false 设置失败(startTime 大于结束时间时失败)。
- */
- }, {
- key: "setStartTime",
- value: function setStartTime(startTime) {
- var me = this;
- startTime = Date.parse(new Date(startTime)); //起始时间不得大于结束时间
- if (startTime > me.endTime) {
- return false;
- }
- me.startTime = startTime; //如果当前时间小于了起始时间,则从当前起始时间开始
- if (me.currentTime < me.startTime) {
- me.currentTime = me.startTime;
- me.tick();
- }
- return true;
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.getStartTime
- * @description 获取起始时间。
- * @returns {number} 返回当前的起始时间。
- */
- }, {
- key: "getStartTime",
- value: function getStartTime() {
- return this.startTime;
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.setEndTime
- * @description 设置结束时间,设置完成后如果当前时间大于结束,则从起始时间开始。
- * @param {number} endTime - 需要设置的结束时间。
- * @returns {boolean} true 代表设置成功,false 设置失败(endTime 小于开始时间时失败)。
- */
- }, {
- key: "setEndTime",
- value: function setEndTime(endTime) {
- var me = this;
- me.endTime = Date.parse(new Date(me.endTime)); //结束时间不得小于开始时间
- if (endTime < me.startTime) {
- return false;
- }
- me.endTime = endTime; //如果当前时间大于了结束时间,则从起始时间开始
- if (me.currentTime >= me.endTime) {
- me.currentTime = me.startTime;
- me.tick();
- }
- return true;
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.getEndTime
- * @description 获取结束时间。
- * @returns {number} 返回当前的结束时间。
- */
- }, {
- key: "getEndTime",
- value: function getEndTime() {
- return this.endTime;
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.setCurrentTime
- * @description 设置当前时间。
- * @param {number} currentTime - 需要设置的当前时间。
- * @returns {boolean} true 代表设置成功,false 设置失败。
- */
- }, {
- key: "setCurrentTime",
- value: function setCurrentTime(currentTime) {
- var me = this;
- me.currentTime = Date.parse(new Date(me.currentTime)); //结束时间不得小于开始时间
- if (currentTime >= me.startTime && currentTime <= me.endTime) {
- me.currentTime = currentTime;
- me.startTime = me.currentTime;
- me.tick();
- return true;
- }
- return false;
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.getCurrentTime
- * @description 获取当前时间。
- * @returns {number} 返回当前时间。
- */
- }, {
- key: "getCurrentTime",
- value: function getCurrentTime() {
- return this.currentTime;
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.setRepeat
- * @description 设置是否重复循环。
- * @param {boolean} [repeat=true] - 是否重复循环。
- */
- }, {
- key: "setRepeat",
- value: function setRepeat(repeat) {
- this.repeat = repeat;
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.getRepeat
- * @description 获取是否重复循环,默认是 true。
- * @returns {boolean} 返回是否重复循环。
- */
- }, {
- key: "getRepeat",
- value: function getRepeat() {
- return this.repeat;
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.setReverse
- * @description 设置是否反向。
- * @param {boolean} [reverse=false] - 是否反向。
- */
- }, {
- key: "setReverse",
- value: function setReverse(reverse) {
- this.reverse = reverse;
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.getReverse
- * @description 获取是否反向,默认是false。
- * @returns {boolean} 返回是否反向。
- */
- }, {
- key: "getReverse",
- value: function getReverse() {
- return this.reverse;
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.getRunning
- * @description 获取运行状态。
- * @returns {boolean} true 代表正在运行,false 发表没有运行。
- */
- }, {
- key: "getRunning",
- value: function getRunning() {
- return this.running;
- }
- /**
- * @function SuperMap.TimeControlBase.prototype.destroy
- * @description 销毁 Animator 对象,释放资源。
- */
- }, {
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.speed = null;
- me.frequency = null;
- me.startTime = null;
- me.endTime = null;
- me.currentTime = null;
- me.repeat = null;
- me.running = false;
- me.reverse = null;
- }
- }, {
- key: "tick",
- value: function tick() {//TODO 每次刷新执行的操作。子类实现
- }
- }]);
- return TimeControlBase;
- }();
- SuperMap.TimeControlBase = TimeControlBase;
- ;// CONCATENATED MODULE: ./src/common/control/TimeFlowControl.js
- 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); }
- function TimeFlowControl_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function TimeFlowControl_createClass(Constructor, protoProps, staticProps) { if (protoProps) TimeFlowControl_defineProperties(Constructor.prototype, protoProps); if (staticProps) TimeFlowControl_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function TimeFlowControl_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TimeFlowControl_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function TimeFlowControl_setPrototypeOf(o, p) { TimeFlowControl_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TimeFlowControl_setPrototypeOf(o, p); }
- 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); }; }
- function TimeFlowControl_possibleConstructorReturn(self, call) { if (call && (TimeFlowControl_typeof(call) === "object" || typeof call === "function")) { return call; } return TimeFlowControl_assertThisInitialized(self); }
- function TimeFlowControl_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function TimeFlowControl_getPrototypeOf(o) { TimeFlowControl_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TimeFlowControl_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.TimeFlowControl
- * @classdesc 时间管理类。
- * @category Control
- * @description 此类只负责时间上的控制,具体执行的操作需要用户在初始化时的回调函数内部进行实现。
- * 如设置起始时间为 1000,结束时间是 2000,步长设置为 1,
- * 那么表示按照每次1年(可以通过 setSpeed 进行修改)的变化从公元 1000 年开始到公元 2000 年为止,默认每 1 秒会 1 次(通过 setFrequency 修改)
- * @extends {SuperMap.TimeControlBase}
- * @param {function} callback - 每次刷新回调函数。具体的效果需要用户在此回调函数里面实现。
- * @param {Object} options - 该类开放的可选属性。
- * @param {number} [options.speed=1] - 步长(单位 ms)。不能小于 0,(每次刷新的数据之间的间隔为 1ms)。
- * @param {number} [options.frequency=1000] - 刷新频率(单位 ms)。
- * @param {number} [options.startTime=0] - 起始时间,必须为数字,且小于等于 endTime。如果不设置,初始化时为 0,建议设置。
- * @param {number} [options.endTime] - 结束时间,必须为数字,且大于等于 startTime。如果不设置,初始化时使用 new Date() 以当前时间进行设置,建议设置。
- * @param {boolean} [options.repeat=true] - 是否重复循环。
- * @param {boolean} [options.reverse=false] - 是否反向。
- */
- var TimeFlowControl = /*#__PURE__*/function (_TimeControlBase) {
- TimeFlowControl_inherits(TimeFlowControl, _TimeControlBase);
- var _super = TimeFlowControl_createSuper(TimeFlowControl);
- function TimeFlowControl(callback, options) {
- var _this;
- TimeFlowControl_classCallCheck(this, TimeFlowControl);
- _this = _super.call(this, options);
- var me = TimeFlowControl_assertThisInitialized(_this);
- /**
- * @member SuperMap.TimeFlowControl.prototype.callback -{function}
- * @description 每次刷新执行的回调函数。
- */
- me.callback = callback; //先让IE下支持bind方法
- if (!Function.prototype.bind) {
- Function.prototype.bind = function (oThis) {
- if (typeof this !== "function") {
- throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
- }
- var aArgs = Array.prototype.slice.call(arguments, 1),
- fToBind = this,
- fNOP = function fNOP() {//empty Function
- },
- fBound = function fBound() {
- return fToBind.apply(this instanceof fNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
- };
- fNOP.prototype = this.prototype;
- fBound.prototype = new fNOP();
- return fBound;
- };
- } //保证 this.tick 的上下文还是 TimeControl 这个对象
- me.update = me.update.bind(me);
- me.oldTime = me.currentTime;
- me.CLASS_NAME = "SuperMap.TimeFlowControl";
- return _this;
- }
- /**
- * @function SuperMap.TimeFlowControl.prototype.updateOptions
- * @override
- */
- TimeFlowControl_createClass(TimeFlowControl, [{
- key: "updateOptions",
- value: function updateOptions(options) {
- options = options || {};
- TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "updateOptions", this).call(this, options);
- }
- /**
- * @function SuperMap.TimeFlowControl.prototype.start
- * @override
- */
- }, {
- key: "start",
- value: function start() {
- var me = this;
- if (me.running) {
- return;
- }
- me.running = true;
- if (me.reverse) {
- if (me.currentTime === me.startTime) {
- me.oldTime = me.endTime;
- me.currentTime = me.oldTime;
- }
- } else {
- if (me.oldTime === me.endTime) {
- me.currentTime = me.startTime;
- me.oldTime = me.currentTime;
- }
- }
- me.tick();
- }
- /**
- * @function SuperMap.TimeFlowControl.prototype.stop
- * @override
- */
- }, {
- key: "stop",
- value: function stop() {
- TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "stop", this).call(this);
- var me = this;
- me.oldTime = me.currentTime;
- if (me.running) {
- me.running = false;
- } //清除定时tick
- me.intervalId && window.clearTimeout(me.intervalId);
- }
- /**
- * @function SuperMap.TimeFlowControl.prototype.destroy
- * @override
- */
- }, {
- key: "destroy",
- value: function destroy() {
- TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "destroy", this).call(this);
- var me = this;
- me.oldTime = null;
- me.callback = null;
- }
- /**
- * @function SuperMap.TimeFlowControl.prototype.tick
- * @description 定时刷新。
- */
- }, {
- key: "tick",
- value: function tick() {
- var me = this;
- me.intervalId && window.clearInterval(me.intervalId);
- me.intervalId = null;
- me.update();
- me.intervalId = window.setInterval(me.update, me.frequency);
- }
- /**
- * @function SuperMap.TimeFlowControl.prototype.update
- * @override
- */
- }, {
- key: "update",
- value: function update() {
- var me = this; //判定是否还需要继续
- if (!me.running) {
- return;
- } //调用回调函数
- me.callback && me.callback(me.currentTime); //destroy之后callback就为空,所以需要判定一下
- if (!me.reverse) {
- //如果相等,则代表上一帧已经运行到了最后,下一帧运行初始化的状态
- if (me.currentTime === me.endTime) {
- //不循环时
- if (!me.repeat) {
- me.running = false;
- me.stop();
- return null;
- }
- me.stop();
- me.currentTime = me.startTime;
- me.oldTime = me.currentTime;
- me.start();
- } else {
- //否则时间递增
- me.oldTime = me.currentTime;
- me.currentTime += me.speed;
- }
- if (me.currentTime >= me.endTime) {
- me.currentTime = me.endTime;
- }
- } else {
- //如果相等,则代表上一帧已经运行到了最前,下一帧运行结束的状态
- if (me.currentTime === me.startTime) {
- //不循环时
- if (!me.repeat) {
- me.running = false;
- return null;
- }
- me.oldTime = me.endTime;
- me.currentTime = me.oldTime;
- } else {
- //否则时间递减
- me.currentTime = me.oldTime;
- me.oldTime -= me.speed;
- }
- if (me.oldTime <= me.startTime) {
- me.oldTime = me.startTime;
- }
- }
- }
- }]);
- return TimeFlowControl;
- }(TimeControlBase);
- SuperMap.TimeFlowControl = TimeFlowControl;
- ;// CONCATENATED MODULE: ./src/common/control/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- // EXTERNAL MODULE: ./node_modules/promise-polyfill/dist/polyfill.js
- var polyfill = __webpack_require__(957);
- // EXTERNAL MODULE: ./node_modules/fetch-ie8/fetch.js
- var fetch = __webpack_require__(937);
- // EXTERNAL MODULE: ./node_modules/fetch-jsonp/build/fetch-jsonp.js
- var fetch_jsonp = __webpack_require__(238);
- var fetch_jsonp_default = /*#__PURE__*/__webpack_require__.n(fetch_jsonp);
- ;// CONCATENATED MODULE: ./src/common/util/FetchRequest.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- var FetchRequest_fetch = window.fetch;
- var setFetch = function setFetch(newFetch) {
- FetchRequest_fetch = newFetch;
- };
- /**
- * @function SuperMap.setCORS
- * @description 设置是否允许跨域请求,全局配置,优先级低于 service 下的 crossOring 参数。
- * @param {boolean} cors - 是否允许跨域请求。
- */
- var setCORS = SuperMap.setCORS = function (cors) {
- SuperMap.CORS = cors;
- };
- /**
- * @function SuperMap.isCORS
- * @description 是是否允许跨域请求。
- * @returns {boolean} 是否允许跨域请求。
- */
- var isCORS = SuperMap.isCORS = function () {
- if (SuperMap.CORS != undefined) {
- return SuperMap.CORS;
- }
- return window.XMLHttpRequest && 'withCredentials' in new window.XMLHttpRequest();
- };
- /**
- * @function SuperMap.setRequestTimeout
- * @description 设置请求超时时间。
- * @param {number} [timeout=45] - 请求超时时间,单位秒。
- */
- var setRequestTimeout = SuperMap.setRequestTimeout = function (timeout) {
- return SuperMap.RequestTimeout = timeout;
- };
- /**
- * @function SuperMap.getRequestTimeout
- * @description 获取请求超时时间。
- * @returns {number} 请求超时时间。
- */
- var getRequestTimeout = SuperMap.getRequestTimeout = function () {
- return SuperMap.RequestTimeout || 45000;
- };
- var FetchRequest = SuperMap.FetchRequest = {
- commit: function commit(method, url, params, options) {
- method = method ? method.toUpperCase() : method;
- switch (method) {
- case 'GET':
- return this.get(url, params, options);
- case 'POST':
- return this.post(url, params, options);
- case 'PUT':
- return this.put(url, params, options);
- case 'DELETE':
- return this["delete"](url, params, options);
- default:
- return this.get(url, params, options);
- }
- },
- supportDirectRequest: function supportDirectRequest(url, options) {
- if (Util.isInTheSameDomain(url)) {
- return true;
- }
- if (options.crossOrigin != undefined) {
- return options.crossOrigin;
- } else {
- return isCORS() || options.proxy;
- }
- },
- get: function get(url, params, options) {
- options = options || {};
- var type = 'GET';
- url = Util.urlAppend(url, this._getParameterString(params || {}));
- url = this._processUrl(url, options);
- if (!this.supportDirectRequest(url, options)) {
- url = url.replace('.json', '.jsonp');
- var config = {
- url: url,
- data: params
- };
- return SuperMap.Util.RequestJSONPPromise.GET(config);
- }
- if (!this.urlIsLong(url)) {
- return this._fetch(url, params, options, type);
- } else {
- return this._postSimulatie(type, url.substring(0, url.indexOf('?') - 1), params, options);
- }
- },
- "delete": function _delete(url, params, options) {
- options = options || {};
- var type = 'DELETE';
- url = Util.urlAppend(url, this._getParameterString(params || {}));
- url = this._processUrl(url, options);
- if (!this.supportDirectRequest(url, options)) {
- url = url.replace('.json', '.jsonp');
- var config = {
- url: url += "&_method=DELETE",
- data: params
- };
- return SuperMap.Util.RequestJSONPPromise.DELETE(config);
- }
- if (this.urlIsLong(url)) {
- return this._postSimulatie(type, url.substring(0, url.indexOf('?') - 1), params, options);
- }
- return this._fetch(url, params, options, type);
- },
- post: function post(url, params, options) {
- options = options || {};
- if (!this.supportDirectRequest(url, options)) {
- url = url.replace('.json', '.jsonp');
- var config = {
- url: url += "&_method=POST",
- data: params
- };
- return SuperMap.Util.RequestJSONPPromise.POST(config);
- }
- return this._fetch(this._processUrl(url, options), params, options, 'POST');
- },
- put: function put(url, params, options) {
- options = options || {};
- url = this._processUrl(url, options);
- if (!this.supportDirectRequest(url, options)) {
- url = url.replace('.json', '.jsonp');
- var config = {
- url: url += "&_method=PUT",
- data: params
- };
- return SuperMap.Util.RequestJSONPPromise.PUT(config);
- }
- return this._fetch(url, params, options, 'PUT');
- },
- urlIsLong: function urlIsLong(url) {
- //当前url的字节长度。
- var totalLength = 0,
- charCode = null;
- for (var i = 0, len = url.length; i < len; i++) {
- //转化为Unicode编码
- charCode = url.charCodeAt(i);
- if (charCode < 0x007f) {
- totalLength++;
- } else if (0x0080 <= charCode && charCode <= 0x07ff) {
- totalLength += 2;
- } else if (0x0800 <= charCode && charCode <= 0xffff) {
- totalLength += 3;
- }
- }
- return totalLength < 2000 ? false : true;
- },
- _postSimulatie: function _postSimulatie(type, url, params, options) {
- var separator = url.indexOf('?') > -1 ? '&' : '?';
- url += separator + '_method=' + type;
- if (typeof params !== 'string') {
- params = JSON.stringify(params);
- }
- return this.post(url, params, options);
- },
- _processUrl: function _processUrl(url, options) {
- if (this._isMVTRequest(url)) {
- return url;
- }
- if (url.indexOf('.json') === -1 && !options.withoutFormatSuffix) {
- if (url.indexOf('?') < 0) {
- url += '.json';
- } else {
- var urlArrays = url.split('?');
- if (urlArrays.length === 2) {
- url = urlArrays[0] + '.json?' + urlArrays[1];
- }
- }
- }
- if (options && options.proxy) {
- if (typeof options.proxy === 'function') {
- url = options.proxy(url);
- } else {
- url = decodeURIComponent(url);
- url = options.proxy + encodeURIComponent(url);
- }
- }
- return url;
- },
- _fetch: function _fetch(url, params, options, type) {
- options = options || {};
- options.headers = options.headers || {};
- if (!options.headers['Content-Type']) {
- options.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
- }
- if (options.timeout) {
- return this._timeout(options.timeout, FetchRequest_fetch(url, {
- method: type,
- headers: options.headers,
- body: type === 'PUT' || type === 'POST' ? params : undefined,
- credentials: this._getWithCredentials(options),
- mode: 'cors',
- timeout: getRequestTimeout()
- }).then(function (response) {
- return response;
- }));
- }
- return FetchRequest_fetch(url, {
- method: type,
- body: type === 'PUT' || type === 'POST' ? params : undefined,
- headers: options.headers,
- credentials: this._getWithCredentials(options),
- mode: 'cors',
- timeout: getRequestTimeout()
- }).then(function (response) {
- return response;
- });
- },
- _getWithCredentials: function _getWithCredentials(options) {
- if (options.withCredentials === true) {
- return 'include';
- }
- if (options.withCredentials === false) {
- return 'omit';
- }
- return 'same-origin';
- },
- _fetchJsonp: function _fetchJsonp(url, options) {
- options = options || {};
- return fetch_jsonp_default()(url, {
- method: 'GET',
- timeout: options.timeout
- }).then(function (response) {
- return response;
- });
- },
- _timeout: function _timeout(seconds, promise) {
- return new Promise(function (resolve, reject) {
- setTimeout(function () {
- reject(new Error('timeout'));
- }, seconds);
- promise.then(resolve, reject);
- });
- },
- _getParameterString: function _getParameterString(params) {
- var paramsArray = [];
- for (var key in params) {
- var value = params[key];
- if (value != null && typeof value !== 'function') {
- var encodedValue;
- if (Array.isArray(value) || value.toString() === '[object Object]') {
- encodedValue = encodeURIComponent(JSON.stringify(value));
- } else {
- encodedValue = encodeURIComponent(value);
- }
- paramsArray.push(encodeURIComponent(key) + '=' + encodedValue);
- }
- }
- return paramsArray.join('&');
- },
- _isMVTRequest: function _isMVTRequest(url) {
- return url.indexOf('.mvt') > -1 || url.indexOf('.pbf') > -1;
- }
- };
- SuperMap.Util.RequestJSONPPromise = {
- limitLength: 1500,
- queryKeys: [],
- queryValues: [],
- supermap_callbacks: {},
- addQueryStrings: function addQueryStrings(values) {
- var me = this;
- for (var key in values) {
- me.queryKeys.push(key);
- if (typeof values[key] !== 'string') {
- values[key] = SuperMap.Util.toJSON(values[key]);
- }
- var tempValue = encodeURIComponent(values[key]);
- me.queryValues.push(tempValue);
- }
- },
- issue: function issue(config) {
- var me = this,
- uid = me.getUid(),
- url = config.url,
- splitQuestUrl = [];
- var p = new Promise(function (resolve) {
- me.supermap_callbacks[uid] = function (response) {
- delete me.supermap_callbacks[uid];
- resolve(response);
- };
- }); // me.addQueryStrings({
- // callback: "SuperMap.Util.RequestJSONPPromise.supermap_callbacks[" + uid + "]"
- // });
- var sectionURL = url,
- keysCount = 0; //此次sectionURL中有多少个key
- var length = me.queryKeys ? me.queryKeys.length : 0;
- for (var i = 0; i < length; i++) {
- if (sectionURL.length + me.queryKeys[i].length + 2 >= me.limitLength) {
- //+2 for ("&"or"?")and"="
- if (keysCount == 0) {
- return false;
- }
- splitQuestUrl.push(sectionURL);
- sectionURL = url;
- keysCount = 0;
- i--;
- } else {
- if (sectionURL.length + me.queryKeys[i].length + 2 + me.queryValues[i].length > me.limitLength) {
- var leftValue = me.queryValues[i];
- while (leftValue.length > 0) {
- var leftLength = me.limitLength - sectionURL.length - me.queryKeys[i].length - 2; //+2 for ("&"or"?")and"="
- if (sectionURL.indexOf('?') > -1) {
- sectionURL += '&';
- } else {
- sectionURL += '?';
- }
- var tempLeftValue = leftValue.substring(0, leftLength); //避免 截断sectionURL时,将类似于%22这样的符号截成两半,从而导致服务端组装sectionURL时发生错误
- if (tempLeftValue.substring(leftLength - 1, leftLength) === '%') {
- leftLength -= 1;
- tempLeftValue = leftValue.substring(0, leftLength);
- } else if (tempLeftValue.substring(leftLength - 2, leftLength - 1) === '%') {
- leftLength -= 2;
- tempLeftValue = leftValue.substring(0, leftLength);
- }
- sectionURL += me.queryKeys[i] + '=' + tempLeftValue;
- leftValue = leftValue.substring(leftLength);
- if (tempLeftValue.length > 0) {
- splitQuestUrl.push(sectionURL);
- sectionURL = url;
- keysCount = 0;
- }
- }
- } else {
- keysCount++;
- if (sectionURL.indexOf('?') > -1) {
- sectionURL += '&';
- } else {
- sectionURL += '?';
- }
- sectionURL += me.queryKeys[i] + '=' + me.queryValues[i];
- }
- }
- }
- splitQuestUrl.push(sectionURL);
- me.send(splitQuestUrl, 'SuperMap.Util.RequestJSONPPromise.supermap_callbacks[' + uid + ']', config && config.proxy);
- return p;
- },
- getUid: function getUid() {
- var uid = new Date().getTime(),
- random = Math.floor(Math.random() * 1e17);
- return uid * 1000 + random;
- },
- send: function send(splitQuestUrl, callback, proxy) {
- var len = splitQuestUrl.length;
- if (len > 0) {
- var jsonpUserID = new Date().getTime();
- for (var i = 0; i < len; i++) {
- var url = splitQuestUrl[i];
- if (url.indexOf('?') > -1) {
- url += '&';
- } else {
- url += '?';
- }
- url += 'sectionCount=' + len;
- url += '§ionIndex=' + i;
- url += '&jsonpUserID=' + jsonpUserID;
- if (proxy) {
- url = decodeURIComponent(url);
- url = proxy + encodeURIComponent(url);
- }
- fetch_jsonp_default()(url, {
- jsonpCallbackFunction: callback,
- timeout: 30000
- });
- }
- }
- },
- GET: function GET(config) {
- var me = this;
- me.queryKeys.length = 0;
- me.queryValues.length = 0;
- me.addQueryStrings(config.params);
- return me.issue(config);
- },
- POST: function POST(config) {
- var me = this;
- me.queryKeys.length = 0;
- me.queryValues.length = 0;
- me.addQueryStrings({
- requestEntity: config.data
- });
- return me.issue(config);
- },
- PUT: function PUT(config) {
- var me = this;
- me.queryKeys.length = 0;
- me.queryValues.length = 0;
- me.addQueryStrings({
- requestEntity: config.data
- });
- return me.issue(config);
- },
- DELETE: function DELETE(config) {
- var me = this;
- me.queryKeys.length = 0;
- me.queryValues.length = 0;
- me.addQueryStrings({
- requestEntity: config.data
- });
- return me.issue(config);
- }
- };
- ;// CONCATENATED MODULE: ./src/common/security/SecurityManager.js
- function SecurityManager_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SecurityManager_createClass(Constructor, protoProps, staticProps) { if (protoProps) SecurityManager_defineProperties(Constructor.prototype, protoProps); if (staticProps) SecurityManager_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @name SecurityManager
- * @memberOf SuperMap
- * @namespace
- * @category Security
- * @description 安全管理中心,提供 iServer,iPortal,Online 统一权限认证管理。
- * > 使用说明:
- * > 创建任何一个服务之前调用 {@link SuperMap.SecurityManager.registerToken}或
- * > {@link SuperMap.SecurityManager.registerKey}注册凭据。
- * > 发送请求时根据 url 或者服务 id 获取相应的 key 或者 token 并自动添加到服务地址中。
- */
- var SecurityManager = /*#__PURE__*/function () {
- function SecurityManager() {
- SecurityManager_classCallCheck(this, SecurityManager);
- }
- SecurityManager_createClass(SecurityManager, null, [{
- key: "generateToken",
- /**
- * @description 从服务器获取一个token,在此之前要注册服务器信息。
- * @function SuperMap.SecurityManager.generateToken
- * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
- * @param {SuperMap.TokenServiceParameter} tokenParam - token 申请参数。
- * @returns {Promise} 返回包含 token 信息的 Promise 对象。
- */
- value: function generateToken(url, tokenParam) {
- var serverInfo = this.servers[url];
- if (!serverInfo) {
- return;
- }
- return FetchRequest.post(serverInfo.tokenServiceUrl, JSON.stringify(tokenParam.toJSON())).then(function (response) {
- return response.text();
- });
- }
- /**
- * @description 注册安全服务器相关信息。
- * @function SuperMap.SecurityManager.registerServers
- * @param {SuperMap.ServerInfo} serverInfos - 服务器信息。
- */
- }, {
- key: "registerServers",
- value: function registerServers(serverInfos) {
- this.servers = this.servers || {};
- if (!Util.isArray(serverInfos)) {
- serverInfos = [serverInfos];
- }
- for (var i = 0; i < serverInfos.length; i++) {
- var serverInfo = serverInfos[i];
- this.servers[serverInfo.server] = serverInfo;
- }
- }
- /**
- * @description 服务请求都会自动带上这个 token。
- * @function SuperMap.SecurityManager.registerToken
- * @param {string} url -服务器域名+端口:如http://localhost:8090。
- * @param {string} token - token
- */
- }, {
- key: "registerToken",
- value: function registerToken(url, token) {
- this.tokens = this.tokens || {};
- if (!url || !token) {
- return;
- }
- var domain = this._getTokenStorageKey(url);
- this.tokens[domain] = token;
- }
- /**
- * @description 注册 key,ids 为数组(存在一个 key 对应多个服务)。
- * @function SuperMap.SecurityManager.registerKey
- * @param {Array} ids - 可以是服务 id 数组或者 url 地址数组或者 webAPI 类型数组。
- * @param {string} key - key
- */
- }, {
- key: "registerKey",
- value: function registerKey(ids, key) {
- this.keys = this.keys || {};
- if (!ids || ids.length < 1 || !key) {
- return;
- }
- ids = Util.isArray(ids) ? ids : [ids];
- for (var i = 0; i < ids.length; i++) {
- var id = this._getUrlRestString(ids[0]) || ids[0];
- this.keys[id] = key;
- }
- }
- /**
- * @description 获取服务器信息。
- * @function SuperMap.SecurityManager.getServerInfo
- * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
- * @returns {SuperMap.ServerInfo} 服务器信息。
- */
- }, {
- key: "getServerInfo",
- value: function getServerInfo(url) {
- this.servers = this.servers || {};
- return this.servers[url];
- }
- /**
- * @description 根据 Url 获取token。
- * @function SuperMap.SecurityManager.getToken
- * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
- * @returns {string} token
- */
- }, {
- key: "getToken",
- value: function getToken(url) {
- if (!url) {
- return;
- }
- this.tokens = this.tokens || {};
- var domain = this._getTokenStorageKey(url);
- return this.tokens[domain];
- }
- /**
- * @description 根据 Url 获取 key。
- * @function SuperMap.SecurityManager.getKey
- * @param {string} id - id
- * @returns {string} key
- */
- }, {
- key: "getKey",
- value: function getKey(id) {
- this.keys = this.keys || {};
- var key = this._getUrlRestString(id) || id;
- return this.keys[key];
- }
- /**
- * @description iServer 登录验证。
- * @function SuperMap.SecurityManager.loginiServer
- * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
- * @param {string} username - 用户名。
- * @param {string} password - 密码。
- * @param {boolean} [rememberme=false] - 是否记住。
- * @returns {Promise} 返回包含 iServer 登录请求结果的 Promise 对象。
- */
- }, {
- key: "loginiServer",
- value: function loginiServer(url, username, password, rememberme) {
- url = Util.urlPathAppend(url, 'services/security/login');
- var loginInfo = {
- username: username && username.toString(),
- password: password && password.toString(),
- rememberme: rememberme
- };
- loginInfo = JSON.stringify(loginInfo);
- var requestOptions = {
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
- }
- };
- return FetchRequest.post(url, loginInfo, requestOptions).then(function (response) {
- return response.json();
- });
- }
- /**
- * @description iServer登出。
- * @function SuperMap.SecurityManager.logoutiServer
- * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
- * @returns {Promise} 是否登出成功。
- */
- }, {
- key: "logoutiServer",
- value: function logoutiServer(url) {
- url = Util.urlPathAppend(url, 'services/security/logout');
- var requestOptions = {
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
- },
- withoutFormatSuffix: true
- };
- return FetchRequest.get(url, "", requestOptions).then(function () {
- return true;
- })["catch"](function () {
- return false;
- });
- }
- /**
- * @description Online 登录验证。
- * @function SuperMap.SecurityManager.loginOnline
- * @param {string} callbackLocation - 跳转位置。
- * @param {boolean} [newTab=true] - 是否新窗口打开。
- */
- }, {
- key: "loginOnline",
- value: function loginOnline(callbackLocation, newTab) {
- var loginUrl = SecurityManager.SSO + "/login?service=" + callbackLocation;
- this._open(loginUrl, newTab);
- }
- /**
- * @description iPortal登录验证。
- * @function SuperMap.SecurityManager.loginiPortal
- * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal.
- * @param {string} username - 用户名。
- * @param {string} password - 密码。
- * @returns {Promise} 返回包含 iPortal 登录请求结果的 Promise 对象。
- */
- }, {
- key: "loginiPortal",
- value: function loginiPortal(url, username, password) {
- url = Util.urlPathAppend(url, 'web/login');
- var loginInfo = {
- username: username && username.toString(),
- password: password && password.toString()
- };
- loginInfo = JSON.stringify(loginInfo);
- var requestOptions = {
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
- },
- withCredentials: true
- };
- return FetchRequest.post(url, loginInfo, requestOptions).then(function (response) {
- return response.json();
- });
- }
- /**
- * @description iPortal 登出。
- * @function SuperMap.SecurityManager.logoutiPortal
- * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal.
- * @returns {Promise} 如果登出成功,返回 true;否则返回 false。
- */
- }, {
- key: "logoutiPortal",
- value: function logoutiPortal(url) {
- url = Util.urlPathAppend(url, 'services/security/logout');
- var requestOptions = {
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
- },
- withCredentials: true,
- withoutFormatSuffix: true
- };
- return FetchRequest.get(url, "", requestOptions).then(function () {
- return true;
- })["catch"](function () {
- return false;
- });
- }
- /**
- * @description iManager 登录验证。
- * @function SuperMap.SecurityManager.loginManager
- * @param {string} url - iManager 地址。地址参数为 iManager 首页地址,如: http://localhost:8390/imanager。
- * @param {Object} [loginInfoParams] - iManager 登录参数。
- * @param {string} loginInfoParams.userName - 用户名。
- * @param {string} loginInfoParams.password - 密码。
- * @param {Object} options
- * @param {boolean} [options.isNewTab=true] - 不同域时是否在新窗口打开登录页面。
- * @returns {Promise} 返回包含 iManager 登录请求结果的 Promise 对象。
- */
- }, {
- key: "loginManager",
- value: function loginManager(url, loginInfoParams, options) {
- if (!Util.isInTheSameDomain(url)) {
- var isNewTab = options ? options.isNewTab : true;
- this._open(url, isNewTab);
- return;
- }
- var requestUrl = Util.urlPathAppend(url, 'icloud/security/tokens');
- var params = loginInfoParams || {};
- var loginInfo = {
- username: params.userName && params.userName.toString(),
- password: params.password && params.password.toString()
- };
- loginInfo = JSON.stringify(loginInfo);
- var requestOptions = {
- headers: {
- 'Accept': '*/*',
- 'Content-Type': 'application/json'
- }
- };
- var me = this;
- return FetchRequest.post(requestUrl, loginInfo, requestOptions).then(function (response) {
- response.text().then(function (result) {
- me.imanagerToken = result;
- return result;
- });
- });
- }
- /**
- * @description 清空全部验证信息。
- * @function SuperMap.SecurityManager.destroyAllCredentials
- */
- }, {
- key: "destroyAllCredentials",
- value: function destroyAllCredentials() {
- this.keys = null;
- this.tokens = null;
- this.servers = null;
- }
- /**
- * @description 清空令牌信息。
- * @function SuperMap.SecurityManager.destroyToken
- * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal.
- */
- }, {
- key: "destroyToken",
- value: function destroyToken(url) {
- if (!url) {
- return;
- }
- var domain = this._getTokenStorageKey(url);
- this.tokens = this.tokens || {};
- if (this.tokens[domain]) {
- delete this.tokens[domain];
- }
- }
- /**
- * @description 清空服务授权码。
- * @function SuperMap.SecurityManager.destroyKey
- * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
- */
- }, {
- key: "destroyKey",
- value: function destroyKey(url) {
- if (!url) {
- return;
- }
- this.keys = this.keys || {};
- var key = this._getUrlRestString(url) || url;
- if (this.keys[key]) {
- delete this.keys[key];
- }
- }
- }, {
- key: "_open",
- value: function _open(url, newTab) {
- newTab = newTab != null ? newTab : true;
- var offsetX = window.screen.availWidth / 2 - this.INNER_WINDOW_WIDTH / 2;
- var offsetY = window.screen.availHeight / 2 - this.INNER_WINDOW_HEIGHT / 2;
- 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";
- if (newTab) {
- window.open(url, 'login');
- } else {
- window.open(url, 'login', options);
- }
- }
- }, {
- key: "_getTokenStorageKey",
- value: function _getTokenStorageKey(url) {
- var patten = /(.*?):\/\/([^\/]+)/i;
- var result = url.match(patten);
- if (!result) {
- return url;
- }
- return result[0];
- }
- }, {
- key: "_getUrlRestString",
- value: function _getUrlRestString(url) {
- if (!url) {
- return url;
- } // var patten = /http:\/\/(.*\/rest)/i;
- var patten = /(http|https):\/\/(.*\/rest)/i;
- var result = url.match(patten);
- if (!result) {
- return url;
- }
- return result[0];
- }
- }]);
- return SecurityManager;
- }();
- SecurityManager.INNER_WINDOW_WIDTH = 600;
- SecurityManager.INNER_WINDOW_HEIGHT = 600;
- SecurityManager.SSO = "https://sso.supermap.com";
- SecurityManager.ONLINE = "https://www.supermapol.com";
- SuperMap.SecurityManager = SecurityManager;
- ;// CONCATENATED MODULE: ./src/common/iManager/iManagerServiceBase.js
- function iManagerServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function iManagerServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) iManagerServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) iManagerServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.iManagerServiceBase
- * @classdesc iManager 服务基类(有权限限制的类需要实现此类)。
- * @category iManager
- * @param {string} url - iManager 首页地址,如:http://localhost:8390/imanager。
- * @param {Object} options - 服务参数。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var IManagerServiceBase = /*#__PURE__*/function () {
- function IManagerServiceBase(url, options) {
- iManagerServiceBase_classCallCheck(this, IManagerServiceBase);
- if (url) {
- var end = url.substr(url.length - 1, 1);
- this.serviceUrl = end === "/" ? url.substr(0, url.length - 2) : url;
- }
- this.options = options || {};
- this.CLASS_NAME = "SuperMap.iManagerServiceBase";
- }
- /**
- * @function SuperMap.iManagerServiceBase.prototype.request
- * @description 子类统一通过该方法发送请求。
- * @param {string} url - 请求 URL。
- * @param {string} [method='GET'] - 请求类型。
- * @param {Object} [requestOptions] - 请求选项。
- * @param {Object} param - 请求参数。
- * @description 发送请求。
- * @returns {Promise} Promise 对象。
- */
- iManagerServiceBase_createClass(IManagerServiceBase, [{
- key: "request",
- value: function request(method, url, param, requestOptions) {
- requestOptions = requestOptions || {
- headers: {
- 'Accept': '*/*',
- 'Content-Type': 'application/json'
- }
- };
- if (!requestOptions.hasOwnProperty("withCredentials")) {
- requestOptions['withCredentials'] = true;
- }
- requestOptions['crossOrigin'] = this.options.crossOrigin;
- requestOptions['headers'] = this.options.headers;
- var token = SecurityManager.imanagerToken;
- if (token) {
- if (!requestOptions.headers) {
- requestOptions.headers = [];
- }
- requestOptions.headers['X-Auth-Token'] = token;
- }
- if (param) {
- param = JSON.stringify(param);
- }
- return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
- return response.json();
- });
- }
- }]);
- return IManagerServiceBase;
- }();
- SuperMap.iManagerServiceBase = IManagerServiceBase;
- ;// CONCATENATED MODULE: ./src/common/iManager/iManagerCreateNodeParam.js
- function iManagerCreateNodeParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.iManagerCreateNodeParam
- * @classdesc iManager 创建节点参数。
- * @category iManager
- * @param {Object} [params] - iManager 创建节点参数。
- *
- */
- var IManagerCreateNodeParam = function IManagerCreateNodeParam(params) {
- iManagerCreateNodeParam_classCallCheck(this, IManagerCreateNodeParam);
- params = params || {};
- this.nodeSpec = 'SMALL'; //取值范围: ['SMALL','MEDIUM','LARGE'] 以及自定义的环境规格名称
- this.nodeCount = 1; //要创建vm的个数
- this.nodeName = ''; //vm名称
- this.password = ''; //vm的密码,空表示随机分配
- this.description = ''; //描述信息
- this.physicalMachineName = ''; //vm所属的物理机名称.
- this.ips = []; //vm的ip,空数组表示随机分配
- this.userName = ''; //vm所属用户
- Util.extend(this, params);
- };
- SuperMap.iManagerCreateNodeParam = IManagerCreateNodeParam;
- ;// CONCATENATED MODULE: ./src/common/iManager/iManager.js
- 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); }
- function iManager_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function iManager_createClass(Constructor, protoProps, staticProps) { if (protoProps) iManager_defineProperties(Constructor.prototype, protoProps); if (staticProps) iManager_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function iManager_setPrototypeOf(o, p) { iManager_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iManager_setPrototypeOf(o, p); }
- 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); }; }
- function iManager_possibleConstructorReturn(self, call) { if (call && (iManager_typeof(call) === "object" || typeof call === "function")) { return call; } return iManager_assertThisInitialized(self); }
- function iManager_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function iManager_getPrototypeOf(o) { iManager_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iManager_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.iManager
- * @classdesc iManager 服务类。
- * @category iManager
- * @param {string} serviceUrl - iManager 首页地址。
- *
- */
- var IManager = /*#__PURE__*/function (_IManagerServiceBase) {
- iManager_inherits(IManager, _IManagerServiceBase);
- var _super = iManager_createSuper(IManager);
- function IManager(iManagerUrl) {
- iManager_classCallCheck(this, IManager);
- return _super.call(this, iManagerUrl);
- }
- /**
- * @function SuperMap.iManager.prototype.load
- * @description 获取所有服务接口,验证是否已登录授权。
- * @returns {Promise} Promise 对象。
- */
- iManager_createClass(IManager, [{
- key: "load",
- value: function load() {
- return this.request("GET", this.serviceUrl + '/web/api/service.json');
- }
- /**
- * @function SuperMap.iManager.prototype.createIServer
- * @param {SuperMap.iManagerCreateNodeParam} createParam - 创建参数。
- * @description 创建 iServer。
- * @returns {Promise} Promise 对象。
- */
- }, {
- key: "createIServer",
- value: function createIServer(createParam) {
- return this.request("POST", this.serviceUrl + '/icloud/web/nodes/server.json', new IManagerCreateNodeParam(createParam));
- }
- /**
- * @function SuperMap.iManager.prototype.createIPortal
- * @param {SuperMap.iManagerCreateNodeParam} createParam - 创建参数。
- * @description 创建 iPortal。
- * @returns {Promise} Promise 对象。
- */
- }, {
- key: "createIPortal",
- value: function createIPortal(createParam) {
- return this.request("POST", this.serviceUrl + '/icloud/web/nodes/portal.json', new IManagerCreateNodeParam(createParam));
- }
- /**
- * @function SuperMap.iManager.prototype.iServerList
- * @description 获取所有创建的 iServer。
- * @returns {Promise} Promise 对象。
- */
- }, {
- key: "iServerList",
- value: function iServerList() {
- return this.request("GET", this.serviceUrl + '/icloud/web/nodes/server.json');
- }
- /**
- * @function SuperMap.iManager.prototype.iPortalList
- * @description 获取所有创建的 iPortal。
- * @returns {Promise} Promise 对象。
- */
- }, {
- key: "iPortalList",
- value: function iPortalList() {
- return this.request("GET", this.serviceUrl + '/icloud/web/nodes/portal.json');
- }
- /**
- * @function SuperMap.iManager.prototype.startNodes
- * @param {Array} ids - 需要启动节点的 ID 数组。e.g:['1']。
- * @description 启动节点。
- * @returns {Promise} Promise 对象。
- */
- }, {
- key: "startNodes",
- value: function startNodes(ids) {
- return this.request("POST", this.serviceUrl + '/icloud/web/nodes/started.json', ids);
- }
- /**
- * @function SuperMap.iManager.prototype.stopNodes
- * @param {Array} ids - 需要停止节点的 ID 数组。e.g:['1']。
- * @description 停止节点。
- * @returns {Promise} Promise 对象。
- */
- }, {
- key: "stopNodes",
- value: function stopNodes(ids) {
- return this.request("POST", this.serviceUrl + '/icloud/web/nodes/stopped.json', ids);
- }
- }]);
- return IManager;
- }(IManagerServiceBase);
- SuperMap.iManager = IManager;
- ;// CONCATENATED MODULE: ./src/common/iManager/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalServiceBase.js
- function iPortalServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function iPortalServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.iPortalServiceBase
- * @classdesc iPortal 服务基类(有权限限制的类需要实现此类)。
- * @category iPortal/Online
- * @param {string} url - iPortal 服务地址。
- * @param {Object} options - 可选参数。
- * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var IPortalServiceBase = /*#__PURE__*/function () {
- function IPortalServiceBase(url, options) {
- iPortalServiceBase_classCallCheck(this, IPortalServiceBase);
- options = options || {};
- this.serviceUrl = url;
- this.serverType = ServerType.iPortal;
- this.CLASS_NAME = "SuperMap.iPortalServiceBase";
- this.withCredentials = options.withCredentials || false;
- this.crossOrigin = options.crossOrigin;
- this.headers = options.headers;
- }
- /**
- * @function SuperMap.iPortalServiceBase.prototype.request
- * @description 子类统一通过该方法发送请求。
- * @param {string} [method='GET'] - 请求类型。
- * @param {string} url - 服务地址。
- * @param {Object} param - 请求参数。
- * @param {Object} [requestOptions] - fetch 请求配置项。
- * @returns {Promise} 返回包含请求结果的 Promise 对象。
- */
- iPortalServiceBase_createClass(IPortalServiceBase, [{
- key: "request",
- value: function request(method, url, param) {
- var requestOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
- headers: this.headers,
- crossOrigin: this.crossOrigin,
- withCredentials: this.withCredentials
- };
- url = this.createCredentialUrl(url);
- return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
- return response.json();
- });
- }
- /**
- * @function SuperMap.iPortalServiceBase.prototype.createCredentialUrl
- * @description 追加授权信息。
- * @param {string} url - 创建证书 URL 地址。
- * @returns {string} 携带 token 或 key 的新地址。
- */
- }, {
- key: "createCredentialUrl",
- value: function createCredentialUrl(url) {
- var newUrl = url,
- credential = this.getCredential();
- if (credential) {
- var endStr = newUrl.substring(newUrl.length - 1, newUrl.length);
- if (newUrl.indexOf("?") > -1 && endStr === "?") {
- newUrl += credential.getUrlParameters();
- } else if (newUrl.indexOf("?") > -1 && endStr !== "?") {
- newUrl += "&" + credential.getUrlParameters();
- } else {
- newUrl += "?" + credential.getUrlParameters();
- }
- }
- return newUrl;
- }
- /**
- * @function SuperMap.iPortalServiceBase.prototype.getCredential
- * @description 获取 token。
- * @returns {string} 返回获取的 token。
- *
- */
- }, {
- key: "getCredential",
- value: function getCredential() {
- var credential,
- value = SecurityManager.getToken(this.serviceUrl);
- credential = value ? new Credential(value, "token") : null;
- if (!credential) {
- value = this.getKey();
- credential = value ? new Credential(value, "key") : null;
- }
- return credential;
- }
- /**
- * @function SuperMap.iPortalServiceBase.prototype.getKey
- * @description 其子类需要重写该方法,修改其中获取 key 的字段,存储 key 可能是服务 ID 字段,可能是 URL。
- */
- }, {
- key: "getKey",
- value: function getKey() {//return SuperMap.SecurityManager.getKey(this.id);
- //或
- //return SuperMap.SecurityManager.getKey(this.serviceUrl);
- }
- }]);
- return IPortalServiceBase;
- }();
- SuperMap.iPortalServiceBase = IPortalServiceBase;
- ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalQueryParam.js
- function iPortalQueryParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.iPortalQueryParam
- * @classdesc iPortal 资源查询参数。
- * @version 10.0.1
- * @category iPortal/Online
- * @param {Object} params - iPortal 资源查询具体参数。
- * @param {SuperMap.ResourceType} [params.resourceType] - 资源类型
- * @param {number} [params.pageSize] - 分页中每页大小。
- * @param {number} [params.currentPage] - 分页页码。
- * @param {SuperMap.OrderBy} [params.orderBy] - 排序字段。
- * @param {SuperMap.OrderType} [params.orderType] - 根据升序还是降序过滤。
- * @param {SuperMap.SearchType} [params.searchType] - 根据查询的范围进行过滤。
- * @param {Array} [params.tags] - 标签。
- * @param {Array} [params.dirIds] - 目录 id
- * @param {Array} [params.resourceSubTypes] - 根据资源的子类型进行过滤。
- * @param {SuperMap.AggregationTypes} [params.aggregationTypes] - 聚合查询的类型。
- * @param {string} [params.text] - 搜索的关键词。
- * @param {Array} [params.groupIds] - 根据群组进行过滤。
- * @param {Array} [params.departmentIds] - 根据部门进行过滤。
- */
- var IPortalQueryParam = function IPortalQueryParam(params) {
- iPortalQueryParam_classCallCheck(this, IPortalQueryParam);
- params = params || {};
- this.resourceType = ""; // 空为全部 MAP SERVICE SCENE DATA INSIGHTS_WORKSPACE MAP_DASHBOARD
- this.pageSize = 12; // 每页多少条
- this.currentPage = 1; // 第几页
- this.orderBy = "UPDATETIME"; // UPDATETIME HEATLEVEL
- this.orderType = "DESC"; // DESC ASC
- this.searchType = "PUBLIC"; // PUBLIC SHARETOME_RES MYDEPARTMENT_RES MYGROUP_RES MY_RES
- this.tags = []; // 标签
- this.dirIds = []; // 类别
- this.resourceSubTypes = []; // 类型
- this.aggregationTypes = []; // TAG TYPE SUBTYPE
- this.text = ""; // 搜索字段
- this.groupIds = []; // 群组Id过滤
- this.departmentIds = []; // 部门Id过滤
- Util.extend(this, params);
- };
- SuperMap.iPortalQueryParam = IPortalQueryParam;
- ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalQueryResult.js
- function iPortalQueryResult_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.iPortalQueryResult
- * @classdesc iPortal 资源结果集封装类。
- * @version 10.0.1
- * @category iPortal/Online
- * @param {Object} queryResult - 资源参数。
- * @param {Array} [queryResult.content] - 页面内容。
- * @param {number} [queryResult.total] - 总记录数。
- * @param {number} [queryResult.currentPage] - 当前第几页。
- * @param {number} [queryResult.pageSize] - 每页大小。
- * @param {Object} [queryResult.aggregations] - 聚合查询的结果。
- */
- var IPortalQueryResult = function IPortalQueryResult(queryResult) {
- iPortalQueryResult_classCallCheck(this, IPortalQueryResult);
- queryResult = queryResult || {};
- this.content = [];
- this.total = 0;
- this.currentPage = 1;
- this.pageSize = 12;
- this.aggregations = null;
- Util.extend(this, queryResult);
- };
- SuperMap.iPortalQueryResult = IPortalQueryResult;
- ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalResource.js
- 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); }
- function iPortalResource_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function iPortalResource_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalResource_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalResource_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function iPortalResource_setPrototypeOf(o, p) { iPortalResource_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iPortalResource_setPrototypeOf(o, p); }
- 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); }; }
- function iPortalResource_possibleConstructorReturn(self, call) { if (call && (iPortalResource_typeof(call) === "object" || typeof call === "function")) { return call; } return iPortalResource_assertThisInitialized(self); }
- function iPortalResource_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function iPortalResource_getPrototypeOf(o) { iPortalResource_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortalResource_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.iPortalResource
- * @classdesc iPortal 资源详情类。
- * @version 10.0.1
- * @category iPortal/Online
- * @param {string} portalUrl - 资源地址。
- * @param {Object} resourceInfo - 资源详情参数。
- * @param {Array} [resourceInfo.authorizeSetting] - 资源的授权信息
- * @param {string} [resourceInfo.bounds] - 资源的坐标范围
- * @param {string} [resourceInfo.bounds4326] - 资源的坐标范围,转换为EPSG 4326坐标系统后的地理范围。
- * @param {string} [resourceInfo.checkStatus] - 资源的审核状态,可以是:空,SUCCESSFUL,UNCHECKED,FAILED
- * @param {Date} [resourceInfo.createTime] - 资源的创建时间
- * @param {string} [resourceInfo.description] - 资源描述
- * @param {number} [resourceInfo.dirId] - 资源所在的门户目录的id
- * @param {number} [resourceInfo.epsgCode] - 门户资源基于的坐标系的EPSG值。
- * @param {number} [resourceInfo.heatLevel] - 记录资源的访问量或下载量。
- * @param {string} [resourceInfo.id] - 资源存储到ElasticSearch中的文档id
- * @param {string} [resourceInfo.name] - 资源名称
- * @param {number} [resourceInfo.personalDirId] - 资源所在的个人目录的id
- * @param {number} [resourceInfo.resourceId] - 资源表(maps,services等)里的id
- * @param {string} [resourceInfo.resourceSubType] - 某类资源的具体子类型。
- * @param {SuperMap.ResourceType} [resourceInfo.resourceType] - 资源类型
- * @param {number} [resourceInfo.serviceRootUrlId] - 批量注册服务时,服务根地址的ID
- * @param {Array} [resourceInfo.tags] - 资源的标签
- * @param {string} [resourceInfo.thumbnail] - 资源的缩略图
- * @param {Date} [resourceInfo.updateTime] - 资源的更新时间
- * @param {string} [resourceInfo.userName] - 搜索的关键词
- * @param {Object} [resourceInfo.sourceJSON] - 提供了门户项目返回的所有信息。
- * @extends {SuperMap.iPortalServiceBase}
- */
- var IPortalResource = /*#__PURE__*/function (_IPortalServiceBase) {
- iPortalResource_inherits(IPortalResource, _IPortalServiceBase);
- var _super = iPortalResource_createSuper(IPortalResource);
- function IPortalResource(portalUrl, resourceInfo) {
- var _this;
- iPortalResource_classCallCheck(this, IPortalResource);
- _this = _super.call(this, portalUrl);
- resourceInfo = resourceInfo || {};
- _this.authorizeSetting = [];
- _this.bounds = "";
- _this.bounds4326 = "";
- _this.checkStatus = "";
- _this.createTime = 0;
- _this.description = null;
- _this.dirId = null;
- _this.epsgCode = 0;
- _this.heatLevel = 0;
- _this.id = 0;
- _this.name = "";
- _this.personalDirId = null;
- _this.resourceId = 0;
- _this.resourceSubType = null;
- _this.resourceType = null;
- _this.serviceRootUrlId = null;
- _this.tags = null;
- _this.thumbnail = null;
- _this.updateTime = 0;
- _this.userName = "";
- _this.sourceJSON = {}; //返回门户资源详细信息
- Util.extend(iPortalResource_assertThisInitialized(_this), resourceInfo); // INSIGHTS_WORKSPACE MAP_DASHBOARD
- _this.resourceUrl = portalUrl + "/web/" + _this.resourceType.replace("_", "").toLowerCase() + "s/" + _this.resourceId;
- if (_this.withCredentials) {
- _this.resourceUrl = portalUrl + "/web/mycontent/" + _this.resourceType.replace("_", "").toLowerCase() + "s/" + _this.resourceId;
- } // if (this.id) {
- // this.mapUrl = mapUrl + "/" + this.id;
- // }
- return _this;
- }
- /**
- * @function SuperMap.iPortalResource.prototype.load
- * @description 加载资源信息。
- * @returns {Promise} 返回 Promise 对象。如果成功,Promise 没有返回值,请求返回结果自动填充到该类的属性中;如果失败,Promise 返回值包含错误信息。
- */
- iPortalResource_createClass(IPortalResource, [{
- key: "load",
- value: function load() {
- var me = this;
- return me.request("GET", me.resourceUrl + ".json").then(function (resourceInfo) {
- if (resourceInfo.error) {
- return resourceInfo;
- }
- me.sourceJSON = resourceInfo;
- });
- }
- /**
- * @function SuperMap.iPortalResource.prototype.update
- * @description 更新资源属性信息。
- * @returns {Promise} 返回包含更新操作状态的 Promise 对象。
- */
- }, {
- key: "update",
- value: function update() {
- var resourceName = this.resourceType.replace("_", "").toLowerCase();
- var options = {
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded'
- }
- };
- if (resourceName === 'data') {
- this.resourceUrl = this.resourceUrl + "/attributes.json";
- }
- var entity = JSON.stringify(this.sourceJSON); //对服务资源进行编辑时,请求体内容只留关键字字段(目前如果是全部字段 更新返回成功 但其实没有真正的更新)
- if (resourceName === 'service') {
- var serviceInfo = {
- authorizeSetting: this.sourceJSON.authorizeSetting,
- metadata: this.sourceJSON.metadata,
- tags: this.sourceJSON.tags,
- thumbnail: this.sourceJSON.thumbnail,
- tokenRefreshUrl: this.sourceJSON.tokenRefreshUrl
- };
- entity = JSON.stringify(serviceInfo);
- }
- return this.request("PUT", this.resourceUrl, entity, options);
- }
- }]);
- return IPortalResource;
- }(IPortalServiceBase);
- SuperMap.iPortalResource = IPortalResource;
- ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalShareParam.js
- function iPortalShareParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.iPortalShareParam
- * @classdesc iPortal 资源共享参数。
- * @version 10.0.1
- * @category iPortal/Online
- * @param {Object} params - iPortal 资源共享具体参数。
- * @param {SuperMap.ResourceType} [params.resourceType] - 资源类型。
- * @param {Array} [params.ids] - 资源的id数组。
- * @param {SuperMap.iPortalShareEntity} [params.entities] - 资源的实体共享参数
- */
- var IPortalShareParam = function IPortalShareParam(params) {
- iPortalShareParam_classCallCheck(this, IPortalShareParam);
- params = params || {};
- this.ids = [];
- this.entities = [];
- this.resourceType = ""; // MAP SERVICE SCENE DATA INSIGHTS_WORKSPACE MAP_DASHBOARD
- Util.extend(this, params);
- };
- SuperMap.iPortalShareParam = IPortalShareParam;
- ;// CONCATENATED MODULE: ./src/common/iPortal/iPortal.js
- 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); }
- function iPortal_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function iPortal_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortal_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortal_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function iPortal_setPrototypeOf(o, p) { iPortal_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iPortal_setPrototypeOf(o, p); }
- 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); }; }
- function iPortal_possibleConstructorReturn(self, call) { if (call && (iPortal_typeof(call) === "object" || typeof call === "function")) { return call; } return iPortal_assertThisInitialized(self); }
- function iPortal_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function iPortal_getPrototypeOf(o) { iPortal_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortal_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.iPortal
- * @classdesc 对接 SuperMap iPortal 基础服务。
- * @category iPortal/Online
- * @extends {SuperMap.iPortalServiceBase}
- * @param {string} iportalUrl - 地址。
- * @param {Object} options - 参数。
- * @param {boolean} [options.withCredentials] - 请求是否携带 cookie。
- */
- var IPortal = /*#__PURE__*/function (_IPortalServiceBase) {
- iPortal_inherits(IPortal, _IPortalServiceBase);
- var _super = iPortal_createSuper(IPortal);
- function IPortal(iportalUrl, options) {
- var _this;
- iPortal_classCallCheck(this, IPortal);
- _this = _super.call(this, iportalUrl, options);
- _this.iportalUrl = iportalUrl;
- options = options || {};
- _this.withCredentials = options.withCredentials || false;
- return _this;
- }
- /**
- * @function SuperMap.iPortal.prototype.load
- * @description 加载页面。
- * @returns {Promise} 返回包含 iportal web 资源信息的 Promise 对象。
- */
- iPortal_createClass(IPortal, [{
- key: "load",
- value: function load() {
- return FetchRequest.get(this.iportalUrl + "/web");
- }
- /**
- * @function SuperMap.iPortal.prototype.queryResources
- * @description 查询资源。
- * @version 10.0.1
- * @param {SuperMap.iPortalQueryParam} queryParams - 查询参数。
- * @returns {Promise} 返回包含所有资源结果的 Promise 对象。
- */
- }, {
- key: "queryResources",
- value: function queryResources(queryParams) {
- if (!(queryParams instanceof IPortalQueryParam)) {
- return new Promise(function (resolve) {
- resolve("queryParams is not instanceof iPortalQueryParam !");
- });
- }
- var me = this;
- var resourceUrl = this.iportalUrl + "/gateway/catalog/resource/search.json";
- queryParams.t = new Date().getTime();
- return this.request("GET", resourceUrl, queryParams).then(function (result) {
- var content = [];
- result.content.forEach(function (item) {
- content.push(new IPortalResource(me.iportalUrl, item));
- });
- var queryResult = new IPortalQueryResult();
- queryResult.content = content;
- queryResult.total = result.total;
- queryResult.currentPage = result.currentPage;
- queryResult.pageSize = result.pageSize;
- queryResult.aggregations = result.aggregations;
- return queryResult;
- });
- }
- /**
- * @function SuperMap.iPortal.prototype.updateResourcesShareSetting
- * @description 更新共享设置。
- * @version 10.0.1
- * @param {SuperMap.iPortalShareParam} shareParams - 共享的参数。
- * @returns {Promise} 返回包含共享资源结果的 Promise 对象。
- */
- }, {
- key: "updateResourcesShareSetting",
- value: function updateResourcesShareSetting(shareParams) {
- if (!(shareParams instanceof IPortalShareParam)) {
- return new Promise(function (resolve) {
- resolve("shareParams is not instanceof iPortalShareParam !");
- });
- }
- var resourceUrlName = shareParams.resourceType.replace("_", "").toLowerCase() + "s";
- if (resourceUrlName === "datas") {
- resourceUrlName = "mycontent/" + resourceUrlName;
- }
- var cloneShareParams = {
- ids: shareParams.ids,
- entities: shareParams.entities
- };
- var shareUrl = this.iportalUrl + "/web/" + resourceUrlName + "/sharesetting.json";
- return this.request("PUT", shareUrl, JSON.stringify(cloneShareParams)).then(function (result) {
- return result;
- });
- }
- }]);
- return IPortal;
- }(IPortalServiceBase);
- SuperMap.iPortal = IPortal;
- ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalShareEntity.js
- function iPortalShareEntity_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.iPortalShareEntity
- * @classdesc iPortal 资源共享实体参数。
- * @version 10.0.1
- * @category iPortal/Online
- * @param {Object} shareEntity - iPortal 资源共享实体具体参数。
- * @param {SuperMap.PermissionType} [shareEntity.permissionType] - 权限类型。
- * @param {SuperMap.EntityType} [shareEntity.entityType] - 实体类型
- * @param {string} [shareEntity.entityName] - 实体 Name。对应的 USER(用户)、 ROLE(角色)、GROUP(用户组)、IPORTALGROUP(群组)的名称。
- * @param {number} [shareEntity.entityId] - 实体的 id。用于群组的授权。
- */
- var IPortalShareEntity = function IPortalShareEntity(shareEntity) {
- iPortalShareEntity_classCallCheck(this, IPortalShareEntity);
- shareEntity = shareEntity || {};
- this.permissionType = ""; // SEARCH READ READWRITE DOWNLOAD
- this.entityType = ""; // USER DEPARTMENT IPORTALGROUP
- this.entityName = "GUEST"; // GUEST or 具体用户 name
- this.entityId = null;
- Util.extend(this, shareEntity);
- };
- SuperMap.iPortalShareEntity = IPortalShareEntity;
- ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalAddResourceParam.js
- function iPortalAddResourceParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.iPortalAddResourceParam
- * @classdesc iPortal 添加资源参数。
- * @version 10.0.1
- * @category iPortal/Online
- * @param {Object} params - iPortal 添加资源具体参数。
- * @param {String} [params.rootUrl] - 服务地址。
- * @param {Array} [params.tags] - 标签。
- * @param {SuperMap.iPortalShareEntity} [params.entities] - 资源的实体共享参数
- */
- var IPortalAddResourceParam = function IPortalAddResourceParam(params) {
- iPortalAddResourceParam_classCallCheck(this, IPortalAddResourceParam);
- params = params || {};
- this.rootUrl = "";
- this.tags = [];
- this.entities = [];
- Util.extend(this, params);
- };
- SuperMap.iPortalAddResourceParam = IPortalAddResourceParam;
- ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalRegisterServiceParam.js
- function iPortalRegisterServiceParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.iPortalRegisterServiceParam
- * @classdesc iPortal 注册服务参数。
- * @version 10.0.1
- * @category iPortal/Online
- * @param {Object} params - iPortal 注册服务具体参数。
- * @param {String} [params.type] - 服务类型。
- * @param {Array} [params.tags] - 服务标签。
- * @param {SuperMap.iPortalShareEntity} [params.entities] - 资源的实体共享参数
- * @param {Object} [params.metadata] - 服务元信息。
- * @param {Array} [params.addedMapNames] - 地图服务列表。
- * @param {Array} [params.addedSceneNames] - 场景服务列表。
- */
- var IPortalRegisterServiceParam = function IPortalRegisterServiceParam(params) {
- iPortalRegisterServiceParam_classCallCheck(this, IPortalRegisterServiceParam);
- params = params || {};
- this.type = ""; // SUPERMAP_REST ARCGIS_REST WMS WFS WCS WPS WMTS OTHERS
- this.tags = [];
- this.entities = [];
- this.metadata = {};
- this.addedMapNames = [];
- this.addedSceneNames = [];
- Util.extend(this, params);
- };
- SuperMap.iPortalRegisterServiceParam = IPortalRegisterServiceParam;
- ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalAddDataParam.js
- function iPortalAddDataParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.iPortalAddDataParam
- * @classdesc iPortal 上传/注册数据所需的参数。
- * @version 10.0.1
- * @category iPortal/Online
- * @param {Object} params - iPortal 上传/注册数据所需的具体参数。
- * @param {string} params.fileName - 文件名称
- * @param {SuperMap.DataItemType} params.type - 数据类型。
- * @param {Array} [params.tags] - 数据的标签
- * @param {SuperMap.iPortalDataMetaInfoParam} [params.dataMetaInfo] - 数据元信息
- */
- var IPortalAddDataParam = function IPortalAddDataParam(params) {
- iPortalAddDataParam_classCallCheck(this, IPortalAddDataParam);
- params = params || {};
- this.fileName = "";
- this.type = "";
- this.tags = [];
- this.dataMetaInfo = {};
- Util.extend(this, params);
- };
- SuperMap.iPortalAddDataParam = IPortalAddDataParam;
- ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalDataMetaInfoParam.js
- function iPortalDataMetaInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.iPortalDataMetaInfoParam
- * @classdesc iPortal 上传数据/注册数据元信息所需的参数。
- * @version 10.0.1
- * @category iPortal/Online
- * @param {Object} params - iPortal 获取数据项id excel csv类型的数据所需数据元信息具体参数。
- * @param {string} params.xField - X 坐标字段
- * @param {string} params.yField - Y 坐标字段
- * @param {number} params.xIndex - x所在列(关系型存储下CSV或EXCEL数据时必填)
- * @param {number} params.yIndex - y所在列(关系型存储下CSV或EXCEL数据时必填)
- * @param {array} [params.fieldTypes] - 设置字段类型(关系型存储下CSV或EXCEL数据时可选填)。默认类型为:WTEXT。该参数按照CSV文件字段顺序从左到右依次设置,其中默认字段类型可省略不设置。例如,CSV文件中有10个字段,如果只需设定第1,2,4个字段,可设置为[a,b,,c]。
- * @param {string} params.separator - 分隔符(关系型存储下CSV数据时必填)
- * @param {boolean} params.firstRowIsHead - 是否带表头(关系型存储下CSV数据时必填)
- * @param {boolean} params.url - HDFS注册目录地址
- * @param {SuperMap.iPortalDataStoreInfoParam} params.dataStoreInfo - 注册数据时的数据存储信息
- */
- var IPortalDataMetaInfoParam = function IPortalDataMetaInfoParam(params) {
- iPortalDataMetaInfoParam_classCallCheck(this, IPortalDataMetaInfoParam);
- params = params || {};
- this.xField = "";
- this.yField = "";
- this.fileEncoding = "UTF-8";
- this.xIndex = 1;
- this.yIndex = 1;
- this.fieldTypes = [];
- this.separator = "";
- this.firstRowIsHead = true;
- this.url = "";
- this.dataStoreInfo = {};
- Util.extend(this, params);
- };
- SuperMap.iPortalDataMetaInfoParam = IPortalDataMetaInfoParam;
- ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalDataStoreInfoParam.js
- function iPortalDataStoreInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.iPortalDataStoreInfoParam
- * @classdesc iPortal 注册一个HBASE HDFS数据存储类。
- * @version 10.0.1
- * @category iPortal/Online
- * @param {Object} params - iPortal 注册一个HBASE HDFS数据存储类具体参数。
- * @param {string} params.type - 大数据文件共享类型和空间数据库类型,包括大数据文件共享HDFS 目录(HDFS)和空间数据库HBASE
- * @param {string} params.url - HDFS数据存储目录地址
- * @param {SuperMap.iPortalDataConnectionInfoParam} [params.connectionInfo] - HBASE空间数据库服务的连接信息
- */
- var IPortalDataStoreInfoParam = function IPortalDataStoreInfoParam(params) {
- iPortalDataStoreInfoParam_classCallCheck(this, IPortalDataStoreInfoParam);
- params = params || {};
- this.type = "";
- this.url = "";
- this.connectionInfo = {};
- Util.extend(this, params);
- };
- SuperMap.iPortalDataStoreInfoParam = IPortalDataStoreInfoParam;
- ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalDataConnectionInfoParam.js
- function iPortalDataConnectionInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.iPortalDataConnectionInfoParam
- * @classdesc iPortal HBASE数据源连接信息类。
- * @version 10.0.1
- * @category iPortal/Online
- * @param {Object} params - iPortal HBASE数据源连接信息类具体参数。
- * @param {string} params.dataBase - 数据源连接的数据库名。
- * @param {string} params.server - 服务地址。
- */
- var IPortalDataConnectionInfoParam = function IPortalDataConnectionInfoParam(params) {
- iPortalDataConnectionInfoParam_classCallCheck(this, IPortalDataConnectionInfoParam);
- params = params || {};
- this.dataBase = "";
- this.server = "";
- Util.extend(this, params);
- };
- SuperMap.iPortalDataConnectionInfoParam = IPortalDataConnectionInfoParam;
- ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalUser.js
- 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); }
- function iPortalUser_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function iPortalUser_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalUser_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalUser_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function iPortalUser_setPrototypeOf(o, p) { iPortalUser_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iPortalUser_setPrototypeOf(o, p); }
- 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); }; }
- function iPortalUser_possibleConstructorReturn(self, call) { if (call && (iPortalUser_typeof(call) === "object" || typeof call === "function")) { return call; } return iPortalUser_assertThisInitialized(self); }
- function iPortalUser_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function iPortalUser_getPrototypeOf(o) { iPortalUser_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortalUser_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.iPortalUser
- * @classdesc iPortal 门户中用户信息的封装类。用于管理用户资源,包括可删除,添加资源。
- * @version 10.0.1
- * @category iPortal/Online
- * @param {string} iportalUrl - iportal根地址。
- * @extends {SuperMap.iPortalServiceBase}
- *
- */
- var IPortalUser = /*#__PURE__*/function (_IPortalServiceBase) {
- iPortalUser_inherits(IPortalUser, _IPortalServiceBase);
- var _super = iPortalUser_createSuper(IPortalUser);
- function IPortalUser(iportalUrl) {
- var _this;
- iPortalUser_classCallCheck(this, IPortalUser);
- _this = _super.call(this, iportalUrl);
- _this.iportalUrl = iportalUrl;
- return _this;
- }
- /**
- * @function SuperMap.iPortalUser.prototype.deleteResources
- * @description 删除资源。
- * @param {Object} params - 删除资源所需的参数对象:{ids,resourceType}。
- * @returns {Promise} 返回包含删除操作状态的 Promise 对象。
- */
- iPortalUser_createClass(IPortalUser, [{
- key: "deleteResources",
- value: function deleteResources(params) {
- var resourceName = params.resourceType.replace("_", "").toLowerCase();
- var deleteResourceUrl = this.iportalUrl + "/web/" + resourceName + "s.json?ids=" + encodeURI(JSON.stringify(params.ids));
- if (resourceName === 'data') {
- deleteResourceUrl = this.iportalUrl + "/web/mycontent/datas/delete.json";
- return this.request("POST", deleteResourceUrl, JSON.stringify(params.ids));
- }
- return this.request("DELETE", deleteResourceUrl);
- }
- /**
- * @function SuperMap.iPortalUser.prototype.addMap
- * @description 添加地图。
- * @version 10.1.0
- * @param {SuperMap.iPortalAddResourceParam} addMapParams - 添加地图的参数。
- * @returns {Promise} 返回包含添加地图结果的 Promise 对象。
- */
- }, {
- key: "addMap",
- value: function addMap(addMapParams) {
- if (!(addMapParams instanceof IPortalAddResourceParam)) {
- return this.getErrMsgPromise("addMapParams is not instanceof IPortalAddResourceParam !");
- }
- var cloneAddMapParams = {
- rootUrl: addMapParams.rootUrl,
- tags: addMapParams.tags,
- authorizeSetting: addMapParams.entities
- };
- var addMapUrl = this.iportalUrl + "/web/maps/batchaddmaps.json";
- return this.request("POST", addMapUrl, JSON.stringify(cloneAddMapParams)).then(function (result) {
- return result;
- });
- }
- /**
- * @function SuperMap.iPortalUser.prototype.addScene
- * @description 添加场景。
- * @version 10.1.0
- * @param {SuperMap.iPortalAddResourceParam} addSceneParams - 添加场景的参数。
- * @returns {Promise} 返回包含添加场景结果的 Promise 对象。
- */
- }, {
- key: "addScene",
- value: function addScene(addSceneParams) {
- if (!(addSceneParams instanceof IPortalAddResourceParam)) {
- return this.getErrMsgPromise("addSceneParams is not instanceof IPortalAddResourceParam !");
- }
- var cloneAddSceneParams = {
- rootUrl: addSceneParams.rootUrl,
- tags: addSceneParams.tags,
- authorizeSetting: addSceneParams.entities
- };
- var addSceneUrl = this.iportalUrl + "/web/scenes/batchaddscenes.json";
- return this.request("POST", addSceneUrl, JSON.stringify(cloneAddSceneParams)).then(function (result) {
- return result;
- });
- }
- /**
- * @function SuperMap.iPortalUser.prototype.registerService
- * @description 注册服务。
- * @version 10.1.0
- * @param {SuperMap.iPortalRegisterServiceParam} registerParams - 注册服务的参数。
- * @returns {Promise} 返回包含注册服务结果的 Promise 对象。
- */
- }, {
- key: "registerService",
- value: function registerService(registerParams) {
- if (!(registerParams instanceof IPortalRegisterServiceParam)) {
- return this.getErrMsgPromise("registerParams is not instanceof IPortalRegisterServiceParam !");
- }
- var cloneRegisterParams = {
- type: registerParams.type,
- tags: registerParams.tags,
- authorizeSetting: registerParams.entities,
- metadata: registerParams.metadata,
- addedMapNames: registerParams.addedMapNames,
- addedSceneNames: registerParams.addedSceneNames
- };
- var registerUrl = this.iportalUrl + "/web/services.json";
- return this.request("POST", registerUrl, JSON.stringify(cloneRegisterParams)).then(function (result) {
- return result;
- });
- }
- /**
- * @function SuperMap.iPortalUser.prototype.getErrMsgPromise
- * @description 获取包含错误信息的Promise对象。
- * @version 10.1.0
- * @param {String} errMsg - 传入的错误信息。
- * @returns {Promise} 返回包含错误信息的 Promise 对象。
- */
- }, {
- key: "getErrMsgPromise",
- value: function getErrMsgPromise(errMsg) {
- return new Promise(function (resolve) {
- resolve(errMsg);
- });
- }
- /**
- * @function SuperMap.iPortalUser.prototype.uploadDataRequest
- * @description 上传数据。
- * @version 10.1.0
- * @param {number} id - 上传数据的资源id。
- * @param {Object} formData - 请求体为文本数据流。
- * @returns {Promise} 返回包含上传数据操作的 Promise 对象。
- */
- }, {
- key: "uploadDataRequest",
- value: function uploadDataRequest(id, formData) {
- var uploadDataUrl = this.iportalUrl + "/web/mycontent/datas/" + id + "/upload.json";
- return this.request("POST", uploadDataUrl, formData);
- }
- /**
- * @function SuperMap.iPortalUser.prototype.addData
- * @description 上传/注册数据。
- * @version 10.1.0
- * @param {SuperMap.iPortalAddDataParam} params - 上传/注册数据所需的参数。
- * @param {Object} [formData] - 请求体为文本数据流(上传数据时传入)。
- * @returns {Promise} 返回上传/注册数据的 Promise 对象。
- */
- }, {
- key: "addData",
- value: function addData(params, formData) {
- var _this2 = this;
- if (!(params instanceof IPortalAddDataParam)) {
- return this.getErrMsgPromise("params is not instanceof iPortalAddDataParam !");
- }
- var datasUrl = this.iportalUrl + "/web/mycontent/datas.json";
- var entity = {
- fileName: params.fileName,
- tags: params.tags,
- type: params.type
- };
- var type = params.type.toLowerCase();
- var dataMetaInfo;
- if (type === "excel" || type === "csv") {
- if (!(params.dataMetaInfo instanceof IPortalDataMetaInfoParam)) {
- return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");
- }
- dataMetaInfo = {
- xField: params.dataMetaInfo.xField,
- yField: params.dataMetaInfo.yField
- };
- if (type === 'csv') {
- dataMetaInfo.fileEncoding = params.dataMetaInfo.fileEncoding;
- }
- entity.coordType = "WGS84";
- entity.dataMetaInfo = dataMetaInfo;
- } else if (type === "hdfs" || type === "hbase") {
- if (!(params.dataMetaInfo instanceof IPortalDataMetaInfoParam)) {
- return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");
- }
- if (!(params.dataMetaInfo.dataStoreInfo instanceof IPortalDataStoreInfoParam)) {
- return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo is not instanceof iPortalDataStoreInfoParam !");
- }
- var dataStoreInfo = {
- type: params.dataMetaInfo.dataStoreInfo.type
- };
- switch (type) {
- case "hdfs":
- dataStoreInfo.url = params.dataMetaInfo.dataStoreInfo.url;
- dataMetaInfo = {
- url: params.dataMetaInfo.url,
- dataStoreInfo: dataStoreInfo
- };
- break;
- case "hbase":
- if (!(params.dataMetaInfo.dataStoreInfo.connectionInfo instanceof IPortalDataConnectionInfoParam)) {
- return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo.connectionInfo is not instanceof iPortalDataConnectionInfoParam !");
- }
- dataStoreInfo.connectionInfo = {
- dataBase: params.dataMetaInfo.dataStoreInfo.connectionInfo.dataBase,
- server: params.dataMetaInfo.dataStoreInfo.connectionInfo.server,
- engineType: 'HBASE'
- };
- dataStoreInfo.datastoreType = "SPATIAL"; //该字段SPATIAL表示HBASE注册
- dataMetaInfo = {
- dataStoreInfo: dataStoreInfo
- };
- break;
- }
- entity.dataMetaInfo = dataMetaInfo;
- }
- return this.request("POST", datasUrl, JSON.stringify(entity)).then(function (res) {
- if (type === "hdfs" || type === "hbase") {
- return res;
- } else {
- if (res.childID) {
- return _this2.uploadDataRequest(res.childID, formData);
- } else {
- return res.customResult;
- }
- }
- });
- }
- /**
- * @function SuperMap.iPortalUser.prototype.publishOrUnpublish
- * @description 发布/取消发布。
- * @version 10.1.0
- * @param {object} options - 发布/取消发布数据服务所需的参数。
- * @param {object} options.dataId - 数据项id。
- * @param {object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
- * @param {object} [options.dataServiceId] - 发布的服务 id。
- * @param {boolean} forPublish - 是否取消发布。
- * @returns {Promise} 返回发布/取消发布数据服务的 Promise 对象。
- */
- }, {
- key: "publishOrUnpublish",
- value: function publishOrUnpublish(option, forPublish) {
- if (!option.dataId || !option.serviceType) {
- return this.getErrMsgPromise("option.dataID and option.serviceType are Required!");
- }
- var dataId = option.dataId;
- var dataServiceId = option.dataServiceId;
- var serviceType = option.serviceType;
- var publishUrl = this.iportalUrl + "/web/mycontent/datas/" + dataId + "/publishstatus.json?serviceType=" + serviceType;
- if (dataServiceId) {
- publishUrl += "&dataServiceId=" + dataServiceId;
- }
- return this.request("PUT", publishUrl, JSON.stringify(forPublish)).then(function (res) {
- // 发起服务状态查询
- if (forPublish) {
- // 发布服务的结果异步处理
- // var publishStateUrl = this.iportalUrl + "web/mycontent/datas/" + dataId + "/publishstatus.rjson";
- if (!dataServiceId) {
- // 发布服务时会回传serviceIDs,发布服务之前serviceIDs为空
- dataServiceId = res.customResult;
- }
- return dataServiceId;
- } else {
- // 取消发布的结果同步处理
- return res;
- }
- });
- }
- /**
- * @function SuperMap.iPortalUser.prototype.getDataPublishedStatus
- * @description 查询服务状态,发起服务状态查询。
- * @version 10.1.0
- * @param {number} dataId - 查询服务状态的数据项id。
- * @param {string} dataServiceId - 发布的服务id。
- * @returns {Promise} 返回查询服务状态的 Promise 对象。
- */
- }, {
- key: "getDataPublishedStatus",
- value: function getDataPublishedStatus(dataId, dataServiceId) {
- var publishStateUrl = this.iportalUrl + "/web/mycontent/datas/" + dataId + "/publishstatus.json?dataServiceId=" + dataServiceId + "&forPublish=true";
- return this.request("GET", publishStateUrl);
- }
- /**
- * @function SuperMap.iPortalUser.prototype.unPublishedDataService
- * @description 取消发布。
- * @version 10.1.0
- * @param {object} options - 取消发布服务具体参数。
- * @param {object} options.dataId - 数据项id。
- * @param {object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
- * @param {object} [options.dataServiceId] - 发布的服务 id。
- * @returns {Promise} 返回取消发布数据服务的 Promise 对象。
- */
- }, {
- key: "unPublishDataService",
- value: function unPublishDataService(option) {
- return this.publishOrUnpublish(option, false);
- }
- /**
- * @function SuperMap.iPortalUser.prototype.publishedDataService
- * @description 发布数据服务。
- * @version 10.1.0
- * @param {object} options - 发布数据服务具体参数。
- * @param {object} options.dataId - 数据项id。
- * @param {object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
- * @param {object} [options.dataServiceId] - 发布的服务 id。
- * @returns {Promise} 返回发布数据服务的 Promise 对象。
- */
- }, {
- key: "publishDataService",
- value: function publishDataService(option) {
- return this.publishOrUnpublish(option, true);
- }
- }]);
- return IPortalUser;
- }(IPortalServiceBase);
- SuperMap.iPortalUser = IPortalUser;
- ;// CONCATENATED MODULE: ./src/common/iPortal/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/common/iServer/CommonServiceBase.js
- function CommonServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function CommonServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) CommonServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) CommonServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.CommonServiceBase
- * @category iServer
- * @classdesc 对接 iServer 各种服务的 Service 的基类。
- * @param {string} url - 服务地址。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
- * @param {string} [options.proxy] - 服务代理地址。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var CommonServiceBase = /*#__PURE__*/function () {
- function CommonServiceBase(url, options) {
- CommonServiceBase_classCallCheck(this, CommonServiceBase);
- var me = this;
- this.EVENT_TYPES = ["processCompleted", "processFailed"];
- this.events = null;
- this.eventListeners = null;
- this.url = null;
- this.urls = null;
- this.proxy = null;
- this.serverType = null;
- this.index = null;
- this.length = null;
- this.options = null;
- this.totalTimes = null;
- this.POLLING_TIMES = 3;
- this._processSuccess = null;
- this._processFailed = null;
- this.isInTheSameDomain = null;
- this.withCredentials = false;
- if (Util.isArray(url)) {
- me.urls = url;
- me.length = url.length;
- me.totalTimes = me.length;
- if (me.length === 1) {
- me.url = url[0];
- } else {
- me.index = parseInt(Math.random() * me.length);
- me.url = url[me.index];
- }
- } else {
- me.totalTimes = 1;
- me.url = url;
- }
- if (Util.isArray(url) && !me.isServiceSupportPolling()) {
- me.url = url[0];
- me.totalTimes = 1;
- }
- me.serverType = me.serverType || ServerType.ISERVER;
- options = options || {};
- this.crossOrigin = options.crossOrigin;
- this.headers = options.headers;
- Util.extend(this, options);
- me.isInTheSameDomain = Util.isInTheSameDomain(me.url);
- me.events = new Events(me, null, me.EVENT_TYPES, true);
- if (me.eventListeners instanceof Object) {
- me.events.on(me.eventListeners);
- }
- this.CLASS_NAME = "SuperMap.CommonServiceBase";
- }
- /**
- * @function SuperMap.CommonServiceBase.prototype.destroy
- * @description 释放资源,将引用的资源属性置空。
- */
- CommonServiceBase_createClass(CommonServiceBase, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- if (Util.isArray(me.urls)) {
- me.urls = null;
- me.index = null;
- me.length = null;
- me.totalTimes = null;
- }
- me.url = null;
- me.options = null;
- me._processSuccess = null;
- me._processFailed = null;
- me.isInTheSameDomain = null;
- me.EVENT_TYPES = null;
- if (me.events) {
- me.events.destroy();
- me.events = null;
- }
- if (me.eventListeners) {
- me.eventListeners = null;
- }
- }
- /**
- * @function SuperMap.CommonServiceBase.prototype.request
- * @description: 该方法用于向服务发送请求。
- * @param {Object} options - 参数。
- * @param {string} [options.method='GET'] - 请求方式,包括 "GET","POST","PUT","DELETE"。
- * @param {string} [options.url] - 发送请求的地址。
- * @param {Object} [options.params] - 作为查询字符串添加到 URL 中的一组键值对,此参数只适用于 GET 方式发送的请求。
- * @param {string} [options.data] - 发送到服务器的数据。
- * @param {function} options.success - 请求成功后的回调函数。
- * @param {function} options.failure - 请求失败后的回调函数。
- * @param {Object} [options.scope] - 如果回调函数是对象的一个公共方法,设定该对象的范围。
- * @param {boolean} [options.isInTheSameDomain] - 请求是否在当前域中。
- * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- }, {
- key: "request",
- value: function request(options) {
- var me = this;
- options.url = options.url || me.url;
- options.proxy = options.proxy || me.proxy;
- options.withCredentials = options.withCredentials != undefined ? options.withCredentials : me.withCredentials;
- options.crossOrigin = options.crossOrigin != undefined ? options.crossOrigin : me.crossOrigin;
- options.headers = options.headers || me.headers;
- options.isInTheSameDomain = me.isInTheSameDomain; //为url添加安全认证信息片段
- var credential = this.getCredential(options.url);
- if (credential) {
- options.url = Util.urlAppend(options.url, credential.getUrlParameters());
- }
- me.calculatePollingTimes();
- me._processSuccess = options.success;
- me._processFailed = options.failure;
- options.scope = me;
- options.success = me.getUrlCompleted;
- options.failure = me.getUrlFailed;
- me.options = options;
- me._commit(me.options);
- }
- /**
- * @function SuperMap.CommonServiceBase.prototype.getCredential
- * @description 获取凭据信息
- * @param {string} url - 服务地址。
- * @returns {SuperMap.Credential} 凭据信息对象。
- */
- }, {
- key: "getCredential",
- value: function getCredential(url) {
- var keyUrl = url,
- credential,
- value;
- switch (this.serverType) {
- case ServerType.IPORTAL:
- value = SecurityManager.getToken(keyUrl);
- credential = value ? new Credential(value, "token") : null;
- if (!credential) {
- value = SecurityManager.getKey(keyUrl);
- credential = value ? new Credential(value, "key") : null;
- }
- break;
- case ServerType.ONLINE:
- value = SecurityManager.getKey(keyUrl);
- credential = value ? new Credential(value, "key") : null;
- break;
- default:
- //iServer or others
- value = SecurityManager.getToken(keyUrl);
- credential = value ? new Credential(value, "token") : null;
- break;
- }
- return credential;
- }
- /**
- * @function SuperMap.CommonServiceBase.prototype.getUrlCompleted
- * @description 请求成功后执行此方法。
- * @param {Object} result - 服务器返回的结果对象。
- */
- }, {
- key: "getUrlCompleted",
- value: function getUrlCompleted(result) {
- var me = this;
- me._processSuccess(result);
- }
- /**
- * @function SuperMap.CommonServiceBase.prototype.getUrlFailed
- * @description 请求失败后执行此方法。
- * @param {Object} result - 服务器返回的结果对象。
- */
- }, {
- key: "getUrlFailed",
- value: function getUrlFailed(result) {
- var me = this;
- if (me.totalTimes > 0) {
- me.totalTimes--;
- me.ajaxPolling();
- } else {
- me._processFailed(result);
- }
- }
- /**
- *
- * @function SuperMap.CommonServiceBase.prototype.ajaxPolling
- * @description 请求失败后,如果剩余请求失败次数不为 0,重新获取 URL 发送请求
- */
- }, {
- key: "ajaxPolling",
- value: function ajaxPolling() {
- var me = this,
- url = me.options.url,
- re = /^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;
- me.index = parseInt(Math.random() * me.length);
- me.url = me.urls[me.index];
- url = url.replace(re, re.exec(me.url)[0]);
- me.options.url = url;
- me.options.isInTheSameDomain = Util.isInTheSameDomain(url);
- me._commit(me.options);
- }
- /**
- * @function SuperMap.CommonServiceBase.prototype.calculatePollingTimes
- * @description 计算剩余请求失败执行次数。
- */
- }, {
- key: "calculatePollingTimes",
- value: function calculatePollingTimes() {
- var me = this;
- if (me.times) {
- if (me.totalTimes > me.POLLING_TIMES) {
- if (me.times > me.POLLING_TIMES) {
- me.totalTimes = me.POLLING_TIMES;
- } else {
- me.totalTimes = me.times;
- }
- } else {
- if (me.times < me.totalTimes) {
- me.totalTimes = me.times;
- }
- }
- } else {
- if (me.totalTimes > me.POLLING_TIMES) {
- me.totalTimes = me.POLLING_TIMES;
- }
- }
- me.totalTimes--;
- }
- /**
- * @function SuperMap.CommonServiceBase.prototype.isServiceSupportPolling
- * @description 判断服务是否支持轮询。
- */
- }, {
- key: "isServiceSupportPolling",
- value: function isServiceSupportPolling() {
- var me = this;
- return !(me.CLASS_NAME === "SuperMap.REST.ThemeService" || me.CLASS_NAME === "SuperMap.REST.EditFeaturesService");
- }
- /**
- * @function SuperMap.CommonServiceBase.prototype.serviceProcessCompleted
- * @description 状态完成,执行此方法。
- * @param {Object} result - 服务器返回的结果对象。
- */
- }, {
- key: "serviceProcessCompleted",
- value: function serviceProcessCompleted(result) {
- result = Util.transformResult(result);
- this.events.triggerEvent("processCompleted", {
- result: result
- });
- }
- /**
- * @function SuperMap.CommonServiceBase.prototype.serviceProcessFailed
- * @description 状态失败,执行此方法。
- * @param {Object} result - 服务器返回的结果对象。
- */
- }, {
- key: "serviceProcessFailed",
- value: function serviceProcessFailed(result) {
- result = Util.transformResult(result);
- var error = result.error || result;
- this.events.triggerEvent("processFailed", {
- error: error
- });
- }
- }, {
- key: "_commit",
- value: function _commit(options) {
- if (options.method === "POST" || options.method === "PUT") {
- if (options.params) {
- options.url = Util.urlAppend(options.url, Util.getParameterString(options.params || {}));
- }
- options.params = options.data;
- }
- FetchRequest.commit(options.method, options.url, options.params, {
- headers: options.headers,
- withCredentials: options.withCredentials,
- crossOrigin: options.crossOrigin,
- timeout: options.async ? 0 : null,
- proxy: options.proxy
- }).then(function (response) {
- if (response.text) {
- return response.text();
- }
- if (response.json) {
- return response.json();
- }
- return response;
- }).then(function (text) {
- var result = text;
- if (typeof text === "string") {
- result = new JSONFormat().read(text);
- }
- if (!result || result.error || result.code >= 300 && result.code !== 304) {
- if (result && result.error) {
- result = {
- error: result.error
- };
- } else {
- result = {
- error: result
- };
- }
- }
- if (result.error) {
- var failure = options.scope ? FunctionExt.bind(options.failure, options.scope) : options.failure;
- failure(result);
- } else {
- result.succeed = result.succeed == undefined ? true : result.succeed;
- var success = options.scope ? FunctionExt.bind(options.success, options.scope) : options.success;
- success(result);
- }
- })["catch"](function (e) {
- var failure = options.scope ? FunctionExt.bind(options.failure, options.scope) : options.failure;
- failure(e);
- });
- }
- }]);
- return CommonServiceBase;
- }();
- SuperMap.CommonServiceBase = CommonServiceBase;
- /**
- * 服务器请求回调函数
- * @callback RequestCallback
- * @example
- * var requestCallback = function (serviceResult){
- * console.log(serviceResult.result);
- * }
- * new QueryService(url).queryByBounds(param, requestCallback);
- * @param {Object} serviceResult
- * @param {Object} serviceResult.result 服务器返回结果。
- * @param {Object} serviceResult.object 发布应用程序事件的对象。
- * @param {Object} serviceResult.type 事件类型。
- * @param {Object} serviceResult.element 接受浏览器事件的 DOM 节点。
- */
- ;// CONCATENATED MODULE: ./src/common/iServer/GeoCodingParameter.js
- function GeoCodingParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GeoCodingParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoCodingParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoCodingParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GeoCodingParameter
- * @category iServer AddressMatch
- * @classdesc 地理正向匹配参数类。
- * @param {Object} options - 参数。
- * @param {string} options.address - 地点关键词。
- * @param {number} [options.fromIndex] - 设置返回对象的起始索引值。
- * @param {number} [options.toIndex] - 设置返回对象的结束索引值。
- * @param {Array.<string>} [options.filters] - 过滤字段,限定查询区域。
- * @param {string} [options.prjCoordSys] - 查询结果的坐标系。
- * @param {number} [options.maxReturn] - 最大返回结果数。
- */
- var GeoCodingParameter = /*#__PURE__*/function () {
- function GeoCodingParameter(options) {
- GeoCodingParameter_classCallCheck(this, GeoCodingParameter);
- if (options.filters && typeof options.filters === 'string') {
- options.filters = options.filters.split(',');
- }
- /**
- * @member {string} SuperMap.GeoCodingParameter.prototype.address
- * @description 地点关键词。
- */
- this.address = null;
- /**
- * @member {number} [SuperMap.GeoCodingParameter.prototype.fromIndex]
- * @description 设置返回对象的起始索引值。
- */
- this.fromIndex = null;
- /**
- * @member {number} [SuperMap.GeoCodingParameter.prototype.toIndex]
- * @description 设置返回对象的结束索引值。
- */
- this.toIndex = null;
- /**
- * @member {Array.<string>} [SuperMap.GeoCodingParameter.prototype.filters]
- * @description 过滤字段,限定查询区域。
- */
- this.filters = null;
- /**
- * @member {string} [SuperMap.GeoCodingParameter.prototype.prjCoordSys]
- * @description 查询结果的坐标系。
- */
- this.prjCoordSys = null;
- /**
- * @member {number} [SuperMap.GeoCodingParameter.prototype.maxReturn]
- * @description 最大返回结果数。
- */
- this.maxReturn = null;
- Util.extend(this, options);
- }
- /**
- * @function SuperMap.GeoCodingParameter.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- GeoCodingParameter_createClass(GeoCodingParameter, [{
- key: "destroy",
- value: function destroy() {
- this.address = null;
- this.fromIndex = null;
- this.toIndex = null;
- this.filters = null;
- this.prjCoordSys = null;
- this.maxReturn = null;
- }
- }]);
- return GeoCodingParameter;
- }();
- SuperMap.GeoCodingParameter = GeoCodingParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/GeoDecodingParameter.js
- function GeoDecodingParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GeoDecodingParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoDecodingParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoDecodingParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GeoDecodingParameter
- * @category iServer AddressMatch
- * @classdesc 地理反向匹配参数类。
- * @param {Object} options - 参数。
- * @param {number} options.x - 查询位置的横坐标。
- * @param {number} options.y - 查询位置的纵坐标。
- * @param {number} [options.fromIndex] - 设置返回对象的起始索引值。
- * @param {Array.<string>} [options.filters] - 过滤字段,限定查询区域。
- * @param {string} [options.prjCoordSys] - 查询结果的坐标系。
- * @param {number} [options.maxReturn] - 最大返回结果数。
- * @param {number} [options.geoDecodingRadius] - 查询半径。
- */
- var GeoDecodingParameter = /*#__PURE__*/function () {
- function GeoDecodingParameter(options) {
- GeoDecodingParameter_classCallCheck(this, GeoDecodingParameter);
- if (options.filters) {
- options.filters = options.filters.split(',');
- }
- /**
- * @member {number} SuperMap.GeoDecodingParameter.prototype.x
- * @description 查询位置的横坐标。
- */
- this.x = null;
- /**
- * @member {number} SuperMap.GeoDecodingParameter.prototype.y
- * @description 查询位置的纵坐标。
- */
- this.y = null;
- /**
- * @member {number} [SuperMap.GeoDecodingParameter.prototype.fromIndex]
- * @description 设置返回对象的起始索引值。
- */
- this.fromIndex = null;
- /**
- * @member {number} [SuperMap.GeoDecodingParameter.prototype.toIndex]
- * @description 设置返回对象的结束索引值。
- */
- this.toIndex = null;
- /**
- * @member {Array.<string>} [SuperMap.GeoDecodingParameter.prototype.filters]
- * @description 过滤字段,限定查询区域。
- */
- this.filters = null;
- /**
- * @member {string} [SuperMap.GeoDecodingParameter.prototype.prjCoordSys]
- * @description 查询结果的坐标系。
- */
- this.prjCoordSys = null;
- /**
- * @member {number} [SuperMap.GeoDecodingParameter.prototype.maxReturn]
- * @description 最大返回结果数。
- */
- this.maxReturn = null;
- /**
- * @member {number} SuperMap.GeoDecodingParameter.prototype.geoDecodingRadius
- * @description 查询半径。
- */
- this.geoDecodingRadius = null;
- Util.extend(this, options);
- }
- /**
- * @function SuperMap.GeoDecodingParameter.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- GeoDecodingParameter_createClass(GeoDecodingParameter, [{
- key: "destroy",
- value: function destroy() {
- this.x = null;
- this.y = null;
- this.fromIndex = null;
- this.toIndex = null;
- this.filters = null;
- this.prjCoordSys = null;
- this.maxReturn = null;
- this.geoDecodingRadius = null;
- }
- }]);
- return GeoDecodingParameter;
- }();
- SuperMap.GeoDecodingParameter = GeoDecodingParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/AddressMatchService.js
- 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); }
- function AddressMatchService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function AddressMatchService_createClass(Constructor, protoProps, staticProps) { if (protoProps) AddressMatchService_defineProperties(Constructor.prototype, protoProps); if (staticProps) AddressMatchService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function AddressMatchService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = AddressMatchService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function AddressMatchService_setPrototypeOf(o, p) { AddressMatchService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AddressMatchService_setPrototypeOf(o, p); }
- 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); }; }
- function AddressMatchService_possibleConstructorReturn(self, call) { if (call && (AddressMatchService_typeof(call) === "object" || typeof call === "function")) { return call; } return AddressMatchService_assertThisInitialized(self); }
- function AddressMatchService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function AddressMatchService_getPrototypeOf(o) { AddressMatchService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AddressMatchService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.AddressMatchService
- * @category iServer AddressMatch
- * @classdesc 地址匹配服务,包括正向匹配和反向匹配。
- * @param {string} url - 地址匹配服务地址。
- * @param {Object} options - 参数。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var AddressMatchService = /*#__PURE__*/function (_CommonServiceBase) {
- AddressMatchService_inherits(AddressMatchService, _CommonServiceBase);
- var _super = AddressMatchService_createSuper(AddressMatchService);
- function AddressMatchService(url, options) {
- var _this;
- AddressMatchService_classCallCheck(this, AddressMatchService);
- _this = _super.call(this, url, options);
- _this.options = options || {};
- _this.CLASS_NAME = 'SuperMap.AddressMatchService';
- return _this;
- }
- /**
- * @function SuperMap.AddressMatchService.prototype.destroy
- * @override
- */
- AddressMatchService_createClass(AddressMatchService, [{
- key: "destroy",
- value: function destroy() {
- AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.AddressMatchService.prototype.code
- * @param {string} url - 正向地址匹配服务地址。
- * @param {SuperMap.GeoCodingParameter} params - 正向地址匹配服务参数。
- */
- }, {
- key: "code",
- value: function code(url, params) {
- if (!(params instanceof GeoCodingParameter)) {
- return;
- }
- this.processAsync(url, params);
- }
- /**
- * @function SuperMap.AddressMatchService.prototype.decode
- * @param {string} url - 反向地址匹配服务地址。
- * @param {SuperMap.GeoDecodingParameter} params - 反向地址匹配服务参数。
- */
- }, {
- key: "decode",
- value: function decode(url, params) {
- if (!(params instanceof GeoDecodingParameter)) {
- return;
- }
- this.processAsync(url, params);
- }
- /**
- * @function SuperMap.AddressMatchService.prototype.processAsync
- * @description 负责将客户端的动态分段服务参数传递到服务端。
- * @param {string} url - 服务地址。
- * @param {Object} params - 参数。
- */
- }, {
- key: "processAsync",
- value: function processAsync(url, params) {
- this.request({
- method: 'GET',
- url: url,
- params: params,
- scope: this,
- success: this.serviceProcessCompleted,
- failure: this.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.AddressMatchService.prototype.serviceProcessCompleted
- * @param {Object} result - 服务器返回的结果对象。
- * @description 服务流程是否完成
- */
- }, {
- key: "serviceProcessCompleted",
- value: function serviceProcessCompleted(result) {
- if (result.succeed) {
- delete result.succeed;
- }
- AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "serviceProcessCompleted", this).call(this, result);
- }
- /**
- * @function SuperMap.AddressMatchService.prototype.serviceProcessCompleted
- * @param {Object} result - 服务器返回的结果对象。
- * @description 服务流程是否失败
- */
- }, {
- key: "serviceProcessFailed",
- value: function serviceProcessFailed(result) {
- AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "serviceProcessFailed", this).call(this, result);
- }
- }]);
- return AddressMatchService;
- }(CommonServiceBase);
- SuperMap.AddressMatchService = AddressMatchService;
- ;// CONCATENATED MODULE: ./src/common/iServer/AggQueryBuilderParameter.js
- function AggQueryBuilderParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function AggQueryBuilderParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) AggQueryBuilderParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) AggQueryBuilderParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.AggQueryBuilderParameter
- * @classdesc 聚合查询 QueryBuilder 参数基类,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
- * @category iServer Data FeatureResults
- * @param {Object} option - 初始化参数。
- * @param {string} option.name - 查询结果名称。
- * @param {SuperMap.AggregationQueryBuilderType} option.queryType - 查询类型。
- */
- var AggQueryBuilderParameter = /*#__PURE__*/function () {
- function AggQueryBuilderParameter(option) {
- AggQueryBuilderParameter_classCallCheck(this, AggQueryBuilderParameter);
- /**
- * @member {string} SuperMap.AggQueryBuilderParameter.prototype.name
- * @description 查询结果名称。
- */
- this.name = null;
- /**
- * @member {SuperMap.AggregationQueryBuilderType} SuperMap.AggQueryBuilderParameter.prototype.queryType
- * @description 查询类型。
- */
- this.queryType = null;
- this.CLASS_NAME = "SuperMap.AggQueryBuilderParameter";
- Util.extend(this, option);
- }
- AggQueryBuilderParameter_createClass(AggQueryBuilderParameter, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.name = null;
- me.queryType = null;
- }
- }]);
- return AggQueryBuilderParameter;
- }();
- SuperMap.AggQueryBuilderParameter = AggQueryBuilderParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/AggregationParameter.js
- function AggregationParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function AggregationParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) AggregationParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) AggregationParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.AggregationParameter
- * @classdesc 聚合查询参数设置,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
- * @category iServer Data FeatureResults
- * @param {Object} options - 初始化参数。
- * @param {string} options.aggName - 聚合名称。
- * @param {SuperMap.AggregationType} options.aggType - 聚合类型设置。
- * @param {string} options.aggFieldName - 聚合字段。
- * @param {SuperMap.AggregationParameter} options.subAgg - 子聚合类。
- *
- */
- var AggregationParameter = /*#__PURE__*/function () {
- function AggregationParameter(options) {
- AggregationParameter_classCallCheck(this, AggregationParameter);
- /**
- * @member {string} SuperMap.AggregationParameter.prototype.aggName
- * @description 聚合名称。
- */
- this.aggName = null;
- /**
- * @member {SuperMap.AggregationType} SuperMap.AggregationParameter.prototype.aggType
- * @description 聚合类型设置类。
- */
- this.aggType = null;
- /**
- * @member {string} SuperMap.AggregationParameter.prototype.aggFieldName
- * @description 聚合字段。
- */
- this.aggFieldName = null;
- /**
- * @member {SuperMap.AggregationParameter} SuperMap.AggregationParameter.prototype.subAgg
- * @description 子聚合。
- */
- this.subAgg = null;
- this.CLASS_NAME = "SuperMap.AggregationParameter";
- Util.extend(this, options);
- }
- AggregationParameter_createClass(AggregationParameter, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.aggName = null;
- me.aggFieldName = null;
- me.aggType = null;
- if (me.subAgg) {
- me.subAgg = null;
- }
- }
- }]);
- return AggregationParameter;
- }();
- SuperMap.AggregationParameter = AggregationParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/AreaSolarRadiationParameters.js
- function AreaSolarRadiationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function AreaSolarRadiationParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) AreaSolarRadiationParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) AreaSolarRadiationParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.AreaSolarRadiationParameters
- * @category iServer SpatialAnalyst SolarRadiationAnalyst
- * @classdesc 地区太阳辐射参数类。
- * @param {Object} options - 参数。
- * @param {string} options.dataset - 要用来做地区太阳辐射数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"的形式来表示,例如:JingjinTerrain@Jingjin。
- * @param {string} options.targetDatasourceName - 指定的存储结果数据集的数据源名称, 例如:"Jingjin"。
- * @param {string} options.totalGridName - 指定地区太阳辐射总辐射量数据集的名称。
- * @param {string} options.diffuseDatasetGridName - 指定地区太阳辐射散射辐射量数据集的名称。
- * @param {string} options.durationDatasetGridName - 指定地区太阳辐射太阳直射持续时间数据集的名称。
- * @param {string} options.directDatasetGridName - 指定地区太阳辐射直射辐射量数据集的名称。
- * @param {number} options.latitude - 待计算区域的纬度值。
- * @param {string} [options.timeMode = 'MULTIDAYS'] - 时间模式。可选值"WITHINDAY"(单日)或"MULTIDAYS"(多日)。
- * @param {number} options.dayStart - 起始日期(年内的第几天)。
- * @param {number} options.dayEnd - 结束日期(年内的第几天)。
- * @param {number} [options.hourStart] - 起始时间(一天中的第几个小时)。
- * @param {number} [options.hourEnd] - 结束时间(一天中的第几个小时)。
- * @param {number} [options.transmittance] - 太阳辐射穿过大气的透射率。
- * @param {number} [options.hourInterval=0.5] - 计算时的小时间隔(设置的越小计算量越大并且计算结果更精确,如果修改此参数,必须使用整数)。
- * @param {number} [options.dayInterval=5] - 计算时的天数间隔(设置的越小计算量越大并且计算结果更精确,必须使用整数)。
- * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
- */
- var AreaSolarRadiationParameters = /*#__PURE__*/function () {
- function AreaSolarRadiationParameters(options) {
- AreaSolarRadiationParameters_classCallCheck(this, AreaSolarRadiationParameters);
- /**
- * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.dataset
- * @description 要用来做地区太阳辐射数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示,例如:JingjinTerrain@Jingjin。注:地区太阳辐射数据必须为栅格数据集。
- */
- this.dataset = null;
- /**
- * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.targetDatasourceName
- * @description 指定的存储结果数据集的数据源名称,例如:"Jingjin"。
- */
- this.targetDatasourceName = null;
- /**
- * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.totalGridName
- * @description 指定地区太阳辐射总辐射量数据集的名称。
- */
- this.totalGridName = null;
- /**
- * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.diffuseDatasetGridName
- * @description 指定地区太阳辐射散射辐射量数据集的名称。
- */
- this.diffuseDatasetGridName = null;
- /**
- * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.durationDatasetGridName
- * @description 指定地区太阳辐射太阳直射持续时间数据集的名称。
- */
- this.durationDatasetGridName = null;
- /**
- * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.durationDatasetGridName
- * @description 指定地区太阳辐射直射辐射量数据集的名称。
- */
- this.directDatasetGridName = null;
- /**
- * @member {number} SuperMap.AreaSolarRadiationParameters.prototype.latitude
- * @description 待计算区域的纬度值。
- */
- this.latitude = null;
- /**
- * @member {string} [SuperMap.AreaSolarRadiationParameters.prototype.timeMode='MULTIDAYS']
- * @description 时间模式。可选值"WITHINDAY"(单日)或"MULTIDAYS"(多日)。
- */
- this.timeMode = "MULTIDAYS";
- /**
- * @member {number} SuperMap.AreaSolarRadiationParameters.prototype.dayStart
- * @description 起始日期(年内的第几天)。
- */
- this.dayStart = null;
- /**
- * @member {number} SuperMap.AreaSolarRadiationParameters.prototype.dayEnd
- * @description 结束日期(年内的第几天)。
- */
- this.dayEnd = null;
- /**
- * @member {number} [SuperMap.AreaSolarRadiationParameters.prototype.hourStart]
- * @description 起始时间(一天中的第几个小时)。
- */
- this.hourStart = null;
- /**
- * @member {number} [SuperMap.AreaSolarRadiationParameters.prototype.hourEnd]
- * @description 结束时间(一天中的第几个小时)。
- */
- this.hourEnd = null;
- /**
- * @member {number} [SuperMap.AreaSolarRadiationParameters.prototype.transmittance]
- * @description 太阳辐射穿过大气的透射率。
- */
- this.transmittance = null;
- /**
- * @member {number} [SuperMap.AreaSolarRadiationParameters.prototype.hourInterval=0.5]
- * @description 计算时的小时间隔(设置的越小计算量越大并且计算结果更精确, 如果修改此参数,必须使用整数)
- */
- this.hourInterval = null;
- /**
- * @member {number} [SuperMap.AreaSolarRadiationParameters.prototype.dayInterval=5]
- * @description 计算时的天数间隔(设置的越小计算量越大并且计算结果更精确, 必须使用整数)
- */
- this.dayInterval = null;
- /**
- * @member {boolean} [SuperMap.AreaSolarRadiationParameters.prototype.deleteExistResultDataset=false]
- * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
- */
- this.deleteExistResultDataset = false;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.AreaSolarRadiationParameters";
- }
- /**
- * @function SuperMap.AreaSolarRadiationParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- AreaSolarRadiationParameters_createClass(AreaSolarRadiationParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.dataset = null;
- me.zFactor = 1.0;
- me.averageCurvatureName = null;
- me.profileCurvatureName = null;
- me.planCurvatureName = null;
- me.deleteExistResultDataset = true;
- }
- /**
- * @function SuperMap.AreaSolarRadiationParameters.toObject
- * @param {SuperMap.AreaSolarRadiationParameters} param - 地区太阳辐射参数类。
- * @param {SuperMap.AreaSolarRadiationParameters} tempObj - 地区太阳辐射参数对象。
- * @returns {Object} JSON对象。
- * @description 将SuperMap.AreaSolarRadiationParameters对象转换成JSON对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(param, tempObj) {
- var parameter = {};
- for (var name in param) {
- if (name !== "dataset") {
- var name1 = name === "latitude" || name === "timeMode" || name === "dayStart";
- var name2 = name === "dayEnd" || name === "hourStart" || name === "hourEnd";
- var name3 = name === "transmittance" || name === "hourInterval" || name === "dayInterval";
- if (name1 || name2 || name3) {
- parameter[name] = param[name];
- } else {
- tempObj[name] = param[name];
- }
- }
- }
- tempObj["parameter"] = parameter;
- }
- }]);
- return AreaSolarRadiationParameters;
- }();
- SuperMap.AreaSolarRadiationParameters = AreaSolarRadiationParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/SpatialAnalystBase.js
- 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); }
- function SpatialAnalystBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SpatialAnalystBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) SpatialAnalystBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) SpatialAnalystBase_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SpatialAnalystBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SpatialAnalystBase_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SpatialAnalystBase_setPrototypeOf(o, p) { SpatialAnalystBase_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SpatialAnalystBase_setPrototypeOf(o, p); }
- 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); }; }
- function SpatialAnalystBase_possibleConstructorReturn(self, call) { if (call && (SpatialAnalystBase_typeof(call) === "object" || typeof call === "function")) { return call; } return SpatialAnalystBase_assertThisInitialized(self); }
- function SpatialAnalystBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SpatialAnalystBase_getPrototypeOf(o) { SpatialAnalystBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SpatialAnalystBase_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.SpatialAnalystBase
- * @category iServer SpatialAnalyst
- * @classdesc 空间分析服务基类。
- * @param {string} url - 地址。
- * @param {Object} options - 参数。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {SuperMap.CommonServiceBase}
- */
- var SpatialAnalystBase = /*#__PURE__*/function (_CommonServiceBase) {
- SpatialAnalystBase_inherits(SpatialAnalystBase, _CommonServiceBase);
- var _super = SpatialAnalystBase_createSuper(SpatialAnalystBase);
- function SpatialAnalystBase(url, options) {
- var _this;
- SpatialAnalystBase_classCallCheck(this, SpatialAnalystBase);
- _this = _super.call(this, url, options);
- /**
- * @member {SuperMap.DataFormat} [SuperMap.SpatialAnalystBase.prototype.format=SuperMap.DataFormat.GEOJSON]
- * @description 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为 "ISERVER","GEOJSON"。
- */
- _this.format = DataFormat.GEOJSON;
- _this.CLASS_NAME = "SuperMap.SpatialAnalystBase";
- return _this;
- }
- /**
- * @function SuperMap.SpatialAnalystBase.prototype.destroy
- * @override
- */
- SpatialAnalystBase_createClass(SpatialAnalystBase, [{
- key: "destroy",
- value: function destroy() {
- SpatialAnalystBase_get(SpatialAnalystBase_getPrototypeOf(SpatialAnalystBase.prototype), "destroy", this).call(this);
- this.format = null;
- }
- /**
- * @function SuperMap.SpatialAnalystBase.prototype.serviceProcessCompleted
- * @description 分析完成,执行此方法。
- * @param {Object} result - 服务器返回的结果对象。
- */
- }, {
- key: "serviceProcessCompleted",
- value: function serviceProcessCompleted(result) {
- var me = this,
- analystResult;
- result = Util.transformResult(result);
- if (result && me.format === DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
- //批量分析时会返回多个结果
- if (Util.isArray(result)) {
- for (var i = 0; i < result.length; i++) {
- result[i] = me.toGeoJSONResult(result[i]);
- }
- analystResult = result;
- } else {
- analystResult = me.toGeoJSONResult(result);
- }
- }
- if (!analystResult) {
- analystResult = result;
- }
- me.events.triggerEvent("processCompleted", {
- result: analystResult
- });
- }
- /**
- * @function SuperMap.SpatialAnalystBase.prototype.toGeoJSONResult
- * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
- * @param {Object} result - 服务器返回的结果对象。
- *
- */
- }, {
- key: "toGeoJSONResult",
- value: function toGeoJSONResult(result) {
- if (!result) {
- return null;
- } //批量叠加分析时结果这样处理
- if (result.result && result.result.resultGeometry) {
- result = result.result;
- }
- var geoJSONFormat = new GeoJSON();
- if (result.recordsets) {
- for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
- if (recordsets[i].features) {
- recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
- }
- }
- } else if (result.recordset && result.recordset.features) {
- result.recordset.features = geoJSONFormat.toGeoJSON(result.recordset.features);
- }
- if (result.resultGeometry) {
- result.resultGeometry = geoJSONFormat.toGeoJSON(result.resultGeometry);
- }
- if (result.regions) {
- result.regions = geoJSONFormat.toGeoJSON(result.regions);
- }
- return result;
- }
- }]);
- return SpatialAnalystBase;
- }(CommonServiceBase);
- SuperMap.SpatialAnalystBase = SpatialAnalystBase;
- ;// CONCATENATED MODULE: ./src/common/iServer/AreaSolarRadiationService.js
- 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); }
- function AreaSolarRadiationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function AreaSolarRadiationService_createClass(Constructor, protoProps, staticProps) { if (protoProps) AreaSolarRadiationService_defineProperties(Constructor.prototype, protoProps); if (staticProps) AreaSolarRadiationService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function AreaSolarRadiationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = AreaSolarRadiationService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function AreaSolarRadiationService_setPrototypeOf(o, p) { AreaSolarRadiationService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AreaSolarRadiationService_setPrototypeOf(o, p); }
- 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); }; }
- function AreaSolarRadiationService_possibleConstructorReturn(self, call) { if (call && (AreaSolarRadiationService_typeof(call) === "object" || typeof call === "function")) { return call; } return AreaSolarRadiationService_assertThisInitialized(self); }
- function AreaSolarRadiationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function AreaSolarRadiationService_getPrototypeOf(o) { AreaSolarRadiationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AreaSolarRadiationService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.AreaSolarRadiationService
- * @category iServer SpatialAnalyst SolarRadiationAnalyst
- * @classdesc 地区太阳辐射服务类。
- * @param {string} url - 服务的访问地址。如:</br>http://localhost:8090/iserver/services/spatialanalyst-sample/restjsr/spatialanalyst。</br>
- * @param {Object} options - 参数。</br>
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {SuperMap.SpatialAnalystBase}
- * @example 例如:
- * (start code)
- * var myAreaSolarRadiationService = new SuperMap.AreaSolarRadiationService(url);
- * myAreaSolarRadiationService.on({
- * "processCompleted": processCompleted,
- * "processFailed": processFailed
- * }
- * );
- * (end)
- *
- */
- var AreaSolarRadiationService = /*#__PURE__*/function (_SpatialAnalystBase) {
- AreaSolarRadiationService_inherits(AreaSolarRadiationService, _SpatialAnalystBase);
- var _super = AreaSolarRadiationService_createSuper(AreaSolarRadiationService);
- function AreaSolarRadiationService(url, options) {
- var _this;
- AreaSolarRadiationService_classCallCheck(this, AreaSolarRadiationService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.AreaSolarRadiationService";
- return _this;
- }
- /**
- * @function SuperMap.AreaSolarRadiationService.prototype.destroy
- * @override
- */
- AreaSolarRadiationService_createClass(AreaSolarRadiationService, [{
- key: "destroy",
- value: function destroy() {
- AreaSolarRadiationService_get(AreaSolarRadiationService_getPrototypeOf(AreaSolarRadiationService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.AreaSolarRadiationService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.AreaSolarRadiationParameters} parameter - 地区太阳辐射参数。
- */
- }, {
- key: "processAsync",
- value: function processAsync(parameter) {
- if (!(parameter instanceof AreaSolarRadiationParameters)) {
- return;
- }
- var me = this;
- var parameterObject = {};
- if (parameter instanceof AreaSolarRadiationParameters) {
- me.url = Util.urlPathAppend(me.url, "datasets/".concat(parameter.dataset, "/solarradiation"));
- }
- me.url = Util.urlAppend(me.url, 'returnContent=true');
- AreaSolarRadiationParameters.toObject(parameter, parameterObject);
- var jsonParameters = Util.toJSON(parameterObject);
- me.request({
- method: 'POST',
- data: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return AreaSolarRadiationService;
- }(SpatialAnalystBase);
- SuperMap.AreaSolarRadiationService = AreaSolarRadiationService;
- ;// CONCATENATED MODULE: ./src/common/iServer/BufferDistance.js
- function BufferDistance_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function BufferDistance_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferDistance_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferDistance_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.BufferDistance
- * @category iServer SpatialAnalyst BufferAnalyst
- * @classdesc 缓冲区分析的缓冲距离类。通过该类可以设置缓冲区分析的缓冲距离,距离可以是数值也可以是数值型的字段表达式。
- * @param {Object} options - 参数。
- * @param {string} [options.exp] - 以数值型的字段表达式作为缓冲区分析的距离值。
- * @param {number} [options.value=100] - 以数值作为缓冲区分析的距离值。单位:米。
- */
- var BufferDistance = /*#__PURE__*/function () {
- function BufferDistance(options) {
- BufferDistance_classCallCheck(this, BufferDistance);
- /**
- * @member {string} [SuperMap.BufferDistance.prototype.exp]
- * @description 以数值型的字段表达式作为缓冲区分析的距离值。
- */
- this.exp = null;
- /**
- * @member {number} [SuperMap.BufferDistance.prototype.value=100]
- * @description 以数值作为缓冲区分析的距离值。单位:米。
- */
- this.value = 100;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.BufferDistance";
- }
- /**
- * @function SuperMap.BufferDistance.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- BufferDistance_createClass(BufferDistance, [{
- key: "destroy",
- value: function destroy() {
- this.exp = null;
- this.value = null;
- }
- }]);
- return BufferDistance;
- }();
- SuperMap.BufferDistance = BufferDistance;
- ;// CONCATENATED MODULE: ./src/common/iServer/BufferSetting.js
- function BufferSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function BufferSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferSetting_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.BufferSetting
- * @category iServer SpatialAnalyst BufferAnalyst
- * @classdesc 缓冲区分析通用设置类。
- * @param {Object} options - 参数。
- * @param {SuperMap.BufferEndType} [options.endType=SuperMap.BufferEndType.FLAT] - 缓冲区端点枚举值。
- * @param {SuperMap.BufferDistance} [options.leftDistance=100] - 左侧缓冲距离。
- * @param {SuperMap.BufferDistance} [options.rightDistance=100] - 右侧缓冲距离。
- * @param {number} [options.semicircleLineSegment=4] - 圆头缓冲圆弧处线段的个数。
- * @param {SuperMap.BufferRadiusUnit} [options.radiusUnit=SuperMap.BufferRadiusUnit.METER] - 缓冲半径单位。
- */
- var BufferSetting = /*#__PURE__*/function () {
- function BufferSetting(options) {
- BufferSetting_classCallCheck(this, BufferSetting);
- /**
- * @member {SuperMap.BufferEndType} [SuperMap.BufferSetting.prototype.endType = SuperMap.BufferEndType.FLAT]
- * @description 缓冲区端点枚举值。分为平头和圆头两种。
- */
- this.endType = BufferEndType.FLAT;
- /**
- * @member {SuperMap.BufferDistance} [SuperMap.BufferSetting.prototype.leftDistance=100]
- * @description 左侧缓冲距离。
- * 当为 GeometryBufferAnalyst 时,单位为默认地图的投影系的单位(如3857为米,4326为度),
- * 当为 DatasetBufferAnalyst 时,单位通过{@link BufferSetting.radiusUnit}设置(默认全部为米)。
- */
- this.leftDistance = new BufferDistance();
- /**
- * @member {SuperMap.BufferDistance} [SuperMap.BufferSetting.prototype.rightDistance=100]
- * @description 右侧缓冲距离。
- * 当为 GeometryBufferAnalyst 时,单位为默认地图的投影系的单位(如3857为米,4326为度),
- * 当为 DatasetBufferAnalyst 时,单位通过{@link BufferSetting.radiusUnit}设置(默认全部为米)。
- */
- this.rightDistance = new BufferDistance();
- /**
- * @member {number} [SuperMap.BufferSetting.prototype.semicircleLineSegment=4]
- * @description 圆头缓冲圆弧处线段的个数。即用多少个线段来模拟一个半圆。
- */
- this.semicircleLineSegment = 4;
- /**
- * @member {SuperMap.BufferRadiusUnit} [SuperMap.BufferSetting.prototype.radiusUnit = SuperMap.BufferRadiusUnit.METER]
- * @description 缓冲半径单位,可以是{@link SuperMap.BufferRadiusUnit.METER}、{@link SuperMap.BufferRadiusUnit.MILIMETER}、
- * {@link SuperMap.BufferRadiusUnit.CENTIMETER}、{@link SuperMap.BufferRadiusUnit.DECIMETER}、{@link SuperMap.BufferRadiusUnit.KILOMETER}、
- * {@link SuperMap.BufferRadiusUnit.FOOT}、{@link SuperMap.BufferRadiusUnit.INCH}、{@link SuperMap.BufferRadiusUnit.MILE}、{@link SuperMap.BufferRadiusUnit.YARD}。
- * 仅对BufferAnalyst有效。
- */
- this.radiusUnit = BufferRadiusUnit.METER;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.BufferSetting";
- }
- /**
- * @function SuperMap.BufferSetting.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- BufferSetting_createClass(BufferSetting, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.endType = null;
- if (me.leftDistance) {
- me.leftDistance.destroy();
- me.leftDistance = null;
- }
- if (me.rightDistance) {
- me.rightDistance.destroy();
- me.rightDistance = null;
- }
- me.semicircleLineSegment = null;
- me.radiusUnit = null;
- }
- }]);
- return BufferSetting;
- }();
- SuperMap.BufferSetting = BufferSetting;
- ;// CONCATENATED MODULE: ./src/common/iServer/BufferAnalystParameters.js
- function BufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function BufferAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.BufferAnalystParameters
- * @category iServer SpatialAnalyst BufferAnalyst
- * @classdesc 缓冲区分析参数基类。
- * @param {Object} options - 参数。
- * @param {SuperMap.BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。为缓冲区分析提供必要的参数信息,包括左缓冲距离、右缓冲距离、端点类型、圆头缓冲圆弧处线段的个数信息。
- */
- var BufferAnalystParameters = /*#__PURE__*/function () {
- function BufferAnalystParameters(options) {
- BufferAnalystParameters_classCallCheck(this, BufferAnalystParameters);
- var me = this;
- /**
- * @member {SuperMap.BufferSetting} [SuperMap.BufferAnalystParameters.prototype.bufferSetting]
- * @description 设置缓冲区通用参数。为缓冲区分析提供必要的参数信息,包括左缓冲距离、右缓冲距离、端点类型、圆头缓冲圆弧处线段的个数信息。
- */
- me.bufferSetting = new BufferSetting();
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.BufferAnalystParameters";
- }
- /**
- * @function SuperMap.BufferAnalystParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- BufferAnalystParameters_createClass(BufferAnalystParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- if (me.bufferSetting) {
- me.bufferSetting.destroy();
- me.bufferSetting = null;
- }
- }
- }]);
- return BufferAnalystParameters;
- }();
- SuperMap.BufferAnalystParameters = BufferAnalystParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/DataReturnOption.js
- function DataReturnOption_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function DataReturnOption_createClass(Constructor, protoProps, staticProps) { if (protoProps) DataReturnOption_defineProperties(Constructor.prototype, protoProps); if (staticProps) DataReturnOption_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.DataReturnOption
- * @category iServer SpatialAnalyst
- * @classdesc 数据返回设置类。
- * @param {Object} options - 参数。
- * @param {number} [options.expectCount=1000] - 设置返回的最大记录数,小于或者等于 0 时表示返回所有记录数。
- * @param {string} [options.dataset] - 设置结果数据集标识,当 dataReturnMode 为 {@link SuperMap.DataReturnMode.DATASET_ONLY}或{@link SuperMap.DataReturnMode.DATASET_AND_RECORDSET}时有效,
- * 作为返回数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
- * @param {SuperMap.DataReturnMode} [options.dataReturnMode=SuperMap.DataReturnMode.RECORDSET_ONLY] - 数据返回模式。
- * @param {boolean} [options.deleteExistResultDataset=true] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
- */
- var DataReturnOption = /*#__PURE__*/function () {
- function DataReturnOption(options) {
- DataReturnOption_classCallCheck(this, DataReturnOption);
- /**
- * @member {number} [SuperMap.DataReturnOption.prototype.expectCount=1000]
- * @description 设置返回的最大记录数,小于或者等于0时表示返回所有记录数。
- */
- this.expectCount = 1000;
- /**
- * @member {string} [SuperMap.DataReturnOption.prototype.dataset]
- * @description 设置结果数据集标识,当dataReturnMode为 {@link SuperMap.DataReturnMode.DATASET_ONLY}
- * 或{@link SuperMap.DataReturnMode.DATASET_AND_RECORDSET}时有效,
- * 作为返回数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示。
- */
- this.dataset = null;
- /**
- * @member {SuperMap.DataReturnMode} [SuperMap.DataReturnOption.prototype.dataReturnMode=SuperMap.DataReturnMode.RECORDSET_ONLY]
- * @description 数据返回模式。
- */
- this.dataReturnMode = DataReturnMode.RECORDSET_ONLY;
- /**
- * @member {boolean} [SuperMap.DataReturnOption.prototype.deleteExistResultDataset=true]
- * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
- */
- this.deleteExistResultDataset = true;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.DataReturnOption";
- }
- /**
- * @function SuperMap.DataReturnOption.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- DataReturnOption_createClass(DataReturnOption, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.expectCount = null;
- me.dataset = null;
- me.dataReturnMode = null;
- me.deleteExistResultDataset = null;
- }
- }]);
- return DataReturnOption;
- }();
- SuperMap.DataReturnOption = DataReturnOption;
- ;// CONCATENATED MODULE: ./src/common/iServer/JoinItem.js
- function JoinItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function JoinItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) JoinItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) JoinItem_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.JoinItem
- * @category iServer
- * @classdesc 连接信息类。
- * 该类用于矢量数据集与外部表的连接。外部表可以为另一个矢量数据集(其中纯属性数据集中没有空间几何信息)所对应的 DBMS 表,也可以是用户自建的业务表。
- * 需要注意的是,矢量数据集与外部表必须属于同一数据源。表之间的联系的建立有两种方式,一种是连接(join),一种是关联(link)。
- * 连接,实际上是依据相同的字段将一个外部表追加到指定的表;而关联是基于一个相同的字段定义了两个表格之间的联系,但不是实际的追加。
- * 用于连接两个表的字段的名称不一定相同,但类型必须一致。当两个表格之间建立了连接,通过对主表进行操作,可以对外部表进行查询,制作专题图以及分析等。
- * 当两个表格之间是一对一或多对一的关系时,可以使用 join 连接。当为多对一的关系时,允许指定多个字段之间的关联。
- *(注意:SuperMap.JoinItem 目前支持左连接和内连接,不支持全连接和右连接,UDB 引擎不支持内连接。并且用于建立连接的两个表必须在同一个数据源下。)
- * @param {Object} options - 参数。
- * @param {string} options.foreignTableName - 外部表的名称。
- * @param {string} options.joinFilter - 矢量数据集与外部表之间的连接表达式,即设定两个表之间关联的字段。
- * @param {SuperMap.JoinType} options.joinType - 两个表之间连接类型。
- * @example 下面以 SQL 查询说明 joinItem 的使用方法:
- *(start code)
- * function queryBySQL() {
- * // 设置与外部表的连接信息
- * var joinItem = new SuperMap.JoinItem({
- * foreignTableName: "foreignTable",
- * joinFilter: "foreignTable.CONTINENT = Countries.CONTINENT",
- * joinType: "LEFTJOIN"
- * })
- * var queryParam, queryBySQLParams, queryBySQLService;
- * // 设置查询参数,在查询参数中添加joinItem关联条件信息
- * queryParam = new SuperMap.FilterParameter({
- * name: "Countries@World",
- * joinItems: [joinItem]
- * }),
- * queryBySQLParams = new SuperMap.QueryBySQLParameters({
- * queryParams: [queryParam]
- * }),
- * queryBySQLService = new SuperMap.QueryBySQLService(url, {
- * eventListeners: { "processCompleted": processCompleted, "processFailed": processFailed}
- * });
- * queryBySQLService.processAsync(queryBySQLParams);
- * }
- * function processCompleted(queryEventArgs) {//todo}
- * function processFailed(e) {//todo}
- * (end)
- */
- var JoinItem = /*#__PURE__*/function () {
- function JoinItem(options) {
- JoinItem_classCallCheck(this, JoinItem);
- /**
- * @member {string} SuperMap.JoinItem.prototype.foreignTableName
- * @description 外部表的名称。
- * 如果外部表的名称是以 “表名@数据源名” 命名方式,则该属性只需赋值表名。
- * 例如:外部表 Name@changchun,Name 为表名,changchun 为数据源名称,则该属性的赋值应为:Name。
- */
- this.foreignTableName = null;
- /**
- * @member {string} SuperMap.JoinItem.prototype.joinFilter
- * @description 矢量数据集与外部表之间的连接表达式,即设定两个表之间关联的字段。
- * 例如,将房屋面数据集(Building)的 district 字段与房屋拥有者的纯属性数据集(Owner)的 region 字段相连接,
- * 两个数据集对应的表名称分别为 Table_Building 和 Table_Owner,
- * 则连接表达式为 Table_Building.district = Table_Owner.region。
- * 当有多个字段相连接时,用 AND 将多个表达式相连。
- */
- this.joinFilter = null;
- /**
- * @member {SuperMap.JoinType} SuperMap.JoinItem.prototype.joinType
- * @description 两个表之间连接类型。
- * 连接类型决定了对两个表进行连接查询后返回的记录的情况。
- */
- this.joinType = null;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.JoinItem";
- }
- /**
- * @function SuperMap.JoinItem.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- JoinItem_createClass(JoinItem, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.foreignTableName = null;
- me.joinFilter = null;
- me.joinType = null;
- }
- /**
- * @function SuperMap.JoinItem.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- var dataObj = {};
- dataObj = Util.copyAttributes(dataObj, this); //joinFilter基本是个纯属性对象,这里不再做转换
- return dataObj;
- }
- }]);
- return JoinItem;
- }();
- SuperMap.JoinItem = JoinItem;
- ;// CONCATENATED MODULE: ./src/common/iServer/DatasourceConnectionInfo.js
- function DatasourceConnectionInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function DatasourceConnectionInfo_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasourceConnectionInfo_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasourceConnectionInfo_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- // eslint-disable-line no-unused-vars
- /**
- * @class SuperMap.DatasourceConnectionInfo
- * @category iServer Data
- * @classdesc 数据源连接信息类。该类包括了进行数据源连接的所有信息,如所要连接的服务器名称、数据库名称、用户名以及密码等。
- * 当保存为工作空间时, 工作空间中的数据源的连接信息都将存储到工作空间文件中。对于不同类型的数据源,其连接信息有所区别。
- * 所以在使 用该类所包含的成员时,请注意该成员所适用的数据源类型。对于从数据源对象中返回的数据连接信息对象,只有 connect 方法可以被修改,
- * 其他内容是不可以被修改的。对于用户创建的数据源连接信息对象,其内容都可以修改。
- * @category iServer Data
- * @param {Object} options - 参数。
- * @param {string} options.alias - 数据源别名。
- * @param {string} options.dataBase - 数据源连接的数据库名。
- * @param {boolean} [options.connect] - 数据源是否自动连接数据。
- * @param {string} [options.driver] - 使用 ODBC(Open Database Connectivity,开放数据库互连)的数据库的驱动程序名。
- * @param {SuperMap.EngineType} [options.engineType] - 数据源连接的引擎类型。
- * @param {boolean} [options.exclusive] - 是否以独占方式打开数据源。
- * @param {boolean} [options.OpenLinkTable] - 是否把数据库中的其他非 SuperMap 数据表作为 LinkTable 打开。
- * @param {string} [options.password] - 登录数据源连接的数据库或文件的密码。
- * @param {boolean} [options.readOnly] - 是否以只读方式打开数据源。
- * @param {string} [options.server] - 数据库服务器名或 SDB 文件名。
- * @param {string} [options.user] - 登录数据库的用户名。
- */
- var DatasourceConnectionInfo = /*#__PURE__*/function () {
- function DatasourceConnectionInfo(options) {
- DatasourceConnectionInfo_classCallCheck(this, DatasourceConnectionInfo);
- /**
- * @member {string} SuperMap.DatasourceConnectionInfo.prototype.alias
- * @description 数据源别名。
- */
- this.alias = null;
- /**
- * @member {boolean} [SuperMap.DatasourceConnectionInfo.prototype.connect]
- * @description 数据源是否自动连接数据。
- */
- this.connect = null;
- /**
- * @member {string} SuperMap.DatasourceConnectionInfo.prototype.dataBase
- * @description 数据源连接的数据库名。
- */
- this.dataBase = null;
- /**
- * @member {string} [SuperMap.DatasourceConnectionInfo.prototype.driver]
- * @description 使用 ODBC(Open Database Connectivity,开放数据库互连) 的数据库的驱动程序名。
- * 其中,对于 SQL Server 数据库与 iServer 发布的 WMTS 服务,此为必设参数。
- * 对于 SQL Server 数据库,它使用 ODBC 连接,所设置的驱动程序名为 "SQL Server" 或 "SQL Native Client";
- * 对于 iServer 发布的 WMTS 服务,设置的驱动名称为 "WMTS"。
- */
- this.driver = null;
- /**
- * @member {SuperMap.EngineType} [SuperMap.DatasourceConnectionInfo.prototype.engineType]
- * @description 数据源连接的引擎类型。
- */
- this.engineType = null;
- /**
- * @member {boolean} [SuperMap.DatasourceConnectionInfo.prototype.exclusive]
- * @description 是否以独占方式打开数据源。
- */
- this.exclusive = null;
- /**
- * @member {boolean} [SuperMap.DatasourceConnectionInfo.prototype.OpenLinkTable]
- * @description 是否把数据库中的其他非 SuperMap 数据表作为 LinkTable 打开。
- */
- this.OpenLinkTable = null;
- /**
- * @member {string} [SuperMap.DatasourceConnectionInfo.prototype.password]
- * @description 登录数据源连接的数据库或文件的密码。
- */
- this.password = null;
- /**
- * @member {boolean} [SuperMap.DatasourceConnectionInfo.prototype.readOnly]
- * @description 是否以只读方式打开数据源。
- */
- this.readOnly = null;
- /**
- * @member {string} [SuperMap.DatasourceConnectionInfo.prototype.server]
- * @description 数据库服务器名、文件名或服务地址。
- * 1.对于 SDB 和 UDB 文件,为其文件的绝对路径。注意:当绝对路径的长度超过 UTF-8 编码格式的 260 字节长度,该数据源无法打开。
- * 2.对于 Oracle 数据库,其服务器名为其 TNS 服务名称。
- * 3.对于 SQL Server 数据库,其服务器名为其系统的 DSN(Database Source Name) 名称。
- * 4.对于 PostgreSQL 数据库,其服务器名为 “IP:端口号”,默认的端口号是 5432。
- * 5.对于 DB2 数据库,已经进行了编目,所以不需要进行服务器的设置。
- * 6.对于 Kingbase 数据库,其服务器名为其 IP 地址。
- * 7.对于 GoogleMaps 数据源,其服务器地址,默认设置为 “{@link http://maps.google.com}”,且不可更改。
- * 8.对于 SuperMapCould 数据源,为其服务地址。
- * 9.对于 MAPWORLD 数据源,为其服务地址,默认设置为 “{@link http://www.tianditu.cn}”,且不可更改。
- * 10.对于 OGC 和 REST 数据源,为其服务地址。
- */
- this.server = null;
- /**
- * @member {string} SuperMap.DatasourceConnectionInfo.prototype.user
- * @description 登录数据库的用户名。
- */
- this.user = null;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.DatasourceConnectionInfo";
- }
- /**
- * @function SuperMap.DatasourceConnectionInfo.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- DatasourceConnectionInfo_createClass(DatasourceConnectionInfo, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.alias = null;
- me.connect = null;
- me.dataBase = null;
- me.driver = null;
- me.engineType = null;
- me.exclusive = null;
- me.OpenLinkTable = null;
- me.password = null;
- me.readOnly = null;
- me.server = null;
- me.user = null;
- }
- }]);
- return DatasourceConnectionInfo;
- }();
- SuperMap.DatasourceConnectionInfo = DatasourceConnectionInfo;
- ;// CONCATENATED MODULE: ./src/common/iServer/LinkItem.js
- function LinkItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function LinkItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) LinkItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) LinkItem_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.LinkItem
- * @constructs SuperMap.LinkItem
- * @category iServer
- * @classdesc 关联信息类。
- * @description 该类用于矢量数据集与外部表的关联。 外部表是另一个数据集(其中纯属性数据集中没有空间几何信息)中的 DBMS 表,
- * 矢量数据集与外部表可以属于不同的数据源,但数据源类型目前只支持 SQL Server 和 Oracle 类型。使用 LinkItem 时,
- * 空间数据和属性数据必须满足关联条件,即主空间数据集与外部属性表之间存在关联字段。{@link SuperMap.LinkItem}
- * 只支持左连接,UDB、PostgreSQL 和 DB2 数据源不支持 {@link SuperMap.LinkItem};另外,用于建立关联关系的两个表可以不在同一个数据源下。注意:<br>
- * 1. 使用 {@link SuperMap.LinkItem} 的约束条件为:空间数据和属性数据必须有关联条件,即主空间数据集与外部属性表之间存在关联字段;<br>
- * 2. 使用外关联表制作专题图时,所关联的字段必须设置表名,例如,如果所关联的字段为 BaseMap_R 数据集的 SmID,就要写成 BaseMap_R.SMID。
- * @param {Object} options - 参数。
- * @param {SuperMap.DatasourceConnectionInfo} options.datasourceConnectionInfo - 关联的外部数据源信息。
- * @param {Array.<string>} options.foreignKeys - 主空间数据集的外键。
- * @param {string} options.foreignTable - 关联的外部属性表的名称。
- * @param {Array.<string>} options.linkFields - 欲保留的外部属性表的字段。
- * @param {string} options.linkFilter - 与外部属性表的连接条件。
- * @param {string} options.name - 此关联信息对象的名称。
- * @param {Array.<string>} options.primaryKeys - 需要关联的外部属性表的主键。
- * @example 下面以 SQL 查询说明 linkitem 的使用方法:
- * function queryBySQL() {
- * // 设置关联的外部数据库信息,alias表示数据库别名
- * var dc = new SuperMap.DatasourceConnectionInfo({
- * dataBase: "RelQuery",
- * server: "{ip}:{port}",
- * user: "sa",
- * password: "map",
- * driver: "SQL Server",
- * connect: true,
- * OpenLinkTable: false,
- * alias: "RelQuery",
- * engineType: EngineType.SQLPLUS,
- * readOnly: false,
- * exclusive: false
- * });
- * // 设置关联信息
- * var linkItem = new SuperMap.LinkItem({
- * datasourceConnectionInfo: dc,
- * foreignKeys: ["name"],
- * foreignTable: "Pop_2011",
- * linkFields: ["SmID as Pid","pop"],
- * name: "link",
- * primatryKeys: ["name"],
- * });
- * // 设置查询参数,在查询参数中添加linkItem关联条件信息
- * var queryParam, queryBySQLParams, queryBySQLService;
- * queryParam = new SuperMap.FilterParameter({
- * name: "Province@RelQuery",
- * fields: ["SmID","name"],
- * attributeFilter: "SmID<7",
- * linkItems: [linkItem]
- * }),
- * queryBySQLParams = new SuperMap.QueryBySQLParameters({
- * queryParams: [queryParam]
- * }),
- * queryBySQLService = new SuperMap.QueryBySQLService(url, {
- * eventListeners: {
- * "processCompleted": processCompleted,
- * "processFailed": processFailed
- * }
- * });
- * queryBySQLService.processAsync(queryBySQLParams);
- * }
- * function processCompleted(queryEventArgs) {//todo}
- * function processFailed(e) {//todo}
- *
- */
- var LinkItem = /*#__PURE__*/function () {
- function LinkItem(options) {
- LinkItem_classCallCheck(this, LinkItem);
- /**
- * @member {SuperMap.DatasourceConnectionInfo} SuperMap.LinkItem.prototype.datasourceConnectionInfo
- * @description 关联的外部数据源信息。
- */
- this.datasourceConnectionInfo = null;
- /**
- * @member {Array.<string>} SuperMap.LinkItem.prototype.foreignKeys
- * @description 主空间数据集的外键。
- */
- this.foreignKeys = null;
- /**
- * @member {string} SuperMap.LinkItem.prototype.foreignTable
- * @description 关联的外部属性表的名称,目前仅支持 Supermap 管理的表,即另一个矢量数据集所对应的 DBMS 表。
- */
- this.foreignTable = null;
- /**
- * @member {Array.<string>} SuperMap.LinkItem.prototype.linkFields
- * @description 欲保留的外部属性表的字段。如果不设置字段或者设置的字段在外部属性表中不存在的话则不返
- * 回任何外部属性表的属性信息。如果欲保留的外部表字段与主表字段存在同名,则还需要指定一个不存在字段名作为外部表的字段别名。
- */
- this.linkFields = null;
- /**
- * @member {string} SuperMap.LinkItem.prototype.linkFilter
- * @description 与外部属性表的连接条件。
- */
- this.linkFilter = null;
- /**
- * @member {string} SuperMap.LinkItem.prototype.name
- * @description 此关联信息对象的名称。
- */
- this.name = null;
- /**
- * @member {Array.<string>} SuperMap.LinkItem.prototype.primaryKeys
- * @description 需要关联的外部属性表的主键。
- */
- this.primaryKeys = null;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.LinkItem";
- }
- /**
- * @function SuperMap.LinkItem.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- LinkItem_createClass(LinkItem, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- if (me.datasourceConnectionInfo instanceof DatasourceConnectionInfo) {
- me.datasourceConnectionInfo.destroy();
- me.datasourceConnectionInfo = null;
- }
- me.foreignKeys = null;
- me.foreignTable = null;
- me.linkFields = null;
- me.linkFilter = null;
- me.name = null;
- me.primaryKeys = null;
- }
- }]);
- return LinkItem;
- }();
- SuperMap.LinkItem = LinkItem;
- ;// CONCATENATED MODULE: ./src/common/iServer/FilterParameter.js
- function FilterParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FilterParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) FilterParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) FilterParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FilterParameter
- * @category iServer
- * @classdesc 查询过滤条件参数类。该类用于设置查询数据集的查询过滤参数。
- * @param {Object} options - 参数。
- * @param {string} options.attributeFilter - 属性过滤条件。
- * @param {string} options.name - 查询数据集名称或者图层名称。
- * @param {Array.<SuperMap.JoinItem>} [options.joinItems] - 与外部表的连接信息 SuperMap.JoinItem 数组。
- * @param {Array.<SuperMap.LinkItem>} [options.linkItems] - 与外部表的关联信息 SuperMap.LinkItem 数组。
- * @param {Array.<string>} [options.ids] - 查询 id 数组,即属性表中的 SmID 值。
- * @param {string} [options.orderBy] - 查询排序的字段,orderBy 的字段须为数值型的。
- * @param {string} [options.groupBy] - 查询分组条件的字段。
- * @param {Array.<string>} [options.fields] - 查询字段数组。
- */
- var FilterParameter = /*#__PURE__*/function () {
- function FilterParameter(options) {
- FilterParameter_classCallCheck(this, FilterParameter);
- /**
- * @member {string} SuperMap.FilterParameter.prototype.attributeFilter
- * @description 属性过滤条件。
- * 相当于 SQL 语句中的 WHERE 子句,其格式为:WHERE <条件表达式>,
- * attributeFilter 就是其中的“条件表达式”。
- * 该字段的用法为 attributeFilter = "过滤条件"。
- * 例如,要查询字段 fieldValue 小于100的记录,设置 attributeFilter = "fieldValue < 100";
- * 要查询字段 name 的值为“酒店”的记录,设置 attributeFilter = "name like '%酒店%'",等等。
- */
- this.attributeFilter = null;
- /**
- * @member {string} SuperMap.FilterParameter.prototype.name
- * @description 查询数据集名称或者图层名称,根据实际的查询对象而定。
- * 一般情况下该字段为数据集名称,但在进行与地图相关功能的操作时,
- * 需要设置为图层名称(图层名称格式:数据集名称@数据源别名)。
- * 因为一个地图的图层可能是来自于不同数据源的数据集,
- * 而不同的数据源中可能存在同名的数据集,
- * 使用数据集名称不能唯一的确定数据集,
- * 所以在进行与地图相关功能的操作时,该值需要设置为图层名称。
- */
- this.name = null;
- /**
- * @member {Array.<SuperMap.JoinItem>} [SuperMap.FilterParameter.prototype.joinItems]
- * @description 与外部表的连接信息 SuperMap.JoinItem 数组。
- */
- this.joinItems = null;
- /**
- * @member {Array.<SuperMap.LinkItem>} [SuperMap.FilterParameter.prototype.linkItems]
- * @description 与外部表的关联信息 LinkItem 数组。
- */
- this.linkItems = null;
- /**
- * @member {Array.<string>} [SuperMap.FilterParameter.prototype.ids]
- * @description 查询 id 数组,即属性表中的 SmID 值。
- */
- this.ids = null;
- /**
- * @member {string} [SuperMap.FilterParameter.prototype.orderBy]
- * @description 查询排序的字段,orderBy的字段须为数值型的。
- * 相当于 SQL 语句中的 ORDER BY 子句,其格式为:ORDER BY <列名>,
- * 列名即属性表中每一列的名称,列又可称为属性,在 SuperMap 中又称为字段。
- * 对单个字段排序时,该字段的用法为 orderBy = "字段名";
- * 对多个字段排序时,字段之间以英文逗号进行分割,用法为 orderBy = "字段名1, 字段名2"。
- * 例如,现有一个国家数据集,它有两个字段分别为“SmArea”和“pop_1994”,
- * 分别表示国家的面积和1994年的各国人口数量。
- * 如果要按照各国人口数量对记录进行排序,则 orderBy = "pop_1994";
- * 如果要以面积和人口进行排序,则 orderBy = "SmArea, pop_1994"。
- */
- this.orderBy = null;
- /**
- * @member {string} [SuperMap.FilterParameter.prototype.groupBy]
- * @description 查询分组条件的字段。
- * 相当于 SQL 语句中的 GROUP BY 子句,其格式为:GROUP BY <列名>,
- * 列名即属性表中每一列的名称,列又可称为属性,在 SuperMap 中又称为字段。
- * 对单个字段分组时,该字段的用法为 groupBy = "字段名";
- * 对多个字段分组时,字段之间以英文逗号进行分割,用法为 groupBy = "字段名1, 字段名2"。
- * 例如,现有一个全球城市数据集,该数据集有两个字段分别为“Continent”和“Country”,
- * 分别表示某个城市所属的洲和国家。
- * 如果要按照国家对全球的城市进行分组, 可以设置 groupBy = "Country";
- * 如果以洲和国家对城市进行分组,设置 groupBy = "Continent, Country"。
- */
- this.groupBy = null;
- /**
- * @member {Array.<string>} [SuperMap.FilterParameter.prototype.fields]
- * @description 查询字段数组,如果不设置则使用系统返回的所有字段。
- */
- this.fields = null;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.FilterParameter";
- }
- /**
- * @function SuperMap.FilterParameter.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- FilterParameter_createClass(FilterParameter, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.attributeFilter = null;
- me.name = null;
- if (me.joinItems) {
- for (var i = 0, joinItems = me.joinItems, len = joinItems.length; i < len; i++) {
- joinItems[i].destroy();
- }
- me.joinItems = null;
- }
- if (me.linkItems) {
- for (var _i = 0, linkItems = me.linkItems, _len = linkItems.length; _i < _len; _i++) {
- linkItems[_i].destroy();
- }
- me.linkItems = null;
- }
- me.ids = null;
- me.orderBy = null;
- me.groupBy = null;
- me.fields = null;
- }
- }]);
- return FilterParameter;
- }();
- SuperMap.FilterParameter = FilterParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/DatasetBufferAnalystParameters.js
- 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); }
- function DatasetBufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function DatasetBufferAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetBufferAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetBufferAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function DatasetBufferAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetBufferAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function DatasetBufferAnalystParameters_setPrototypeOf(o, p) { DatasetBufferAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetBufferAnalystParameters_setPrototypeOf(o, p); }
- 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); }; }
- function DatasetBufferAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetBufferAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return DatasetBufferAnalystParameters_assertThisInitialized(self); }
- function DatasetBufferAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function DatasetBufferAnalystParameters_getPrototypeOf(o) { DatasetBufferAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetBufferAnalystParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.DatasetBufferAnalystParameters
- * @category iServer SpatialAnalyst BufferAnalyst
- * @classdesc 数据集缓冲区分析参数类。
- * @param {Object} options - 参数。
- * @param {string} options.dataset - 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
- * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 设置数据集中几何对象的过滤条件。只有满足此条件的几何对象才参与缓冲区分析。
- * @param {SuperMap.DataReturnOption} [options.resultSetting] - 结果返回设置类。
- * @param {boolean} [options.isAttributeRetained=true] - 是否保留进行缓冲区分析的对象的字段属性。当 isUnion 字段为 false 时该字段有效。
- * @param {boolean} [options.isUnion=false] - 是否将缓冲区与源记录集中的对象合并后返回。对于面对象而言,要求源数据集中的面对象不相交。
- * @param {SuperMap.BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。
- *
- * @extends {SuperMap.BufferAnalystParameters}
- */
- var DatasetBufferAnalystParameters = /*#__PURE__*/function (_BufferAnalystParamet) {
- DatasetBufferAnalystParameters_inherits(DatasetBufferAnalystParameters, _BufferAnalystParamet);
- var _super = DatasetBufferAnalystParameters_createSuper(DatasetBufferAnalystParameters);
- function DatasetBufferAnalystParameters(options) {
- var _this;
- DatasetBufferAnalystParameters_classCallCheck(this, DatasetBufferAnalystParameters);
- _this = _super.call(this, options);
- /**
- * @member {string} SuperMap.DatasetBufferAnalystParameters.prototype.dataset
- * @description 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
- */
- _this.dataset = null;
- /**
- * @member {SuperMap.FilterParameter} [SuperMap.DatasetBufferAnalystParameters.prototype.filterQueryParameter]
- * @description 设置数据集中几何对象的过滤条件。只有满足此条件的几何对象才参与缓冲区分析。
- */
- _this.filterQueryParameter = new FilterParameter();
- /**
- * @member {SuperMap.DataReturnOption} [SuperMap.DatasetBufferAnalystParameters.prototype.resultSetting]
- * @description 结果返回设置类。
- */
- _this.resultSetting = new DataReturnOption();
- /**
- * @member {boolean} [SuperMap.DatasetBufferAnalystParameters.prototype.isAttributeRetained=true]
- * @description 是否保留进行缓冲区分析的对象的字段属性。当 isUnion 字段为 false 时该字段有效。
- */
- _this.isAttributeRetained = true;
- /**
- * @member {boolean} [SuperMap.DatasetBufferAnalystParameters.prototype.isUnion=false]
- * @description 是否将缓冲区与源记录集中的对象合并后返回。对于面对象而言,要求源数据集中的面对象不相交。
- */
- _this.isUnion = false;
- Util.extend(DatasetBufferAnalystParameters_assertThisInitialized(_this), options);
- _this.CLASS_NAME = "SuperMap.DatasetBufferAnalystParameters";
- return _this;
- }
- /**
- * @function SuperMap.DatasetBufferAnalystParameters.prototype.destroy
- * @override
- */
- DatasetBufferAnalystParameters_createClass(DatasetBufferAnalystParameters, [{
- key: "destroy",
- value: function destroy() {
- DatasetBufferAnalystParameters_get(DatasetBufferAnalystParameters_getPrototypeOf(DatasetBufferAnalystParameters.prototype), "destroy", this).call(this);
- var me = this;
- me.dataset = null;
- if (me.filterQueryParameter) {
- me.filterQueryParameter.destroy();
- me.filterQueryParameter = null;
- }
- if (me.resultSetting) {
- me.resultSetting.destroy();
- me.resultSetting = null;
- }
- me.isAttributeRetained = null;
- me.isUnion = null;
- }
- /**
- * @function SuperMap.DatasetBufferAnalystParameters.toObject
- * @param {SuperMap.DatasetBufferAnalystParameters} datasetBufferAnalystParameters - 数据集缓冲区分析参数类。
- * @param {SuperMap.DatasetBufferAnalystParameters} tempObj - 数据集缓冲区分析参数对象。
- * @description 将数据集缓冲区分析参数对象转换为 JSON 对象。
- * @returns {Object} JSON 对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(datasetBufferAnalystParameters, tempObj) {
- for (var name in datasetBufferAnalystParameters) {
- if (name === "bufferSetting") {
- datasetBufferAnalystParameters.bufferSetting.radiusUnit = datasetBufferAnalystParameters.bufferSetting.radiusUnit.toUpperCase();
- tempObj.bufferAnalystParameter = datasetBufferAnalystParameters.bufferSetting;
- } else if (name === "resultSetting") {
- tempObj.dataReturnOption = datasetBufferAnalystParameters.resultSetting;
- } else if (name === "dataset") {
- continue;
- } else {
- tempObj[name] = datasetBufferAnalystParameters[name];
- }
- }
- }
- }]);
- return DatasetBufferAnalystParameters;
- }(BufferAnalystParameters);
- SuperMap.DatasetBufferAnalystParameters = DatasetBufferAnalystParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/GeometryBufferAnalystParameters.js
- 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); }
- function GeometryBufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GeometryBufferAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryBufferAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryBufferAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GeometryBufferAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryBufferAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GeometryBufferAnalystParameters_setPrototypeOf(o, p) { GeometryBufferAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryBufferAnalystParameters_setPrototypeOf(o, p); }
- 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); }; }
- function GeometryBufferAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometryBufferAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GeometryBufferAnalystParameters_assertThisInitialized(self); }
- function GeometryBufferAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GeometryBufferAnalystParameters_getPrototypeOf(o) { GeometryBufferAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryBufferAnalystParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GeometryBufferAnalystParameters
- * @category iServer SpatialAnalyst BufferAnalyst
- * @classdesc 几何对象缓冲区分析参数类
- * 对指定的某个几何对象做缓冲区分析。通过该类可以指定要做缓冲区分析的几何对象、缓冲区参数等。
- * @param {Object} options - 参数。
- * @param {Object} options.sourceGeometry - 要做缓冲区分析的几何对象。
- * @param {number} options.sourceGeometrySRID - 缓冲区几何对象投影坐标参数, 如 4326,3857。
- * @param {SuperMap.BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。
- * @extends {SuperMap.BufferAnalystParameters}
- */
- var GeometryBufferAnalystParameters = /*#__PURE__*/function (_BufferAnalystParamet) {
- GeometryBufferAnalystParameters_inherits(GeometryBufferAnalystParameters, _BufferAnalystParamet);
- var _super = GeometryBufferAnalystParameters_createSuper(GeometryBufferAnalystParameters);
- function GeometryBufferAnalystParameters(options) {
- var _this;
- GeometryBufferAnalystParameters_classCallCheck(this, GeometryBufferAnalystParameters);
- _this = _super.call(this, options);
- /**
- * @member {Object} SuperMap.GeometryBufferAnalystParameters.prototype.sourceGeometry
- * @description 要做缓冲区分析的几何对象。<br>
- * 点类型可以是:{@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>
- * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。</br>
- * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
- */
- _this.sourceGeometry = null;
- /**
- * @member {number} SuperMap.GeometryBufferAnalystParameters.prototype.sourceGeometrySRID
- * @description 缓冲区几何对象投影坐标参数, 如 4326,3857。
- */
- _this.sourceGeometrySRID = null;
- if (options) {
- Util.extend(GeometryBufferAnalystParameters_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = " SuperMap.GeometryBufferAnalystParameters";
- return _this;
- }
- /**
- * @function SuperMap.GeometryBufferAnalystParameters.prototype.destroy
- * @override
- */
- GeometryBufferAnalystParameters_createClass(GeometryBufferAnalystParameters, [{
- key: "destroy",
- value: function destroy() {
- GeometryBufferAnalystParameters_get(GeometryBufferAnalystParameters_getPrototypeOf(GeometryBufferAnalystParameters.prototype), "destroy", this).call(this);
- var me = this;
- if (me.sourceGeometry) {
- me.sourceGeometry.destroy();
- me.sourceGeometry = null;
- }
- }
- /**
- * @function SuperMap.GeometryBufferAnalystParameters.toObject
- * @param {SuperMap.GeometryBufferAnalystParameters} geometryBufferAnalystParameters - 几何对象缓冲区分析参数类。
- * @param {SuperMap.GeometryBufferAnalystParameters} tempObj - 几何对象缓冲区分析参数对象。
- * @description 将几何对象缓冲区分析参数对象转换为 JSON 对象。
- * @returns {Object} JSON 对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(geometryBufferAnalystParameters, tempObj) {
- for (var name in geometryBufferAnalystParameters) {
- if (name === "bufferSetting") {
- var tempBufferSetting = {};
- for (var key in geometryBufferAnalystParameters.bufferSetting) {
- tempBufferSetting[key] = geometryBufferAnalystParameters.bufferSetting[key];
- }
- tempObj.analystParameter = tempBufferSetting;
- } else if (name === "sourceGeometry") {
- tempObj.sourceGeometry = ServerGeometry.fromGeometry(geometryBufferAnalystParameters.sourceGeometry);
- } else {
- tempObj[name] = geometryBufferAnalystParameters[name];
- }
- }
- }
- }]);
- return GeometryBufferAnalystParameters;
- }(BufferAnalystParameters);
- SuperMap.GeometryBufferAnalystParameters = GeometryBufferAnalystParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/BufferAnalystService.js
- 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); }
- function BufferAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function BufferAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function BufferAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BufferAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function BufferAnalystService_setPrototypeOf(o, p) { BufferAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BufferAnalystService_setPrototypeOf(o, p); }
- 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); }; }
- function BufferAnalystService_possibleConstructorReturn(self, call) { if (call && (BufferAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return BufferAnalystService_assertThisInitialized(self); }
- function BufferAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function BufferAnalystService_getPrototypeOf(o) { BufferAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BufferAnalystService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.BufferAnalystService
- * @category iServer SpatialAnalyst BufferAnalyst
- * @classdesc 缓冲区分析服务类。
- * 该类负责将客户设置的缓冲区分析参数传递给服务端,并接收服务端返回的缓冲区分析结果数据。
- * 缓冲区分析结果通过该类支持的事件的监听函数参数获取。
- * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
- * @param {Object} options - 参数。</br>
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {SuperMap.SpatialAnalystBase}
- * @example 例如:
- * (start code)
- * var myBufferAnalystService = new SuperMap.BufferAnalystService(url, {
- * eventListeners: {
- * "processCompleted": bufferCompleted,
- * "processFailed": bufferFailed
- * }
- * });
- * (end)
- *
- *
- */
- var BufferAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
- BufferAnalystService_inherits(BufferAnalystService, _SpatialAnalystBase);
- var _super = BufferAnalystService_createSuper(BufferAnalystService);
- function BufferAnalystService(url, options) {
- var _this;
- BufferAnalystService_classCallCheck(this, BufferAnalystService);
- _this = _super.call(this, url, options);
- /**
- * @member {string} SuperMap.BufferAnalystService.prototype.mode
- * @description 缓冲区分析类型
- */
- _this.mode = null;
- if (options) {
- Util.extend(BufferAnalystService_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.BufferAnalystService";
- return _this;
- }
- /**
- * @function SuperMap.BufferAnalystService.prototype.destroy
- * @override
- */
- BufferAnalystService_createClass(BufferAnalystService, [{
- key: "destroy",
- value: function destroy() {
- BufferAnalystService_get(BufferAnalystService_getPrototypeOf(BufferAnalystService.prototype), "destroy", this).call(this);
- this.mode = null;
- }
- /**
- * @method SuperMap.BufferAnalystService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.BufferAnalystParameters} parameter - 缓冲区分析参数
- */
- }, {
- key: "processAsync",
- value: function processAsync(parameter) {
- var parameterObject = {};
- var me = this;
- if (parameter instanceof DatasetBufferAnalystParameters) {
- me.mode = 'datasets';
- me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/buffer');
- DatasetBufferAnalystParameters.toObject(parameter, parameterObject);
- } else if (parameter instanceof GeometryBufferAnalystParameters) {
- me.mode = 'geometry';
- me.url = Util.urlPathAppend(me.url, 'geometry/buffer');
- GeometryBufferAnalystParameters.toObject(parameter, parameterObject);
- }
- var jsonParameters = Util.toJSON(parameterObject);
- me.url = Util.urlAppend(me.url, 'returnContent=true');
- me.request({
- method: "POST",
- data: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return BufferAnalystService;
- }(SpatialAnalystBase);
- SuperMap.BufferAnalystService = BufferAnalystService;
- ;// CONCATENATED MODULE: ./src/common/iServer/OutputSetting.js
- function OutputSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function OutputSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) OutputSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) OutputSetting_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.OutputSetting
- * @category iServer ProcessingService
- * @classdesc 分布式分析输出类型设置类。
- * @param {Object} options - 参数。
- * @param {SuperMap.DatasourceConnectionInfo} options.datasourceInfo - 数据源连接信息。
- * @param {string} [options.datasetName='analystResult'] - 结果数据集名称。
- * @param {SuperMap.OutputType} [options.type=SuperMap.OutputType.UDB] - 输出类型。
- * @param {string} [options.outputPath] - 分析结果输出路径。
- */
- var OutputSetting = /*#__PURE__*/function () {
- function OutputSetting(options) {
- OutputSetting_classCallCheck(this, OutputSetting);
- /**
- * @member {SuperMap.OutputType} SuperMap.OutputSetting.prototype.type
- * @description 分布式分析的输出类型。
- */
- this.type = OutputType.UDB;
- /**
- * @member {string} [SuperMap.OutputSetting.prototype.datasetName='analystResult']
- * @description 分布式分析的输出结果数据集名称。
- */
- this.datasetName = "analystResult";
- /**
- * @member {SuperMap.DatasourceConnectionInfo} SuperMap.OutputSetting.prototype.datasourceInfo
- * @description 分布式分析的输出结果数据源连接信息。
- */
- this.datasourceInfo = null;
- /**
- * @member {string} [SuperMap.OutputSetting.prototype.outputPath]
- * @description 分布式分析的分析结果输出路径。
- */
- this.outputPath = "";
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.OutputSetting";
- }
- /**
- * @function SuperMap.OutputSetting.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- OutputSetting_createClass(OutputSetting, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.type = null;
- me.datasetName = null;
- me.outputPath = null;
- if (me.datasourceInfo instanceof DatasourceConnectionInfo) {
- me.datasourceInfo.destroy();
- me.datasourceInfo = null;
- }
- }
- }]);
- return OutputSetting;
- }();
- SuperMap.OutputSetting = OutputSetting;
- ;// CONCATENATED MODULE: ./src/common/iServer/MappingParameters.js
- function MappingParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function MappingParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) MappingParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) MappingParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.MappingParameters
- * @category iServer ProcessingService
- * @classdesc 分析后结果可视化的参数类。
- * @param {Object} options - 参数。
- * @param {Array.<SuperMap.ThemeGridRangeItem>} [options.items] - 栅格分段专题图子项数组。
- * @param {number} [options.numericPrecision=1] - 精度,此字段用于设置分析结果标签专题图中标签数值的精度,如“1”表示精确到小数点的后一位。
- * @param {SuperMap.RangeMode} [options.rangeMode=SuperMap.RangeMode.EQUALINTERVAL] - 专题图分段模式。
- * @param {number} [options.rangeCount] - 专题图分段个数。
- * @param {SuperMap.ColorGradientType} [options.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED] - 专题图颜色渐变模式。
- */
- var MappingParameters = /*#__PURE__*/function () {
- function MappingParameters(options) {
- MappingParameters_classCallCheck(this, MappingParameters);
- /**
- * @member {Array.<SuperMap.ThemeGridRangeItem>} [SuperMap.MappingParameters.prototype.items]
- * @description 栅格分段专题图子项数组。
- */
- this.items = null;
- /**
- * @member {number} [SuperMap.MappingParameters.prototype.numericPrecision=1]
- * @description 精度,此字段用于设置分析结果标签专题图中标签数值的精度,如“1”表示精确到小数点的后一位。
- */
- this.numericPrecision = 1;
- /**
- * @member {SuperMap.RangeMode} [SuperMap.MappingParameters.prototype.RangeMode=SuperMap.RangeMode.EQUALINTERVAL]
- * @description 专题图分段模式。
- */
- this.rangeMode = RangeMode.EQUALINTERVAL;
- /**
- * @member {number} [SuperMap.MappingParameters.prototype.rangeCount]
- * @description 专题图分段个数。
- */
- this.rangeCount = "";
- /**
- * @member {SuperMap.ColorGradientType} [SuperMap.MappingParameters.prototype.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED]
- * @description 专题图颜色渐变模式。
- */
- this.colorGradientType = ColorGradientType.YELLOW_RED;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.MappingParameters";
- }
- /**
- * @function SuperMap.MappingParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- MappingParameters_createClass(MappingParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- if (me.items) {
- if (me.items.length > 0) {
- for (var item in me.items) {
- me.items[item].destroy();
- me.items[item] = null;
- }
- }
- me.items = null;
- }
- me.numericPrecision = null;
- me.rangeMode = null;
- me.rangeCount = null;
- me.colorGradientType = null;
- }
- }]);
- return MappingParameters;
- }();
- SuperMap.MappingParameters = MappingParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/BuffersAnalystJobsParameter.js
- function BuffersAnalystJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function BuffersAnalystJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) BuffersAnalystJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) BuffersAnalystJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.BuffersAnalystJobsParameter
- * @category iServer ProcessingService BufferAnalyst
- * @classdesc 缓冲区分析任务参数类。
- * @param {Object} options - 参数。
- * @param {string} options.datasetName - 数据集名。
- * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.bounds] - 分析范围(默认为全图范围)。
- * @param {string} [options.distance='15'] - 缓冲距离,或缓冲区半径。
- * @param {string} [options.distanceField='pickup_latitude'] - 缓冲区分析距离字段。
- * @param {SuperMap.AnalystSizeUnit} [options.distanceUnit=SuperMap.AnalystSizeUnit.METER] - 缓冲距离单位单位。
- * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
- * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
- */
- var BuffersAnalystJobsParameter = /*#__PURE__*/function () {
- function BuffersAnalystJobsParameter(options) {
- BuffersAnalystJobsParameter_classCallCheck(this, BuffersAnalystJobsParameter);
- /**
- * @member {string} SuperMap.BuffersAnalystJobsParameter.prototype.datasetName
- * @description 数据集名。
- */
- this.datasetName = '';
- /**
- * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.BuffersAnalystJobsParameter.prototype.bounds
- * @description 分析范围。
- */
- this.bounds = '';
- /**
- * @member {string} [SuperMap.BuffersAnalystJobsParameter.prototype.distance='15']
- * @description 缓冲距离,或称为缓冲区半径。当缓冲距离字段位空时,此参数有效。
- */
- this.distance = '';
- /**
- * @member {string} [SuperMap.BuffersAnalystJobsParameter.prototype.distanceField='pickup_latitude']
- * @description 缓冲距离字段。
- */
- this.distanceField = '';
- /**
- * @member {SuperMap.AnalystSizeUnit} [SuperMap.BuffersAnalystJobsParameter.prototype.distanceUnit=SuperMap.AnalystSizeUnit.METER]
- * @description 缓冲距离单位。
- */
- this.distanceUnit = AnalystSizeUnit.METER;
- /**
- * @member {string} SuperMap.BuffersAnalystJobsParameter.prototype.dissolveField
- * @description 融合字段,根据字段值对缓冲区结果面对象进行融合。
- */
- this.dissolveField = '';
- /**
- * @member {SuperMap.OutputSetting} [SuperMap.BuffersAnalystJobsParameter.prototype.output]
- * @description 输出参数设置类。
- */
- this.output = null;
- /**
- * @member {SuperMap.MappingParameters} [SuperMap.BuffersAnalystJobsParameter.prototype.mappingParameters]
- * @description 分析后结果可视化的参数类。
- */
- this.mappingParameters = null;
- if (!options) {
- return this;
- }
- Util.extend(this, options);
- this.CLASS_NAME = 'SuperMap.BuffersAnalystJobsParameter';
- }
- /**
- * @function SuperMap.BuffersAnalystJobsParameter.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- BuffersAnalystJobsParameter_createClass(BuffersAnalystJobsParameter, [{
- key: "destroy",
- value: function destroy() {
- this.datasetName = null;
- this.bounds = null;
- this.distance = null;
- this.distanceField = null;
- this.distanceUnit = null;
- this.dissolveField = null;
- if (this.output instanceof OutputSetting) {
- this.output.destroy();
- this.output = null;
- }
- if (this.mappingParameters instanceof MappingParameters) {
- this.mappingParameters.destroy();
- this.mappingParameters = null;
- }
- }
- /**
- * @function SuperMap.BuffersAnalystJobsParameter.toObject
- * @param {SuperMap.BuffersAnalystJobsParameter} BuffersAnalystJobsParameter - 缓冲区分析任务参数。
- * @param {Object} tempObj - 目标对象。
- * @description 生成缓冲区分析任务对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(BuffersAnalystJobsParameter, tempObj) {
- for (var name in BuffersAnalystJobsParameter) {
- if (name === 'datasetName') {
- tempObj['input'] = tempObj['input'] || {};
- tempObj['input'][name] = BuffersAnalystJobsParameter[name];
- continue;
- }
- if (name === 'output') {
- tempObj['output'] = tempObj['output'] || {};
- tempObj['output'] = BuffersAnalystJobsParameter[name];
- continue;
- }
- tempObj['analyst'] = tempObj['analyst'] || {};
- if (name === 'bounds' && BuffersAnalystJobsParameter[name]) {
- tempObj['analyst'][name] = BuffersAnalystJobsParameter[name].toBBOX();
- } else {
- tempObj['analyst'][name] = BuffersAnalystJobsParameter[name];
- }
- if (name === 'mappingParameters') {
- tempObj['analyst'][name] = tempObj['analyst'][name] || {};
- tempObj['analyst']['mappingParameters'] = BuffersAnalystJobsParameter[name];
- }
- }
- }
- }]);
- return BuffersAnalystJobsParameter;
- }();
- SuperMap.BuffersAnalystJobsParameter = BuffersAnalystJobsParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/ProcessingServiceBase.js
- 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); }
- function ProcessingServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ProcessingServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) ProcessingServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) ProcessingServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function ProcessingServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ProcessingServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function ProcessingServiceBase_setPrototypeOf(o, p) { ProcessingServiceBase_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ProcessingServiceBase_setPrototypeOf(o, p); }
- 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); }; }
- function ProcessingServiceBase_possibleConstructorReturn(self, call) { if (call && (ProcessingServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } return ProcessingServiceBase_assertThisInitialized(self); }
- function ProcessingServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function ProcessingServiceBase_getPrototypeOf(o) { ProcessingServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ProcessingServiceBase_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ProcessingServiceBase
- * @category iServer ProcessingService
- * @classdesc 分布式分析服务基类
- * @extends {SuperMap.CommonServiceBase}
- * @param {string} url - 分布式分析服务地址。
- * @param {Object} options - 参数。
- * @param {SuperMap.Events} options.events - 处理所有事件的对象。
- * @param {number} options.index - 服务访问地址在数组中的位置。
- * @param {number} options.length - 服务访问地址数组长度。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var ProcessingServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
- ProcessingServiceBase_inherits(ProcessingServiceBase, _CommonServiceBase);
- var _super = ProcessingServiceBase_createSuper(ProcessingServiceBase);
- function ProcessingServiceBase(url, options) {
- var _this;
- ProcessingServiceBase_classCallCheck(this, ProcessingServiceBase);
- options = options || {};
- /*
- * Constant: EVENT_TYPES
- * {Array.<string>}
- * 此类支持的事件类型
- * - *processCompleted* 创建成功后触发的事件。
- * - *processFailed* 创建失败后触发的事件 。
- * - *processRunning* 创建过程的整个阶段都会触发的事件,用于获取创建过程的状态 。
- */
- options.EVENT_TYPES = ["processCompleted", "processFailed", "processRunning"];
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.ProcessingServiceBase";
- return _this;
- }
- /**
- * @function SuperMap.ProcessingServiceBase.prototype.destroy
- * @override
- */
- ProcessingServiceBase_createClass(ProcessingServiceBase, [{
- key: "destroy",
- value: function destroy() {
- ProcessingServiceBase_get(ProcessingServiceBase_getPrototypeOf(ProcessingServiceBase.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.ProcessingServiceBase.prototype.getJobs
- * @description 获取分布式分析任务。
- * @param {string} url - 资源地址。
- */
- }, {
- key: "getJobs",
- value: function getJobs(url) {
- var me = this;
- FetchRequest.get(me._processUrl(url), null, {
- proxy: me.proxy
- }).then(function (response) {
- return response.json();
- }).then(function (result) {
- me.events.triggerEvent("processCompleted", {
- result: result
- });
- })["catch"](function (e) {
- me.eventListeners.processFailed({
- error: e
- });
- });
- }
- /**
- * @function SuperMap.ProcessingServiceBase.prototype.addJob
- * @description 添加分布式分析任务。
- * @param {string} url - 资源根地址。
- * @param {Object} params - 创建一个空间分析的请求参数。
- * @param {string} paramType - 请求参数类型。
- * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
- */
- }, {
- key: "addJob",
- value: function addJob(url, params, paramType, seconds) {
- var me = this,
- parameterObject = null;
- if (params && params instanceof paramType) {
- parameterObject = new Object();
- paramType.toObject(params, parameterObject);
- }
- var headers = Object.assign({
- 'Content-Type': 'application/x-www-form-urlencoded'
- }, me.headers || {});
- var options = {
- proxy: me.proxy,
- headers: headers,
- withCredentials: me.withCredentials,
- crossOrigin: me.crossOrigin,
- isInTheSameDomain: me.isInTheSameDomain
- };
- FetchRequest.post(me._processUrl(url), JSON.stringify(parameterObject), options).then(function (response) {
- return response.json();
- }).then(function (result) {
- if (result.succeed) {
- me.serviceProcessCompleted(result, seconds);
- } else {
- me.serviceProcessFailed(result);
- }
- })["catch"](function (e) {
- me.serviceProcessFailed({
- error: e
- });
- });
- }
- }, {
- key: "serviceProcessCompleted",
- value: function serviceProcessCompleted(result, seconds) {
- result = Util.transformResult(result);
- seconds = seconds || 1000;
- var me = this;
- if (result) {
- var id = setInterval(function () {
- FetchRequest.get(me._processUrl(result.newResourceLocation), {
- _t: new Date().getTime()
- }).then(function (response) {
- return response.json();
- }).then(function (job) {
- me.events.triggerEvent("processRunning", {
- id: job.id,
- state: job.state
- });
- if (job.state.runState === 'LOST' || job.state.runState === 'KILLED' || job.state.runState === 'FAILED') {
- clearInterval(id);
- me.events.triggerEvent("processFailed", {
- error: job.state.errorMsg,
- state: job.state.runState
- });
- }
- if (job.state.runState === 'FINISHED' && job.setting.serviceInfo) {
- clearInterval(id);
- me.events.triggerEvent("processCompleted", {
- result: job
- });
- }
- })["catch"](function (e) {
- clearInterval(id);
- me.events.triggerEvent("processFailed", {
- error: e
- });
- });
- }, seconds);
- }
- }
- }, {
- key: "serviceProcessFailed",
- value: function serviceProcessFailed(result) {
- ProcessingServiceBase_get(ProcessingServiceBase_getPrototypeOf(ProcessingServiceBase.prototype), "serviceProcessFailed", this).call(this, result);
- }
- }, {
- key: "_processUrl",
- value: function _processUrl(url) {
- if (SecurityManager.getToken(url)) {
- url = Util.urlAppend(url, 'token=' + SecurityManager.getToken(url));
- }
- return url;
- }
- }]);
- return ProcessingServiceBase;
- }(CommonServiceBase);
- SuperMap.ProcessingServiceBase = ProcessingServiceBase;
- ;// CONCATENATED MODULE: ./src/common/iServer/BuffersAnalystJobsService.js
- 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); }
- function BuffersAnalystJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function BuffersAnalystJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) BuffersAnalystJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) BuffersAnalystJobsService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function BuffersAnalystJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BuffersAnalystJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function BuffersAnalystJobsService_setPrototypeOf(o, p) { BuffersAnalystJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BuffersAnalystJobsService_setPrototypeOf(o, p); }
- 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); }; }
- function BuffersAnalystJobsService_possibleConstructorReturn(self, call) { if (call && (BuffersAnalystJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return BuffersAnalystJobsService_assertThisInitialized(self); }
- function BuffersAnalystJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function BuffersAnalystJobsService_getPrototypeOf(o) { BuffersAnalystJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BuffersAnalystJobsService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.BuffersAnalystJobsService
- * @category iServer ProcessingService BufferAnalyst
- * @classdesc 缓冲区分析服务类
- * @extends {SuperMap.ProcessingServiceBase}
- * @param {string} url - 服务地址。
- * @param {Object} options - 参数。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var BuffersAnalystJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
- BuffersAnalystJobsService_inherits(BuffersAnalystJobsService, _ProcessingServiceBas);
- var _super = BuffersAnalystJobsService_createSuper(BuffersAnalystJobsService);
- function BuffersAnalystJobsService(url, options) {
- var _this;
- BuffersAnalystJobsService_classCallCheck(this, BuffersAnalystJobsService);
- _this = _super.call(this, url, options);
- _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/buffers');
- _this.CLASS_NAME = 'SuperMap.BuffersAnalystJobsService';
- return _this;
- }
- /**
- *@override
- */
- BuffersAnalystJobsService_createClass(BuffersAnalystJobsService, [{
- key: "destroy",
- value: function destroy() {
- BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.BuffersAnalystJobsService.prototype.getBufferJobs
- * @description 获取缓冲区分析所有任务
- */
- }, {
- key: "getBuffersJobs",
- value: function getBuffersJobs() {
- BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "getJobs", this).call(this, this.url);
- }
- /**
- * @function SuperMap.BuffersAnalystJobsService.prototype.getBufferJob
- * @description 获取指定id的缓冲区分析服务
- * @param {string} id - 指定要获取数据的id。
- */
- }, {
- key: "getBuffersJob",
- value: function getBuffersJob(id) {
- BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
- }
- /**
- * @function SuperMap.BuffersAnalystJobsService.prototype.addBufferJob
- * @description 新建缓冲区分析服务
- * @param {SuperMap.BuffersAnalystJobsParameter} params - 创建一个空间分析的请求参数。
- * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
- */
- }, {
- key: "addBuffersJob",
- value: function addBuffersJob(params, seconds) {
- BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "addJob", this).call(this, this.url, params, BuffersAnalystJobsParameter, seconds);
- }
- }]);
- return BuffersAnalystJobsService;
- }(ProcessingServiceBase);
- SuperMap.BuffersAnalystJobsService = BuffersAnalystJobsService;
- ;// CONCATENATED MODULE: ./src/common/iServer/BurstPipelineAnalystParameters.js
- function BurstPipelineAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function BurstPipelineAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) BurstPipelineAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) BurstPipelineAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.BurstPipelineAnalystParameters
- * @category iServer NetworkAnalyst BurstAnalyse
- * @classdesc 爆管分析参数类。
- * @param {Object} options - 参数。
- * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
- * @param {number} [options.edgeID] - 指定的弧段ID,edgeID 与 nodeID 必须指定一个。
- * @param {number} [options.nodeID] - 指定的结点ID,edgeID 与 nodeID 必须指定一个。
- * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。
- */
- var BurstPipelineAnalystParameters = /*#__PURE__*/function () {
- function BurstPipelineAnalystParameters(options) {
- BurstPipelineAnalystParameters_classCallCheck(this, BurstPipelineAnalystParameters);
- var me = this;
- /**
- * @member {Array.<number>} SuperMap.BurstPipelineAnalystParameters.prototype.sourceNodeIDs
- * @description 指定的设施点 ID 数组。
- */
- this.sourceNodeIDs = null;
- /**
- * @member {number} [SuperMap.BurstPipelineAnalystParameters.prototype.edgeID]
- * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
- */
- this.edgeID = null;
- /**
- * @member {number} [SuperMap.BurstPipelineAnalystParameters.prototype.nodeID]
- * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
- */
- this.nodeID = null;
- /**
- * @member {boolean} [SuperMap.BurstPipelineAnalystParameters.prototype.isUncertainDirectionValid=false]
- * @description 指定不确定流向是否有效。
- * 指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行。
- * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
- */
- this.isUncertainDirectionValid = false;
- Util.extend(me, options);
- this.CLASS_NAME = "SuperMap.BurstPipelineAnalystParameters";
- }
- /**
- * @function SuperMap.BurstPipelineAnalystParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- BurstPipelineAnalystParameters_createClass(BurstPipelineAnalystParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.sourceNodeIDs = null;
- me.edgeID = null;
- me.nodeID = null;
- me.isUncertainDirectionValid = null;
- }
- }]);
- return BurstPipelineAnalystParameters;
- }();
- SuperMap.BurstPipelineAnalystParameters = BurstPipelineAnalystParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/NetworkAnalystServiceBase.js
- 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); }
- function NetworkAnalystServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function NetworkAnalystServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) NetworkAnalystServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) NetworkAnalystServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function NetworkAnalystServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = NetworkAnalystServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function NetworkAnalystServiceBase_setPrototypeOf(o, p) { NetworkAnalystServiceBase_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NetworkAnalystServiceBase_setPrototypeOf(o, p); }
- 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); }; }
- function NetworkAnalystServiceBase_possibleConstructorReturn(self, call) { if (call && (NetworkAnalystServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } return NetworkAnalystServiceBase_assertThisInitialized(self); }
- function NetworkAnalystServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function NetworkAnalystServiceBase_getPrototypeOf(o) { NetworkAnalystServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NetworkAnalystServiceBase_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.NetworkAnalystServiceBase
- * @category iServer NetworkAnalyst
- * @classdesc 网络分析服务基类。
- * @description 网络分析服务基类。
- * @extends {SuperMap.CommonServiceBase}
- * @param {string} url - 网络分析服务地址。
- * @param {Object} options - 参数。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var NetworkAnalystServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
- NetworkAnalystServiceBase_inherits(NetworkAnalystServiceBase, _CommonServiceBase);
- var _super = NetworkAnalystServiceBase_createSuper(NetworkAnalystServiceBase);
- function NetworkAnalystServiceBase(url, options) {
- var _this;
- NetworkAnalystServiceBase_classCallCheck(this, NetworkAnalystServiceBase);
- _this = _super.call(this, url, options);
- /**
- * @member {SuperMap.DataFormat} [SuperMap.NetworkAnalystServiceBase.prototype.format=SuperMap.DataFormat.GEOJSON]
- * @description 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为 "ISERVER","GEOJSON"
- */
- _this.format = DataFormat.GEOJSON;
- _this.CLASS_NAME = "SuperMap.NetworkAnalystServiceBase";
- return _this;
- }
- /**
- * @function SuperMap.NetworkAnalystServiceBase.prototype.destroy
- * @description 释放资源,将引用的资源属性置空。
- */
- NetworkAnalystServiceBase_createClass(NetworkAnalystServiceBase, [{
- key: "destroy",
- value: function destroy() {
- NetworkAnalystServiceBase_get(NetworkAnalystServiceBase_getPrototypeOf(NetworkAnalystServiceBase.prototype), "destroy", this).call(this);
- this.format = null;
- }
- /**
- * @function SuperMap.NetworkAnalystServiceBase.prototype.serviceProcessCompleted
- * @description 分析完成,执行此方法。
- * @param {Object} result - 服务器返回的结果对象。
- */
- }, {
- key: "serviceProcessCompleted",
- value: function serviceProcessCompleted(result) {
- var me = this,
- analystResult;
- result = Util.transformResult(result);
- if (result && me.format === DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
- analystResult = me.toGeoJSONResult(result);
- }
- if (!analystResult) {
- analystResult = result;
- }
- me.events.triggerEvent("processCompleted", {
- result: analystResult
- });
- }
- /**
- * @function SuperMap.NetworkAnalystServiceBase.prototype.toGeoJSONResult
- * @description 将含有 geometry 的数据转换为 GeoJSON 格式。只处理结果中的路由,由子类实现。
- * @param {Object} result - 服务器返回的结果对象。
- * @returns {GeoJSONObject} GeoJSON 对象。
- */
- }, {
- key: "toGeoJSONResult",
- value: function toGeoJSONResult(result) {
- // eslint-disable-line no-unused-vars
- return null;
- }
- }]);
- return NetworkAnalystServiceBase;
- }(CommonServiceBase);
- SuperMap.NetworkAnalystServiceBase = NetworkAnalystServiceBase;
- ;// CONCATENATED MODULE: ./src/common/iServer/BurstPipelineAnalystService.js
- 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); }
- function BurstPipelineAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function BurstPipelineAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) BurstPipelineAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) BurstPipelineAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function BurstPipelineAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BurstPipelineAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function BurstPipelineAnalystService_setPrototypeOf(o, p) { BurstPipelineAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BurstPipelineAnalystService_setPrototypeOf(o, p); }
- 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); }; }
- function BurstPipelineAnalystService_possibleConstructorReturn(self, call) { if (call && (BurstPipelineAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return BurstPipelineAnalystService_assertThisInitialized(self); }
- function BurstPipelineAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function BurstPipelineAnalystService_getPrototypeOf(o) { BurstPipelineAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BurstPipelineAnalystService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.BurstPipelineAnalystService
- * @category iServer NetworkAnalyst BurstAnalyse
- * @classdesc 爆管分析服务类,即将给定弧段或节点作为爆管点来进行分析,返回关键结点 ID 数组、普通结点 ID 数组及其上下游弧段 ID 数组。
- * @extends {SuperMap.NetworkAnalystServiceBase}
- * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
- * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源},
- * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet"。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var BurstPipelineAnalystService = /*#__PURE__*/function (_NetworkAnalystServic) {
- BurstPipelineAnalystService_inherits(BurstPipelineAnalystService, _NetworkAnalystServic);
- var _super = BurstPipelineAnalystService_createSuper(BurstPipelineAnalystService);
- function BurstPipelineAnalystService(url, options) {
- var _this;
- BurstPipelineAnalystService_classCallCheck(this, BurstPipelineAnalystService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.BurstPipelineAnalystService";
- return _this;
- }
- /**
- * @function SuperMap.BurstPipelineAnalystService.prototype.destroy
- * @override
- */
- BurstPipelineAnalystService_createClass(BurstPipelineAnalystService, [{
- key: "destroy",
- value: function destroy() {
- BurstPipelineAnalystService_get(BurstPipelineAnalystService_getPrototypeOf(BurstPipelineAnalystService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.BurstPipelineAnalystService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @params {SuperMap.BurstPipelineAnalystParameters} params - 爆管分析参数类
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof BurstPipelineAnalystParameters)) {
- return null;
- }
- var me = this,
- jsonObject;
- me.url = Util.urlPathAppend(me.url, 'burstAnalyse');
- jsonObject = {
- sourceNodeIDs: params.sourceNodeIDs,
- isUncertainDirectionValid: params.isUncertainDirectionValid
- }; //必传参数不正确,就终止
- if (params.edgeID !== null && params.nodeID !== null) {
- throw new Error('edgeID and nodeID cannot be null at the same time.');
- }
- if (params.edgeID === null && params.nodeID === null) {
- throw new Error('edgeID and nodeID cannot be null at the same time.');
- }
- if (params.edgeID !== null) {
- jsonObject.edgeID = params.edgeID;
- } else {
- jsonObject.nodeID = params.nodeID;
- }
- me.request({
- method: "GET",
- params: jsonObject,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return BurstPipelineAnalystService;
- }(NetworkAnalystServiceBase);
- SuperMap.BurstPipelineAnalystService = BurstPipelineAnalystService;
- ;// CONCATENATED MODULE: ./src/common/iServer/ChartFeatureInfoSpecsService.js
- 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); }
- function ChartFeatureInfoSpecsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ChartFeatureInfoSpecsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartFeatureInfoSpecsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartFeatureInfoSpecsService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function ChartFeatureInfoSpecsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ChartFeatureInfoSpecsService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function ChartFeatureInfoSpecsService_setPrototypeOf(o, p) { ChartFeatureInfoSpecsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ChartFeatureInfoSpecsService_setPrototypeOf(o, p); }
- 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); }; }
- function ChartFeatureInfoSpecsService_possibleConstructorReturn(self, call) { if (call && (ChartFeatureInfoSpecsService_typeof(call) === "object" || typeof call === "function")) { return call; } return ChartFeatureInfoSpecsService_assertThisInitialized(self); }
- function ChartFeatureInfoSpecsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function ChartFeatureInfoSpecsService_getPrototypeOf(o) { ChartFeatureInfoSpecsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChartFeatureInfoSpecsService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ChartFeatureInfoSpecsService
- * @category iServer Map Chart
- * @classdesc 海图物标信息服务类,通过该服务类可以查询到服务端支持的所有海图物标信息。
- * 用户可以通过两种方式获取查询结果:
- * 一种是通过监听 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE 事件;
- * 另一种是使用 AsyncResponder 类实现异步处理。
- * @extends {SuperMap.CommonServiceBase}
- * @param {string} url - 地图(特指海图)服务地址。
- * 如:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图"。
- * 发送请求格式类似于:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图/chartFeatureInfoSpecs.json"。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为"ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var ChartFeatureInfoSpecsService = /*#__PURE__*/function (_CommonServiceBase) {
- ChartFeatureInfoSpecsService_inherits(ChartFeatureInfoSpecsService, _CommonServiceBase);
- var _super = ChartFeatureInfoSpecsService_createSuper(ChartFeatureInfoSpecsService);
- function ChartFeatureInfoSpecsService(url, options) {
- var _this;
- ChartFeatureInfoSpecsService_classCallCheck(this, ChartFeatureInfoSpecsService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.ChartFeatureInfoSpecsService";
- return _this;
- }
- /**
- * @function SuperMap.ChartFeatureInfoSpecsService.prototype.destroy
- * @override
- */
- ChartFeatureInfoSpecsService_createClass(ChartFeatureInfoSpecsService, [{
- key: "destroy",
- value: function destroy() {
- ChartFeatureInfoSpecsService_get(ChartFeatureInfoSpecsService_getPrototypeOf(ChartFeatureInfoSpecsService.prototype), "destroy", this).call(this);
- Util.reset(this);
- }
- /**
- * @function SuperMap.ChartFeatureInfoSpecsService.prototype.processAsync
- * @description 根据地图(特指海图)服务地址与服务端完成异步通讯,获取物标信息。
- * 当查询物标信息成功时,将触发 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE
- * 事件。用可以通过户两种方式获取图层信息:
- * 1. 通过 AsyncResponder 类获取(推荐使用);
- * 2. 通过监听 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE 事件获取。
- */
- }, {
- key: "processAsync",
- value: function processAsync() {
- var me = this,
- method = "GET";
- if (!me.isTempLayers) {
- Util.urlPathAppend(me.url, 'chartFeatureInfoSpecs');
- }
- me.request({
- method: method,
- params: null,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return ChartFeatureInfoSpecsService;
- }(CommonServiceBase);
- SuperMap.ChartFeatureInfoSpecsService = ChartFeatureInfoSpecsService;
- ;// CONCATENATED MODULE: ./src/common/iServer/ChartQueryFilterParameter.js
- function ChartQueryFilterParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ChartQueryFilterParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartQueryFilterParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartQueryFilterParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ChartQueryFilterParameter
- * @category iServer Map Chart
- * @classdesc 海图查询过滤参数类,用于设置海图查询的过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
- * @param {Object} options - 参数。
- * @param {string} options.attributeFilter - 属性字段过滤条件。
- * @param {number} options.chartFeatureInfoSpecCode - 查询的物标代号。
- * @param {boolean} [options.isQueryPoint] - 是否查询点。
- * @param {boolean} [options.isQueryLine] - 是否查询线。
- * @param {boolean} [options.isQueryRegion] - 是否查询面。
- */
- var ChartQueryFilterParameter = /*#__PURE__*/function () {
- function ChartQueryFilterParameter(options) {
- ChartQueryFilterParameter_classCallCheck(this, ChartQueryFilterParameter);
- /**
- * @member {boolean} [SuperMap.ChartQueryFilterParameter.prototype.isQueryPoint]
- * @description 是否查询点。
- */
- this.isQueryPoint = null;
- /**
- * @member {boolean} [SuperMap.ChartQueryFilterParameter.prototype.isQueryLine]
- * @description 是否查询线。
- */
- this.isQueryLine = null;
- /**
- * @member {boolean} [SuperMap.ChartQueryFilterParameter.prototype.isQueryRegion]
- * @description 是否查询面。
- */
- this.isQueryRegion = null;
- /**
- * @member {string} SuperMap.ChartQueryFilterParameter.prototype.attributeFilter
- * @description 属性字段过滤条件。
- */
- this.attributeFilter = null;
- /**
- * @member {number} SuperMap.ChartQueryFilterParameter.prototype.chartFeatureInfoSpecCode
- * @description 查询的物标代号。
- */
- this.chartFeatureInfoSpecCode = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.ChartQueryFilterParameter";
- }
- /**
- * @function SuperMap.ChartQueryFilterParameter.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ChartQueryFilterParameter_createClass(ChartQueryFilterParameter, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.isQueryPoint = null;
- me.isQueryLine = null;
- me.isQueryRegion = null;
- me.attributeFilter = null;
- me.chartFeatureInfoSpecCode = null;
- }
- /**
- * @function SuperMap.ChartQueryFilterParameter.prototype.toJson
- * @description 将属性信息转化成 JSON 格式字符串。
- */
- }, {
- key: "toJson",
- value: function toJson() {
- var json = "";
- json += "\"isQueryPoint\":" + this.isQueryPoint + ",";
- json += "\"isQueryLine\":" + this.isQueryLine + ",";
- json += "\"isQueryRegion\":" + this.isQueryRegion + ",";
- if (this.attributeFilter) {
- json += "\"attributeFilter\": \"" + this.attributeFilter + "\",";
- }
- json += "\"chartFeatureInfoSpecCode\":" + this.chartFeatureInfoSpecCode;
- json = "{" + json + "}";
- return json;
- }
- }]);
- return ChartQueryFilterParameter;
- }();
- SuperMap.ChartQueryFilterParameter = ChartQueryFilterParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/ChartQueryParameters.js
- function ChartQueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ChartQueryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartQueryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartQueryParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ChartQueryParameters
- * @category iServer Map Chart
- * @classdesc 海图查询参数类,该类用于设置海图查询时的相关参数,海图查询分为海图属性查询和海图范围查询两类,通过属性 queryMode 指定查询模式。
- * 必设属性有:queryMode、chartLayerNames、chartQueryFilterParameters。当进行海图范围查询时,必设属性还包括 bounds。
- * @param {Object} options - 参数。
- * @param {string} options.queryMode - 海图查询模式类型,支持两种查询方式:海图属性查询("ChartAttributeQuery")和海图空间查询("ChartBoundsQuery")。
- * @param {Array.<string>} options.chartLayerNames - 查询的海图图层的名称。
- * @param {Array.<{SuperMap.ChartQueryFilterParameter}>} options.chartQueryFilterParameters - 海图查询过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
- * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.bounds] - 海图查询范围。当进行海图范围查询时,此参数为必选。
- * @param {boolean} [options.returnContent=true] - 获取或设置是返回查询结果记录集 recordsets,还是返回查询结果的资源 resourceInfo。
- * @param {number} [options.startRecord=0] - 查询起始记录位置。
- * @param {number} [options.expectCount] - 期望查询结果返回的记录数,该值大于0。
- */
- var ChartQueryParameters = /*#__PURE__*/function () {
- function ChartQueryParameters(options) {
- ChartQueryParameters_classCallCheck(this, ChartQueryParameters);
- /**
- * @member {string} SuperMap.ChartQueryParameters.prototype.queryMode
- * @description 海图查询模式类型,支持两种查询方式:海图属性查询("ChartAttributeQuery")和海图空间查询("ChartBoundsQuery") 。
- */
- this.queryMode = null;
- /**
- * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.ChartQueryParameters.prototype.bounds
- * @description 海图查询范围。
- */
- this.bounds = null;
- /**
- * @member {Array.<string>} SuperMap.ChartQueryParameters.prototype.chartLayerNames
- * @description 查询的海图图层的名称。
- */
- this.chartLayerNames = null;
- /**
- * @member {Array.<SuperMap.ChartQueryFilterParameter>} SuperMap.ChartQueryParameters.prototype.chartQueryFilterParameters
- * @description 海图查询过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
- */
- this.chartQueryFilterParameters = null;
- /**
- * @member {boolean} [SuperMap.ChartQueryParameters.prototype.returnContent=true]
- * @description 获取或设置是返回查询结果记录集 recordsets,还是返回查询结果的资源 resourceInfo。
- */
- this.returnContent = true;
- /**
- * @member {number} [SuperMap.ChartQueryParameters.prototype.startRecord=0]
- * @description 查询起始记录位置。
- */
- this.startRecord = 0;
- /**
- * @member {number} [SuperMap.ChartQueryParameters.prototype.expectCount]
- * @description 期望查询结果返回的记录数,该值大于0。
- */
- this.expectCount = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.ChartQueryParameters";
- }
- /**
- * @function SuperMap.ChartQueryParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ChartQueryParameters_createClass(ChartQueryParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.queryMode = null;
- me.bounds = null;
- me.chartLayerNames = null;
- me.chartQueryFilterParameters = null;
- me.returnContent = true;
- me.startRecord = 0;
- me.expectCount = null;
- }
- /**
- * @function SuperMap.ChartQueryParameters.prototype.getVariablesJson
- * @description 将属性信息转换成能够被服务识别的 JSON 格式字符串。
- * @returns {string} JSON 字符串。
- */
- }, {
- key: "getVariablesJson",
- value: function getVariablesJson() {
- var json = "";
- json += "\"queryMode\":\"" + this.queryMode + "\",";
- if (this.chartLayerNames && this.chartLayerNames.length) {
- var chartLayersArray = [];
- var layerLength = this.chartLayerNames.length;
- for (var i = 0; i < layerLength; i++) {
- chartLayersArray.push("\"" + this.chartLayerNames[i] + "\"");
- }
- var layerNames = "[" + chartLayersArray.join(",") + "]";
- json += "\"chartLayerNames\":" + layerNames + ",";
- }
- if (this.queryMode === "ChartBoundsQuery" && this.bounds) {
- json += "\"bounds\":" + "{" + "\"leftBottom\":" + "{" + "\"x\":" + this.bounds.left + "," + "\"y\":" + this.bounds.bottom + "}" + "," + "\"rightTop\":" + "{" + "\"x\":" + this.bounds.right + "," + "\"y\":" + this.bounds.top + "}" + "},";
- }
- if (this.chartQueryFilterParameters && this.chartQueryFilterParameters.length) {
- var chartParamArray = [];
- var chartLength = this.chartQueryFilterParameters.length;
- for (var j = 0; j < chartLength; j++) {
- var chartQueryFilterParameter = this.chartQueryFilterParameters[j];
- if (!(chartQueryFilterParameter instanceof ChartQueryFilterParameter)) {
- continue;
- }
- chartParamArray.push(chartQueryFilterParameter.toJson());
- }
- var chartParamsJson = "[" + chartParamArray.join(",") + "]";
- chartParamsJson = "\"chartQueryParams\":" + chartParamsJson + ",";
- chartParamsJson += "\"startRecord\":" + this.startRecord + ",";
- chartParamsJson += "\"expectCount\":" + this.expectCount;
- chartParamsJson = "{" + chartParamsJson + "}";
- json += "\"chartQueryParameters\":" + chartParamsJson;
- }
- json = "{" + json + "}";
- return json;
- }
- }]);
- return ChartQueryParameters;
- }();
- SuperMap.ChartQueryParameters = ChartQueryParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/QueryParameters.js
- function QueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function QueryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.QueryParameters
- * @category iServer Map QueryResults
- * @classdesc 查询参数基类。距离查询、SQL 查询、几何地物查询等各自的参数均继承此类。
- * @param {Object} options - 参数。
- * @param {Array.<SuperMap.FilterParameter>} options.queryParams - 查询过滤条件参数数组。
- * @param {string} [options.customParams] - 自定义参数,供扩展使用。
- * @param {Object} [options.prjCoordSys] - 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
- * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
- * @param {SuperMap.GeometryType} [options.networkType=SuperMap.GeometryType.LINE] - 网络数据集对应的查询类型。
- * @param {SuperMap.QueryOption} [options.queryOption=SuperMap.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
- * @param {number} [options.startRecord=0] - 查询起始记录号。
- * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
- * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
- * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
- */
- var QueryParameters = /*#__PURE__*/function () {
- function QueryParameters(options) {
- QueryParameters_classCallCheck(this, QueryParameters);
- if (!options) {
- return;
- }
- /**
- * @member {string} [SuperMap.QueryParameters.prototype.customParams]
- * @description 自定义参数,供扩展使用。
- */
- this.customParams = null;
- /**
- * @member {Object} [SuperMap.QueryParameters.prototype.prjCoordSys]
- * @description 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}
- */
- this.prjCoordSys = null;
- /**
- * @member {number} [SuperMap.QueryParameters.prototype.expectCount=100000]
- * @description 期望返回结果记录个数,默认返回100000条查询记录,
- * 如果实际不足100000条则返回实际记录条数。
- */
- this.expectCount = 100000;
- /**
- * @member {SuperMap.GeometryType} [SuperMap.QueryParameters.prototype.networkType=SuperMap.GeometryType.LINE]
- * @description 网络数据集对应的查询类型,分为点和线两种类型。
- */
- this.networkType = GeometryType.LINE;
- /**
- * @member {SuperMap.QueryOption} [SuperMap.QueryParameters.prototype.queryOption=SuperMap.QueryOption.ATTRIBUTEANDGEOMETRY]
- * @description 查询结果类型枚举类。
- * 该类描述查询结果返回类型,包括只返回属性、
- * 只返回几何实体以及返回属性和几何实体。
- */
- this.queryOption = QueryOption.ATTRIBUTEANDGEOMETRY;
- /**
- * @member {Array.<SuperMap.FilterParameter>} SuperMap.QueryParameters.prototype.queryParams
- * @description 查询过滤条件参数数组。
- * 该类用于设置查询数据集的查询过滤参数。
- */
- this.queryParams = null;
- /**
- * @member {number} [SuperMap.QueryParameters.prototype.startRecord=0]
- * @description 查询起始记录号。
- */
- this.startRecord = 0;
- /**
- * @member {number} [SuperMap.QueryParameters.prototype.holdTime=10]
- * @description 资源在服务端保存的时间,单位为分钟。
- */
- this.holdTime = 10;
- /**
- * @member {boolean} [SuperMap.QueryParameters.prototype.returnCustomResult=false]
- * @description 仅供三维使用。
- */
- this.returnCustomResult = false;
- /**
- * @member {boolean} [SuperMap.QueryParameters.prototype.returnFeatureWithFieldCaption=false]
- * @description 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
- */
- this.returnFeatureWithFieldCaption = false;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.QueryParameters";
- }
- /**
- * @function SuperMap.QueryParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- QueryParameters_createClass(QueryParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.customParams = null;
- me.expectCount = null;
- me.networkType = null;
- me.queryOption = null;
- if (me.queryParams) {
- for (var i = 0, qps = me.queryParams, len = qps.length; i < len; i++) {
- qps[i].destroy();
- }
- me.queryParams = null;
- }
- me.startRecord = null;
- me.holdTime = null;
- me.returnCustomResult = null;
- me.prjCoordSys = null;
- }
- }]);
- return QueryParameters;
- }();
- SuperMap.QueryParameters = QueryParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/ChartQueryService.js
- 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); }
- function ChartQueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ChartQueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartQueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartQueryService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function ChartQueryService_setPrototypeOf(o, p) { ChartQueryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ChartQueryService_setPrototypeOf(o, p); }
- 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); }; }
- function ChartQueryService_possibleConstructorReturn(self, call) { if (call && (ChartQueryService_typeof(call) === "object" || typeof call === "function")) { return call; } return ChartQueryService_assertThisInitialized(self); }
- function ChartQueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function ChartQueryService_getPrototypeOf(o) { ChartQueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChartQueryService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ChartQueryService
- * @category iServer Map Chart
- * @classdesc 海图查询服务类。该类负责将海图查询所需参数(ChartQueryParameters)传递至服务端,并获取服务端的返回结果。
- * 用户可以通过两种方式获取查询结果:
- * 1.通过 AsyncResponder 类获取(推荐使用);
- * 2.通过监听 QueryEvent.PROCESS_COMPLETE 事件获取。
- * @extends {SuperMap.CommonServiceBase}
- * @param {string} url - 地图查询服务访问地址。如:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图"。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为"ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @example
- * 下面示例显示了如何进行海图属性查询:
- * var nameArray = ["GB4X0000_52000"];
- * var chartQueryFilterParameter = new ChartQueryFilterParameter({
- * isQueryPoint:true,
- * isQueryLine:true,
- * isQueryRegion:true,
- * attributeFilter:"SmID<10",
- * chartFeatureInfoSpecCode:1
- * });
- *
- * var chartQueryParameters = new SuperMap.ChartQueryParameters({
- * queryMode:"ChartAttributeQuery",
- * chartLayerNames:nameArray,
- * returnContent:true,
- * chartQueryFilterParameters:[chartQueryFilterParameter]
- * });
- *
- * var chartQueryService = new SuperMap.ChartQueryService(url);
- *
- * chartQueryService.events.on({
- * "processCompleted":processCompleted,
- * "processFailed":processFailed
- * });
- * chartQueryService.processAsync(chartQueryParameters);
- */
- var ChartQueryService = /*#__PURE__*/function (_CommonServiceBase) {
- ChartQueryService_inherits(ChartQueryService, _CommonServiceBase);
- var _super = ChartQueryService_createSuper(ChartQueryService);
- function ChartQueryService(url, options) {
- var _this;
- ChartQueryService_classCallCheck(this, ChartQueryService);
- _this = _super.call(this, url, options);
- options = options || {};
- /**
- * @member {boolean} SuperMap.ChartQueryService.prototype.returnContent
- * @description 是否立即返回新创建资源的表述还是返回新资源的URI。
- */
- _this.returnContent = null;
- /**
- * @member {SuperMap.DataFormat} SuperMap.ChartQueryService.prototype.format
- * @description 查询结果返回格式,目前支持iServerJSON 和GeoJSON两种格式
- * 参数格式为"ISERVER","GEOJSON",GEOJSON
- */
- _this.format = DataFormat.GEOJSON;
- Util.extend(ChartQueryService_assertThisInitialized(_this), options);
- var me = ChartQueryService_assertThisInitialized(_this);
- if (options.format) {
- me.format = options.format.toUpperCase();
- }
- if (!me.url) {
- return ChartQueryService_possibleConstructorReturn(_this);
- }
- me.url = Util.urlPathAppend(me.url, 'queryResults');
- _this.CLASS_NAME = "SuperMap.ChartQueryService";
- return _this;
- }
- /**
- * @function SuperMap.ChartQueryService.prototype.destroy
- * @override
- */
- ChartQueryService_createClass(ChartQueryService, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- CommonServiceBase.prototype.destroy.apply(this, arguments);
- me.returnContent = null;
- me.format = null;
- }
- /**
- * @function SuperMap.ChartQueryService.prototype.processAsync
- * @description 使用服务地址 URL 实例化 ChartQueryService 对象。
- * @param {SuperMap.ChartQueryParameters} params - 查询参数。
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- //todo重点需要添加代码的地方
- if (!(params instanceof ChartQueryParameters)) {
- return;
- }
- var me = this,
- jsonParameters;
- me.returnContent = params.returnContent;
- jsonParameters = params.getVariablesJson();
- if (me.returnContent) {
- me.url = Util.urlAppend(me.url, 'returnContent=true');
- }
- me.request({
- method: "POST",
- data: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.ChartQueryService.prototype.serviceProcessCompleted
- * @description 查询完成,执行此方法。
- * @param {Object} result - 服务器返回的结果对象。
- */
- }, {
- key: "serviceProcessCompleted",
- value: function serviceProcessCompleted(result) {
- var me = this;
- result = Util.transformResult(result);
- if (result && result.recordsets && me.format === DataFormat.GEOJSON) {
- for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
- if (recordsets[i].features) {
- var geoJSONFormat = new GeoJSON();
- recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
- }
- }
- }
- me.events.triggerEvent("processCompleted", {
- result: result
- });
- }
- /**
- * @function SuperMap.ChartQueryService.prototype.getQueryParameters
- * @description 将 JSON 对象表示的查询参数转化为 QueryParameters 对象。
- * @param {Object} params - JSON 字符串表示的查询参数。
- * @returns {SuperMap.QueryParameters} 返回查询结果
- */
- }, {
- key: "getQueryParameters",
- value: function getQueryParameters(params) {
- return new QueryParameters({
- queryMode: params.queryMode,
- bounds: params.bounds,
- chartLayerNames: params.chartLayerNames,
- chartQueryFilterParameters: params.chartQueryFilterParameters,
- returnContent: params.returnContent
- });
- }
- }]);
- return ChartQueryService;
- }(CommonServiceBase);
- SuperMap.ChartQueryService = ChartQueryService;
- ;// CONCATENATED MODULE: ./src/common/iServer/ClipParameter.js
- function ClipParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ClipParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) ClipParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) ClipParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ClipParameter
- * @category iServer SpatialAnalyst InterpolationAnalyst
- * @classdesc 用于裁剪的参数。
- * @description 优先使用用户指定的裁剪区域多边形进行裁剪,也可以通过指定数据源和数据集名,从而使用指定数据集的边界多边形进行裁剪。
- * @param {Object} options - 参数。
- * @param {string} [options.clipDatasetName] - 裁剪的数据集名。
- * @param {string} [options.clipDatasourceName] - 裁剪的数据集所在数据源的名字。
- * @param {(SuperMap.Geometry.Polygon|L.Polygon|L.GeoJSON|ol.geom.Polygon|ol.format.GeoJSON)} [options.clipRegion] - 用户指定的裁剪区域。
- * @param {boolean} [options.isClipInRegion=true] - 是否对裁剪区内的数据集进行裁剪。
- * @param {boolean} [options.isExactClip=true] - 是否使用精确裁剪。
- */
- var ClipParameter = /*#__PURE__*/function () {
- function ClipParameter(options) {
- ClipParameter_classCallCheck(this, ClipParameter);
- /**
- * @member {string} SuperMap.ClipParameter.prototype.clipDatasetName
- * @description 用于裁剪的数据集名,clipDatasetName 与 clipRegion 必须设置一个。
- */
- this.clipDatasetName = null;
- /**
- * @member {string} SuperMap.ClipParameter.prototype.clipDatasourceName
- * @description 用于裁剪的数据集所在数据源的名字。当 clipRegion 不设置时起作用。
- */
- this.clipDatasourceName = null;
- /**
- * @member {(SuperMap.Geometry.Polygon|L.Polygon|L.GeoJSON|ol.geom.Polygon|ol.format.GeoJSON)} SuperMap.ClipParameter.prototype.clipRegion
- * @description 用户指定的裁剪区域,优先使用,clipDatasetName 与 clipRegion 必须设置一个。
- */
- this.clipRegion = null;
- /**
- * @member {boolean} [SuperMap.ClipParameter.prototype.isClipInRegion=true]
- * @description 是否对裁剪区内的数据集进行裁剪。若为 true,则对裁剪区域内的结果进行裁剪,若为 false,则对裁剪区域外的结果进行裁剪。
- */
- this.isClipInRegion = true;
- /**
- * @member {boolean} [SuperMap.ClipParameter.prototype.isExactClip=true]
- * @description 是否使用精确裁剪。
- */
- this.isExactClip = null;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ClipParameter";
- }
- /**
- * @function SuperMap.ClipParameter.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ClipParameter_createClass(ClipParameter, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.clipDatasetName = null;
- me.clipDatasourceName = null;
- me.clipRegion = null;
- me.isClipInRegion = null;
- me.isExactClip = null;
- }
- /**
- * @function SuperMap.ClipParameter.prototype.toJSON
- * @description 将 ClipParameter 对象转化为 JSON 字符串。
- * @returns {string} 返回转换后的 JSON 字符串。
- */
- }, {
- key: "toJSON",
- value: function toJSON() {
- return Util.toJSON({
- isClipInRegion: this.isClipInRegion,
- clipDatasetName: this.clipDatasetName,
- clipDatasourceName: this.clipDatasourceName,
- isExactClip: this.isExactClip,
- clipRegion: ServerGeometry.fromGeometry(this.clipRegion)
- });
- }
- }]);
- return ClipParameter;
- }();
- SuperMap.ClipParameter = ClipParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/ColorDictionary.js
- function ColorDictionary_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ColorDictionary_createClass(Constructor, protoProps, staticProps) { if (protoProps) ColorDictionary_defineProperties(Constructor.prototype, protoProps); if (staticProps) ColorDictionary_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ColorDictionary
- * @category iServer Map Theme
- * @classdesc 颜色对照表类。
- * @description 颜色对照表中的键名为具体的高程值,键值表示该高程值要显示的颜色。对于栅格图层中高程值小于颜色对照表中高程最小值的点使用颜色对照表中高程最小值对应的颜色,对于栅格图层中高程值大于颜色对照表中高程最大值的点使用颜色对照表中高程最大值对应的颜色,对于栅格图层中高程值在颜色对照表中没有对应颜色的点,则查找颜色对照表中与当前高程值相邻的两个高程对应的颜色,然后通过渐变运算要显示的颜色。如果设置了颜色对照表的话,则颜色表设置无效。
- * @param {Object} options - 参数。
- * @param {number} options.elevation - 高程值。
- * @param {SuperMap.ServerColor} options.color - 服务端颜色类。
- */
- var ColorDictionary = /*#__PURE__*/function () {
- function ColorDictionary(options) {
- ColorDictionary_classCallCheck(this, ColorDictionary);
- options = options || {};
- /**
- * @member {number} SuperMap.ColorDictionary.prototype.elevation
- * @description 高程值。
- */
- this.elevation = null;
- /**
- * @member {SuperMap.ServerColor} SuperMap.ColorDictionary.prototype.color
- * @description 服务端颜色类。
- */
- this.color = null;
- Util.extend(this, options);
- var me = this,
- c = me.color;
- if (c) {
- me.color = new ServerColor(c.red, c.green, c.blue);
- }
- this.CLASS_NAME = "SuperMap.ColorDictionary";
- }
- /**
- * @function SuperMap.ColorDictionary.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ColorDictionary_createClass(ColorDictionary, [{
- key: "destroy",
- value: function destroy() {
- Util.reset(this);
- }
- /**
- * @function SuperMap.ColorDictionary.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- * @returns {Object} JSON 对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- var dataObj = {};
- dataObj = Util.copyAttributes(dataObj, this);
- return dataObj;
- }
- }]);
- return ColorDictionary;
- }();
- SuperMap.ColorDictionary = ColorDictionary;
- ;// CONCATENATED MODULE: ./src/common/iServer/TransportationAnalystResultSetting.js
- function TransportationAnalystResultSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function TransportationAnalystResultSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransportationAnalystResultSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransportationAnalystResultSetting_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.TransportationAnalystResultSetting
- * @category iServer NetworkAnalyst
- * @classdesc 交通网络分析结果参数类。
- * @description 通过该类设置交通网络分析返回的结果,包括是否返回图片、是否返回弧段空间信息、是否返回结点空间信息等。
- * @param {Object} options - 参数。
- * @param {boolean} [options.returnEdgeFeatures=false] - 是否在分析结果中包含弧段要素集合。
- * @param {boolean} [options.returnEdgeGeometry=false] - 返回的弧段要素集合中是否包含几何对象信息。
- * @param {boolean} [options.returnEdgeIDs=false] - 返回结果中是否包含经过弧段 ID 集合。
- * @param {boolean} [options.returnNodeFeatures=false] - 是否在分析结果中包含结点要素集合。
- * @param {boolean} [options.returnNodeGeometry=false] - 返回的结点要素集合中是否包含几何对象信息。
- * @param {boolean} [options.returnNodeIDs=false] - 返回结果中是否包含经过结点 ID 集合。
- * @param {boolean} [options.returnPathGuides=false] - 返回分析结果中是否包含行驶导引集合。
- * @param {boolean} [options.returnRoutes=false] - 返回分析结果中是否包含路由对象的集合。
- */
- var TransportationAnalystResultSetting = /*#__PURE__*/function () {
- function TransportationAnalystResultSetting(options) {
- TransportationAnalystResultSetting_classCallCheck(this, TransportationAnalystResultSetting);
- if (!options) {
- return;
- }
- /**
- * @member {boolean} SuperMap.TransportationAnalystResultSetting.prototype.returnEdgeFeatures
- * @description 是否在分析结果中包含弧段要素集合。弧段要素包括弧段的空间信息和属性信息。
- */
- this.returnEdgeFeatures = false;
- /**
- * @member {boolean} [SuperMap.TransportationAnalystResultSetting.prototype.returnEdgeGeometry=false]
- * @description 返回的弧段要素集合中是否包含几何对象信息。
- */
- this.returnEdgeGeometry = false;
- /**
- * @member {boolean} [SuperMap.TransportationAnalystResultSetting.prototype.returnEdgeIDs=false]
- * @description 返回结果中是否包含经过弧段 ID 集合。
- */
- this.returnEdgeIDs = false;
- /**
- * @member {boolean} [SuperMap.TransportationAnalystResultSetting.prototype.returnNodeFeatures=false]
- * @description 是否在分析结果中包含结点要素集合。
- * 结点要素包括结点的空间信息和属性信息。其中返回的结点要素是否包含空间信息可通过 returnNodeGeometry 字段设置。
- */
- this.returnNodeFeatures = false;
- /**
- * @member {boolean} [SuperMap.TransportationAnalystResultSetting.prototype.returnNodeGeometry=false]
- * @description 返回的结点要素集合中是否包含几何对象信息。
- */
- this.returnNodeGeometry = false;
- /**
- * @member {boolean} [SuperMap.TransportationAnalystResultSetting.prototype.returnNodeIDs=false]
- * @description 返回结果中是否包含经过结点 ID 集合。
- */
- this.returnNodeIDs = false;
- /**
- * @member {boolean} SuperMap.TransportationAnalystResultSetting.prototype.returnPathGuides
- * @description 返回分析结果中是否包含行驶导引集合。
- */
- this.returnPathGuides = false;
- /**
- * @member {boolean} SuperMap.TransportationAnalystResultSetting.prototype.returnRoutes
- * @description 返回分析结果中是否包含路由对象的集合。
- */
- this.returnRoutes = false;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.TransportationAnalystResultSetting";
- }
- /**
- * @function SuperMap.TransportationAnalystResultSetting.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- TransportationAnalystResultSetting_createClass(TransportationAnalystResultSetting, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.returnEdgeFeatures = null;
- me.returnEdgeGeometry = null;
- me.returnEdgeIDs = null;
- me.returnNodeFeatures = null;
- me.returnNodeGeometry = null;
- me.returnNodeIDs = null;
- me.returnPathGuides = null;
- me.returnRoutes = null;
- }
- }]);
- return TransportationAnalystResultSetting;
- }();
- SuperMap.TransportationAnalystResultSetting = TransportationAnalystResultSetting;
- ;// CONCATENATED MODULE: ./src/common/iServer/TransportationAnalystParameter.js
- function TransportationAnalystParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function TransportationAnalystParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransportationAnalystParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransportationAnalystParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.TransportationAnalystParameter
- * @category iServer NetworkAnalyst
- * @classdesc 交通网络分析通用参数类。
- * @description 该类主要用来提供交通网络分析所需的通用参数。
- * 通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息,还可以对分析结果包含的内容进行一些设置。
- * @param {Object} options - 参数。
- * @param {Array.<number>} options.barrierEdgeIDs - 网络分析中障碍弧段的 ID 数组。
- * @param {Array.<number>} options.barrierNodeIDs - 网络分析中障碍点的 ID 数组。
- * @param {string} options.turnWeightField - 转向权重字段的名称。
- * @param {SuperMap.TransportationAnalystResultSetting} options.resultSetting - 分析结果返回内容。
- * @param {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} [options.barrierPoints] - 网络分析中 Point2D 类型的障碍点数组。
- * @param {string} [options.weightFieldName] - 阻力字段的名称。
- */
- var TransportationAnalystParameter = /*#__PURE__*/function () {
- function TransportationAnalystParameter(options) {
- TransportationAnalystParameter_classCallCheck(this, TransportationAnalystParameter);
- if (!options) {
- return;
- }
- /**
- * @member {Array.<number>} SuperMap.TransportationAnalystParameter.prototype.barrierEdgeIDs
- * @description 网络分析中障碍弧段的 ID 数组。弧段设置为障碍边之后,表示双向都不通。
- */
- this.barrierEdgeIDs = null;
- /**
- * @member {Array.<number>} SuperMap.TransportationAnalystParameter.prototype.barrierNodeIDs
- * @description 网络分析中障碍点的 ID 数组。结点设置为障碍点之后,表示任何方向都不能通过此结点。
- */
- this.barrierNodeIDs = null;
- /**
- * @member {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} SuperMap.TransportationAnalystParameter.prototype.barrierPoints
- * @description 网络分析中 Point2D 类型的障碍点数组。障碍点表示任何方向都不能通过此点。</br>
- * 当各网络分析参数类中的 isAnalyzeById 属性设置为 false 时,该属性才生效。
- */
- this.barrierPoints = null;
- /**
- * @member {string} [SuperMap.TransportationAnalystParameter.prototype.weightFieldName]
- * @description 阻力字段的名称,标识了进行网络分析时所使用的阻力字段,例如表示时间、长度等的字段都可以用作阻力字段。
- * 该字段默值为服务器发布的所有耗费字段的第一个字段。
- */
- this.weightFieldName = null;
- /**
- * @member {string} SuperMap.TransportationAnalystParameter.prototype.turnWeightField
- * @description 转向权重字段的名称。
- */
- this.turnWeightField = null;
- /**
- * @member {SuperMap.TransportationAnalystResultSetting} SuperMap.TransportationAnalystParameter.prototype.resultSetting
- * @description 分析结果返回内容。
- */
- this.resultSetting = new TransportationAnalystResultSetting();
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.TransportationAnalystParameter";
- }
- /**
- * @function SuperMap.TransportationAnalystParameter.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- TransportationAnalystParameter_createClass(TransportationAnalystParameter, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.barrierEdgeIDs = null;
- me.barrierNodeIDs = null;
- me.weightFieldName = null;
- me.turnWeightField = null;
- if (me.resultSetting) {
- me.resultSetting.destroy();
- me.resultSetting = null;
- }
- if (me.barrierPoints && me.barrierPoints.length) {
- for (var i in me.barrierPoints) {
- me.barrierPoints[i].destroy();
- }
- }
- me.barrierPoints = null;
- }
- }]);
- return TransportationAnalystParameter;
- }();
- SuperMap.TransportationAnalystParameter = TransportationAnalystParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/ComputeWeightMatrixParameters.js
- function ComputeWeightMatrixParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ComputeWeightMatrixParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ComputeWeightMatrixParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ComputeWeightMatrixParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ComputeWeightMatrixParameters
- * @category iServer NetworkAnalyst WeightMatrix
- * @classdesc 耗费矩阵分析参数类。根据交通网络分析参数中的耗费字段返回一个耗费矩阵。该矩阵是一个二维数组,用来存储任意两点间的资源消耗。
- * @param {Object} options - 参数。
- * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
- * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.nodes - 要计算耗费矩阵的点数组。
- * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
- */
- var ComputeWeightMatrixParameters = /*#__PURE__*/function () {
- function ComputeWeightMatrixParameters(options) {
- ComputeWeightMatrixParameters_classCallCheck(this, ComputeWeightMatrixParameters);
- /**
- * @member {boolean} [SuperMap.ComputeWeightMatrixParameters.prototype.isAnalyzeById=false]
- * @description 是否通过节点 ID 指定路径分析的结点,即通过坐标点指定。
- */
- this.isAnalyzeById = false;
- /**
- * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} SuperMap.ComputeWeightMatrixParameters.prototype.nodes
- * @description 要计算耗费矩阵的点数组。
- * 当 {@link SuperMap.ComputeWeightMatrixParameters.isAnalyzeById} = false 时,nodes 应为点的坐标数组;
- * 当 {@link SuperMap.ComputeWeightMatrixParameters.isAnalyzeById} = true 时,nodes 应为点的 ID 数组。
- */
- this.nodes = null;
- /**
- * @member {SuperMap.TransportationAnalystParameter} SuperMap.ComputeWeightMatrixParameters.prototype.parameter
- * @description 交通网络分析通用参数。
- */
- this.parameter = new TransportationAnalystParameter();
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.ComputeWeightMatrixParameters";
- }
- /**
- * @function SuperMap.ComputeWeightMatrixParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ComputeWeightMatrixParameters_createClass(ComputeWeightMatrixParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.isAnalyzeById = null;
- me.nodes = null;
- if (me.parameter) {
- me.parameter.destroy();
- me.parameter = null;
- }
- }
- }]);
- return ComputeWeightMatrixParameters;
- }();
- SuperMap.ComputeWeightMatrixParameters = ComputeWeightMatrixParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/ComputeWeightMatrixService.js
- 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); }
- function ComputeWeightMatrixService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ComputeWeightMatrixService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ComputeWeightMatrixService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ComputeWeightMatrixService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function ComputeWeightMatrixService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ComputeWeightMatrixService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function ComputeWeightMatrixService_setPrototypeOf(o, p) { ComputeWeightMatrixService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ComputeWeightMatrixService_setPrototypeOf(o, p); }
- 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); }; }
- function ComputeWeightMatrixService_possibleConstructorReturn(self, call) { if (call && (ComputeWeightMatrixService_typeof(call) === "object" || typeof call === "function")) { return call; } return ComputeWeightMatrixService_assertThisInitialized(self); }
- function ComputeWeightMatrixService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function ComputeWeightMatrixService_getPrototypeOf(o) { ComputeWeightMatrixService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ComputeWeightMatrixService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ComputeWeightMatrixService
- * @category iServer NetworkAnalyst WeightMatrix
- * @classdesc 耗费矩阵分析服务类。
- * 耗费矩阵是根据交通网络分析参数中的耗费字段来计算一个二维数组,
- * 用来存储指定的任意两点间的资源消耗。
- * 耗费矩阵分析结果通过该类支持的事件的监听函数参数获取
- * @extends {SuperMap.NetworkAnalystServiceBase}
- * @example
- * var mycomputeWeightMatrixService = new SuperMap.ComputeWeightMatrixService(url,{
- * eventListeners: {
- * "processCompleted": computeWeightMatrixCompleted,
- * "processFailed": computeWeightMatrixnError
- * }
- * });
- * @param {string} url - 耗费矩阵分析服务地址。请求服务的URL应为:
- * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
- * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var ComputeWeightMatrixService = /*#__PURE__*/function (_NetworkAnalystServic) {
- ComputeWeightMatrixService_inherits(ComputeWeightMatrixService, _NetworkAnalystServic);
- var _super = ComputeWeightMatrixService_createSuper(ComputeWeightMatrixService);
- function ComputeWeightMatrixService(url, options) {
- var _this;
- ComputeWeightMatrixService_classCallCheck(this, ComputeWeightMatrixService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.ComputeWeightMatrixService";
- return _this;
- }
- /**
- * @function SuperMap.ComputeWeightMatrixService.prototype.destroy
- * @override
- */
- ComputeWeightMatrixService_createClass(ComputeWeightMatrixService, [{
- key: "destroy",
- value: function destroy() {
- ComputeWeightMatrixService_get(ComputeWeightMatrixService_getPrototypeOf(ComputeWeightMatrixService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.ComputeWeightMatrixService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.ComputeWeightMatrixParameters} params - 耗费矩阵分析参数类
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof ComputeWeightMatrixParameters)) {
- return;
- }
- var me = this,
- jsonObject;
- me.url = Util.urlPathAppend(me.url, 'weightmatrix');
- jsonObject = {
- parameter: Util.toJSON(params.parameter),
- nodes: me.getJson(params.isAnalyzeById, params.nodes)
- };
- me.request({
- method: "GET",
- params: jsonObject,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.ComputeWeightMatrixService.prototype.getJson
- * @description 将对象转化为JSON字符串。
- * @param {boolean} isAnalyzeById - 是否通过id分析
- * @param {Array.<SuperMap.ComputeWeightMatrixParameters>} params - 分析参数数组
- * @returns {string} 转化后的JSON字符串。
- */
- }, {
- key: "getJson",
- value: function getJson(isAnalyzeById, params) {
- var jsonString = "[",
- len = params ? params.length : 0;
- if (isAnalyzeById === false) {
- for (var i = 0; i < len; i++) {
- if (i > 0) {
- jsonString += ",";
- }
- jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
- }
- } else if (isAnalyzeById === true) {
- for (var _i = 0; _i < len; _i++) {
- if (_i > 0) {
- jsonString += ",";
- }
- jsonString += params[_i];
- }
- }
- jsonString += ']';
- return jsonString;
- }
- }]);
- return ComputeWeightMatrixService;
- }(NetworkAnalystServiceBase);
- SuperMap.ComputeWeightMatrixService = ComputeWeightMatrixService;
- ;// CONCATENATED MODULE: ./src/common/iServer/DataFlowService.js
- 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); }
- function DataFlowService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function DataFlowService_createClass(Constructor, protoProps, staticProps) { if (protoProps) DataFlowService_defineProperties(Constructor.prototype, protoProps); if (staticProps) DataFlowService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function DataFlowService_setPrototypeOf(o, p) { DataFlowService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DataFlowService_setPrototypeOf(o, p); }
- 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); }; }
- function DataFlowService_possibleConstructorReturn(self, call) { if (call && (DataFlowService_typeof(call) === "object" || typeof call === "function")) { return call; } return DataFlowService_assertThisInitialized(self); }
- function DataFlowService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function DataFlowService_getPrototypeOf(o) { DataFlowService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DataFlowService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.DataFlowService
- * @category iServer DataFlow
- * @classdesc 数据流服务类
- * @extends {SuperMap.CommonServiceBase}
- * @param {string} url - 数据流服务地址
- * @param {Object} options - 参数。
- * @param {function} options.style - 设置数据加载样式。
- * @param {function} [options.onEachFeature] - 设置每个数据加载popup等。
- * @param {GeoJSONObject} [options.geometry] - 指定几何范围,该范围内的要素才能被订阅。
- * @param {Object} [options.excludeField] - -排除字段。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var DataFlowService = /*#__PURE__*/function (_CommonServiceBase) {
- DataFlowService_inherits(DataFlowService, _CommonServiceBase);
- var _super = DataFlowService_createSuper(DataFlowService);
- function DataFlowService(url, options) {
- var _this;
- DataFlowService_classCallCheck(this, DataFlowService);
- options = options || {};
- /*
- * @constant EVENT_TYPES
- * {Array.<string>}
- * 此类支持的事件类型
- */
- options.EVENT_TYPES = ["broadcastSocketConnected", "broadcastSocketError", "broadcastFailed", "broadcastSucceeded", "subscribeSocketConnected", "subscribeSocketError", "messageSucceeded", "setFilterParamSucceeded"];
- _this = _super.call(this, url, options);
- /**
- * @member {GeoJSONObject} SuperMap.DataFlowService.prototype.geometry
- * @description 指定几何范围,该范围内的要素才能被订阅。
- */
- _this.geometry = null;
- /**
- * @member {Object} SuperMap.DataFlowService.prototype.prjCoordSys
- * @description 动态投影参数
- */
- _this.prjCoordSys = null;
- /**
- * @member {Object} SuperMap.DataFlowService.prototype.excludeField
- * @description 排除字段
- */
- _this.excludeField = null;
- Util.extend(DataFlowService_assertThisInitialized(_this), options);
- _this.CLASS_NAME = "SuperMap.DataFlowService";
- return _this;
- }
- /**
- * @function SuperMap.DataFlowService.prototype.initBroadcast
- * @description 初始化广播
- * @returns {SuperMap.DataFlowService}
- */
- DataFlowService_createClass(DataFlowService, [{
- key: "initBroadcast",
- value: function initBroadcast() {
- var me = this;
- this.broadcastWebSocket = this._connect(Util.urlPathAppend(me.url, 'broadcast'));
- this.broadcastWebSocket.onopen = function (e) {
- me.broadcastWebSocket.isOpen = true;
- e.eventType = 'broadcastSocketConnected';
- me.events.triggerEvent('broadcastSocketConnected', e);
- };
- this.broadcastWebSocket.onclose = function (e) {
- me.broadcastWebSocket.isOpen = false;
- e.eventType = 'broadcastSocketConnected';
- me.events.triggerEvent('broadcastSocketConnected', e);
- };
- this.broadcastWebSocket.onerror = function (e) {
- e.eventType = 'broadcastSocketError';
- me.events.triggerEvent('broadcastSocketError', e);
- };
- return this;
- }
- /**
- * @function SuperMap.DataFlowService.prototype.broadcast
- * @description 加载广播数据。
- * @param {GeoJSONObject} geoJSONFeature - JSON 格式的要素数据。
- */
- }, {
- key: "broadcast",
- value: function broadcast(geoJSONFeature) {
- if (!this.broadcastWebSocket || !this.broadcastWebSocket.isOpen) {
- this.events.triggerEvent('broadcastFailed');
- return;
- }
- this.broadcastWebSocket.send(JSON.stringify(geoJSONFeature));
- this.events.triggerEvent('broadcastSucceeded');
- }
- /**
- * @function SuperMap.DataFlowService.prototype.initSubscribe
- * @description 初始化订阅数据
- * @returns {this} this
- */
- }, {
- key: "initSubscribe",
- value: function initSubscribe() {
- var me = this;
- this.subscribeWebSocket = this._connect(Util.urlPathAppend(me.url, 'subscribe'));
- this.subscribeWebSocket.onopen = function (e) {
- me.subscribeWebSocket.send(me._getFilterParams());
- e.eventType = 'subscribeSocketConnected';
- me.events.triggerEvent('subscribeSocketConnected', e);
- };
- this.subscribeWebSocket.onerror = function (e) {
- e.eventType = 'subscribeSocketError';
- me.events.triggerEvent('subscribeSocketError', e);
- };
- this.subscribeWebSocket.onmessage = function (e) {
- me._onMessage(e);
- };
- return this;
- }
- /**
- * @function SuperMap.DataFlowService.prototype.setExcludeField
- * @description 设置排除字段
- * @param {Object} excludeField - 排除字段
- * @returns {this} this
- */
- }, {
- key: "setExcludeField",
- value: function setExcludeField(excludeField) {
- this.excludeField = excludeField;
- this.subscribeWebSocket.send(this._getFilterParams());
- return this;
- }
- /**
- * @function SuperMap.DataFlowService.prototype.setGeometry
- * @description 设置添加的几何要素数据
- * @param {GeoJSONObject} geometry - 指定几何范围,该范围内的要素才能被订阅。
- * @returns {this} this
- */
- }, {
- key: "setGeometry",
- value: function setGeometry(geometry) {
- this.geometry = geometry;
- this.subscribeWebSocket.send(this._getFilterParams());
- return this;
- }
- /**
- * @function SuperMap.DataFlowService.prototype.unSubscribe
- * @description 结束订阅数据
- */
- }, {
- key: "unSubscribe",
- value: function unSubscribe() {
- if (!this.subscribeWebSocket) {
- return;
- }
- this.subscribeWebSocket.close();
- this.subscribeWebSocket = null;
- }
- /**
- * @function SuperMap.DataFlowService.prototype.unBroadcast
- * @description 结束加载广播
- */
- }, {
- key: "unBroadcast",
- value: function unBroadcast() {
- if (!this.broadcastWebSocket) {
- return;
- }
- this.broadcastWebSocket.close();
- this.broadcastWebSocket = null;
- }
- /**
- * @function SuperMap.DataFlowService.prototype.destroy
- * @override
- */
- }, {
- key: "destroy",
- value: function destroy() {
- CommonServiceBase.prototype.destroy.apply(this, arguments);
- var me = this;
- me.geometry = null;
- me.prjCoordSys = null;
- me.excludeField = null;
- this.unBroadcast();
- this.unSubscribe();
- }
- }, {
- key: "_getFilterParams",
- value: function _getFilterParams() {
- var filter = {
- filterParam: {
- prjCoordSys: this.prjCoordSys,
- excludeField: this.excludeField,
- geometry: this.geometry
- }
- };
- return Util.toJSON(filter);
- }
- }, {
- key: "_onMessage",
- value: function _onMessage(e) {
- if (e.data && e.data.indexOf("filterParam") >= 0) {
- var filterParam = JSON.parse(e.data);
- e.filterParam = filterParam;
- e.eventType = 'setFilterParamSucceeded';
- this.events.triggerEvent('setFilterParamSucceeded', e);
- return;
- }
- var feature = JSON.parse(e.data);
- e.featureResult = feature;
- e.eventType = 'messageSucceeded';
- this.events.triggerEvent('messageSucceeded', e);
- }
- }, {
- key: "_connect",
- value: function _connect(url) {
- url = this._appendCredentials(url);
- if ("WebSocket" in window) {
- return new WebSocket(url);
- } else if ("MozWebSocket" in window) {
- var mozWebSocket = window.MozWebSocket;
- return new mozWebSocket(url);
- } else {
- console.log("no WebSocket");
- return null;
- }
- }
- }, {
- key: "_appendCredentials",
- value: function _appendCredentials(url) {
- var token = SecurityManager.getToken(url);
- if (token) {
- url = Util.urlAppend(url, "token=" + token);
- }
- return url;
- }
- }]);
- return DataFlowService;
- }(CommonServiceBase);
- SuperMap.DataFlowService = DataFlowService;
- ;// CONCATENATED MODULE: ./src/common/iServer/DatasetInfo.js
- function DatasetInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function DatasetInfo_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetInfo_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetInfo_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.DatasetInfo
- * @category iServer Data
- * @classdesc 数据集信息类。
- * @description 数据集一般为存储在一起的相关数据的集合;根据数据类型的不同,分为矢量数据集、栅格数据集(griddataset)和
- * 影像数据集(image dataset),以及为了处理特定问题而设计的数据集,如拓扑数据集,网络数据集等。
- * 数据集是 GIS 数据组织的最小单位。其中矢量数据集是由同种类型空间要素组成的集合,
- * 所以也可以称为要素集。根据要素的空间特征的不同,矢量数据集又分为点数据集,
- * 线数据集,面数据集等,各矢量数据集是空间特征和性质相同的数据组织起来的集合。
- * 目前版本支持的数据集主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、
- * 网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
- * @param {Object} options - 参数。
- * @param {SuperMap.Bounds} [options.bounds] - 数据集范围,该字段只读。
- * @param {string} [options.dataSourceName] - 数据源名称,该字段只读。
- * @param {string} [options.description] - 数据集的描述信息。
- * @param {string} [options.encodeType] - 数据集存储时的压缩编码方式,该字段只读。
- * @param {boolean} [options.isReadOnly] - 数据集是否为只读。
- * @param {string} options.name - 数据集名称,该字段必须且只读。
- * @param {SuperMap.Projection} [options.prjCoordSys] - 数据集的投影信息。
- * @param {string} [options.tableName] - 表名,该字段只读。
- * @param {string} options.type - 数据集类型。主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
- */
- var DatasetInfo = /*#__PURE__*/function () {
- function DatasetInfo(options) {
- DatasetInfo_classCallCheck(this, DatasetInfo);
- options = options || {};
- /**
- * @member {SuperMap.Bounds} [SuperMap.DatasetInfo.prototype.bounds]
- * @description 数据集范围,该字段只读。
- */
- this.bounds = null;
- /**
- * @member {string} [SuperMap.DatasetInfo.prototype.dataSourceName]
- * @description 数据源名称,该字段只读。
- */
- this.dataSourceName = null;
- /**
- * @member {string} [SuperMap.DatasetInfo.prototype.description]
- * @description 数据集的描述信息。
- */
- this.description = null;
- /**
- * @member {string} [SuperMap.DatasetInfo.prototype.encodeType]
- * @description 数据集存储时的压缩编码方式,该字段只读。
- */
- this.encodeType = null;
- /**
- * @member {boolean} [SuperMap.DatasetInfo.prototype.isReadOnly]
- * @description 数据集是否为只读。
- */
- this.isReadOnly = null;
- /**
- * @member {string} SuperMap.DatasetInfo.prototype.name
- * @description 数据集名称,该字段必须且只读。
- */
- this.name = null;
- /**
- * @member {SuperMap.Projection} [SuperMap.DatasetInfo.prototype.prjCoordSys]
- * @description 数据集的投影信息。
- */
- this.prjCoordSys = null;
- /**
- * @member {string} [SuperMap.DatasetInfo.prototype.tableName]
- * @description 表名,该字段只读。
- */
- this.tableName = null;
- /**
- * @member {string} SuperMap.DatasetInfo.prototype.type
- * @description 数据集类型,该字段必设。主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
- */
- this.type = null;
- Util.extend(this, options);
- var b = this.bounds;
- if (b) {
- this.bounds = new Bounds(b.leftBottom.x, b.leftBottom.y, b.rightTop.x, b.rightTop.y);
- }
- this.CLASS_NAME = "SuperMap.DatasetInfo";
- }
- /**
- * @function SuperMap.DatasetInfo.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- DatasetInfo_createClass(DatasetInfo, [{
- key: "destroy",
- value: function destroy() {
- Util.reset(this);
- }
- /**
- * @function SuperMap.DatasetInfo.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- * @returns {Object} JSON 对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- var dataObj = {};
- dataObj = Util.copyAttributes(dataObj, this);
- if (dataObj.bounds) {
- if (dataObj.bounds.toServerJSONObject) {
- dataObj.bounds = dataObj.bounds.toServerJSONObject();
- }
- }
- return dataObj;
- }
- }]);
- return DatasetInfo;
- }();
- SuperMap.DatasetInfo = DatasetInfo;
- ;// CONCATENATED MODULE: ./src/common/iServer/OverlayAnalystParameters.js
- function OverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function OverlayAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.OverlayAnalystParameters
- * @category iServer SpatialAnalyst OverlayAnalyst
- * @classdesc 叠加分析参数基类。数据集叠加分析参数和几何对象叠加分析参数均继承此基类。
- * @param {Object} options - 参数。
- */
- var OverlayAnalystParameters = /*#__PURE__*/function () {
- function OverlayAnalystParameters(options) {
- OverlayAnalystParameters_classCallCheck(this, OverlayAnalystParameters);
- /**
- * @member {SuperMap.OverlayOperationType} [SuperMap.OverlayAnalystParameters.prototype.operation=SuperMap.OverlayOperationType.UNION]
- * @description 指定叠加分析操作类型。
- */
- this.operation = OverlayOperationType.UNION;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.OverlayAnalystParameters";
- }
- /**
- * @function SuperMap.OverlayAnalystParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- OverlayAnalystParameters_createClass(OverlayAnalystParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.operation = null;
- }
- }]);
- return OverlayAnalystParameters;
- }();
- SuperMap.OverlayAnalystParameters = OverlayAnalystParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/DatasetOverlayAnalystParameters.js
- 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); }
- function DatasetOverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function DatasetOverlayAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetOverlayAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetOverlayAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function DatasetOverlayAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetOverlayAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function DatasetOverlayAnalystParameters_setPrototypeOf(o, p) { DatasetOverlayAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetOverlayAnalystParameters_setPrototypeOf(o, p); }
- 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); }; }
- function DatasetOverlayAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetOverlayAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return DatasetOverlayAnalystParameters_assertThisInitialized(self); }
- function DatasetOverlayAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function DatasetOverlayAnalystParameters_getPrototypeOf(o) { DatasetOverlayAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetOverlayAnalystParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.DatasetOverlayAnalystParameters
- * @category iServer SpatialAnalyst OverlayAnalyst
- * @classdesc 数据集叠加分析参数类。
- * @param {Object} options - 参数。
- * @param {string} options.operateDataset - 叠加分析中操作数据集的名称。
- * @param {string} options.sourceDataset - 叠加分析中源数据集的名称。
- * @param {Array.<string>} [options.operateDatasetFields] - 叠加分析中操作数据集保留在结果数据集中的字段名列表。
- * @param {SuperMap.FilterParameter} [options.operateDatasetFilter] - 设置操作数据集中空间对象过滤条件。
- * @param {Array.<SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon>} [options.operateRegions] - 操作面对象集合,表示与这些面对象进行叠加分析。与 operateDataset 参数互斥,冲突时以 operateDataset 为准。
- * @param {Array.<string>} [options.sourceDatasetFields] - 叠加分析中源数据集保留在结果数据集中的字段名列表。
- * @param {SuperMap.FilterParameter} [options.sourceDatasetFilter] - 设置源数据集中空间对象过滤条件。
- * @param {number} [options.tolerance=0] - 容限。
- * @param {SuperMap.OverlayOperationType} options.operation - 叠加操作枚举值。
- * @param {SuperMap.DataReturnOption} [options.resultSetting] - 结果返回设置类。
- * @extends {SuperMap.GetFeaturesParametersBase}
- */
- var DatasetOverlayAnalystParameters = /*#__PURE__*/function (_OverlayAnalystParame) {
- DatasetOverlayAnalystParameters_inherits(DatasetOverlayAnalystParameters, _OverlayAnalystParame);
- var _super = DatasetOverlayAnalystParameters_createSuper(DatasetOverlayAnalystParameters);
- function DatasetOverlayAnalystParameters(options) {
- var _this;
- DatasetOverlayAnalystParameters_classCallCheck(this, DatasetOverlayAnalystParameters);
- _this = _super.call(this, options);
- /**
- * @member {string} SuperMap.DatasetOverlayAnalystParameters.prototype.operateDataset
- * @description 叠加分析中操作数据集的名称。
- */
- _this.operateDataset = null;
- /**
- * @member {Array.<string>} [SuperMap.DatasetOverlayAnalystParameters.prototype.operateDatasetFields]
- * @description 叠加分析中操作数据集保留在结果数据集中的字段名列表。
- */
- _this.operateDatasetFields = [];
- /**
- * @member {SuperMap.FilterParameter} SuperMap.DatasetOverlayAnalystParameters.prototype.operateDatasetFilter
- * @description 设置操作数据集中空间对象过滤条件。
- */
- _this.operateDatasetFilter = new FilterParameter();
- /**
- * @member {Array.<SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon>} [SuperMap.DatasetOverlayAnalystParameters.prototype.operateRegions]
- * @description 操作面对象集合,表示与这些面对象进行叠加分析。与 operateDataset 参数互斥,冲突时以 operateDataset 为准。
- */
- _this.operateRegions = [];
- /**
- * @member {string} SuperMap.DatasetOverlayAnalystParameters.prototype.sourceDataset
- * @description 叠加分析中源数据集的名称。
- */
- _this.sourceDataset = null;
- /**
- * @member {Array.<string>} [SuperMap.DatasetOverlayAnalystParameters.prototype.sourceDatasetFields]
- * @description 叠加分析中源数据集保留在结果数据集中的字段名列表。
- */
- _this.sourceDatasetFields = [];
- /**
- * @member {SuperMap.FilterParameter} [SuperMap.DatasetOverlayAnalystParameters.prototype.filterQueryParameter]
- * @description 设置源数据集中空间对象过滤条件。
- */
- _this.sourceDatasetFilter = new FilterParameter();
- /**
- * @member {number} [SuperMap.DatasetOverlayAnalystParameters.prototype.tolerance=0]
- * @description 容限。
- */
- _this.tolerance = 0;
- /**
- * @member {SuperMap.DataReturnOption} [SuperMap.DatasetOverlayAnalystParameters.prototype.resultSetting]
- * @description 结果返回设置类。
- */
- _this.resultSetting = new DataReturnOption();
- Util.extend(DatasetOverlayAnalystParameters_assertThisInitialized(_this), options);
- _this.CLASS_NAME = "SuperMap.DatasetOverlayAnalystParameters";
- return _this;
- }
- /**
- * @function SuperMap.DatasetOverlayAnalystParameters.prototype.destroy
- * @override
- */
- DatasetOverlayAnalystParameters_createClass(DatasetOverlayAnalystParameters, [{
- key: "destroy",
- value: function destroy() {
- DatasetOverlayAnalystParameters_get(DatasetOverlayAnalystParameters_getPrototypeOf(DatasetOverlayAnalystParameters.prototype), "destroy", this).call(this);
- var me = this;
- me.operateDataset = null;
- me.operateDatasetFields = null;
- if (me.operateDatasetFilter) {
- me.operateDatasetFilter.destroy();
- me.operateDatasetFilter = null;
- }
- if (me.operateRegions) {
- for (var i = 0, opRegions = me.operateRegions, len = opRegions.length; i < len; i++) {
- opRegions[i].destroy();
- }
- me.operateRegions = null;
- }
- me.sourceDataset = null;
- me.sourceDatasetFields = null;
- if (me.sourceDatasetFilter) {
- me.sourceDatasetFilter.destroy();
- me.sourceDatasetFilter = null;
- }
- me.tolerance = null;
- if (me.resultSetting) {
- me.resultSetting.destroy();
- me.resultSetting = null;
- }
- }
- /**
- * @function SuperMap.DatasetOverlayAnalystParameters.toObject
- * @param {SuperMap.DatasetOverlayAnalystParameters} datasetOverlayAnalystParameters - 数据集叠加分析参数类。
- * @param {SuperMap.DatasetOverlayAnalystParameters} tempObj - 数据集叠加分析参数对象。
- * @description 将数据集叠加分析参数类转换为 JSON 对象。
- * @returns {Object} JSON 对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(datasetOverlayAnalystParameters, tempObj) {
- for (var name in datasetOverlayAnalystParameters) {
- if (name === "sourceDataset") {
- continue;
- } else if (name === "operateRegions") {
- tempObj.operateRegions = [];
- var ors = datasetOverlayAnalystParameters.operateRegions;
- for (var index in ors) {
- if (ors.hasOwnProperty(index)) {
- //icl542
- tempObj.operateRegions[index] = ServerGeometry.fromGeometry(ors[index]);
- }
- }
- } else if (name === "resultSetting") {
- tempObj.dataReturnOption = datasetOverlayAnalystParameters.resultSetting;
- } else {
- tempObj[name] = datasetOverlayAnalystParameters[name];
- }
- }
- }
- }]);
- return DatasetOverlayAnalystParameters;
- }(OverlayAnalystParameters);
- SuperMap.DatasetOverlayAnalystParameters = DatasetOverlayAnalystParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystParametersSetting.js
- function SurfaceAnalystParametersSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SurfaceAnalystParametersSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) SurfaceAnalystParametersSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) SurfaceAnalystParametersSetting_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.SurfaceAnalystParametersSetting
- * @category iServer SpatialAnalyst SurfaceAnalyst
- * @classdesc 表面分析参数设置类。
- * 通过该类可以设置表面分析提取等值线、提取等值面的一些参数,包括基准值、等值距、光滑度、光滑方法等。
- * @param {Object} options - 参数。
- * @param {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [options.clipRegion] - 获取或设置裁剪面对象,如果不需要对操作结果进行裁剪,可以使用 null 值取代该参数。
- * @param {number} [options.datumValue=0] - 获取或设置表面分析中提取等值线、提取等值面的基准值。
- * @param {Array.<number>} options.expectedZValues - 获取或设置期望分析结果的 Z 值集合。
- * @param {number} [options.interval=0] - 获取或设置等值距。等值距是两条等值线之间的间隔值。
- * @param {number} [options.resampleTolerance=0] - 获取或设置重采样容限。
- * @param {SuperMap.SmoothMethod} [options.smoothMethod=SuperMap.SmoothMethod.BSPLINE] - 获取或设置光滑处理所使用的方法。
- * @param {number} [options.smoothness=0] - 获取或设置表面分析中等值线或等值面的边界线的光滑度。
- */
- var SurfaceAnalystParametersSetting = /*#__PURE__*/function () {
- function SurfaceAnalystParametersSetting(options) {
- SurfaceAnalystParametersSetting_classCallCheck(this, SurfaceAnalystParametersSetting);
- /**
- * @member {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [SuperMap.SurfaceAnalystParametersSetting.prototype.clipRegion]
- * @description 获取或设置裁剪面对象,如果不需要对操作结果进行裁剪,可以使用 null 值取代该参数。
- */
- this.clipRegion = null;
- /**
- * @member {number} [SuperMap.SurfaceAnalystParametersSetting.prototype.datumValue=0]
- * @description 获取或设置表面分析中提取等值线、提取等值面的基准值。
- * 基准值是作为一个生成等值线的初始起算值,并不一定是最小等值线的值。 例如,高程范围为 220 -1550 的 DEM 栅格数据,
- * 如果设基准值为 0, 等值距为 50,则提取等值线时,以基准值 0 为起点,等值距 50 为间隔提取等值线,
- * 因为给定高程的最小值是 220,所以,在给定范围内提取等值线的最小高程是 250。
- * 提取等值线的结果是:最小等值线值为 250,最大等值线值为 1550。
- */
- this.datumValue = 0;
- /**
- * @member {Array.<number>} SuperMap.SurfaceAnalystParametersSetting.prototype.expectedZValues
- * @description 获取或设置期望分析结果的 Z 值集合。
- * Z 值集合存储一系列数值,该数值为待提取等值线的值。即仅高程值在 Z 值集合中的等值线会被提取。
- */
- this.expectedZValues = null;
- /**
- * @member {number} [SuperMap.SurfaceAnalystParametersSetting.prototype.interval=0]
- * @description 获取或设置等值距。等值距是两条等值线之间的间隔值。
- */
- this.interval = 0;
- /**
- * @member {number} [SuperMap.SurfaceAnalystParametersSetting.prototype.resampleTolerance=0]
- * @description 获取或设置重采样容限。
- * 容限值越大,采样结果数据越简化。当分析结果出现交叉时,可通过调整重采样容限为较小的值来处理。
- */
- this.resampleTolerance = 0;
- /**
- * @member {SuperMap.SmoothMethod} [SuperMap.SurfaceAnalystParametersSetting.prototype.smoothMethod=SuperMap.SmoothMethod.BSPLINE]
- * @description 获取或设置光滑处理所使用的方法。
- */
- this.smoothMethod = SmoothMethod.BSPLINE;
- /**
- * @member {number} [SuperMap.SurfaceAnalystParametersSetting.prototype.smoothness=0]
- * @description 获取或设置表面分析中等值线或等值面的边界线的光滑度。
- * 以为 0-5 为例,光滑度为 0 表示不进行光滑操作,值越大表示光滑度越高。
- * 随着光滑度的增加,提取的等值线越光滑.当然光滑度越大,
- * 计算所需的时间和占用的内存也就越大。而且,当等值距较小时,
- * 光滑度太高会出现等值线相交的问题。
- */
- this.smoothness = 0;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.SurfaceAnalystParametersSetting";
- }
- /**
- * @function SuperMap.SurfaceAnalystParametersSetting.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- SurfaceAnalystParametersSetting_createClass(SurfaceAnalystParametersSetting, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- if (me.clipRegion) {
- me.clipRegion.destroy();
- me.clipRegion = null;
- }
- me.datumValue = null;
- me.expectedZValues = null;
- me.interval = null;
- me.resampleTolerance = null;
- me.smoothMethod = null;
- me.smoothness = null;
- }
- /**
- * @function SuperMap.SurfaceAnalystParametersSetting.prototype.toJSON
- * @description 将对象转化为 JSON 字符串。
- * @returns {string} 对象 JSON 字符串。
- */
- }, {
- key: "toJSON",
- value: function toJSON() {
- var json = "'datumValue':" + Util.toJSON(this.datumValue);
- json += ",'interval':" + Util.toJSON(this.interval);
- json += ",'resampleTolerance':" + Util.toJSON(this.resampleTolerance);
- json += ",'smoothMethod':" + Util.toJSON(this.smoothMethod);
- json += ",'smoothness':" + Util.toJSON(this.smoothness);
- if (this.expectedZValues != null) {
- json += "," + "'expectedZValues':" + Util.toJSON(this.expectedZValues);
- }
- if (this.clipRegion != null) {
- var serverGeometry = this.clipRegion;
- if (this.clipRegion instanceof Geometry && this.clipRegion.components) {
- serverGeometry = ServerGeometry.fromGeometry(this.clipRegion);
- }
- json += ",'clipRegion':" + Util.toJSON(serverGeometry);
- }
- return "{" + json + "}";
- }
- }]);
- return SurfaceAnalystParametersSetting;
- }();
- SuperMap.SurfaceAnalystParametersSetting = SurfaceAnalystParametersSetting;
- ;// CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystParameters.js
- function SurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SurfaceAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SurfaceAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SurfaceAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.SurfaceAnalystParameters
- * @category iServer SpatialAnalyst SurfaceAnalyst
- * @classdesc 表面分析提取操作参数类。
- * @description 通过该类可以为进行表面分析提供参数信息,包括表面分析的方法提取等值线、提取等值面和中间结果的分辨率,
- * {@link SuperMap.DatasetSurfaceAnalystParameters} 和 {@link SuperMap.GeometrySurfaceAnalystParameters} 继承自该类。
- * @param {Object} options - 参数。
- * @param {SuperMap.SurfaceAnalystParametersSetting} options.extractParameter - 获取或设置表面分析参数。
- * @param {number} options.resolution - 指定中间结果(栅格数据集)的分辨率。
- * @param {SuperMap.DataReturnOption} options.resultSetting - 结果返回设置类。
- * @param {SuperMap.SurfaceAnalystMethod} [options.surfaceAnalystMethod=SuperMap.SurfaceAnalystMethod.ISOLINE] - 获取或设置表面分析的提取方法,提取等值线和提取等值面。
- */
- var SurfaceAnalystParameters = /*#__PURE__*/function () {
- function SurfaceAnalystParameters(options) {
- SurfaceAnalystParameters_classCallCheck(this, SurfaceAnalystParameters);
- /**
- * @member {number} SuperMap.SurfaceAnalystParameters.prototype.resolution
- * @description 获取或设置指定中间结果(栅格数据集)的分辨率。
- */
- this.resolution = 0;
- /**
- * @member {SuperMap.SurfaceAnalystParametersSetting} SuperMap.SurfaceAnalystParameters.prototype.extractParameter
- * @description 获取或设置表面分析参数。
- * 在进行点数据集进行提取等值面分析时,暂时不支持 SurfaceAnalystParametersSetting 类中的 expectedZValues 字段。
- */
- this.extractParameter = new SurfaceAnalystParametersSetting();
- /**
- * @member {SuperMap.DataReturnOption} SuperMap.SurfaceAnalystParameters.prototype.resultSetting
- * @description 结果返回设置类。
- */
- this.resultSetting = new DataReturnOption();
- /**
- * @member {SuperMap.SurfaceAnalystMethod} [SuperMap.SurfaceAnalystParameters.prototype.surfaceAnalystMethod=SuperMap.SurfaceAnalystMethod.ISOLINE]
- * @description 获取或设置表面分析的提取方法,提取等值线和提取等值面。
- */
- this.surfaceAnalystMethod = SurfaceAnalystMethod.ISOLINE;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.SurfaceAnalystParameters";
- }
- /**
- * @function SuperMap.SurfaceAnalystParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- SurfaceAnalystParameters_createClass(SurfaceAnalystParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.resolution = null;
- if (me.extractParameter) {
- me.extractParameter.destroy();
- me.extractParameter = null;
- }
- if (me.resultSetting) {
- me.resultSetting.destroy();
- me.resultSetting = null;
- }
- me.surfaceAnalystMethod = null;
- }
- }]);
- return SurfaceAnalystParameters;
- }();
- SuperMap.SurfaceAnalystParameters = SurfaceAnalystParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/DatasetSurfaceAnalystParameters.js
- 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); }
- function DatasetSurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function DatasetSurfaceAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetSurfaceAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetSurfaceAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function DatasetSurfaceAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetSurfaceAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function DatasetSurfaceAnalystParameters_setPrototypeOf(o, p) { DatasetSurfaceAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetSurfaceAnalystParameters_setPrototypeOf(o, p); }
- 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); }; }
- function DatasetSurfaceAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetSurfaceAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return DatasetSurfaceAnalystParameters_assertThisInitialized(self); }
- function DatasetSurfaceAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function DatasetSurfaceAnalystParameters_getPrototypeOf(o) { DatasetSurfaceAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetSurfaceAnalystParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.DatasetSurfaceAnalystParameters
- * @category iServer SpatialAnalyst SurfaceAnalyst
- * @classdesc 数据集表面分析参数类。该类对数据集表面分析所用到的参数进行设置。
- * @param {Object} options - 参数。
- * @param {string} options.dataset - 要用来做数据集表面分析的数据源中数据集的名称。
- * @param {string} options.zValueFieldName - 获取或设置用于提取操作的字段名称。
- * @param {integer} options.resolution - 获取或设置指定中间结果(栅格数据集)的分辨率。
- * @param {SuperMap.SurfaceAnalystParametersSetting} options.extractParameter - 表面分析参数设置类。获取或设置表面分析参数。
- * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 获取或设置查询过滤条件参数。
- * @param {SuperMap.DataReturnOption} [options.resultSetting] - 结果返回设置类。
- * @param {SuperMap.SurfaceAnalystMethod} [options.surfaceAnalystMethod=SuperMap.SurfaceAnalystMethod.ISOLINE] - 获取或设置表面分析的提取方法,提取等值线和提取等值面。
- * @extends {SuperMap.SurfaceAnalystParameters}
- */
- var DatasetSurfaceAnalystParameters = /*#__PURE__*/function (_SurfaceAnalystParame) {
- DatasetSurfaceAnalystParameters_inherits(DatasetSurfaceAnalystParameters, _SurfaceAnalystParame);
- var _super = DatasetSurfaceAnalystParameters_createSuper(DatasetSurfaceAnalystParameters);
- function DatasetSurfaceAnalystParameters(options) {
- var _this;
- DatasetSurfaceAnalystParameters_classCallCheck(this, DatasetSurfaceAnalystParameters);
- _this = _super.call(this, options);
- /**
- * @member {string} SuperMap.DatasetSurfaceAnalystParameters.prototype.dataset
- * @description 要用来做数据集表面分析的数据源中数据集的名称。该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:Country@World。
- */
- _this.dataset = null;
- /**
- * @member {SuperMap.FilterParameter} SuperMap.DatasetSurfaceAnalystParameters.prototype.filterQueryParameter
- * @description 获取或设置查询过滤条件参数。
- */
- _this.filterQueryParameter = new FilterParameter();
- /**
- * @member {string} SuperMap.DatasetSurfaceAnalystParameters.prototype.zValueFieldName
- * @description 获取或设置用于提取操作的字段名称。提取等值线时,将使用该字段中的值,对点记录集中的点数据进行插值分析,得到栅格数据集(中间结果),接着从栅格数据集提取等值线。
- */
- _this.zValueFieldName = null;
- if (options) {
- Util.extend(DatasetSurfaceAnalystParameters_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.DatasetSurfaceAnalystParameters";
- return _this;
- }
- /**
- * @function SuperMap.DatasetSurfaceAnalystParameters.prototype.destroy
- * @override
- */
- DatasetSurfaceAnalystParameters_createClass(DatasetSurfaceAnalystParameters, [{
- key: "destroy",
- value: function destroy() {
- DatasetSurfaceAnalystParameters_get(DatasetSurfaceAnalystParameters_getPrototypeOf(DatasetSurfaceAnalystParameters.prototype), "destroy", this).call(this);
- var me = this;
- me.dataset = null;
- if (me.filterQueryParameter) {
- me.filterQueryParameter.destroy();
- me.filterQueryParameter = null;
- }
- me.zValueFieldName = null;
- }
- /**
- * @function SuperMap.DatasetSurfaceAnalystParameters.toObject
- * @param {SuperMap.DatasetSurfaceAnalystParameters} datasetSurfaceAnalystParameters - 数据集表面分析参数类。
- * @param {SuperMap.DatasetSurfaceAnalystParameters} tempObj - 数据集表面分析参数对象。
- * @description 将数据集表面分析参数对象转换为 JSON 对象。
- * @returns JSON 对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(datasetSurfaceAnalystParameters, tempObj) {
- for (var name in datasetSurfaceAnalystParameters) {
- if (name === "filterQueryParameter") {
- tempObj.filterQueryParameter = datasetSurfaceAnalystParameters.filterQueryParameter;
- }
- if (name === "extractParameter") {
- if (datasetSurfaceAnalystParameters.extractParameter.clipRegion instanceof Geometry && datasetSurfaceAnalystParameters.extractParameter.clipRegion.components) {
- datasetSurfaceAnalystParameters.extractParameter.clipRegion = ServerGeometry.fromGeometry(datasetSurfaceAnalystParameters.extractParameter.clipRegion);
- }
- tempObj.extractParameter = datasetSurfaceAnalystParameters.extractParameter;
- } else if (name === "dataset") {
- continue;
- } else if (name === "surfaceAnalystMethod") {
- continue;
- } else {
- tempObj[name] = datasetSurfaceAnalystParameters[name];
- }
- }
- }
- }]);
- return DatasetSurfaceAnalystParameters;
- }(SurfaceAnalystParameters);
- SuperMap.DatasetSurfaceAnalystParameters = DatasetSurfaceAnalystParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThiessenAnalystParameters.js
- function ThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThiessenAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThiessenAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThiessenAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThiessenAnalystParameters
- * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
- * @classdesc 泰森多边形分析参数基类。
- * @param {Object} options - 参数。
- * @param {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [options.clipRegion] - 结果数据裁剪区域,可以为 null,表示不对结果进行裁剪。
- * @param {boolean} [options.createResultDataset=false] - 是否返回结果数据集。
- * @param {string} [options.resultDatasetName] - 指定结果数据集名称。
- * @param {string} [options.resultDatasourceName] - 指定结果数据集所在数据源,默认为当前数据源。
- * @param {boolean} [options.returnResultRegion=true] - 是否返回分析得到的多边形面数组。
- */
- var ThiessenAnalystParameters = /*#__PURE__*/function () {
- function ThiessenAnalystParameters(options) {
- ThiessenAnalystParameters_classCallCheck(this, ThiessenAnalystParameters);
- if (!options) {
- return;
- }
- /**
- * @member {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [SuperMap.ThiessenAnalystParameters.prototype.clipRegion]
- * @description 结果数据裁剪区域,可以为 null,表示不对结果进行裁剪。
- */
- this.clipRegion = null;
- /**
- * @member {boolean} [SuperMap.ThiessenAnalystParameters.prototype.createResultDataset=false]
- * @description 是否返回结果数据集。如果为 true,则必须设置属性 resultDatasetName 和 resultDatasourceName。
- */
- this.createResultDataset = false;
- /**
- * @member {string} SuperMap.ThiessenAnalystParameters.prototype.resultDatasetName
- * @description 指定结果数据集名称。
- */
- this.resultDatasetName = null;
- /**
- * @member {string} SuperMap.ThiessenAnalystParameters.prototype.resultDatasourceName
- * @description 指定结果数据集所在数据源。
- */
- this.resultDatasourceName = null;
- /**
- * @member {boolean} SuperMap.ThiessenAnalystParameters.prototype.returnResultRegion
- * @description 是否返回分析得到的多边形面数组。
- */
- this.returnResultRegion = true;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.ThiessenAnalystParameters";
- }
- /**
- * @function SuperMap.ThiessenAnalystParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThiessenAnalystParameters_createClass(ThiessenAnalystParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- if (me.clipRegion) {
- me.clipRegion.destroy();
- me.clipRegion = null;
- }
- me.createResultDataset = null;
- me.resultDatasetName = null;
- me.resultDatasourceName = null;
- me.returnResultRegion = null;
- }
- }]);
- return ThiessenAnalystParameters;
- }();
- SuperMap.ThiessenAnalystParameters = ThiessenAnalystParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/DatasetThiessenAnalystParameters.js
- 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); }
- function DatasetThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function DatasetThiessenAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetThiessenAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetThiessenAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function DatasetThiessenAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetThiessenAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function DatasetThiessenAnalystParameters_setPrototypeOf(o, p) { DatasetThiessenAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetThiessenAnalystParameters_setPrototypeOf(o, p); }
- 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); }; }
- function DatasetThiessenAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetThiessenAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return DatasetThiessenAnalystParameters_assertThisInitialized(self); }
- function DatasetThiessenAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function DatasetThiessenAnalystParameters_getPrototypeOf(o) { DatasetThiessenAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetThiessenAnalystParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.DatasetThiessenAnalystParameters
- * @category iServer SpatialAnalyst ThiessenAnalyst
- * @classdesc 数据集泰森多边形分析参数类。
- * @param {Object} options - 参数。
- * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 对待分析数据集中的点进行过滤,即对数据集中的所有点进行分析。
- * @extends {SuperMap.ThiessenAnalystParameters}
- */
- var DatasetThiessenAnalystParameters = /*#__PURE__*/function (_ThiessenAnalystParam) {
- DatasetThiessenAnalystParameters_inherits(DatasetThiessenAnalystParameters, _ThiessenAnalystParam);
- var _super = DatasetThiessenAnalystParameters_createSuper(DatasetThiessenAnalystParameters);
- function DatasetThiessenAnalystParameters(options) {
- var _this;
- DatasetThiessenAnalystParameters_classCallCheck(this, DatasetThiessenAnalystParameters);
- _this = _super.call(this, options);
- /**
- * @member {SuperMap.FilterParameter} [SuperMap.DatasetThiessenAnalystParameters.prototype.filterQueryParameter]
- * @description 过滤条件,对待分析数据集中的点进行过滤,即对数据集中的所有点进行分析。
- * @example
- * var filterQueryParameter = new SuperMap.FilterParameter({
- * name: "Countries@World",
- * attributeFilter: "SmID>100"
- * });
- */
- _this.filterQueryParameter = null;
- /**
- * @member {string} SuperMap.DatasetThiessenAnalystParameters.prototype.dataset
- * @description 数据集名称待分析的数据集名称,请使用 "datasetName@datasourceName" 格式来表示。
- */
- _this.dataset = null;
- if (options) {
- Util.extend(DatasetThiessenAnalystParameters_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.DatasetThiessenAnalystParameters";
- return _this;
- }
- /**
- * @function SuperMap.DatasetThiessenAnalystParameters.prototype.destroy
- * @override
- */
- DatasetThiessenAnalystParameters_createClass(DatasetThiessenAnalystParameters, [{
- key: "destroy",
- value: function destroy() {
- DatasetThiessenAnalystParameters_get(DatasetThiessenAnalystParameters_getPrototypeOf(DatasetThiessenAnalystParameters.prototype), "destroy", this).call(this);
- var me = this;
- if (me.filterQueryParameter) {
- me.filterQueryParameter.destroy();
- me.filterQueryParameter = null;
- }
- }
- /**
- * @function SuperMap.DatasetThiessenAnalystParameters.toObject
- * @param {SuperMap.DatasetThiessenAnalystParameters} datasetThiessenAnalystParameters - 泰森多边形分析服务参数类。
- * @param {SuperMap.DatasetThiessenAnalystParameters} tempObj - 泰森多边形分析服务参数对象。
- * @description 将泰森多边形分析服务参数对象转换为 JSON 对象。
- * @returns JSON 对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(datasetThiessenAnalystParameters, tempObj) {
- for (var name in datasetThiessenAnalystParameters) {
- if (name === "clipRegion") {
- tempObj.clipRegion = ServerGeometry.fromGeometry(datasetThiessenAnalystParameters.clipRegion);
- } else {
- tempObj[name] = datasetThiessenAnalystParameters[name];
- }
- }
- }
- }]);
- return DatasetThiessenAnalystParameters;
- }(ThiessenAnalystParameters);
- SuperMap.DatasetThiessenAnalystParameters = DatasetThiessenAnalystParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/DensityKernelAnalystParameters.js
- function DensityKernelAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function DensityKernelAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DensityKernelAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DensityKernelAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.DensityKernelAnalystParameters
- * @category iServer SpatialAnalyst DensityAnalyst
- * @classdesc 核密度分析参数类。
- * @param {Object} options - 参数。
- * @param {string} options.dataset - 要用来做核密度分析数据源中数据集的名称。该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:BaseMap_P@Jingjin。
- * @param {string} options.fieldName - 用于进行核密度分析的测量值的字段名称,核密度分析不支持文本类型的字段。
- * @param {string} options.resultGridName - 指定结果数据集名称。
- * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.bounds] - 核密度分析的范围,用于确定结果栅格数据集的范围。如果缺省,则默认为原数据集的范围。
- * @param {number} [options.searchRadius] - 栅格邻域内用于计算密度的查找半径,单位与当前数据集相同。默认值为当前数据集的长宽中的最大值除30。
- * @param {number} [options.resultGridDatasetResolution] - 密度分析结果栅格数据的分辨率,单位与当前数据集相同。默认值为当前数据集的长宽中的最小值除500。
- * @param {string} [options.targetDatasource] - 指定的存储结果数据集的数据源,默认为当前分析的数据集所在的数据源。
- * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
- */
- var DensityKernelAnalystParameters = /*#__PURE__*/function () {
- function DensityKernelAnalystParameters(options) {
- DensityKernelAnalystParameters_classCallCheck(this, DensityKernelAnalystParameters);
- /**
- * @member {string} SuperMap.DensityKernelAnalystParameters.prototype.dataset
- * @description 要用来做核密度分析数据源中数据集的名称。
- * 该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:Railway@Changchun。
- * 注:核密度分析支持点数据集和线数据集。
- */
- this.dataset = null;
- /**
- * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} [SuperMap.DensityKernelAnalystParameters.prototype.bounds]
- * @description 核密度分析的范围,用于确定结果栅格数据集的范围。
- * 如果缺省,则默认为原数据集的范围。
- */
- this.bounds = null;
- /**
- * @member {string} SuperMap.DensityKernelAnalystParameters.prototype.fieldName
- * @description 用于进行核密度分析的测量值的字段名称,核密度分析不支持文本类型的字段。
- */
- this.fieldName = null;
- /**
- * @member {number} [SuperMap.DensityKernelAnalystParameters.prototype.resultGridDatasetResolution]
- * @description 密度分析结果栅格数据的分辨率,单位与当前数据集相同。默认值为当前数据集的长宽中的最小值除500。
- */
- this.resultGridDatasetResolution = null;
- /**
- * @member {number} [SuperMap.DensityKernelAnalystParameters.prototype.searchRadius]
- * @description 栅格邻域内用于计算密度的查找半径,单位与当前数据集相同。默认值为当前数据集的长宽中的最大值除30。
- */
- this.searchRadius = null;
- /**
- * @member {string} [SuperMap.DensityKernelAnalystParameters.prototype.targetDatasource]
- * @description 指定的存储结果数据集的数据源,默认为当前分析的数据集所在的数据源。
- */
- this.targetDatasource = null;
- /**
- * @member {string} SuperMap.DensityKernelAnalystParameters.prototype.resultGridName
- * @description 指定结果数据集名称。
- */
- this.resultGridName = null;
- /**
- * @member {boolean} [SuperMap.DensityKernelAnalystParameters.prototype.deleteExistResultDataset=false]
- * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
- */
- this.deleteExistResultDataset = false;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.DensityKernelAnalystParameters";
- }
- /**
- * @function SuperMap.DensityKernelAnalystParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- DensityKernelAnalystParameters_createClass(DensityKernelAnalystParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.dataset = null;
- me.bounds = null;
- me.fieldName = null;
- me.resultGridDatasetResolution = null;
- me.searchRadius = null;
- me.targetDatasource = null;
- me.resultGridName = null;
- me.deleteExistResultDataset = null;
- }
- /**
- * @function SuperMap.DensityKernelAnalystParameters.toObject
- * @param {SuperMap.DensityKernelAnalystParameters} densityKernelAnalystParameters -核密度分析参数类。
- * @param {SuperMap.DensityKernelAnalystParameters} tempObj - 核密度分析参数对象。
- * @description 将核密度分析参数对象转换成 JSON 对象。
- * @returns JSON 对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(densityKernelAnalystParameters, tempObj) {
- for (var name in densityKernelAnalystParameters) {
- if (name !== "dataset") {
- tempObj[name] = densityKernelAnalystParameters[name];
- }
- }
- }
- }]);
- return DensityKernelAnalystParameters;
- }();
- SuperMap.DensityKernelAnalystParameters = DensityKernelAnalystParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/DensityAnalystService.js
- 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); }
- function DensityAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function DensityAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) DensityAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) DensityAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function DensityAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DensityAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function DensityAnalystService_setPrototypeOf(o, p) { DensityAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DensityAnalystService_setPrototypeOf(o, p); }
- 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); }; }
- function DensityAnalystService_possibleConstructorReturn(self, call) { if (call && (DensityAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return DensityAnalystService_assertThisInitialized(self); }
- function DensityAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function DensityAnalystService_getPrototypeOf(o) { DensityAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DensityAnalystService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.DensityAnalystService
- * @category iServer SpatialAnalyst DensityAnalyst
- * @classdesc
- * 密度分析服务类,密度分析可计算每个输出栅格像元周围圆形邻域内输入的点或线对象的密度。
- * 密度分析,在某种意义上来说,相当于在表面上将输入的点线对象的测量值散开来,将每个点或线对象的测量量分布在整个研究区域,并计算输出栅格中每个像元的密度值。目前提供1种密度分析:核密度分析(Kernel)。
- * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst 。
- * @param {Object} options - 参数。</br>
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {SuperMap.SpatialAnalystBase}
- * @example 例如:
- * var myDensityAnalystService = new SuperMap.DensityAnalystService(url);
- * myDensityAnalystService.on({
- * "processCompleted": processCompleted,
- * "processFailed": processFailed
- * }
- * );
- */
- var DensityAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
- DensityAnalystService_inherits(DensityAnalystService, _SpatialAnalystBase);
- var _super = DensityAnalystService_createSuper(DensityAnalystService);
- function DensityAnalystService(url, options) {
- var _this;
- DensityAnalystService_classCallCheck(this, DensityAnalystService);
- _this = _super.call(this, url, options);
- /**
- * @member {string} SuperMap.DensityAnalystService.prototype.mode
- * @description 密度分析类型。
- */
- _this.mode = null;
- if (options) {
- Util.extend(DensityAnalystService_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.DensityAnalystService";
- return _this;
- }
- /**
- * @function SuperMap.DensityAnalystService.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- DensityAnalystService_createClass(DensityAnalystService, [{
- key: "destroy",
- value: function destroy() {
- DensityAnalystService_get(DensityAnalystService_getPrototypeOf(DensityAnalystService.prototype), "destroy", this).call(this);
- this.mode = null;
- }
- /**
- * @function SuperMap.DensityAnalystService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.DensityKernelAnalystParameters} parameter - 核密度分析参数。
- */
- }, {
- key: "processAsync",
- value: function processAsync(parameter) {
- var me = this;
- var parameterObject = new Object();
- if (parameter instanceof DensityKernelAnalystParameters) {
- me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/densityanalyst/kernel');
- me.mode = "kernel";
- }
- DensityKernelAnalystParameters.toObject(parameter, parameterObject);
- var jsonParameters = Util.toJSON(parameterObject);
- me.url = Util.urlAppend(me.url, 'returnContent=true');
- me.request({
- method: "POST",
- data: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return DensityAnalystService;
- }(SpatialAnalystBase);
- SuperMap.DensityAnalystService = DensityAnalystService;
- ;// CONCATENATED MODULE: ./src/common/iServer/EditFeaturesParameters.js
- function EditFeaturesParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function EditFeaturesParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) EditFeaturesParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) EditFeaturesParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.EditFeaturesParameters
- * @category iServer Data Feature
- * @classdesc 数据服务中数据集添加、修改、删除参数类。
- * @category iServer Data
- * @param {Object} options - 参数。
- * @param {Array.<SuperMap.Feature.Vector|GeoJSONObject|ol.feature>} options.features - 当前需要创建或者是修改的要素集。
- * @param {boolean} [options.returnContent=false] - 是返回创建要素的 ID 数组还是返回 featureResult 资源的 URI。
- * @param {SuperMap.EditType} [options.editType=SuperMap.EditType.ADD] - POST 动作类型 (ADD、UPDATE、DELETE)。
- * @param {Array.<string|integer>} [options.IDs] - 删除要素时的要素的 ID 数组。
- */
- var EditFeaturesParameters = /*#__PURE__*/function () {
- function EditFeaturesParameters(options) {
- EditFeaturesParameters_classCallCheck(this, EditFeaturesParameters);
- /**
- * @member {string} SuperMap.EditFeaturesParameters.prototype.dataSourceName
- * @description 当前需要创建或者是修改的要素的数据源。
- */
- this.dataSourceName = null;
- /**
- * @member {string} SuperMap.EditFeaturesParameters.prototype.dataSetName
- * @description 当前需要创建或者是修改的要素的数据集。
- */
- this.dataSetName = null;
- /**
- * @member {Array.<SuperMap.Feature.Vector|GeoJSONObject|ol.feature>} SuperMap.EditFeaturesParameters.prototype.features
- * @description 当前需要创建或者是修改的要素集。
- */
- this.features = null;
- /**
- * @member {SuperMap.EditType} [SuperMap.EditFeaturesParameters.prototype.editType=SuperMap.EditType.ADD]
- * @description 要素集更新类型 (add、update、delete)。
- */
- this.editType = EditType.ADD;
- /**
- * @member {Array.<string|number>} [SuperMap.EditFeaturesParameters.prototype.IDs]
- * @description 执行删除时要素集 ID 集合。
- */
- this.IDs = null;
- /**
- * @member {boolean} [SuperMap.EditFeaturesParameters.prototype.returnContent=false]
- * @description 要素添加时,isUseBatch 不传或传为 false 的情况下有效。
- * true 表示直接返回新创建的要素的 ID 数组;false 表示返回创建的 featureResult 资源的 URI。
- */
- this.returnContent = false;
- /**
- * @member {boolean} [SuperMap.EditFeaturesParameters.prototype.isUseBatch=false]
- * @description 是否使用批量添加要素功能,要素添加时有效。批量添加能够提高要素编辑效率。true 表示批量添加;false 表示不使用批量添加。
- */
- this.isUseBatch = false;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.EditFeaturesParameters";
- }
- /**
- * @function SuperMap.EditFeaturesParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- EditFeaturesParameters_createClass(EditFeaturesParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.dataSourceName = null;
- me.dataSetName = null;
- me.features = null;
- me.editType = null;
- me.IDs = null;
- me.returnContent = null;
- }
- /**
- * @function SuperMap.EditFeaturesParameters.prototype.toJsonParameters
- * @description 将 EditFeaturesParameters 对象参数转换为 JSON 字符串。
- * @param {SuperMap.EditFeaturesParameters} params - 地物编辑参数。
- * @returns {string} JSON 字符串。
- */
- }], [{
- key: "toJsonParameters",
- value: function toJsonParameters(params) {
- var feature,
- len,
- features,
- editType = params.editType;
- if (editType === EditType.DELETE) {
- if (params.IDs === null) {
- return;
- }
- features = {
- ids: params.IDs
- };
- } else {
- features = [];
- if (params.features) {
- len = params.features.length;
- for (var i = 0; i < len; i++) {
- feature = params.features[i];
- feature.geometry = ServerGeometry.fromGeometry(feature.geometry);
- features.push(feature);
- }
- }
- }
- return Util.toJSON(features);
- }
- }]);
- return EditFeaturesParameters;
- }();
- SuperMap.EditFeaturesParameters = EditFeaturesParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/EditFeaturesService.js
- 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); }
- function EditFeaturesService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function EditFeaturesService_createClass(Constructor, protoProps, staticProps) { if (protoProps) EditFeaturesService_defineProperties(Constructor.prototype, protoProps); if (staticProps) EditFeaturesService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function EditFeaturesService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = EditFeaturesService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function EditFeaturesService_setPrototypeOf(o, p) { EditFeaturesService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return EditFeaturesService_setPrototypeOf(o, p); }
- 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); }; }
- function EditFeaturesService_possibleConstructorReturn(self, call) { if (call && (EditFeaturesService_typeof(call) === "object" || typeof call === "function")) { return call; } return EditFeaturesService_assertThisInitialized(self); }
- function EditFeaturesService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function EditFeaturesService_getPrototypeOf(o) { EditFeaturesService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return EditFeaturesService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.EditFeaturesService
- * @category iServer Data Feature
- * @classdesc 数据服务中数据集添加、更新、删除服务类。
- * @extends {SuperMap.CommonServiceBase}
- * @param {string} url - 服务端的数据服务资源地址。请求数据服务中数据集编辑服务,URL 应为:</br>
- * http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/datasources/name/{数据源名}/datasets/name/{数据集名} 。</br>
- * 例如:http://localhost:8090/iserver/services/data-jingjin/rest/data/datasources/name/Jingjin/datasets/name/Landuse_R
- * @param {Object} options - 参数。</br>
- * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [format] -查询结果返回格式,目前支持iServerJSON 和GeoJSON两种格式。参数格式为"ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @example
- * var myService = new SuperMap.EditFeaturesService(url, {eventListeners: {
- * "processCompleted": editFeatureCompleted,
- * "processFailed": editFeatureError
- * }
- * };
- *
- */
- var EditFeaturesService = /*#__PURE__*/function (_CommonServiceBase) {
- EditFeaturesService_inherits(EditFeaturesService, _CommonServiceBase);
- var _super = EditFeaturesService_createSuper(EditFeaturesService);
- function EditFeaturesService(url, options) {
- var _this;
- EditFeaturesService_classCallCheck(this, EditFeaturesService);
- _this = _super.call(this, url, options);
- /**
- * @member {boolean} [SuperMap.EditFeaturesService.prototype.returnContent=false]
- * @description要素添加时,isUseBatch 不传或传为 false 的情况下有效。true 表示直接返回新创建的要素的 ID 数组;false 表示返回创建的 featureResult 资源的 URI。
- */
- _this.returnContent = false;
- /**
- * @member {boolean} [SuperMap.EditFeaturesService.prototype.isUseBatch=false]
- * @description 是否使用批量添加要素功能,要素添加时有效。
- * 批量添加能够提高要素编辑效率。
- * true 表示批量添加;false 表示不使用批量添加。
- */
- _this.isUseBatch = false;
- if (options) {
- Util.extend(EditFeaturesService_assertThisInitialized(_this), options);
- }
- _this.url = Util.urlPathAppend(_this.url, 'features');
- _this.CLASS_NAME = "SuperMap.EditFeaturesService";
- return _this;
- }
- /**
- * @function SuperMap.EditFeaturesService.prototype.destroy
- * @override
- */
- EditFeaturesService_createClass(EditFeaturesService, [{
- key: "destroy",
- value: function destroy() {
- EditFeaturesService_get(EditFeaturesService_getPrototypeOf(EditFeaturesService.prototype), "destroy", this).call(this);
- var me = this;
- me.returnContent = null;
- me.isUseBatch = null;
- me.fromIndex = null;
- me.toIndex = null;
- }
- /**
- * @function SuperMap.EditFeaturesService.prototype.processAsync
- * @description 负责将客户端的更新参数传递到服务端。
- * @param {SuperMap.EditFeaturesParameters} params - 编辑要素参数。
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof EditFeaturesParameters)) {
- return;
- }
- var me = this,
- method = "POST",
- ids = "",
- editType = params.editType,
- jsonParameters = null;
- me.returnContent = params.returnContent;
- me.isUseBatch = params.isUseBatch;
- jsonParameters = EditFeaturesParameters.toJsonParameters(params);
- if (editType === EditType.DELETE) {
- ids = Util.toJSON(params.IDs);
- me.url = Util.urlAppend(me.url, "ids=" + ids);
- method = "DELETE";
- jsonParameters = ids;
- } else if (editType === EditType.UPDATE) {
- method = "PUT";
- } else {
- if (me.isUseBatch) {
- me.url = Util.urlAppend(me.url, "isUseBatch=".concat(me.isUseBatch));
- me.returnContent = false;
- }
- if (me.returnContent) {
- me.url = Util.urlAppend(me.url, 'returnContent=true');
- method = "POST";
- }
- }
- me.request({
- method: method,
- data: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return EditFeaturesService;
- }(CommonServiceBase);
- SuperMap.EditFeaturesService = EditFeaturesService;
- ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalyst3DParameters.js
- function FacilityAnalyst3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FacilityAnalyst3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalyst3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalyst3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FacilityAnalyst3DParameters
- * @category iServer FacilityAnalyst3D
- * @classdesc 最近设施分析参数基类。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
- * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在 10 分钟内能到达的最近医院,
- * 超过 10 分钟能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起
- * 作用的障碍边、障碍点、转向表、耗费等属性在最近设施分析时同样可设置。
- * @param {Object} options - 参数。
- * @param {string} options.weightName - 指定的权值字段信息对象的名称。
- * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
- * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
- * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
- * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
- */
- var FacilityAnalyst3DParameters = /*#__PURE__*/function () {
- function FacilityAnalyst3DParameters(options) {
- FacilityAnalyst3DParameters_classCallCheck(this, FacilityAnalyst3DParameters);
- /**
- * @member {number} [SuperMap.FacilityAnalyst3DParameters.prototype.edgeID]
- * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
- */
- this.edgeID = null;
- /**
- * @member {number} [SuperMap.FacilityAnalyst3DParameters.prototype.nodeID]
- * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
- */
- this.nodeID = null;
- /**
- * @member {string} SuperMap.FacilityAnalyst3DParameters.prototype.weightName
- * @description 指定的权值字段信息对象的名称。
- */
- this.weightName = null;
- /**
- * @member {boolean} [SuperMap.FacilityAnalyst3DParameters.prototype.isUncertainDirectionValid=false]
- * @description 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
- * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找
- */
- this.isUncertainDirectionValid = false;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.FacilityAnalyst3DParameters";
- }
- /**
- * @function SuperMap.FacilityAnalyst3DParameters.prototype.destroy
- * @override
- */
- FacilityAnalyst3DParameters_createClass(FacilityAnalyst3DParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.edgeID = null;
- me.nodeID = null;
- me.weightName = null;
- me.isUncertainDirectionValid = null;
- }
- }]);
- return FacilityAnalyst3DParameters;
- }();
- SuperMap.FacilityAnalyst3DParameters = FacilityAnalyst3DParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSinks3DParameters.js
- 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); }
- function FacilityAnalystSinks3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FacilityAnalystSinks3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSinks3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSinks3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function FacilityAnalystSinks3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSinks3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function FacilityAnalystSinks3DParameters_setPrototypeOf(o, p) { FacilityAnalystSinks3DParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSinks3DParameters_setPrototypeOf(o, p); }
- 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); }; }
- function FacilityAnalystSinks3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSinks3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystSinks3DParameters_assertThisInitialized(self); }
- function FacilityAnalystSinks3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function FacilityAnalystSinks3DParameters_getPrototypeOf(o) { FacilityAnalystSinks3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSinks3DParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FacilityAnalystSinks3DParameters
- * @category iServer FacilityAnalyst3D Sinks
- * @classdesc 最近设施分析参数类(汇查找资源)。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
- * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在10分钟内能到达的最近医院,超过10分钟
- * 能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起作用的障碍边、障碍点、
- * 转向表、耗费等属性在最近设施分析时同样可设置。
- * @extends {SuperMap.FacilityAnalyst3DParameters}
- * @param {Object} options - 参数。
- * @param {string} options.weightName - 指定的权值字段信息对象的名称。
- * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
- * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
- * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
- * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
- */
- var FacilityAnalystSinks3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
- FacilityAnalystSinks3DParameters_inherits(FacilityAnalystSinks3DParameters, _FacilityAnalyst3DPar);
- var _super = FacilityAnalystSinks3DParameters_createSuper(FacilityAnalystSinks3DParameters);
- function FacilityAnalystSinks3DParameters(options) {
- var _this;
- FacilityAnalystSinks3DParameters_classCallCheck(this, FacilityAnalystSinks3DParameters);
- _this = _super.call(this, options);
- _this.CLASS_NAME = "SuperMap.FacilityAnalystSinks3DParameters";
- return _this;
- }
- /**
- * @function SuperMap.FacilityAnalystSinks3DParameters.prototype.destroy
- * @override
- */
- FacilityAnalystSinks3DParameters_createClass(FacilityAnalystSinks3DParameters, [{
- key: "destroy",
- value: function destroy() {
- FacilityAnalystSinks3DParameters_get(FacilityAnalystSinks3DParameters_getPrototypeOf(FacilityAnalystSinks3DParameters.prototype), "destroy", this).call(this);
- }
- }]);
- return FacilityAnalystSinks3DParameters;
- }(FacilityAnalyst3DParameters);
- SuperMap.FacilityAnalystSinks3DParameters = FacilityAnalystSinks3DParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSinks3DService.js
- 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); }
- function FacilityAnalystSinks3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FacilityAnalystSinks3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSinks3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSinks3DService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function FacilityAnalystSinks3DService_setPrototypeOf(o, p) { FacilityAnalystSinks3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSinks3DService_setPrototypeOf(o, p); }
- 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); }; }
- function FacilityAnalystSinks3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSinks3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystSinks3DService_assertThisInitialized(self); }
- function FacilityAnalystSinks3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function FacilityAnalystSinks3DService_getPrototypeOf(o) { FacilityAnalystSinks3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSinks3DService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FacilityAnalystSinks3DService
- * @category iServer FacilityAnalyst3D Sinks
- * @classdesc 最近设施分析服务类(汇查找资源)<br>
- * 最近设施分析是指在网络上给定一个事件点和一组设施点,
- * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
- * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
- * 最近设施分析结果通过该类支持的事件的监听函数参数获取
- * @extends {SuperMap.CommonServiceBase}
- * @example
- * var myFacilityAnalystSinks3DService = new SuperMap.FacilityAnalystSinks3DService(url, {
- * eventListeners: {
- * "processCompleted": facilityAnalystSinks3DCompleted,
- * "processFailed": facilityAnalystSinks3DError
- * }
- * });
- * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:<br>
- * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};<br>
- * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。<br>
- * @param {Object} options - 参数。<br>
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var FacilityAnalystSinks3DService = /*#__PURE__*/function (_CommonServiceBase) {
- FacilityAnalystSinks3DService_inherits(FacilityAnalystSinks3DService, _CommonServiceBase);
- var _super = FacilityAnalystSinks3DService_createSuper(FacilityAnalystSinks3DService);
- function FacilityAnalystSinks3DService(url, options) {
- var _this;
- FacilityAnalystSinks3DService_classCallCheck(this, FacilityAnalystSinks3DService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.FacilityAnalystSinks3DService";
- return _this;
- }
- /**
- * @function SuperMap.FacilityAnalystSinks3DService.prototype.destroy
- * @override
- */
- FacilityAnalystSinks3DService_createClass(FacilityAnalystSinks3DService, [{
- key: "destroy",
- value: function destroy() {
- CommonServiceBase.prototype.destroy.apply(this, arguments);
- }
- /**
- * @function SuperMap.FacilityAnalystSinks3DService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.FacilityAnalystSinks3DParameters} params - 最近设施分析参数类(汇查找资源)
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof FacilityAnalystSinks3DParameters)) {
- return;
- }
- var me = this,
- jsonObject;
- me.url = Util.urlPathAppend(me.url, 'sinks');
- jsonObject = {
- edgeID: params.edgeID,
- nodeID: params.nodeID,
- weightName: params.weightName,
- isUncertainDirectionValid: params.isUncertainDirectionValid
- };
- me.request({
- method: "GET",
- params: jsonObject,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return FacilityAnalystSinks3DService;
- }(CommonServiceBase);
- SuperMap.FacilityAnalystSinks3DService = FacilityAnalystSinks3DService;
- ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSources3DParameters.js
- 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); }
- function FacilityAnalystSources3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FacilityAnalystSources3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSources3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSources3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function FacilityAnalystSources3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSources3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function FacilityAnalystSources3DParameters_setPrototypeOf(o, p) { FacilityAnalystSources3DParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSources3DParameters_setPrototypeOf(o, p); }
- 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); }; }
- function FacilityAnalystSources3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSources3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystSources3DParameters_assertThisInitialized(self); }
- function FacilityAnalystSources3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function FacilityAnalystSources3DParameters_getPrototypeOf(o) { FacilityAnalystSources3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSources3DParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FacilityAnalystSources3DParameters
- * @category iServer FacilityAnalyst3D Sources
- * @classdesc 最近设施分析参数类(源查找资源)。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
- * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在10分钟内能到达的最近医院,超过10分
- * 钟能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起作用的障碍边、障碍
- * 点、转向表、耗费等属性在最近设施分析时同样可设置。
- * @extends {SuperMap.FacilityAnalyst3DParameters}
- * @param {Object} options - 参数。
- * @param {string} options.weightName - 指定的权值字段信息对象的名称。
- * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
- * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
- * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
- * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
- */
- var FacilityAnalystSources3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
- FacilityAnalystSources3DParameters_inherits(FacilityAnalystSources3DParameters, _FacilityAnalyst3DPar);
- var _super = FacilityAnalystSources3DParameters_createSuper(FacilityAnalystSources3DParameters);
- function FacilityAnalystSources3DParameters(options) {
- var _this;
- FacilityAnalystSources3DParameters_classCallCheck(this, FacilityAnalystSources3DParameters);
- _this = _super.call(this, options);
- _this.CLASS_NAME = "SuperMap.FacilityAnalystSources3DParameters";
- return _this;
- }
- /**
- * @function SuperMap.FacilityAnalystSources3DParameters.prototype.destroy
- * @override
- */
- FacilityAnalystSources3DParameters_createClass(FacilityAnalystSources3DParameters, [{
- key: "destroy",
- value: function destroy() {
- FacilityAnalystSources3DParameters_get(FacilityAnalystSources3DParameters_getPrototypeOf(FacilityAnalystSources3DParameters.prototype), "destroy", this).call(this);
- }
- }]);
- return FacilityAnalystSources3DParameters;
- }(FacilityAnalyst3DParameters);
- SuperMap.FacilityAnalystSources3DParameters = FacilityAnalystSources3DParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSources3DService.js
- 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); }
- function FacilityAnalystSources3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FacilityAnalystSources3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSources3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSources3DService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function FacilityAnalystSources3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSources3DService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function FacilityAnalystSources3DService_setPrototypeOf(o, p) { FacilityAnalystSources3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSources3DService_setPrototypeOf(o, p); }
- 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); }; }
- function FacilityAnalystSources3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSources3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystSources3DService_assertThisInitialized(self); }
- function FacilityAnalystSources3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function FacilityAnalystSources3DService_getPrototypeOf(o) { FacilityAnalystSources3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSources3DService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FacilityAnalystSources3DService
- * @category iServer FacilityAnalyst3D Sources
- * @classdesc 最近设施分析服务类(源查找资源)
- * 最近设施分析是指在网络上给定一个事件点和一组设施点,
- * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
- * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
- * 最近设施分析结果通过该类支持的事件的监听函数参数获取。
- * @extends {SuperMap.CommonServiceBase}
- * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
- * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
- * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var FacilityAnalystSources3DService = /*#__PURE__*/function (_CommonServiceBase) {
- FacilityAnalystSources3DService_inherits(FacilityAnalystSources3DService, _CommonServiceBase);
- var _super = FacilityAnalystSources3DService_createSuper(FacilityAnalystSources3DService);
- function FacilityAnalystSources3DService(url, options) {
- var _this;
- FacilityAnalystSources3DService_classCallCheck(this, FacilityAnalystSources3DService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.FacilityAnalystSources3DService";
- return _this;
- }
- /**
- * @function SuperMap.FacilityAnalystSources3DService.prototype.destroy
- * @override
- */
- FacilityAnalystSources3DService_createClass(FacilityAnalystSources3DService, [{
- key: "destroy",
- value: function destroy() {
- FacilityAnalystSources3DService_get(FacilityAnalystSources3DService_getPrototypeOf(FacilityAnalystSources3DService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.FacilityAnalystSources3DService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.FacilityAnalystSources3DParameters} params - 最近设施分析参数类(源查找资源)
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof FacilityAnalystSources3DParameters)) {
- return;
- }
- var me = this,
- jsonObject;
- me.url = Util.urlPathAppend(me.url, 'sources');
- jsonObject = {
- edgeID: params.edgeID,
- nodeID: params.nodeID,
- weightName: params.weightName,
- isUncertainDirectionValid: params.isUncertainDirectionValid
- };
- me.request({
- method: "GET",
- params: jsonObject,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return FacilityAnalystSources3DService;
- }(CommonServiceBase);
- SuperMap.FacilityAnalystSources3DService = FacilityAnalystSources3DService;
- ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystStreamParameters.js
- function FacilityAnalystStreamParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FacilityAnalystStreamParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystStreamParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystStreamParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FacilityAnalystStreamParameters
- * @category iServer NetworkAnalyst UpstreamCriticalFacilities
- * @classdesc 上游/下游关键设施查找资源参数类。
- * @param {Object} options - 参数。
- * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
- * @param {number} options.queryType - 分析类型,只能是 0 (上游关键设施查询) 或者是 1(下游关键设施查询)。
- * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
- * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
- * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。
- */
- var FacilityAnalystStreamParameters = /*#__PURE__*/function () {
- function FacilityAnalystStreamParameters(options) {
- FacilityAnalystStreamParameters_classCallCheck(this, FacilityAnalystStreamParameters);
- /**
- * @member {Array.<number>} [SuperMap.FacilityAnalystStreamParameters.prototype.sourceNodeIDs]
- * @description 指定的设施点 ID 数组。
- */
- this.sourceNodeIDs = null;
- /**
- * @member {number} [SuperMap.FacilityAnalystStreamParameters.prototype.edgeID]
- * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
- */
- this.edgeID = null;
- /**
- * @member {number} [SuperMap.FacilityAnalystStreamParameters.prototype.nodeID]
- * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
- */
- this.nodeID = null;
- /**
- * @member {boolean} [SuperMap.FacilityAnalystStreamParameters.prototype.isUncertainDirectionValid=false]
- * @description 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
- * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
- */
- this.isUncertainDirectionValid = false;
- /**
- * @member {number} SuperMap.FacilityAnalystStreamParameters.prototype.queryType
- * @description 分析类型,只能是 0 (上游关键设施查询) 或者是 1(下游关键设施查询)。
- */
- this.queryType = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.FacilityAnalystStreamParameters";
- }
- /**
- * @function SuperMap.FacilityAnalystStreamParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- FacilityAnalystStreamParameters_createClass(FacilityAnalystStreamParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.edgeID = null;
- me.nodeID = null;
- me.weightName = null;
- me.isUncertainDirectionValid = null;
- me.type = null;
- }
- }]);
- return FacilityAnalystStreamParameters;
- }();
- SuperMap.FacilityAnalystStreamParameters = FacilityAnalystStreamParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystStreamService.js
- 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); }
- function FacilityAnalystStreamService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FacilityAnalystStreamService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystStreamService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystStreamService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function FacilityAnalystStreamService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystStreamService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function FacilityAnalystStreamService_setPrototypeOf(o, p) { FacilityAnalystStreamService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystStreamService_setPrototypeOf(o, p); }
- 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); }; }
- function FacilityAnalystStreamService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystStreamService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystStreamService_assertThisInitialized(self); }
- function FacilityAnalystStreamService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function FacilityAnalystStreamService_getPrototypeOf(o) { FacilityAnalystStreamService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystStreamService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FacilityAnalystStreamService
- * @category iServer NetworkAnalyst UpstreamCriticalFacilities
- * @classdesc 上游/下游 关键设施查找资源服务类;即查找给定弧段或节点的上游/下游中的关键设施结点,返回关键结点 ID 数组及其下游弧段 ID 数组。
- * @extends SuperMap.NetworkAnalystServiceBase
- * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
- * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
- * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet";
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var FacilityAnalystStreamService = /*#__PURE__*/function (_NetworkAnalystServic) {
- FacilityAnalystStreamService_inherits(FacilityAnalystStreamService, _NetworkAnalystServic);
- var _super = FacilityAnalystStreamService_createSuper(FacilityAnalystStreamService);
- function FacilityAnalystStreamService(url, options) {
- var _this;
- FacilityAnalystStreamService_classCallCheck(this, FacilityAnalystStreamService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.FacilityAnalystStreamService";
- return _this;
- }
- /**
- * @function SuperMap.FacilityAnalystStreamService.prototype.destroy
- * @override
- */
- FacilityAnalystStreamService_createClass(FacilityAnalystStreamService, [{
- key: "destroy",
- value: function destroy() {
- FacilityAnalystStreamService_get(FacilityAnalystStreamService_getPrototypeOf(FacilityAnalystStreamService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.FacilityAnalystStreamService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.FacilityAnalystStreamParameters} params - 上游/下游关键设施查找资源参数类。
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof FacilityAnalystStreamParameters)) {
- return;
- }
- var me = this,
- jsonObject; //URL 通过参数类型来判断是 上游 还是下游 查询
- if (params.queryType === 0) {
- me.url = Util.urlPathAppend(me.url, 'upstreamcirticalfaclilities');
- } else if (params.queryType === 1) {
- me.url = Util.urlPathAppend(me.url, 'downstreamcirticalfaclilities');
- } else {
- return;
- }
- jsonObject = {
- sourceNodeIDs: params.sourceNodeIDs,
- isUncertainDirectionValid: params.isUncertainDirectionValid
- };
- if (params.edgeID !== null && params.nodeID !== null) {
- return;
- }
- if (params.edgeID === null && params.nodeID === null) {
- return;
- }
- if (params.edgeID !== null) {
- jsonObject.edgeID = params.edgeID;
- } else {
- jsonObject.nodeID = params.nodeID;
- }
- me.request({
- method: "GET",
- params: jsonObject,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return FacilityAnalystStreamService;
- }(NetworkAnalystServiceBase);
- SuperMap.FacilityAnalystStreamService = FacilityAnalystStreamService;
- ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTracedown3DParameters.js
- 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); }
- function FacilityAnalystTracedown3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FacilityAnalystTracedown3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTracedown3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTracedown3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function FacilityAnalystTracedown3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTracedown3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function FacilityAnalystTracedown3DParameters_setPrototypeOf(o, p) { FacilityAnalystTracedown3DParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTracedown3DParameters_setPrototypeOf(o, p); }
- 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); }; }
- function FacilityAnalystTracedown3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTracedown3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystTracedown3DParameters_assertThisInitialized(self); }
- function FacilityAnalystTracedown3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function FacilityAnalystTracedown3DParameters_getPrototypeOf(o) { FacilityAnalystTracedown3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTracedown3DParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FacilityAnalystTracedown3DParameters
- * @category iServer FacilityAnalyst3D TraceDownResult
- * @classdesc 下游追踪资源参数类。
- * @extends {SuperMap.FacilityAnalyst3DParameters}
- * @param {Object} options - 参数。
- * @param {string} options.weightName - 指定的权值字段信息对象的名称。
- * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
- * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
- * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
- * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
- */
- var FacilityAnalystTracedown3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
- FacilityAnalystTracedown3DParameters_inherits(FacilityAnalystTracedown3DParameters, _FacilityAnalyst3DPar);
- var _super = FacilityAnalystTracedown3DParameters_createSuper(FacilityAnalystTracedown3DParameters);
- function FacilityAnalystTracedown3DParameters(options) {
- var _this;
- FacilityAnalystTracedown3DParameters_classCallCheck(this, FacilityAnalystTracedown3DParameters);
- _this = _super.call(this, options);
- _this.CLASS_NAME = "SuperMap.FacilityAnalystTracedown3DParameters";
- return _this;
- }
- /**
- * @function SuperMap.FacilityAnalystTracedown3DParameters.prototype.destroy
- * @override
- */
- FacilityAnalystTracedown3DParameters_createClass(FacilityAnalystTracedown3DParameters, [{
- key: "destroy",
- value: function destroy() {
- FacilityAnalystTracedown3DParameters_get(FacilityAnalystTracedown3DParameters_getPrototypeOf(FacilityAnalystTracedown3DParameters.prototype), "destroy", this).call(this);
- }
- }]);
- return FacilityAnalystTracedown3DParameters;
- }(FacilityAnalyst3DParameters);
- SuperMap.FacilityAnalystTracedown3DParameters = FacilityAnalystTracedown3DParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTracedown3DService.js
- 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); }
- function FacilityAnalystTracedown3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FacilityAnalystTracedown3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTracedown3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTracedown3DService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function FacilityAnalystTracedown3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTracedown3DService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function FacilityAnalystTracedown3DService_setPrototypeOf(o, p) { FacilityAnalystTracedown3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTracedown3DService_setPrototypeOf(o, p); }
- 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); }; }
- function FacilityAnalystTracedown3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTracedown3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystTracedown3DService_assertThisInitialized(self); }
- function FacilityAnalystTracedown3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function FacilityAnalystTracedown3DService_getPrototypeOf(o) { FacilityAnalystTracedown3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTracedown3DService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FacilityAnalystTracedown3DService
- * @category iServer FacilityAnalyst3D TraceDownResult
- * @classdesc 下游追踪资源服务类
- * @extends {SuperMap.CommonServiceBase}
- * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
- * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
- * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var FacilityAnalystTracedown3DService = /*#__PURE__*/function (_CommonServiceBase) {
- FacilityAnalystTracedown3DService_inherits(FacilityAnalystTracedown3DService, _CommonServiceBase);
- var _super = FacilityAnalystTracedown3DService_createSuper(FacilityAnalystTracedown3DService);
- function FacilityAnalystTracedown3DService(url, options) {
- var _this;
- FacilityAnalystTracedown3DService_classCallCheck(this, FacilityAnalystTracedown3DService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.FacilityAnalystTracedown3DService";
- return _this;
- }
- /**
- * @function SuperMap.FacilityAnalystTracedown3DService.prototype.destroy
- * @override
- */
- FacilityAnalystTracedown3DService_createClass(FacilityAnalystTracedown3DService, [{
- key: "destroy",
- value: function destroy() {
- FacilityAnalystTracedown3DService_get(FacilityAnalystTracedown3DService_getPrototypeOf(FacilityAnalystTracedown3DService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.FacilityAnalystTracedown3DService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.FacilityAnalystTracedown3DParameters} params - 下游追踪资源参数类。
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof FacilityAnalystTracedown3DParameters)) {
- return;
- }
- var me = this,
- jsonObject;
- me.url = Util.urlPathAppend(me.url, 'tracedownresult');
- jsonObject = {
- edgeID: params.edgeID,
- nodeID: params.nodeID,
- weightName: params.weightName,
- isUncertainDirectionValid: params.isUncertainDirectionValid
- };
- me.request({
- method: "GET",
- params: jsonObject,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return FacilityAnalystTracedown3DService;
- }(CommonServiceBase);
- SuperMap.FacilityAnalystTracedown3DService = FacilityAnalystTracedown3DService;
- ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTraceup3DParameters.js
- 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); }
- function FacilityAnalystTraceup3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FacilityAnalystTraceup3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTraceup3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTraceup3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function FacilityAnalystTraceup3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTraceup3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function FacilityAnalystTraceup3DParameters_setPrototypeOf(o, p) { FacilityAnalystTraceup3DParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTraceup3DParameters_setPrototypeOf(o, p); }
- 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); }; }
- function FacilityAnalystTraceup3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTraceup3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystTraceup3DParameters_assertThisInitialized(self); }
- function FacilityAnalystTraceup3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function FacilityAnalystTraceup3DParameters_getPrototypeOf(o) { FacilityAnalystTraceup3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTraceup3DParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FacilityAnalystTraceup3DParameters
- * @category iServer FacilityAnalyst3D TraceUpResult
- * @classdesc 上游追踪资源参数类。
- * @extends {SuperMap.FacilityAnalyst3DParameters}
- * @param {Object} options - 参数。
- * @param {string} options.weightName - 指定的权值字段信息对象的名称。
- * @param {number} [options.edgeID] - 指定的弧段ID,edgeID 与 nodeID 必须指定一个。
- * @param {number} [options.nodeID] - 指定的结点ID,edgeID 与 nodeID 必须指定一个。
- * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
- * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
- */
- var FacilityAnalystTraceup3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
- FacilityAnalystTraceup3DParameters_inherits(FacilityAnalystTraceup3DParameters, _FacilityAnalyst3DPar);
- var _super = FacilityAnalystTraceup3DParameters_createSuper(FacilityAnalystTraceup3DParameters);
- function FacilityAnalystTraceup3DParameters(options) {
- var _this;
- FacilityAnalystTraceup3DParameters_classCallCheck(this, FacilityAnalystTraceup3DParameters);
- _this = _super.call(this, options);
- _this.CLASS_NAME = "SuperMap.FacilityAnalystTraceup3DParameters";
- return _this;
- }
- /**
- * @function SuperMap.FacilityAnalystTraceup3DParameters.prototype.destroy
- * @override
- */
- FacilityAnalystTraceup3DParameters_createClass(FacilityAnalystTraceup3DParameters, [{
- key: "destroy",
- value: function destroy() {
- FacilityAnalystTraceup3DParameters_get(FacilityAnalystTraceup3DParameters_getPrototypeOf(FacilityAnalystTraceup3DParameters.prototype), "destroy", this).call(this);
- }
- }]);
- return FacilityAnalystTraceup3DParameters;
- }(FacilityAnalyst3DParameters);
- SuperMap.FacilityAnalystTraceup3DParameters = FacilityAnalystTraceup3DParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTraceup3DService.js
- 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); }
- function FacilityAnalystTraceup3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FacilityAnalystTraceup3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTraceup3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTraceup3DService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function FacilityAnalystTraceup3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTraceup3DService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function FacilityAnalystTraceup3DService_setPrototypeOf(o, p) { FacilityAnalystTraceup3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTraceup3DService_setPrototypeOf(o, p); }
- 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); }; }
- function FacilityAnalystTraceup3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTraceup3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystTraceup3DService_assertThisInitialized(self); }
- function FacilityAnalystTraceup3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function FacilityAnalystTraceup3DService_getPrototypeOf(o) { FacilityAnalystTraceup3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTraceup3DService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FacilityAnalystTraceup3DService
- * @category iServer FacilityAnalyst3D TraceUpResult
- * @classdesc 上游追踪资源服务类
- * @extends {SuperMap.CommonServiceBase}
- * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
- * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
- * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var FacilityAnalystTraceup3DService = /*#__PURE__*/function (_CommonServiceBase) {
- FacilityAnalystTraceup3DService_inherits(FacilityAnalystTraceup3DService, _CommonServiceBase);
- var _super = FacilityAnalystTraceup3DService_createSuper(FacilityAnalystTraceup3DService);
- /**
- * @function SuperMap.FacilityAnalystTraceup3DService.constructor
- * @description 上游追踪资源服务类构造函数。
- * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
- * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
- * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- */
- function FacilityAnalystTraceup3DService(url, options) {
- var _this;
- FacilityAnalystTraceup3DService_classCallCheck(this, FacilityAnalystTraceup3DService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.FacilityAnalystTraceup3DService";
- return _this;
- }
- /**
- * @function SuperMap.FacilityAnalystTraceup3DService.prototype.destroy
- * @override
- */
- FacilityAnalystTraceup3DService_createClass(FacilityAnalystTraceup3DService, [{
- key: "destroy",
- value: function destroy() {
- FacilityAnalystTraceup3DService_get(FacilityAnalystTraceup3DService_getPrototypeOf(FacilityAnalystTraceup3DService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.FacilityAnalystTraceup3DService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.FacilityAnalystTraceup3DParameters} params - 上游追踪资源参数类
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof FacilityAnalystTraceup3DParameters)) {
- return;
- }
- var me = this,
- jsonObject;
- me.url = Util.urlPathAppend(me.url, 'traceupresult');
- jsonObject = {
- edgeID: params.edgeID,
- nodeID: params.nodeID,
- weightName: params.weightName,
- isUncertainDirectionValid: params.isUncertainDirectionValid
- };
- me.request({
- method: "GET",
- params: jsonObject,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return FacilityAnalystTraceup3DService;
- }(CommonServiceBase);
- SuperMap.FacilityAnalystTraceup3DService = FacilityAnalystTraceup3DService;
- ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystUpstream3DParameters.js
- 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); }
- function FacilityAnalystUpstream3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FacilityAnalystUpstream3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystUpstream3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystUpstream3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function FacilityAnalystUpstream3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystUpstream3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function FacilityAnalystUpstream3DParameters_setPrototypeOf(o, p) { FacilityAnalystUpstream3DParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystUpstream3DParameters_setPrototypeOf(o, p); }
- 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); }; }
- function FacilityAnalystUpstream3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystUpstream3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystUpstream3DParameters_assertThisInitialized(self); }
- function FacilityAnalystUpstream3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function FacilityAnalystUpstream3DParameters_getPrototypeOf(o) { FacilityAnalystUpstream3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystUpstream3DParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FacilityAnalystUpstream3DParameters
- * @category iServer FacilityAnalyst3D UpstreamCriticalFacilities
- * @classdesc 上游关键设施查找资源参数类。
- * @extends {SuperMap.FacilityAnalyst3DParameters}
- * @param {Object} options - 参数。
- * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
- * @param {number} [options.edgeID] - 指定的弧段ID。edgeID 与 nodeID 必须指定一个。
- * @param {number} [options.nodeID] - 指定的结点ID。edgeID 与 edgeID 必须指定一个。
- * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
- * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
- */
- var FacilityAnalystUpstream3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
- FacilityAnalystUpstream3DParameters_inherits(FacilityAnalystUpstream3DParameters, _FacilityAnalyst3DPar);
- var _super = FacilityAnalystUpstream3DParameters_createSuper(FacilityAnalystUpstream3DParameters);
- function FacilityAnalystUpstream3DParameters(options) {
- var _this;
- FacilityAnalystUpstream3DParameters_classCallCheck(this, FacilityAnalystUpstream3DParameters);
- _this = _super.call(this, options);
- options = options || {};
- _this.sourceNodeIDs = null;
- Util.extend(FacilityAnalystUpstream3DParameters_assertThisInitialized(_this), options);
- _this.CLASS_NAME = "SuperMap.FacilityAnalystUpstream3DParameters";
- return _this;
- }
- /**
- * @function SuperMap.FacilityAnalystUpstream3DParameters.prototype.destroy
- * @override
- */
- FacilityAnalystUpstream3DParameters_createClass(FacilityAnalystUpstream3DParameters, [{
- key: "destroy",
- value: function destroy() {
- FacilityAnalystUpstream3DParameters_get(FacilityAnalystUpstream3DParameters_getPrototypeOf(FacilityAnalystUpstream3DParameters.prototype), "destroy", this).call(this);
- this.sourceNodeIDs = null;
- }
- }]);
- return FacilityAnalystUpstream3DParameters;
- }(FacilityAnalyst3DParameters);
- SuperMap.FacilityAnalystUpstream3DParameters = FacilityAnalystUpstream3DParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystUpstream3DService.js
- 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); }
- function FacilityAnalystUpstream3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FacilityAnalystUpstream3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystUpstream3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystUpstream3DService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function FacilityAnalystUpstream3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystUpstream3DService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function FacilityAnalystUpstream3DService_setPrototypeOf(o, p) { FacilityAnalystUpstream3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystUpstream3DService_setPrototypeOf(o, p); }
- 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); }; }
- function FacilityAnalystUpstream3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystUpstream3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystUpstream3DService_assertThisInitialized(self); }
- function FacilityAnalystUpstream3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function FacilityAnalystUpstream3DService_getPrototypeOf(o) { FacilityAnalystUpstream3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystUpstream3DService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FacilityAnalystUpstream3DService
- * @category iServer FacilityAnalyst3D UpstreamCriticalFacilities
- * @classdesc 上游关键设施查找资源服务类
- * @extends {SuperMap.CommonServiceBase}
- * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
- * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
- * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var FacilityAnalystUpstream3DService = /*#__PURE__*/function (_CommonServiceBase) {
- FacilityAnalystUpstream3DService_inherits(FacilityAnalystUpstream3DService, _CommonServiceBase);
- var _super = FacilityAnalystUpstream3DService_createSuper(FacilityAnalystUpstream3DService);
- function FacilityAnalystUpstream3DService(url, options) {
- var _this;
- FacilityAnalystUpstream3DService_classCallCheck(this, FacilityAnalystUpstream3DService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.FacilityAnalystUpstream3DService";
- return _this;
- }
- /**
- * @function SuperMap.FacilityAnalystUpstream3DService.prototype.destroy
- * @override
- */
- FacilityAnalystUpstream3DService_createClass(FacilityAnalystUpstream3DService, [{
- key: "destroy",
- value: function destroy() {
- FacilityAnalystUpstream3DService_get(FacilityAnalystUpstream3DService_getPrototypeOf(FacilityAnalystUpstream3DService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.FacilityAnalystUpstream3DService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.FacilityAnalystUpstream3DParameters} params - 上游关键设施查找资源参数类
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof FacilityAnalystUpstream3DParameters)) {
- return;
- }
- var me = this,
- jsonObject;
- me.url = Util.urlPathAppend(me.url, 'upstreamcirticalfaclilities');
- jsonObject = {
- sourceNodeIDs: params.sourceNodeIDs,
- edgeID: params.edgeID,
- nodeID: params.nodeID,
- isUncertainDirectionValid: params.isUncertainDirectionValid
- };
- me.request({
- method: "GET",
- params: jsonObject,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return FacilityAnalystUpstream3DService;
- }(CommonServiceBase);
- SuperMap.FacilityAnalystUpstream3DService = FacilityAnalystUpstream3DService;
- ;// CONCATENATED MODULE: ./src/common/iServer/FilterAggParameter.js
- 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); }
- function FilterAggParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FilterAggParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) FilterAggParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) FilterAggParameter_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function FilterAggParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FilterAggParameter_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function FilterAggParameter_setPrototypeOf(o, p) { FilterAggParameter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FilterAggParameter_setPrototypeOf(o, p); }
- 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); }; }
- function FilterAggParameter_possibleConstructorReturn(self, call) { if (call && (FilterAggParameter_typeof(call) === "object" || typeof call === "function")) { return call; } return FilterAggParameter_assertThisInitialized(self); }
- function FilterAggParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function FilterAggParameter_getPrototypeOf(o) { FilterAggParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FilterAggParameter_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FilterAggParameter
- * @classdesc 过滤条件参数设置,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
- * @category iServer Data FeatureResults
- * @param {Object} options - 初始化参数。
- * @param {SuperMap.AggQueryBuilderParameter} options.filterParam - 过滤条件参数设置类。
- * @param {SuperMap.AggregationType} [options.aggType=AggregationType.FILTER] - 聚合类型。
- */
- var FilterAggParameter = /*#__PURE__*/function (_AggregationParameter) {
- FilterAggParameter_inherits(FilterAggParameter, _AggregationParameter);
- var _super = FilterAggParameter_createSuper(FilterAggParameter);
- function FilterAggParameter(options) {
- var _this;
- FilterAggParameter_classCallCheck(this, FilterAggParameter);
- _this = _super.call(this, options);
- /**
- * @member {SuperMap.AggQueryBuilderParameter} SuperMap.FilterAggParameter.prototype.filterParam
- * @description 过滤条件参数设置类。
- */
- _this.filterParam = null;
- /**
- * @member {SuperMap.AggregationType} [SuperMap.FilterAggParameter.prototype.aggType=AggregationType.FILTER]
- * @description 聚合类型。
- */
- _this.aggType = AggregationType.FILTER;
- _this.CLASS_NAME = "SuperMap.FilterAggParameter";
- Util.extend(FilterAggParameter_assertThisInitialized(_this), options);
- return _this;
- }
- FilterAggParameter_createClass(FilterAggParameter, [{
- key: "destroy",
- value: function destroy() {
- FilterAggParameter_get(FilterAggParameter_getPrototypeOf(FilterAggParameter.prototype), "destroy", this).call(this);
- var me = this;
- if (me.filterParam) {
- me.filterParam = null;
- }
- }
- }]);
- return FilterAggParameter;
- }(AggregationParameter);
- SuperMap.FilterAggParameter = FilterAggParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/FieldParameters.js
- function FieldParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FieldParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FieldParameters
- * @category iServer Data Field
- * @classdesc 字段信息查询参数类。
- * @param {Object} options - 参数。
- * @param {string} options.datasource - 数据源名称。
- * @param {string} options.dataset - 数据集名称。
- */
- var FieldParameters = /*#__PURE__*/function () {
- function FieldParameters(options) {
- FieldParameters_classCallCheck(this, FieldParameters);
- /**
- * @member {string} SuperMap.FieldParameters.prototype.datasource
- * @description 要查询的数据集所在的数据源名称。
- */
- this.datasource = null;
- /**
- * @member {string} SuperMap.FieldParameters.prototype.dataset
- * @description 要查询的数据集名称。
- */
- this.dataset = null;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.FieldParameters";
- }
- /**
- * @function SuperMap.FieldParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- FieldParameters_createClass(FieldParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.datasource = null;
- me.dataset = null;
- }
- }]);
- return FieldParameters;
- }();
- SuperMap.FieldParameters = FieldParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/FieldStatisticsParameters.js
- 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); }
- function FieldStatisticsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FieldStatisticsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldStatisticsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldStatisticsParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function FieldStatisticsParameters_setPrototypeOf(o, p) { FieldStatisticsParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FieldStatisticsParameters_setPrototypeOf(o, p); }
- 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); }; }
- function FieldStatisticsParameters_possibleConstructorReturn(self, call) { if (call && (FieldStatisticsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FieldStatisticsParameters_assertThisInitialized(self); }
- function FieldStatisticsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function FieldStatisticsParameters_getPrototypeOf(o) { FieldStatisticsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FieldStatisticsParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FieldStatisticsParameters
- * @category iServer Data Field
- * @classdesc 字段统计信息查询参数类。
- * @param {Object} options - 参数。
- * @param {string} options.datasource - 数据源名称。
- * @param {string} options.dataset - 数据集名称。
- * @param {string} options.fieldName - 字段名。
- * @param {(string.<SuperMap.StatisticMode>|Array.<string.<SuperMap.StatisticMode>>)} statisticMode - 字段统计方法类型。
- * @extends {SuperMap.FieldParameters}
- */
- var FieldStatisticsParameters = /*#__PURE__*/function (_FieldParameters) {
- FieldStatisticsParameters_inherits(FieldStatisticsParameters, _FieldParameters);
- var _super = FieldStatisticsParameters_createSuper(FieldStatisticsParameters);
- function FieldStatisticsParameters(options) {
- var _this;
- FieldStatisticsParameters_classCallCheck(this, FieldStatisticsParameters);
- _this = _super.call(this, options);
- /**
- * @member {string} SuperMap.FieldStatisticsParameters.prototype.fieldName
- * @description 字段名
- */
- _this.fieldName = null;
- /**
- * @member {(string.<SuperMap.StatisticMode>|Array.<string.<SuperMap.StatisticMode>>)} SuperMap.FieldStatisticsParameters.prototype.statisticMode
- * @description 字段统计方法类型
- */
- _this.statisticMode = null;
- if (options) {
- Util.extend(FieldStatisticsParameters_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.FieldStatisticsParameters";
- return _this;
- }
- /**
- * @function SuperMap.FieldStatisticsParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- FieldStatisticsParameters_createClass(FieldStatisticsParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.fieldName = null;
- me.statisticMode = null;
- }
- }]);
- return FieldStatisticsParameters;
- }(FieldParameters);
- SuperMap.FieldStatisticsParameters = FieldStatisticsParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/FieldStatisticService.js
- 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); }
- function FieldStatisticService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FieldStatisticService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldStatisticService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldStatisticService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function FieldStatisticService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FieldStatisticService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function FieldStatisticService_setPrototypeOf(o, p) { FieldStatisticService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FieldStatisticService_setPrototypeOf(o, p); }
- 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); }; }
- function FieldStatisticService_possibleConstructorReturn(self, call) { if (call && (FieldStatisticService_typeof(call) === "object" || typeof call === "function")) { return call; } return FieldStatisticService_assertThisInitialized(self); }
- function FieldStatisticService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function FieldStatisticService_getPrototypeOf(o) { FieldStatisticService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FieldStatisticService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FieldStatisticService
- * @category iServer Data Field
- * @classdesc 字段查询统计服务类。用来完成对指定数据集指定字段的查询统计分析,即求平均值,最大值等。
- * @extends {SuperMap.CommonServiceBase}
- * @param {string} url - 服务的访问地址。如访问 World Map 服务,只需将 url 设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {string} options.datasource - 数据集所在的数据源名称。
- * @param {string} options.dataset - 数据集名称。
- * @param {string} options.field - 查询统计的目标字段名称。
- * @param {SuperMap.StatisticMode} options.statisticMode - 字段查询统计的方法类型。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @example
- * var myService = new SuperMap.FieldStatisticService(url, {eventListeners: {
- * "processCompleted": fieldStatisticCompleted,
- * "processFailed": fieldStatisticError
- * },
- * datasource: "World",
- * dataset: "Countries",
- * field: "SmID",
- * statisticMode: StatisticMode.AVERAGE
- * };
- */
- var FieldStatisticService = /*#__PURE__*/function (_CommonServiceBase) {
- FieldStatisticService_inherits(FieldStatisticService, _CommonServiceBase);
- var _super = FieldStatisticService_createSuper(FieldStatisticService);
- function FieldStatisticService(url, options) {
- var _this;
- FieldStatisticService_classCallCheck(this, FieldStatisticService);
- _this = _super.call(this, url, options);
- /**
- * @member {string} SuperMap.FieldStatisticService.prototype.datasource
- * @description 数据集所在的数据源名称。
- */
- _this.datasource = null;
- /**
- * @member {string} SuperMap.FieldStatisticService.prototype.dataset
- * @description 数据集名称。
- */
- _this.dataset = null;
- /**
- * @member {string} SuperMap.FieldStatisticService.prototype.field
- * @description 查询统计的目标字段名称。
- */
- _this.field = null;
- /**
- * @member {SuperMap.StatisticMode} SuperMap.FieldStatisticService.prototype.statisticMode
- * @description 字段查询统计的方法类型。
- */
- _this.statisticMode = null;
- if (options) {
- Util.extend(FieldStatisticService_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.FieldStatisticService";
- return _this;
- }
- /**
- * @function SuperMap.FieldStatisticService.prototype.destroy
- * @override
- */
- FieldStatisticService_createClass(FieldStatisticService, [{
- key: "destroy",
- value: function destroy() {
- FieldStatisticService_get(FieldStatisticService_getPrototypeOf(FieldStatisticService.prototype), "destroy", this).call(this);
- var me = this;
- me.datasource = null;
- me.dataset = null;
- me.field = null;
- me.statisticMode = null;
- }
- /**
- * @function SuperMap.FieldStatisticService.prototype.processAsync
- * @description 执行服务,进行指定字段的查询统计。
- */
- }, {
- key: "processAsync",
- value: function processAsync() {
- var me = this,
- fieldStatisticURL = "datasources/" + me.datasource + "/datasets/" + me.dataset + "/fields/" + me.field + "/" + me.statisticMode;
- me.url = Util.urlPathAppend(me.url, fieldStatisticURL);
- me.request({
- method: "GET",
- data: null,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return FieldStatisticService;
- }(CommonServiceBase);
- SuperMap.FieldStatisticService = FieldStatisticService;
- ;// CONCATENATED MODULE: ./src/common/iServer/FindClosestFacilitiesParameters.js
- function FindClosestFacilitiesParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FindClosestFacilitiesParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindClosestFacilitiesParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindClosestFacilitiesParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FindClosestFacilitiesParameters
- * @category iServer NetworkAnalyst ClosestFacility
- * @classdesc 最近设施分析参数类。
- * @param {Object} options - 参数。
- * @param {(SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number)} options.event - 事件点,一般为需要获得服务设施服务的事件位置。
- * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.facilities - 设施点集合,一般为提供服务的服务设施位置。
- * @param {number} [options.expectFacilityCount=1] - 要查找的设施点数量。
- * @param {boolean} [options.fromEvent=false] - 是否从事件点到设施点进行查找。
- * @param {boolean} [options.isAnalyzeById=false] - 事件点和设施点是否通过节点 ID 号来指定。
- * @param {number} [options.maxWeight=0] - 查找半径。单位与该类中 parameter 字段(交通网络分析通用参数)中设置的耗费字段一致。
- * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
- */
- var FindClosestFacilitiesParameters = /*#__PURE__*/function () {
- function FindClosestFacilitiesParameters(options) {
- FindClosestFacilitiesParameters_classCallCheck(this, FindClosestFacilitiesParameters);
- /**
- * @member {(SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number)} SuperMap.FindClosestFacilitiesParameters.prototype.event
- * @description 事件点,一般为需要获得服务设施服务的事件位置。
- * 可以通过两种方式赋予事件点:当该类中字段 isAnalyzeById = true 时,应输入事件点 ID 号;当 isAnalyzeById = false 时,应输入事件点坐标。
- */
- this.event = null;
- /**
- * @member {number} [SuperMap.FindClosestFacilitiesParameters.prototype.expectFacilityCount=1]
- * @description 要查找的设施点数量。
- */
- this.expectFacilityCount = 1;
- /**
- * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} [SuperMap.FindClosestFacilitiesParameters.prototype.facilities=false]
- * @description 设施点集合,一般为提供服务的服务设施位置。
- * 可以通过两种方式赋予设施点:当该类中字段 isAnalyzeById = true 时,应输入设施点 ID 号;当 isAnalyzeById = false 时,应输入设施点坐标。
- */
- this.facilities = null;
- /**
- * @member {boolean} [SuperMap.FindClosestFacilitiesParameters.prototype.fromEvent=false]
- * @description 是否从事件点到设施点进行查找。最近设施分析主要是通过设施点和事件点之间最优的路线来分析在一定范围内哪个或哪些设施与事件点有最优路线的关系。
- * 这个行走线路是通过网络图层进行网络分析算法计算出来的两点间的最优路线。由于存在从 A 点到 B 点与从 B 点到 A 点的耗费不一样的情况,因此起止点
- * 不同可能会得到不同的最优路线。因此在进行最近设施分析之前,需要设置获取的最优路线的方向,即是以事件点作为起点到最近设施点的方向分析,还是以最
- * 近设施点为起点到事件点的方向分析。如果需要以事件点作为起点到设施点方向进行查找,设置该字段值为 true;设置为 false,表示从设施点到事件点进行查找。
- */
- this.fromEvent = false;
- /**
- * @member {boolean} [SuperMap.FindClosestFacilitiesParameters.prototype.isAnalyzeById=false]
- * @description 事件点和设施点是否通过节点 ID 号来指定,设置为 false,表示通过坐标点指定事件点和设施点。
- */
- this.isAnalyzeById = false;
- /**
- * @member {number} [SuperMap.FindClosestFacilitiesParameters.prototype.maxWeight=0]
- * @description 查找半径。单位与该类中 parameter 字段(交通网络分析通用参数)中设置的耗费字段一致。
- * 例如事件发生点是一起交通事故,要求查找在 10 分钟内能到达的最近医院,超过 10 分钟能到达的都不予考虑。
- * 那么需要将网络分析参数中 parameter.weightFieldName 设置为表示时间的字段,然后设置查找范围的半径值为10。
- */
- this.maxWeight = 0;
- /**
- * @member {SuperMap.TransportationAnalystParameter} [SuperMap.FindClosestFacilitiesParameters.prototype.parameter]
- * @description 交通网络分析通用参数。通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
- * 它为 SuperMap.TransportationAnalystParameter 类型,虽然为可选参数,但是如果不设置其中的 resultSetting 字段,
- * 则返回结果空间信息等都为空。
- */
- this.parameter = new TransportationAnalystParameter();
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.FindClosestFacilitiesParameters";
- }
- /**
- * @function SuperMap.FindClosestFacilitiesParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- FindClosestFacilitiesParameters_createClass(FindClosestFacilitiesParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.event = null;
- me.expectFacilityCount = null;
- me.facilities = null;
- me.fromEvent = null;
- me.isAnalyzeById = null;
- me.maxWeight = null;
- if (me.parameter) {
- me.parameter.destroy();
- me.parameter = null;
- }
- }
- }]);
- return FindClosestFacilitiesParameters;
- }();
- SuperMap.FindClosestFacilitiesParameters = FindClosestFacilitiesParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/FindClosestFacilitiesService.js
- 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); }
- function FindClosestFacilitiesService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FindClosestFacilitiesService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindClosestFacilitiesService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindClosestFacilitiesService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function FindClosestFacilitiesService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindClosestFacilitiesService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function FindClosestFacilitiesService_setPrototypeOf(o, p) { FindClosestFacilitiesService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindClosestFacilitiesService_setPrototypeOf(o, p); }
- 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); }; }
- function FindClosestFacilitiesService_possibleConstructorReturn(self, call) { if (call && (FindClosestFacilitiesService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindClosestFacilitiesService_assertThisInitialized(self); }
- function FindClosestFacilitiesService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function FindClosestFacilitiesService_getPrototypeOf(o) { FindClosestFacilitiesService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindClosestFacilitiesService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FindClosestFacilitiesService
- * @category iServer NetworkAnalyst ClosestFacility
- * @classdesc 最近设施分析服务类。
- * 最近设施分析是指在网络上给定一个事件点和一组设施点,
- * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
- * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
- * 最近设施分析结果通过该类支持的事件的监听函数参数获取
- * @extends {SuperMap.NetworkAnalystServiceBase}
- * @example
- * var myfindClosestFacilitiesService = new SuperMap.FindClosestFacilitiesService(url, {
- * eventListeners: {
- * "processCompleted": findClosestFacilitiesCompleted,
- * "processFailed": findClosestFacilitiesError
- * }
- * });
- * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
- * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
- * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var FindClosestFacilitiesService = /*#__PURE__*/function (_NetworkAnalystServic) {
- FindClosestFacilitiesService_inherits(FindClosestFacilitiesService, _NetworkAnalystServic);
- var _super = FindClosestFacilitiesService_createSuper(FindClosestFacilitiesService);
- /*
- * @function SuperMap.FindClosestFacilitiesService.prototype.constructor
- * @description 最近设施分析服务类构造函数。
- * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
- * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
- * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
- * @param {Object} options - 选参数。<br>
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- */
- function FindClosestFacilitiesService(url, options) {
- var _this;
- FindClosestFacilitiesService_classCallCheck(this, FindClosestFacilitiesService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.FindClosestFacilitiesService";
- return _this;
- }
- /**
- * @function SuperMap.FindClosestFacilitiesService.prototype.destroy
- * @override
- */
- FindClosestFacilitiesService_createClass(FindClosestFacilitiesService, [{
- key: "destroy",
- value: function destroy() {
- FindClosestFacilitiesService_get(FindClosestFacilitiesService_getPrototypeOf(FindClosestFacilitiesService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.FindClosestFacilitiesService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.FindClosestFacilitiesParameters} params - 最近设施分析服务参数类
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof FindClosestFacilitiesParameters)) {
- return;
- }
- var me = this,
- jsonObject;
- me.url = Util.urlPathAppend(me.url, 'closestfacility');
- jsonObject = {
- expectFacilityCount: params.expectFacilityCount,
- fromEvent: params.fromEvent,
- maxWeight: params.maxWeight,
- parameter: Util.toJSON(params.parameter),
- event: Util.toJSON(params.event),
- facilities: me.getJson(params.isAnalyzeById, params.facilities)
- };
- me.request({
- method: "GET",
- params: jsonObject,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.FindClosestFacilitiesService.prototype.getJson
- * @description 将对象转化为JSON字符串。
- * @param {boolean} isAnalyzeById - 是否通过ID来分析
- * @param {Array} params - 分析参数数组
- * @returns {Object} 转化后的JSON字符串。
- */
- }, {
- key: "getJson",
- value: function getJson(isAnalyzeById, params) {
- var jsonString = "[",
- len = params ? params.length : 0;
- if (isAnalyzeById === false) {
- for (var i = 0; i < len; i++) {
- if (i > 0) {
- jsonString += ",";
- }
- jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
- }
- } else if (isAnalyzeById === true) {
- for (var _i = 0; _i < len; _i++) {
- if (_i > 0) {
- jsonString += ",";
- }
- jsonString += params[_i];
- }
- }
- jsonString += ']';
- return jsonString;
- }
- /**
- * @function SuperMap.FindClosestFacilitiesService.prototype.toGeoJSONResult
- * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
- * @param {Object} result - 服务器返回的结果对象。
- */
- }, {
- key: "toGeoJSONResult",
- value: function toGeoJSONResult(result) {
- if (!result || !result.facilityPathList) {
- return result;
- }
- var geoJSONFormat = new GeoJSON();
- result.facilityPathList.map(function (path) {
- if (path.route) {
- path.route = geoJSONFormat.toGeoJSON(path.route);
- }
- if (path.pathGuideItems) {
- path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
- }
- if (path.edgeFeatures) {
- path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
- }
- if (path.nodeFeatures) {
- path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
- }
- return path;
- });
- return result;
- }
- }]);
- return FindClosestFacilitiesService;
- }(NetworkAnalystServiceBase);
- SuperMap.FindClosestFacilitiesService = FindClosestFacilitiesService;
- ;// CONCATENATED MODULE: ./src/common/iServer/FindLocationParameters.js
- function FindLocationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FindLocationParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindLocationParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindLocationParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FindLocationParameters
- * @category iServer NetworkAnalyst Location
- * @classdesc 选址分区分析参数类。
- * @param {Object} options - 参数。
- * @param {string} options.turnWeightField - 转向权值字段的名称。
- * @param {string} options.weightName - 阻力字段的名称,标识了进行网络分析时所使用的阻力字段。
- * @param {Array.<SuperMap.SupplyCenter>} options.supplyCenters - 资源供给中心集合。
- * @param {number} [options.expectedSupplyCenterCount=1] - 期望用于最终设施选址的资源供给中心数量。
- * @param {boolean} [options.isFromCenter=false] - 是否从中心点开始分配资源。
- */
- var FindLocationParameters = /*#__PURE__*/function () {
- function FindLocationParameters(options) {
- FindLocationParameters_classCallCheck(this, FindLocationParameters);
- /**
- * @member {number} [SuperMap.FindLocationParameters.prototype.expectedSupplyCenterCount=1]
- * @description 期望用于最终设施选址的资源供给中心数量。
- * 当输入值为 0 时,最终设施选址的资源供给中心数量默认为覆盖分析区域内的所需最少的供给中心数。
- */
- this.expectedSupplyCenterCount = null;
- /**
- * @member {boolean} [SuperMap.FindLocationParameters.prototype.isFromCenter=false]
- * @description 是否从中心点开始分配资源。
- * 由于网路数据中的弧段具有正反阻力,即弧段的正向阻力值与其反向阻力值可能不同,
- * 因此,在进行分析时,从资源供给中心开始分配资源到需求点与从需求点向资源供给中心分配这两种分配形式下,所得的分析结果会不同。
- */
- this.isFromCenter = false;
- /**
- * @member {Array.<SuperMap.SupplyCenter>} SuperMap.FindLocationParameters.prototype.supplyCenters
- * @description 资源供给中心集合。
- * 资源供给中心是提供资源和服务的设施,对应于网络结点,
- * 资源供给中心的相关信息包括资源量、最大阻力值、资源供给中心类型,资源供给中心在网络中所处结点的 ID 等,以便在进行选址分区分析时使用。
- */
- this.supplyCenters = null;
- /**
- * @member {string} SuperMap.FindLocationParameters.prototype.turnWeightField
- * @description 转向权值字段的名称。
- */
- this.turnWeightField = null;
- /**
- * @member {string} SuperMap.FindLocationParameters.prototype.weightName
- * @description 阻力字段的名称,标识了进行网络分析时所使用的阻力字段。
- */
- this.weightName = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.FindLocationParameters";
- }
- /**
- * @function SuperMap.FindLocationParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- FindLocationParameters_createClass(FindLocationParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.expectedSupplyCenterCount = null;
- me.isFromCenter = null;
- me.turnWeightField = null;
- me.weightName = null;
- if (me.supplyCenters) {
- for (var i = 0, supplyCenters = me.supplyCenters, len = supplyCenters.length; i < len; i++) {
- supplyCenters[i].destroy();
- }
- me.supplyCenters = null;
- }
- }
- }]);
- return FindLocationParameters;
- }();
- SuperMap.FindLocationParameters = FindLocationParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/FindLocationService.js
- 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); }
- function FindLocationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FindLocationService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindLocationService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindLocationService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function FindLocationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindLocationService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function FindLocationService_setPrototypeOf(o, p) { FindLocationService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindLocationService_setPrototypeOf(o, p); }
- 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); }; }
- function FindLocationService_possibleConstructorReturn(self, call) { if (call && (FindLocationService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindLocationService_assertThisInitialized(self); }
- function FindLocationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function FindLocationService_getPrototypeOf(o) { FindLocationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindLocationService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FindLocationService
- * @category iServer NetworkAnalyst Location
- * @classdesc 选址分区分析服务类。
- * 选址分区分析是为了确定一个或多个待建设施的最佳或最优位置,使得设施可以用一种最经济有效的方式为需求方提供服务或者商品。
- * 选址分区不仅仅是一个选址过程,还要将需求点的需求分配到相应的新建设施的服务区中,因此称之为选址与分区。
- * 选址分区分析结果通过该类支持的事件的监听函数参数获取
- * @extends {SuperMap.NetworkAnalystServiceBase}
- * @example
- * (start code)
- * var findLocationService = new SuperMap.FindLocationService(url, {
- * eventListeners: {
- * "processCompleted": findLocationCompleted,
- * "processFailed": findLocationError
- * }
- * });
- * (end)
- * @param {string} url - 服务的访问地址。
- * 如 http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var FindLocationService = /*#__PURE__*/function (_NetworkAnalystServic) {
- FindLocationService_inherits(FindLocationService, _NetworkAnalystServic);
- var _super = FindLocationService_createSuper(FindLocationService);
- function FindLocationService(url, options) {
- var _this;
- FindLocationService_classCallCheck(this, FindLocationService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.FindLocationService";
- return _this;
- }
- /**
- * @function SuperMap.FindLocationService.prototype.destroy
- * @override
- */
- FindLocationService_createClass(FindLocationService, [{
- key: "destroy",
- value: function destroy() {
- FindLocationService_get(FindLocationService_getPrototypeOf(FindLocationService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.FindLocationService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.FindLocationParameters} params - 选址分区分析服务参数类
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof FindLocationParameters)) {
- return;
- }
- var me = this,
- jsonObject;
- me.url = Util.urlPathAppend(me.url, 'location');
- jsonObject = {
- isFromCenter: params.isFromCenter,
- expectedSupplyCenterCount: params.expectedSupplyCenterCount,
- weightName: params.weightName,
- turnWeightField: params.turnWeightField,
- returnEdgeFeature: true,
- returnEdgeGeometry: true,
- returnNodeFeature: true,
- mapParameter: Util.toJSON(params.mapParameter),
- supplyCenters: me.getCentersJson(params.supplyCenters)
- };
- me.request({
- method: "GET",
- params: jsonObject,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.FindLocationService.prototype.getCentersJson
- * @description 将数组对象转化为JSON字符串。
- * @param {Array} params - 需要转换的参数
- * @returns {string} 转化后的JSON字符串。
- */
- }, {
- key: "getCentersJson",
- value: function getCentersJson(params) {
- var json = "[",
- len = params ? params.length : 0;
- for (var i = 0; i < len; i++) {
- if (i > 0) {
- json += ",";
- }
- json += Util.toJSON(params[i]);
- }
- json += "]";
- return json;
- }
- /**
- * @function SuperMap.FindLocationService.prototype.toGeoJSONResult
- * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
- * @param {Object} result - 服务器返回的结果对象。
- */
- }, {
- key: "toGeoJSONResult",
- value: function toGeoJSONResult(result) {
- if (!result) {
- return null;
- }
- var geoJSONFormat = new GeoJSON();
- if (result.demandResults) {
- result.demandResults = geoJSONFormat.toGeoJSON(result.demandResults);
- }
- if (result.supplyResults) {
- result.supplyResults = geoJSONFormat.toGeoJSON(result.supplyResults);
- }
- return result;
- }
- }]);
- return FindLocationService;
- }(NetworkAnalystServiceBase);
- SuperMap.FindLocationService = FindLocationService;
- ;// CONCATENATED MODULE: ./src/common/iServer/FindMTSPPathsParameters.js
- function FindMTSPPathsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FindMTSPPathsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindMTSPPathsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindMTSPPathsParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FindMTSPPathsParameters
- * @category iServer NetworkAnalyst MTSPPath
- * @classdesc 多旅行商分析参数类
- * @param {Object} options - 参数。
- * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.centers - 配送中心集合。
- * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.nodes - 配送目标集合。
- * @param {boolean} [options.hasLeastTotalCost=false] - 配送模式是否为总花费最小方案。
- * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 号来指定配送中心点和配送目的点,即通过坐标点指定。
- * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
- */
- var FindMTSPPathsParameters = /*#__PURE__*/function () {
- function FindMTSPPathsParameters(options) {
- FindMTSPPathsParameters_classCallCheck(this, FindMTSPPathsParameters);
- /**
- * @member SuperMap.FindMTSPPathsParameters.prototype.centers - {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>}
- * @description 配送中心集合。
- * 当 SuperMap.FindMTSPPathsParameters.isAnalyzeById = false 时,centers 应为点的坐标数组;
- * 当 SuperMap.FindMTSPPathsParameters.isAnalyzeById = true 时,centers 应为点的 ID 数组。
- */
- this.centers = null;
- /**
- * @member {boolean} [SuperMap.FindMTSPPathsParameters.prototype.hasLeastTotalCost=false]
- * @description 配送模式是否为总花费最小方案。
- * 若为 true,则按照总花费最小的模式进行配送,此时可能会出现某几个配送中心点配送的花费较多而其他配送中心点的花费很少的情况。
- * 若为 false,则为局部最优,此方案会控制每个配送中心点的花费,使各个中心点花费相对平均,此时总花费不一定最小。
- */
- this.hasLeastTotalCost = false;
- /**
- * @member {boolean} [SuperMap.FindMTSPPathsParameters.prototype.isAnalyzeById=false]
- * @description 是否通过节点 ID 号来指定配送中心点和配送目的点,即通过坐标点指定。
- */
- this.isAnalyzeById = false;
- /**
- * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} SuperMap.FindMTSPPathsParameters.prototype.nodes
- * @description 配送目标集合。
- * 当 SuperMap.FindMTSPPathsParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
- * 当 SuperMap.FindMTSPPathsParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
- */
- this.nodes = null;
- /**
- * @member {SuperMap.TransportationAnalystParameter} [SuperMap.FindMTSPPathsParameters.prototype.parameter]
- * @description 交通网络分析通用参数。
- * 通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
- * SuperMap.TransportationAnalystParameter 类型,它虽然为可选参数,但是如果不设置其中的 resultSetting 字段,则返回结果空间信息等都为空。
- */
- this.parameter = new TransportationAnalystParameter();
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.FindMTSPPathsParameters";
- }
- /**
- * @function SuperMap.FindMTSPPathsParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- FindMTSPPathsParameters_createClass(FindMTSPPathsParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.centers = null;
- me.hasLeastTotalCost = null;
- me.isAnalyzeById = null;
- me.nodes = null;
- me.maxWeight = null;
- if (me.parameter) {
- me.parameter.destroy();
- me.parameter = null;
- }
- }
- }]);
- return FindMTSPPathsParameters;
- }();
- SuperMap.FindMTSPPathsParameters = FindMTSPPathsParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/FindMTSPPathsService.js
- 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); }
- function FindMTSPPathsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FindMTSPPathsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindMTSPPathsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindMTSPPathsService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function FindMTSPPathsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindMTSPPathsService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function FindMTSPPathsService_setPrototypeOf(o, p) { FindMTSPPathsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindMTSPPathsService_setPrototypeOf(o, p); }
- 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); }; }
- function FindMTSPPathsService_possibleConstructorReturn(self, call) { if (call && (FindMTSPPathsService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindMTSPPathsService_assertThisInitialized(self); }
- function FindMTSPPathsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function FindMTSPPathsService_getPrototypeOf(o) { FindMTSPPathsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindMTSPPathsService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FindMTSPPathsService
- * @category iServer NetworkAnalyst MTSPPath
- * @classdesc 多旅行商分析服务类
- * 多旅行商分析也称为物流配送,是指在网络数据集中,给定 M 个配送中心点和 N 个配送目的地(M,N 为大于零的整数)。
- * 查找经济有效的配送路径,并给出相应的行走路线。
- * 物流配送功能就是解决如何合理分配配送次序和送货路线,使配送总花费达到最小或每个配送中心的花费达到最小。
- * 该类负责将客户端指定的多旅行商分析参数传递给服务端,并接收服务端返回的结果数据。
- * 多旅行商分析结果通过该类支持的事件的监听函数参数获取
- * @extends {SuperMap.NetworkAnalystServiceBase}
- * @example
- * var myFindMTSPPathsService = new SuperMap.FindMTSPPathsService(url, {
- * eventListeners: {
- * "processCompleted": findMTSPPathsCompleted,
- * "processFailed": findMTSPPathsError
- * }
- * });
- * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
- * http://{服务器地址}:{服务端口号}/iserver/services/网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
- * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
- * @param {Object} options - 互服务时所需可选参数。如:
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var FindMTSPPathsService = /*#__PURE__*/function (_NetworkAnalystServic) {
- FindMTSPPathsService_inherits(FindMTSPPathsService, _NetworkAnalystServic);
- var _super = FindMTSPPathsService_createSuper(FindMTSPPathsService);
- function FindMTSPPathsService(url, options) {
- var _this;
- FindMTSPPathsService_classCallCheck(this, FindMTSPPathsService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.FindMTSPPathsService";
- return _this;
- }
- /**
- * @function SuperMap.FindMTSPPathsService.prototype.destroy
- * @override
- */
- FindMTSPPathsService_createClass(FindMTSPPathsService, [{
- key: "destroy",
- value: function destroy() {
- FindMTSPPathsService_get(FindMTSPPathsService_getPrototypeOf(FindMTSPPathsService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.FindMTSPPathsService..prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.FindMTSPPathsParameters} params - 多旅行商分析服务参数类
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof FindMTSPPathsParameters)) {
- return;
- }
- var me = this,
- jsonObject,
- //end = me.url.substr(me.url.length - 1, 1),
- centers = me.getJson(params.isAnalyzeById, params.centers),
- nodes = me.getJson(params.isAnalyzeById, params.nodes);
- me.url = Util.urlPathAppend(me.url, 'mtsppath');
- jsonObject = {
- centers: centers,
- nodes: nodes,
- parameter: Util.toJSON(params.parameter),
- hasLeastTotalCost: params.hasLeastTotalCost
- };
- me.request({
- method: "GET",
- params: jsonObject,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.FindMTSPPathsService.prototype.getJson
- * @description 将对象转化为JSON字符串。
- * @param {boolean} isAnalyzeById - 是否通过id分析
- * @param {Array} params - 需要转换的数字
- * @returns {Object} 转化后的JSON字符串。
- */
- }, {
- key: "getJson",
- value: function getJson(isAnalyzeById, params) {
- var jsonString = "[",
- len = params ? params.length : 0;
- if (isAnalyzeById === false) {
- for (var i = 0; i < len; i++) {
- if (i > 0) {
- jsonString += ",";
- }
- jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
- }
- } else if (isAnalyzeById === true) {
- for (var _i = 0; _i < len; _i++) {
- if (_i > 0) {
- jsonString += ",";
- }
- jsonString += params[_i];
- }
- }
- jsonString += ']';
- return jsonString;
- }
- /**
- * @function SuperMap.FindMTSPPathsService.prototype.toGeoJSONResult
- * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
- * @param {Object} result - 服务器返回的结果对象。
- */
- }, {
- key: "toGeoJSONResult",
- value: function toGeoJSONResult(result) {
- if (!result || !result.pathList) {
- return null;
- }
- var geoJSONFormat = new GeoJSON();
- result.pathList.map(function (path) {
- if (path.route) {
- path.route = geoJSONFormat.toGeoJSON(path.route);
- }
- if (path.pathGuideItems) {
- path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
- }
- if (path.edgeFeatures) {
- path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
- }
- if (path.nodeFeatures) {
- path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
- }
- return path;
- });
- return result;
- }
- }]);
- return FindMTSPPathsService;
- }(NetworkAnalystServiceBase);
- SuperMap.FindMTSPPathsService = FindMTSPPathsService;
- ;// CONCATENATED MODULE: ./src/common/iServer/FindPathParameters.js
- function FindPathParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FindPathParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindPathParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindPathParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FindPathParameters
- * @category iServer NetworkAnalyst Path
- * @classdesc 最佳路径分析参数类。最佳路径是在网络数据集中指定一些结点,按照顺序访问结点从而求解起止点之间阻抗最小的路径。
- * 例如如果要顺序访问 1、2、3、4 四个结点,则需要分别找到1、2结点间的最佳路径 R1—2,2、3 间的最佳路径 R2—3 和 3、4 结点间的最佳路径 R3—4,
- * 顺序访问 1、2、3、4 四个结点的最佳路径就是 R = R1—2 + R2—3 + R3—4。
- * 阻抗就是指从一点到另一点的耗费,在实际应用中我们可以将距离、时间、花费等作为阻抗条件。
- * 阻抗最小也就可以理解为从一点到另一点距离最短、时间最少、花费最低等。当两点间距离最短时为最短路径,它是最佳路径问题的一个特例。
- * 阻抗值通过 SuperMap.TransportationAnalystParameter.weightFieldName 设置。
- * 计算最佳路径除了受阻抗影响外,还受转向字段的影响。转向值通过 {@link SuperMap.TransportationAnalystParameter.turnWeightField} 设置。
- *
- * @param {Object} options - 参数。
- * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.nodes - 最佳路径分析经过的结点或设施点数组。该字段至少包含两个点。
- * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
- * @param {boolean} [options.hasLeastEdgeCount=false] - 是否按照弧段数最少的进行最佳路径分析。
- * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
- */
- var FindPathParameters = /*#__PURE__*/function () {
- function FindPathParameters(options) {
- FindPathParameters_classCallCheck(this, FindPathParameters);
- /**
- * @member {boolean} [SuperMap.FindPathParameters.prototype.isAnalyzeById=false]
- * @description 是否通过节点 ID 指定路径分析的结点。
- * 指定路径分析经过的结点或设施点有两种方式:输入结点 ID 号或直接输入点坐标。
- * 当该字段为 true 时,表示通过结点 ID 指定途经点,即 SuperMap.FindPathParameters.nodes = [ID1,ID2,...];
- * 反之表示通过结点坐标指定途经点,即 SuperMap.FindPathParameters.nodes = [{x1,y1},{x2,y2},...] 。
- */
- this.isAnalyzeById = false;
- /**
- * @member {boolean} [SuperMap.FindPathParameters.prototype.hasLeastEdgeCount=false]
- * @description 是否按照弧段数最少的进行最佳路径分析。
- * true 表示按照弧段数最少进行分析,返回弧段数最少的路径中一个阻抗最小的最佳路径;
- * false 表示直接返回阻抗最小的路径,而不考虑弧段的多少。
- */
- this.hasLeastEdgeCount = null;
- /**
- * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} SuperMap.FindPathParameters.prototype.nodes
- * @description 最佳路径分析经过的结点或设施点数组,必设字段。该字段至少包含两个点。
- * 当 SuperMap.FindPathParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
- * 当 SuperMap.FindPathParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
- */
- this.nodes = null;
- /**
- * @member {SuperMap.TransportationAnalystParameter} SuperMap.FindPathParameters.prototype.parameter
- * @description 交通网络分析通用参数。
- */
- this.parameter = new TransportationAnalystParameter();
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.FindPathParameters";
- }
- /**
- * @function SuperMap.FindPathParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- FindPathParameters_createClass(FindPathParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.isAnalyzeById = null;
- me.hasLeastEdgeCount = null;
- me.nodes = null;
- if (me.parameter) {
- me.parameter.destroy();
- me.parameter = null;
- }
- }
- }]);
- return FindPathParameters;
- }();
- SuperMap.FindPathParameters = FindPathParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/FindPathService.js
- 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); }
- function FindPathService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FindPathService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindPathService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindPathService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function FindPathService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindPathService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function FindPathService_setPrototypeOf(o, p) { FindPathService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindPathService_setPrototypeOf(o, p); }
- 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); }; }
- function FindPathService_possibleConstructorReturn(self, call) { if (call && (FindPathService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindPathService_assertThisInitialized(self); }
- function FindPathService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function FindPathService_getPrototypeOf(o) { FindPathService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindPathService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FindPathService
- * @category iServer NetworkAnalyst Path
- * @classdesc 最佳路径分析服务类。
- * 最佳路径是在网络数据集中指定一些节点,按照节点的选择顺序,
- * 顺序访问这些节点从而求解起止点之间阻抗最小的路经。
- * 该类负责将客户端指定的最佳路径分析参数传递给服务端,并接收服务端返回的结果数据。
- * 最佳路径分析结果通过该类支持的事件的监听函数参数获取
- * @extends {SuperMap.NetworkAnalystServiceBase}
- * @example
- * var myFindPathService = new SuperMap.FindPathService(url, {
- * eventListeners: {
- * "processCompleted": findPathCompleted,
- * "processFailed": findPathError
- * }
- * });
- * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
- * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
- * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var FindPathService = /*#__PURE__*/function (_NetworkAnalystServic) {
- FindPathService_inherits(FindPathService, _NetworkAnalystServic);
- var _super = FindPathService_createSuper(FindPathService);
- function FindPathService(url, options) {
- var _this;
- FindPathService_classCallCheck(this, FindPathService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.FindPathService";
- return _this;
- }
- /**
- * @function SuperMap.FindPathService.prototype.destroy
- * @override
- */
- FindPathService_createClass(FindPathService, [{
- key: "destroy",
- value: function destroy() {
- FindPathService_get(FindPathService_getPrototypeOf(FindPathService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.FindPathService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.FindPathParameters} params - 最佳路径分析服务参数类
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof FindPathParameters)) {
- return;
- }
- var me = this,
- jsonObject;
- me.url = Util.urlPathAppend(me.url, 'path');
- jsonObject = {
- hasLeastEdgeCount: params.hasLeastEdgeCount,
- parameter: Util.toJSON(params.parameter),
- nodes: me.getJson(params.isAnalyzeById, params.nodes)
- };
- me.request({
- method: "GET",
- params: jsonObject,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.FindPathService.prototype.getJson
- * @description 将对象转化为JSON字符串。
- * @param {boolean} isAnalyzeById - 是否通过id分析
- * @param {Array} params - 需要转换的数字
- * @returns {Object} 转化后的JSON字符串。
- */
- }, {
- key: "getJson",
- value: function getJson(isAnalyzeById, params) {
- var jsonString = "[",
- len = params ? params.length : 0;
- if (isAnalyzeById === false) {
- for (var i = 0; i < len; i++) {
- if (i > 0) {
- jsonString += ",";
- }
- jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
- }
- } else if (isAnalyzeById === true) {
- for (var _i = 0; _i < len; _i++) {
- if (_i > 0) {
- jsonString += ",";
- }
- jsonString += params[_i];
- }
- }
- jsonString += ']';
- return jsonString;
- }
- /**
- * @function SuperMap.FindMTSPPathsService.prototype.toGeoJSONResult
- * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
- * @param {Object} result - 服务器返回的结果对象。
- */
- }, {
- key: "toGeoJSONResult",
- value: function toGeoJSONResult(result) {
- if (!result || !result.pathList || result.pathList.length < 1) {
- return null;
- }
- var geoJSONFormat = new GeoJSON();
- result.pathList.forEach(function (path) {
- if (path.route) {
- path.route = geoJSONFormat.toGeoJSON(path.route);
- }
- if (path.pathGuideItems) {
- path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
- }
- if (path.edgeFeatures) {
- path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
- }
- if (path.nodeFeatures) {
- path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
- }
- });
- return result;
- }
- }]);
- return FindPathService;
- }(NetworkAnalystServiceBase);
- SuperMap.FindPathService = FindPathService;
- ;// CONCATENATED MODULE: ./src/common/iServer/FindServiceAreasParameters.js
- function FindServiceAreasParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FindServiceAreasParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindServiceAreasParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindServiceAreasParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FindServiceAreasParameters
- * @category iServer NetworkAnalyst ServiceArea
- * @classdesc 服务区分析参数类。
- * 服务区分析是以指定服务站点为中心,在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
- * 例如:计算某快餐店能够在30分钟内送达快餐的区域。
- * @param {Object} options - 参数。
- * @param {Array.<number>} options.weights - 每个服务站点提供服务的阻力半径,超过这个阻力半径的区域不予考虑,其单位与阻力字段一致。
- * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.centers - 服务站点数组。
- * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
- * @param {boolean} [options.isCenterMutuallyExclusive=false] - 是否中心点互斥。
- * @param {boolean} [options.isFromCenter=false] - 是否从中心点开始分析。
- * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
- */
- var FindServiceAreasParameters = /*#__PURE__*/function () {
- function FindServiceAreasParameters(options) {
- FindServiceAreasParameters_classCallCheck(this, FindServiceAreasParameters);
- /**
- * @member {boolean} [SuperMap.FindServiceAreasParameters.prototype.isAnalyzeById=false]
- * @description 是否通过节点 ID 指定路径分析的结点。
- * 指定路径分析经过的结点或设施点有两种方式:输入结点 ID 号或直接输入点坐标。
- * 当该字段为 true 时,表示通过结点 ID 指定途经点,即 SuperMap.FindServiceAreasParameters.centers = [ID1,ID2,...];
- * 反之表示通过结点坐标指定途经点,即 SuperMap.FindServiceAreasParameters.centers = [{x1,y1},{x2,y2},...]。
- */
- this.isAnalyzeById = false;
- /**
- * @member {boolean} [SuperMap.FindServiceAreasParameters.prototype.isCenterMutuallyExclusive=false]
- * @description 是否中心点互斥,即按照中心点的距离进行判断是否要进行互斥处理。
- * 若分析出的服务区有重叠的部分,则通过设置该参数进行互斥处理。
- */
- this.isCenterMutuallyExclusive = false;
- /**
- * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} SuperMap.FindServiceAreasParameters.prototype.centers
- * @description 服务站点数组。
- * 当该类的 iSAnalyzeById = true 时,通过结点 ID 号指定服务站点;当 iSAnalyzeById = false 时,通过点坐标指定服务站点。
- */
- this.centers = null;
- /**
- * @member {boolean} [SuperMap.FindServiceAreasParameters.prototype.isFromCenter=false]
- * @description 是否从中心点开始分析。
- * 从中心点开始分析和不从中心点开始分析,体现了服务中心和需要该服务的需求地的关系模式。
- * 从中心点开始分析,是一个服务中心向服务需求地提供服务;
- * 而不从中心点开始分析,是一个服务需求地主动到服务中心获得服务。
- */
- this.isFromCenter = false;
- /**
- * APIProperty: weights
- * @member {Array.<number>} SuperMap.FindServiceAreasParameters.prototype.weights
- * @description 每个服务站点提供服务的阻力半径,即超过这个阻力半径的区域不予考虑,其单位与阻力字段一致。
- * 该字段为一个数组,数组长度跟服务中心个数一致,按照索引顺序与站点一一对应,每个元素表示了在对每个服务中心进行服务区分析时,所用的服务半径。
- */
- this.weights = null;
- /**
- * @member {SuperMap.TransportationAnalystParameter} SuperMap.FindServiceAreasParameters.prototype.parameter
- * @description 交通网络分析通用参数。
- */
- this.parameter = new TransportationAnalystParameter();
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.FindServiceAreasParameters";
- }
- /**
- * @function SuperMap.FindServiceAreasParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- FindServiceAreasParameters_createClass(FindServiceAreasParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.isAnalyzeById = null;
- me.isCenterMutuallyExclusive = null;
- me.centers = null;
- me.isFromCenter = null;
- me.weights = null;
- if (me.parameter) {
- me.parameter.destroy();
- me.parameter = null;
- }
- }
- }]);
- return FindServiceAreasParameters;
- }();
- SuperMap.FindServiceAreasParameters = FindServiceAreasParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/FindServiceAreasService.js
- 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); }
- function FindServiceAreasService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FindServiceAreasService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindServiceAreasService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindServiceAreasService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function FindServiceAreasService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindServiceAreasService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function FindServiceAreasService_setPrototypeOf(o, p) { FindServiceAreasService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindServiceAreasService_setPrototypeOf(o, p); }
- 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); }; }
- function FindServiceAreasService_possibleConstructorReturn(self, call) { if (call && (FindServiceAreasService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindServiceAreasService_assertThisInitialized(self); }
- function FindServiceAreasService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function FindServiceAreasService_getPrototypeOf(o) { FindServiceAreasService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindServiceAreasService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FindServiceAreasService
- * @category iServer NetworkAnalyst ServiceArea
- * @classdesc 服务区分析服务类。
- * 服务区分析是以指定服务站点为中心,
- * 在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
- * 该类负责将客户端指定的服务区分析参数传递给服务端,并接收服务端返回的结果数据。
- * 服务区分析结果通过该类支持的事件的监听函数参数获取
- * @extends {SuperMap.NetworkAnalystServiceBase}
- * @example
- * var myFindServiceAreasService = new SuperMap.FindServiceAreasService(url, {
- * eventListeners: {
- * "processCompleted": findServiceAreasCompleted,
- * "processFailed": findServiceAreasError
- * }
- * });
- * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
- * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
- * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
- * @param {Object} options - 互服务时所需可选参数。如:
- * @param {Object} options.eventListeners - 需要被注册的监听器对象
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var FindServiceAreasService = /*#__PURE__*/function (_NetworkAnalystServic) {
- FindServiceAreasService_inherits(FindServiceAreasService, _NetworkAnalystServic);
- var _super = FindServiceAreasService_createSuper(FindServiceAreasService);
- function FindServiceAreasService(url, options) {
- var _this;
- FindServiceAreasService_classCallCheck(this, FindServiceAreasService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.FindServiceAreasService";
- return _this;
- }
- /**
- * @function SuperMap.FindServiceAreasService.prototype.destroy
- * @override
- */
- FindServiceAreasService_createClass(FindServiceAreasService, [{
- key: "destroy",
- value: function destroy() {
- FindServiceAreasService_get(FindServiceAreasService_getPrototypeOf(FindServiceAreasService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.FindServiceAreasService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.FindServiceAreasParameters} params - 服务区分析服务参数类
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof FindServiceAreasParameters)) {
- return;
- }
- var me = this,
- jsonObject;
- me.url = Util.urlPathAppend(me.url, 'servicearea');
- jsonObject = {
- isFromCenter: params.isFromCenter,
- isCenterMutuallyExclusive: params.isCenterMutuallyExclusive,
- parameter: Util.toJSON(params.parameter),
- centers: me.getJson(params.isAnalyzeById, params.centers),
- weights: me.getJson(true, params.weights)
- };
- me.request({
- method: "GET",
- params: jsonObject,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.FindServiceAreasService.prototype.getJson
- * @description 将对象转化为JSON字符串。
- * @param {boolean} isAnalyzeById - 是否通过id分析
- * @param {Array} params - 需要转换的数字
- * @returns {Object} 转化后的JSON字符串。
- */
- }, {
- key: "getJson",
- value: function getJson(isAnalyzeById, params) {
- var jsonString = "[",
- len = params ? params.length : 0;
- if (isAnalyzeById === false) {
- for (var i = 0; i < len; i++) {
- if (i > 0) {
- jsonString += ",";
- }
- jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
- }
- } else if (isAnalyzeById === true) {
- for (var _i = 0; _i < len; _i++) {
- if (_i > 0) {
- jsonString += ",";
- }
- jsonString += params[_i];
- }
- }
- jsonString += ']';
- return jsonString;
- }
- /**
- * @function SuperMap.FindServiceAreasService.prototype.toGeoJSONResult
- * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
- * @param {Object} result - 服务器返回的结果对象。。
- */
- }, {
- key: "toGeoJSONResult",
- value: function toGeoJSONResult(result) {
- if (!result || !result.serviceAreaList) {
- return result;
- }
- var geoJSONFormat = new GeoJSON();
- result.serviceAreaList.map(function (serviceArea) {
- if (serviceArea.serviceRegion) {
- serviceArea.serviceRegion = geoJSONFormat.toGeoJSON(serviceArea.serviceRegion);
- }
- if (serviceArea.edgeFeatures) {
- serviceArea.edgeFeatures = geoJSONFormat.toGeoJSON(serviceArea.edgeFeatures);
- }
- if (serviceArea.nodeFeatures) {
- serviceArea.nodeFeatures = geoJSONFormat.toGeoJSON(serviceArea.nodeFeatures);
- }
- if (serviceArea.routes) {
- serviceArea.routes = geoJSONFormat.toGeoJSON(serviceArea.routes);
- }
- return serviceArea;
- });
- return result;
- }
- }]);
- return FindServiceAreasService;
- }(NetworkAnalystServiceBase);
- SuperMap.FindServiceAreasService = FindServiceAreasService;
- ;// CONCATENATED MODULE: ./src/common/iServer/FindTSPPathsParameters.js
- function FindTSPPathsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FindTSPPathsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindTSPPathsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindTSPPathsParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FindTSPPathsParameters
- * @category iServer NetworkAnalyst TSPPath
- * @classdesc 旅行商分析参数类。
- * 旅行商分析是路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
- * 旅行商分析也可以指定到达的终点,这时查找从起点能够遍历所有途经点最后到达终点,且花费最小的路径。
- * 旅行商分析和最佳路径分析都是在网络中寻找遍历所有站点的最经济的路径,区别是在遍历网络所有站点的过程中对结点访问顺序不同
- * 最佳路径分析必须按照指定顺序对站点进行访问,而旅行商分析是无序的路径分析。
- * @param {Object} options - 参数。
- * @param {boolean} [options.endNodeAssigned=false] - 是否指定终止点,将指定的途经点的最后一个点作为终止点。true 表示指定终止点,则旅行商必须最后一个访问终止点。
- * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 号来指定配送中心点和配送目的点。
- * @param {Array.<(SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number)>} options.nodes - 配送目标集合。
- * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
- */
- var FindTSPPathsParameters = /*#__PURE__*/function () {
- function FindTSPPathsParameters(options) {
- FindTSPPathsParameters_classCallCheck(this, FindTSPPathsParameters);
- /**
- * @member {boolean} [SuperMap.FindTSPPathsParameters.prototype.endNodeAssigned=false]
- * @description 是否指定终止点,将指定的途经点的最后一个点作为终止点。
- * true 表示指定终止点,则旅行商必须最后一个访问终止点。
- */
- this.endNodeAssigned = false;
- /**
- * @member {boolean} [SuperMap.FindTSPPathsParameters.prototype.isAnalyzeById=false]
- * @description 是否通过节点 ID 号来指定途经点。
- */
- this.isAnalyzeById = false;
- /**
- * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} SuperMap.FindTSPPathsParameters.prototype.nodes
- * @description 旅行商分析途经点数组。
- * 当 SuperMap.FindTSPPathsParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
- * 当 SuperMap.FindTSPPathsParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
- */
- this.nodes = null;
- /**
- * @member {SuperMap.TransportationAnalystParameter} [SuperMap.FindTSPPathsParameters.prototype.parameter]
- * @description 交通网络分析通用参数。通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
- * SuperMap.TransportationAnalystParameter 类型,它虽然为可选参数,但是如果不设置其中的 resultSetting
- * 字段,则返回结果空间信息等都为空。
- */
- this.parameter = new TransportationAnalystParameter();
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.FindTSPPathsParameters";
- }
- /**
- * @function SuperMap.FindTSPPathsParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- FindTSPPathsParameters_createClass(FindTSPPathsParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.endNodeAssigned = null;
- me.isAnalyzeById = null;
- me.nodes = null;
- if (me.parameter) {
- me.parameter.destroy();
- me.parameter = null;
- }
- }
- }]);
- return FindTSPPathsParameters;
- }();
- SuperMap.FindTSPPathsParameters = FindTSPPathsParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/FindTSPPathsService.js
- 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); }
- function FindTSPPathsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FindTSPPathsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindTSPPathsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindTSPPathsService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function FindTSPPathsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindTSPPathsService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function FindTSPPathsService_setPrototypeOf(o, p) { FindTSPPathsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindTSPPathsService_setPrototypeOf(o, p); }
- 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); }; }
- function FindTSPPathsService_possibleConstructorReturn(self, call) { if (call && (FindTSPPathsService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindTSPPathsService_assertThisInitialized(self); }
- function FindTSPPathsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function FindTSPPathsService_getPrototypeOf(o) { FindTSPPathsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindTSPPathsService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FindTSPPathsService
- * @category iServer NetworkAnalyst TSPPath
- * @classdesc 旅行商分析服务类
- * 旅行商分析是路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
- * 旅行商分析也可以指定到达的终点,这时查找从起点能够遍历所有途经点最后到达终点,且花费最小的路径。
- * 该类负责将客户端指定的旅行商分析参数传递给服务端,并接收服务端返回的结果数据。
- * 旅行商分析结果通过该类支持的事件的监听函数参数获取
- * @extends {SuperMap.NetworkAnalystServiceBase}
- * @example
- * (start code)
- * var myFindTSPPathsService = new SuperMap.FindTSPPathsService(url, {
- * eventListeners: {
- * "processCompleted": findTSPPathsCompleted,
- * "processFailed": findTSPPathsError
- * }
- * });
- * (end)
- * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
- * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
- * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var FindTSPPathsService = /*#__PURE__*/function (_NetworkAnalystServic) {
- FindTSPPathsService_inherits(FindTSPPathsService, _NetworkAnalystServic);
- var _super = FindTSPPathsService_createSuper(FindTSPPathsService);
- function FindTSPPathsService(url, options) {
- var _this;
- FindTSPPathsService_classCallCheck(this, FindTSPPathsService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.FindTSPPathsService";
- return _this;
- }
- /**
- * @function SuperMap.FindTSPPathsService.prototype.destroy
- * @override
- */
- FindTSPPathsService_createClass(FindTSPPathsService, [{
- key: "destroy",
- value: function destroy() {
- FindTSPPathsService_get(FindTSPPathsService_getPrototypeOf(FindTSPPathsService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.FindTSPPathsService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.FindTSPPathsParameters} params - 旅行商分析服务参数类。
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof FindTSPPathsParameters)) {
- return;
- }
- var me = this,
- jsonObject;
- me.url = Util.urlPathAppend(me.url, 'tsppath');
- jsonObject = {
- parameter: SuperMap.Util.toJSON(params.parameter),
- endNodeAssigned: params.endNodeAssigned,
- nodes: me.getNodesJson(params)
- };
- me.request({
- method: "GET",
- params: jsonObject,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.FindTSPPathsService.prototype.getNodesJson
- * @description 将节点对象转化为JSON字符串。
- * @param {SuperMap.FindTSPPathsParameters} params - 旅行商分析服务参数类。
- * @returns {string} 转化后的JSON字符串。
- */
- }, {
- key: "getNodesJson",
- value: function getNodesJson(params) {
- var jsonParameters = "",
- nodesString,
- i,
- len,
- nodes;
- if (params.isAnalyzeById === false) {
- for (nodesString = "[", i = 0, nodes = params.nodes, len = nodes.length; i < len; i++) {
- if (i > 0) {
- nodesString += ",";
- }
- nodesString += '{"x":' + nodes[i].x + ',"y":' + nodes[i].y + '}';
- }
- nodesString += ']';
- jsonParameters += nodesString;
- } else if (params.isAnalyzeById === true) {
- var nodeIDsString = "[",
- _nodes = params.nodes,
- _len = _nodes.length;
- for (var _i = 0; _i < _len; _i++) {
- if (_i > 0) {
- nodeIDsString += ",";
- }
- nodeIDsString += _nodes[_i];
- }
- nodeIDsString += ']';
- jsonParameters += nodeIDsString;
- }
- return jsonParameters;
- }
- /**
- * @function SuperMap.FindTSPPathsService.prototype.toGeoJSONResult
- * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
- * @param {Object} result - 服务器返回的结果对象。
- */
- }, {
- key: "toGeoJSONResult",
- value: function toGeoJSONResult(result) {
- if (!result || !result.tspPathList) {
- return null;
- }
- var geoJSONFormat = new GeoJSON();
- result.tspPathList.forEach(function (path) {
- if (path.route) {
- path.route = geoJSONFormat.toGeoJSON(path.route);
- }
- if (path.pathGuideItems) {
- path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
- }
- if (path.edgeFeatures) {
- path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
- }
- if (path.nodeFeatures) {
- path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
- }
- });
- return result;
- }
- }]);
- return FindTSPPathsService;
- }(NetworkAnalystServiceBase);
- SuperMap.FindTSPPathsService = FindTSPPathsService;
- ;// CONCATENATED MODULE: ./src/common/iServer/GenerateSpatialDataParameters.js
- function GenerateSpatialDataParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GenerateSpatialDataParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GenerateSpatialDataParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GenerateSpatialDataParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GenerateSpatialDataParameters
- * @category iServer SpatialAnalyst GenerateSpatialData
- * @classdesc 动态分段操作参数类。通过该类可以为动态分段提供参数信息。
- * @param {Object} options - 参数。
- * @param {string} options.routeTable - 路由数据集。
- * @param {string} options.routeIDField - 路由数据集的标识字段。
- * @param {string} options.eventTable - 用于生成空间数据的事件表名。
- * @param {SuperMap.DataReturnOption} options.dataReturnOption - 设置数据返回选项。
- * @param {string} [options.attributeFilter] - 属性过滤条件。
- * @param {string} options.eventRouteIDField - 用于生成空间数据的事件表的路由标识字段。
- * @param {string} [options.measureField] - 用于生成空间数据的事件表的刻度字段,只有当事件为点事件的时候该属性才有意义。
- * @param {string} [options.measureStartField] - 用于生成空间数据的事件表的起始刻度字段,只有当事件为线事件的时候该属性才有意义。
- * @param {string} [options.measureEndField] - 用于生成空间数据的事件表的终止刻度字段,只有当事件为线事件的时候该属性才有意义。
- * @param {string} [options.measureOffsetField] - 刻度偏移量字段。
- * @param {string} [options.errorInfoField] - 错误信息字段,直接写入原事件表,用于描述事件未能生成对应的点或线时的错误信息。
- * @param {Array.<string>} [options.retainedFields] - 欲保留到结果空间数据中的字段集合(系统字段除外)。
- */
- var GenerateSpatialDataParameters = /*#__PURE__*/function () {
- function GenerateSpatialDataParameters(options) {
- GenerateSpatialDataParameters_classCallCheck(this, GenerateSpatialDataParameters);
- /**
- * @member {string} SuperMap.GenerateSpatialDataParameters.prototype.routeTable
- * @description 路由数据集。
- */
- this.routeTable = null;
- /**
- * @member {string} SuperMap.GenerateSpatialDataParameters.prototype.routeIDField
- * @description 路由数据集的标识字段。
- */
- this.routeIDField = null;
- /**
- * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.attributeFilter]
- * @description 属性过滤条件。
- * 当 {@link SuperMap.GenerateSpatialDataParameters.prototype.dataReturnOption.dataReturnMode} 为 {@link DataReturnMode.DATASET_AND_RECORDSET} 或 {@link DataReturnMode.RECORDSET_ONLY} 时有效。
- */
- this.attributeFilter = null;
- /**
- * @member {string} SuperMap.GenerateSpatialDataParameters.prototype.eventTable
- * @description 用于生成空间数据的事件表名。
- */
- this.eventTable = null;
- /**
- * @member {string} SuperMap.GenerateSpatialDataParameters.prototype.eventRouteIDField
- * @description 用于生成空间数据的事件表的路由标识字段。
- */
- this.eventRouteIDField = null;
- /**
- * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.measureField]
- * @description 用于生成空间数据的事件表的刻度字段,只有当事件为点事件的时候该属性才有意义
- */
- this.measureField = null;
- /**
- * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.measureStartField]
- * @description 用于生成空间数据的事件表的起始刻度字段,只有当事件为线事件的时候该属性才有意义。
- */
- this.measureStartField = null;
- /**
- * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.measureEndField]
- * @description 用于生成空间数据的事件表的终止刻度字段,只有当事件为线事件的时候该属性才有意义。
- */
- this.measureEndField = null;
- /**
- * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.measureOffsetField]
- * @description 刻度偏移量字段。
- */
- this.measureOffsetField = null;
- /**
- * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.errorInfoField]
- * @description 错误信息字段,直接写入原事件表,用于描述事件未能生成对应的点或线时的错误信息。
- */
- this.errorInfoField = null;
- /**
- * @member {Array.<string>} [SuperMap.GenerateSpatialDataParameters.prototype.retainedFields]
- * @description 欲保留到结果空间数据中的字段集合(系统字段除外)。
- * 生成空间数据时,无论是否指定保留字段,路由 ID 字段、刻度偏移量字段、刻度值字段(点事件为刻度字段,线事件是起始和终止刻度字段)都会保留到结果空间数据中;
- * 如果没有指定 retainedFields 参数或者 retainedFields 参数数组长度为 0,则返回所有用户字段。
- */
- this.retainedFields = null;
- /**
- * @member {SuperMap.DataReturnOption} SuperMap.GenerateSpatialDataParameters.prototype.dataReturnOption
- * @description 设置数据返回的选项。
- */
- this.dataReturnOption = null;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.GenerateSpatialDataParameters";
- }
- /**
- * @function SuperMap.GenerateSpatialDataParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- GenerateSpatialDataParameters_createClass(GenerateSpatialDataParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- if (me.routeTable) {
- me.routeTable = null;
- }
- me.routeIDField = null;
- me.attributeFilter = null;
- me.eventTable = null;
- me.eventRouteIDField = null;
- me.measureField = null;
- me.measureStartField = null;
- me.measureEndField = null;
- me.measureOffsetField = null;
- me.errorInfoField = null;
- if (me.dataReturnOption) {
- me.dataReturnOption.destroy();
- me.dataReturnOption = null;
- }
- }
- }]);
- return GenerateSpatialDataParameters;
- }();
- SuperMap.GenerateSpatialDataParameters = GenerateSpatialDataParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/GenerateSpatialDataService.js
- 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); }
- function GenerateSpatialDataService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GenerateSpatialDataService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GenerateSpatialDataService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GenerateSpatialDataService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GenerateSpatialDataService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GenerateSpatialDataService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GenerateSpatialDataService_setPrototypeOf(o, p) { GenerateSpatialDataService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GenerateSpatialDataService_setPrototypeOf(o, p); }
- 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); }; }
- function GenerateSpatialDataService_possibleConstructorReturn(self, call) { if (call && (GenerateSpatialDataService_typeof(call) === "object" || typeof call === "function")) { return call; } return GenerateSpatialDataService_assertThisInitialized(self); }
- function GenerateSpatialDataService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GenerateSpatialDataService_getPrototypeOf(o) { GenerateSpatialDataService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GenerateSpatialDataService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GenerateSpatialDataService
- * @category iServer SpatialAnalyst GenerateSpatialData
- * @classdesc 动态分段分析服务类。该类负责将客户设置的动态分段分析服务参数传递给服务端,并接收服务端返回的动态分段分析结果数据。
- * 获取的结果数据包括 originResult 、result 两种,其中,originResult 为服务端返回的用 JSON 对象表示的动态分段分析结果数据,result 为服务端返回的动态分段分析结果数据。
- * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
- * @param {Object} options - 参数。</br>
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {SuperMap.SpatialAnalystBase}
- * @example 实例化该类如下例所示:
- * (start code)
- * function GenerateSpatialData(){
- *
- * //配置数据返回选项(option)
- * var option = new SuperMap.DataReturnOption({
- * expectCount: 1000,
- * dataset: "generateSpatialData",
- * deleteExistResultDataset: true,
- * dataReturnMode: SuperMap.DataReturnMode.DATASET_ONLY
- * }),
- * //配置动态分段参数(Parameters)
- * parameters = new SuperMap.GenerateSpatialDataParameters({
- * routeTable: "RouteDT_road@Changchun",
- * routeIDField: "RouteID",
- * eventTable: "LinearEventTabDT@Changchun",
- * eventRouteIDField: "RouteID",
- * measureField: "",
- * measureStartField: "LineMeasureFrom",
- * measureEndField: "LineMeasureTo",
- * measureOffsetField: "",
- * errorInfoField: "",
- * retainedFields:[],
- * dataReturnOption: option
- * }),
- * //配置动态分段iService
- * iService = new SuperMap.GenerateSpatialDataService(Changchun_spatialanalyst, {
- * eventListeners: {
- * processCompleted: generateCompleted,
- * processFailed: generateFailded
- * }
- * });
- * //执行
- * iService.processAsync(parameters);
- * function Completed(generateSpatialDataEventArgs){//todo};
- * function Error(generateSpatialDataEventArgs){//todo};
- * (end)
- */
- var GenerateSpatialDataService = /*#__PURE__*/function (_SpatialAnalystBase) {
- GenerateSpatialDataService_inherits(GenerateSpatialDataService, _SpatialAnalystBase);
- var _super = GenerateSpatialDataService_createSuper(GenerateSpatialDataService);
- function GenerateSpatialDataService(url, options) {
- var _this;
- GenerateSpatialDataService_classCallCheck(this, GenerateSpatialDataService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.GenerateSpatialDataService";
- return _this;
- }
- /**
- * @function SuperMap.GenerateSpatialDataService.prototype.destroy
- * @override
- */
- GenerateSpatialDataService_createClass(GenerateSpatialDataService, [{
- key: "destroy",
- value: function destroy() {
- GenerateSpatialDataService_get(GenerateSpatialDataService_getPrototypeOf(GenerateSpatialDataService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.GenerateSpatialDataService.prototype.processAsync
- * @description 负责将客户端的动态分段服务参数传递到服务端。
- * @param {SuperMap.GenerateSpatialDataParameters} params - 动态分段操作参数类。
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof GenerateSpatialDataParameters)) {
- return;
- }
- var me = this,
- jsonParameters;
- jsonParameters = me.getJsonParameters(params);
- me.request({
- method: "POST",
- data: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.GenerateSpatialDataService.prototype.getJsonParameters
- * @description 将参数转化为 JSON 字符串。
- * @param {SuperMap.GenerateSpatialDataParameters} params - 动态分段操作参数类。
- * @returns {string}转化后的JSON字符串。
- */
- }, {
- key: "getJsonParameters",
- value: function getJsonParameters(params) {
- var jsonParameters = "",
- jsonStr = "datasets/" + params.routeTable + "/linearreferencing/generatespatialdata",
- me = this;
- me.url = Util.urlPathAppend(me.url, jsonStr);
- me.url = Util.urlAppend(me.url, 'returnContent=true');
- jsonParameters = Util.toJSON(params);
- return jsonParameters;
- }
- }]);
- return GenerateSpatialDataService;
- }(SpatialAnalystBase);
- SuperMap.GenerateSpatialDataService = GenerateSpatialDataService;
- ;// CONCATENATED MODULE: ./src/common/iServer/GeoBoundingBoxQueryBuilderParameter.js
- 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); }
- function GeoBoundingBoxQueryBuilderParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GeoBoundingBoxQueryBuilderParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoBoundingBoxQueryBuilderParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoBoundingBoxQueryBuilderParameter_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GeoBoundingBoxQueryBuilderParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoBoundingBoxQueryBuilderParameter_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GeoBoundingBoxQueryBuilderParameter_setPrototypeOf(o, p) { GeoBoundingBoxQueryBuilderParameter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoBoundingBoxQueryBuilderParameter_setPrototypeOf(o, p); }
- 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); }; }
- function GeoBoundingBoxQueryBuilderParameter_possibleConstructorReturn(self, call) { if (call && (GeoBoundingBoxQueryBuilderParameter_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoBoundingBoxQueryBuilderParameter_assertThisInitialized(self); }
- function GeoBoundingBoxQueryBuilderParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GeoBoundingBoxQueryBuilderParameter_getPrototypeOf(o) { GeoBoundingBoxQueryBuilderParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoBoundingBoxQueryBuilderParameter_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GeoBoundingBoxQueryBuilderParameter
- * @classdesc bounds 查询参数设置类,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
- * @category iServer Data FeatureResults
- * @param {Object} options - 参数。
- * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 查询范围。
- * @param {SuperMap.AggregationQueryBuilderType} [options.queryType=SuperMap.AggregationQueryBuilderType.GEO_BOUNDING_BOX] - 查询类型。
- */
- var GeoBoundingBoxQueryBuilderParameter = /*#__PURE__*/function (_AggQueryBuilderParam) {
- GeoBoundingBoxQueryBuilderParameter_inherits(GeoBoundingBoxQueryBuilderParameter, _AggQueryBuilderParam);
- var _super = GeoBoundingBoxQueryBuilderParameter_createSuper(GeoBoundingBoxQueryBuilderParameter);
- function GeoBoundingBoxQueryBuilderParameter(options) {
- var _this;
- GeoBoundingBoxQueryBuilderParameter_classCallCheck(this, GeoBoundingBoxQueryBuilderParameter);
- _this = _super.call(this, options);
- /**
- * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.GeoBoundingBoxQueryBuilderParameter.prototype.bounds
- * @description 查询范围。
- */
- _this.bounds = null;
- /**
- * @member {SuperMap.AggregationQueryBuilderType} [SuperMap.GeoBoundingBoxQueryBuilderParameter.prototype.queryType=SuperMap.AggregationQueryBuilderType.GEO_BOUNDING_BOX]
- * @description 查询类型。
- */
- _this.queryType = AggregationQueryBuilderType.GEO_BOUNDING_BOX;
- _this.CLASS_NAME = "SuperMap.GeoBoundingBoxQueryBuilderParameter";
- Util.extend(GeoBoundingBoxQueryBuilderParameter_assertThisInitialized(_this), options);
- return _this;
- }
- GeoBoundingBoxQueryBuilderParameter_createClass(GeoBoundingBoxQueryBuilderParameter, [{
- key: "destroy",
- value: function destroy() {
- GeoBoundingBoxQueryBuilderParameter_get(GeoBoundingBoxQueryBuilderParameter_getPrototypeOf(GeoBoundingBoxQueryBuilderParameter.prototype), "destroy", this).call(this);
- this.bounds = null;
- this.queryType = null;
- }
- }]);
- return GeoBoundingBoxQueryBuilderParameter;
- }(AggQueryBuilderParameter);
- SuperMap.GeoBoundingBoxQueryBuilderParameter = GeoBoundingBoxQueryBuilderParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/GeoHashGridAggParameter.js
- 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); }
- function GeoHashGridAggParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GeoHashGridAggParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoHashGridAggParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoHashGridAggParameter_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GeoHashGridAggParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoHashGridAggParameter_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GeoHashGridAggParameter_setPrototypeOf(o, p) { GeoHashGridAggParameter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoHashGridAggParameter_setPrototypeOf(o, p); }
- 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); }; }
- function GeoHashGridAggParameter_possibleConstructorReturn(self, call) { if (call && (GeoHashGridAggParameter_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoHashGridAggParameter_assertThisInitialized(self); }
- function GeoHashGridAggParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GeoHashGridAggParameter_getPrototypeOf(o) { GeoHashGridAggParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoHashGridAggParameter_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GeoHashGridAggParameter
- * @classdesc 格网聚合查询参数类,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
- * @category iServer Data FeatureResults
- * @param {Object} option - 初始化参数。
- * @param {number} [option.precision=5] - 网格中数字的精度。
- * @param {SuperMap.AggregationType} [option.aggType=SuperMap.AggregationType.GEOHASH_GRID] - 格网聚合类型。
- */
- var GeoHashGridAggParameter = /*#__PURE__*/function (_AggregationParameter) {
- GeoHashGridAggParameter_inherits(GeoHashGridAggParameter, _AggregationParameter);
- var _super = GeoHashGridAggParameter_createSuper(GeoHashGridAggParameter);
- function GeoHashGridAggParameter(option) {
- var _this;
- GeoHashGridAggParameter_classCallCheck(this, GeoHashGridAggParameter);
- _this = _super.call(this, option);
- /**
- * @member {number} [SuperMap.GeoHashGridAggParameter.prototype.precision=5]
- * @description 网格中数字的精度。
- */
- _this.precision = 5;
- /**
- * @member {SuperMap.AggregationType} [SuperMap.GeoHashGridAggParameter.prototype.aggType=SuperMap.AggregationType.GEOHASH_GRID]
- * @description 格网聚合类型。
- */
- _this.aggType = AggregationType.GEOHASH_GRID;
- Util.extend(GeoHashGridAggParameter_assertThisInitialized(_this), option);
- _this.CLASS_NAME = "SuperMap.GeoHashGridAggParameter";
- return _this;
- }
- GeoHashGridAggParameter_createClass(GeoHashGridAggParameter, [{
- key: "destroy",
- value: function destroy() {
- GeoHashGridAggParameter_get(GeoHashGridAggParameter_getPrototypeOf(GeoHashGridAggParameter.prototype), "destroy", this).call(this);
- this.aggType = null;
- }
- /**
- * @function SuperMap.GeoHashGridAggParameter.toJsonParameters
- * @description 将对象转为 JSON 格式。
- * @param param 转换对象。
- * @returns {string|object}
- */
- }], [{
- key: "toJsonParameters",
- value: function toJsonParameters(param) {
- var parameters = {
- aggName: param.aggName,
- aggFieldName: param.aggFieldName,
- aggType: param.aggType,
- precision: param.precision
- };
- if (param.subAgg) {
- parameters.subAgg = param.subAgg;
- }
- return Util.toJson(parameters);
- }
- }]);
- return GeoHashGridAggParameter;
- }(AggregationParameter);
- SuperMap.GeoHashGridAggParameter = GeoHashGridAggParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/GeometryOverlayAnalystParameters.js
- 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); }
- function GeometryOverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GeometryOverlayAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryOverlayAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryOverlayAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GeometryOverlayAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryOverlayAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GeometryOverlayAnalystParameters_setPrototypeOf(o, p) { GeometryOverlayAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryOverlayAnalystParameters_setPrototypeOf(o, p); }
- 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); }; }
- function GeometryOverlayAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometryOverlayAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GeometryOverlayAnalystParameters_assertThisInitialized(self); }
- function GeometryOverlayAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GeometryOverlayAnalystParameters_getPrototypeOf(o) { GeometryOverlayAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryOverlayAnalystParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GeometryOverlayAnalystParameters
- * @category iServer SpatialAnalyst OverlayAnalyst
- * @classdesc
- * 几何对象叠加分析参数类。对指定的某两个几何对象做叠加分析。通过该类可以指定要做叠加分析的几何对象、叠加操作类型。
- * @param {Object} options - 参数。
- * @param {Object} options.operateGeometry - 叠加分析的操作几何对象。 </br>
- * 点类型可以是:{@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>
- * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link GeoJSONObject}。</br>
- * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link GeoJSONObject}。
- * @param {Object} options.sourceGeometry - 叠加分析的源几何对象。
- * @param {Array.<Object>} [options.operateGeometries] - 批量叠加分析的操作几何对象数组。
- * @param {Array.<Object>} [options.sourceGeometries] -批量叠加分析的源几何对象数组。
- * @param {SuperMap.OverlayOperationType} [options.operation] - 叠加操作枚举值。
- * @extends {SuperMap.OverlayAnalystParameters}
- */
- var GeometryOverlayAnalystParameters = /*#__PURE__*/function (_OverlayAnalystParame) {
- GeometryOverlayAnalystParameters_inherits(GeometryOverlayAnalystParameters, _OverlayAnalystParame);
- var _super = GeometryOverlayAnalystParameters_createSuper(GeometryOverlayAnalystParameters);
- function GeometryOverlayAnalystParameters(options) {
- var _this;
- GeometryOverlayAnalystParameters_classCallCheck(this, GeometryOverlayAnalystParameters);
- _this = _super.call(this, options);
- if (options && options.operateGeometry) {
- _this.operateGeometry = options.operateGeometry;
- }
- if (options && options.sourceGeometry) {
- _this.sourceGeometry = options.sourceGeometry;
- }
- if (options && options.operateGeometries) {
- _this.operateGeometries = options.operateGeometries;
- }
- if (options && options.sourceGeometries) {
- _this.sourceGeometries = options.sourceGeometries;
- }
- if (options) {
- Util.extend(GeometryOverlayAnalystParameters_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.GeometryOverlayAnalystParameters";
- return _this;
- }
- /**
- * @function SuperMap.GeometryOverlayAnalystParameters.prototype.destroy
- * @override
- */
- GeometryOverlayAnalystParameters_createClass(GeometryOverlayAnalystParameters, [{
- key: "destroy",
- value: function destroy() {
- GeometryOverlayAnalystParameters_get(GeometryOverlayAnalystParameters_getPrototypeOf(GeometryOverlayAnalystParameters.prototype), "destroy", this).call(this);
- var me = this;
- if (me.sourceGeometry) {
- me.sourceGeometry.destroy();
- me.sourceGeometry = null;
- }
- if (me.sourceGeometries) {
- me.sourceGeometries.destroy();
- me.sourceGeometries = null;
- }
- if (me.sourceGeometry) {
- me.sourceGeometry.destroy();
- me.sourceGeometry = null;
- }
- if (me.operateGeometries) {
- me.operateGeometries.destroy();
- me.operateGeometries = null;
- }
- }
- /**
- * @function SuperMap.GeometryOverlayAnalystParameters.toObject
- * @param {SuperMap.GeometryOverlayAnalystParameters} geometryOverlayAnalystParameters - 几何对象叠加分析参数类。
- * @param {SuperMap.GeometryOverlayAnalystParameters} tempObj - 几何对象叠加分析参数对象。
- * @description 将几何对象叠加分析参数对象转换为 JSON 对象。
- * @returns {Object} JSON 对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(geometryOverlayAnalystParameters, tempObj) {
- for (var name in geometryOverlayAnalystParameters) {
- if (name === "sourceGeometry") {
- tempObj.sourceGeometry = ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.sourceGeometry);
- } else if (name === "sourceGeometries") {
- var sourceGeometries = [];
- for (var i = 0; i < geometryOverlayAnalystParameters.sourceGeometries.length; i++) {
- sourceGeometries.push(ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.sourceGeometries[i]));
- }
- tempObj.sourceGeometries = sourceGeometries;
- } else if (name === "operateGeometry") {
- tempObj.operateGeometry = ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.operateGeometry);
- } else if (name === "operateGeometries") {
- var operateGeometries = [];
- for (var j = 0; j < geometryOverlayAnalystParameters.operateGeometries.length; j++) {
- operateGeometries.push(ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.operateGeometries[j]));
- }
- tempObj.operateGeometries = operateGeometries;
- } else {
- tempObj[name] = geometryOverlayAnalystParameters[name];
- }
- }
- }
- }]);
- return GeometryOverlayAnalystParameters;
- }(OverlayAnalystParameters);
- SuperMap.GeometryOverlayAnalystParameters = GeometryOverlayAnalystParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/GeometrySurfaceAnalystParameters.js
- 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); }
- function GeometrySurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GeometrySurfaceAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometrySurfaceAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometrySurfaceAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GeometrySurfaceAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometrySurfaceAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GeometrySurfaceAnalystParameters_setPrototypeOf(o, p) { GeometrySurfaceAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometrySurfaceAnalystParameters_setPrototypeOf(o, p); }
- 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); }; }
- function GeometrySurfaceAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometrySurfaceAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GeometrySurfaceAnalystParameters_assertThisInitialized(self); }
- function GeometrySurfaceAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GeometrySurfaceAnalystParameters_getPrototypeOf(o) { GeometrySurfaceAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometrySurfaceAnalystParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GeometrySurfaceAnalystParameters
- * @category iServer SpatialAnalyst SurfaceAnalyst
- * @classdesc 几何对象表面分析参数类。该类对几何对象表面分析所用到的参数进行设置。
- * @param {Object} options - 参数。
- * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} options.points - 表面分析的坐标点数组。
- * @param {Array.<number>} options.zValues - 表面分析的坐标点的 Z 值数组。
- * @param {number} [options.resolution] - 获取或设置指定中间结果(栅格数据集)的分辨率。
- * @param {SuperMap.DataReturnOption} [options.resultSetting] - 结果返回设置类。
- * @param {SuperMap.SurfaceAnalystParametersSetting} options.extractParameter - 获取或设置表面分析参数。
- * @param {SuperMap.SurfaceAnalystMethod} [options.surfaceAnalystMethod = SuperMap.SurfaceAnalystMethod.ISOLINE] - 获取或设置表面分析的提取方法,提取等值线和提取等值面。
- * @extends {SuperMap.SurfaceAnalystParameters}
- */
- var GeometrySurfaceAnalystParameters = /*#__PURE__*/function (_SurfaceAnalystParame) {
- GeometrySurfaceAnalystParameters_inherits(GeometrySurfaceAnalystParameters, _SurfaceAnalystParame);
- var _super = GeometrySurfaceAnalystParameters_createSuper(GeometrySurfaceAnalystParameters);
- function GeometrySurfaceAnalystParameters(options) {
- var _this;
- GeometrySurfaceAnalystParameters_classCallCheck(this, GeometrySurfaceAnalystParameters);
- _this = _super.call(this, options);
- /**
- * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} SuperMap.GeometrySurfaceAnalystParameters.prototype.points
- * @description 获取或设置用于表面分析的坐标点数组。
- */
- _this.points = null;
- /**
- * @member {Array.<number>} SuperMap.GeometrySurfaceAnalystParameters.prototype.zValues
- * @description 获取或设置用于提取操作的值。提取等值线时,将使用该数组中的值,
- * 对几何对象中的坐标点数组进行插值分析,得到栅格数据集(中间结果),接着从栅格数据集提取等值线。
- */
- _this.zValues = null;
- if (options) {
- Util.extend(GeometrySurfaceAnalystParameters_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.GeometrySurfaceAnalystParameters";
- return _this;
- }
- /**
- * @function SuperMap.GeometrySurfaceAnalystParameters.prototype.destroy
- * @override
- */
- GeometrySurfaceAnalystParameters_createClass(GeometrySurfaceAnalystParameters, [{
- key: "destroy",
- value: function destroy() {
- GeometrySurfaceAnalystParameters_get(GeometrySurfaceAnalystParameters_getPrototypeOf(GeometrySurfaceAnalystParameters.prototype), "destroy", this).call(this);
- var me = this;
- if (me.points) {
- for (var i = 0, points = me.points, len = points.length; i < len; i++) {
- points[i].destroy();
- }
- me.points = null;
- }
- me.zValues = null;
- }
- }]);
- return GeometrySurfaceAnalystParameters;
- }(SurfaceAnalystParameters);
- SuperMap.GeometrySurfaceAnalystParameters = GeometrySurfaceAnalystParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/GeometryThiessenAnalystParameters.js
- 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); }
- function GeometryThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GeometryThiessenAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryThiessenAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryThiessenAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GeometryThiessenAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryThiessenAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GeometryThiessenAnalystParameters_setPrototypeOf(o, p) { GeometryThiessenAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryThiessenAnalystParameters_setPrototypeOf(o, p); }
- 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); }; }
- function GeometryThiessenAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometryThiessenAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GeometryThiessenAnalystParameters_assertThisInitialized(self); }
- function GeometryThiessenAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GeometryThiessenAnalystParameters_getPrototypeOf(o) { GeometryThiessenAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryThiessenAnalystParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GeometryThiessenAnalystParameters
- * @constructs SuperMap.GeometryThiessenAnalystParameters
- * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
- * @classdesc 几何对象泰森多边形分析参数类。对指定的某个几何对象做泰森多边形分析。通过该类可以指定要做泰森多边形分析的几何对象、返回数据集名称等。
- * @param {Object} options - 参数。
- * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} options.points - 使用点数组进行分析时使用的几何对象。
- * @extends {SuperMap.ThiessenAnalystParameters}
- */
- var GeometryThiessenAnalystParameters = /*#__PURE__*/function (_ThiessenAnalystParam) {
- GeometryThiessenAnalystParameters_inherits(GeometryThiessenAnalystParameters, _ThiessenAnalystParam);
- var _super = GeometryThiessenAnalystParameters_createSuper(GeometryThiessenAnalystParameters);
- function GeometryThiessenAnalystParameters(options) {
- var _this;
- GeometryThiessenAnalystParameters_classCallCheck(this, GeometryThiessenAnalystParameters);
- _this = _super.call(this, options);
- /**
- * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} SuperMap.GeometryThiessenAnalystParameters.prototype.points
- * @description 使用点数组进行分析时使用的几何对象。
- */
- _this.points = null;
- if (options) {
- Util.extend(GeometryThiessenAnalystParameters_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.GeometryThiessenAnalystParameters";
- return _this;
- }
- /**
- * @function SuperMap.GeometryThiessenAnalystParameters.prototype.destroy
- * @override
- */
- GeometryThiessenAnalystParameters_createClass(GeometryThiessenAnalystParameters, [{
- key: "destroy",
- value: function destroy() {
- GeometryThiessenAnalystParameters_get(GeometryThiessenAnalystParameters_getPrototypeOf(GeometryThiessenAnalystParameters.prototype), "destroy", this).call(this);
- var me = this;
- if (me.points) {
- for (var i = me.points.length - 1; i >= 0; i--) {
- me.points[i].destroy();
- }
- me.points = null;
- }
- }
- /**
- * @function SuperMap.GeometryThiessenAnalystParameters.toObject
- * @param {SuperMap.GeometryThiessenAnalystParameters} geometryThiessenAnalystParameters - 几何对象泰森多边形分析参数类。
- * @param {SuperMap.GeometryThiessenAnalystParameters} tempObj - 几何对象泰森多边形分析参数对象。
- * @description 将几何对象泰森多边形分析参数对象转换为 JSON 对象。
- * @returns {Object} JSON 对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(geometryThiessenAnalystParameters, tempObj) {
- for (var name in geometryThiessenAnalystParameters) {
- if (name === "clipRegion") {
- tempObj.clipRegion = ServerGeometry.fromGeometry(geometryThiessenAnalystParameters.clipRegion);
- } else {
- tempObj[name] = geometryThiessenAnalystParameters[name];
- }
- }
- }
- }]);
- return GeometryThiessenAnalystParameters;
- }(ThiessenAnalystParameters);
- SuperMap.GeometryThiessenAnalystParameters = GeometryThiessenAnalystParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/GeoprocessingService.js
- 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); }
- function GeoprocessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GeoprocessingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoprocessingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoprocessingService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GeoprocessingService_setPrototypeOf(o, p) { GeoprocessingService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoprocessingService_setPrototypeOf(o, p); }
- 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); }; }
- function GeoprocessingService_possibleConstructorReturn(self, call) { if (call && (GeoprocessingService_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoprocessingService_assertThisInitialized(self); }
- function GeoprocessingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GeoprocessingService_getPrototypeOf(o) { GeoprocessingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoprocessingService_getPrototypeOf(o); }
- /**
- * @class SuperMap.GeoprocessingService
- * @category iServer GeoprocessingService
- * @classdesc 地理处理服务接口的基类。
- * @version 10.1.0
- * @extends {SuperMap.CommonServiceBase}
- * @param {string} url - 服务地址。
- * @param {Object} options - 参数。
- * @param {SuperMap.Events} options.events - 处理所有事件的对象。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,iServer|iPortal|Online。
- * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
- */
- var GeoprocessingService = /*#__PURE__*/function (_CommonServiceBase) {
- GeoprocessingService_inherits(GeoprocessingService, _CommonServiceBase);
- var _super = GeoprocessingService_createSuper(GeoprocessingService);
- function GeoprocessingService(url, options) {
- var _this;
- GeoprocessingService_classCallCheck(this, GeoprocessingService);
- options = options || {};
- options.EVENT_TYPES = ['processCompleted', 'processFailed', 'processRunning'];
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = 'SuperMap.GeoprocessingService';
- _this.headers = {};
- _this.crossOrigin = true;
- return _this;
- }
- /**
- * @function SuperMap.GeoprocessingService.prototype.getTools
- * @description 获取地理处理工具列表。
- */
- GeoprocessingService_createClass(GeoprocessingService, [{
- key: "getTools",
- value: function getTools() {
- this._get("".concat(this.url, "/list"));
- }
- /**
- * @function SuperMap.GeoprocessingService.prototype.getTool
- * @description 获取地理处理工具的ID、名称、描述、输入参数、环境参数和输出结果等相关参数。
- * @param {string} identifier - 地理处理工具ID。
- */
- }, {
- key: "getTool",
- value: function getTool(identifier) {
- this._get("".concat(this.url, "/").concat(identifier));
- }
- /**
- * @function SuperMap.GeoprocessingService.prototype.execute
- * @description 同步执行地理处理工具。
- * @param {string} identifier - 地理处理工具ID。
- * @param {Object} parameter - 地理处理工具的输入参数。
- * @param {Object} environment - 地理处理工具的环境参数。
- */
- }, {
- key: "execute",
- value: function execute(identifier, parameter, environment) {
- parameter = parameter ? parameter : null;
- environment = environment ? environment : null;
- var executeParamter = {
- parameter: parameter,
- environment: environment
- };
- this._get("".concat(this.url, "/").concat(identifier, "/execute"), executeParamter);
- }
- /**
- * @function SuperMap.GeoprocessingService.prototype.submitJob
- * @description 异步执行地理处理工具。
- * @param {string} identifier - 地理处理工具ID。
- * @param {Object} parameter - 地理处理工具的输入参数。
- * @param {Object} environments - 地理处理工具的环境参数。
- */
- }, {
- key: "submitJob",
- value: function submitJob(identifier, parameter, environments) {
- parameter = parameter ? parameter : null;
- environments = environments ? environments : null;
- var asyncParamter = {
- parameter: parameter,
- environments: environments
- };
- this.request({
- url: "".concat(this.url, "/").concat(identifier, "/jobs"),
- headers: {
- 'Content-type': 'application/json'
- },
- method: 'POST',
- data: JSON.stringify(asyncParamter),
- scope: this,
- success: this.serviceProcessCompleted,
- failure: this.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.GeoprocessingService.prototype.waitForJobCompletion
- * @description 获取地理处理异步执行状态信息。
- * @param {string} jobId - 地理处理任务ID。
- * @param {string} identifier - 地理处理工具ID。
- * @param {Object} options - 状态信息参数。
- * @param {number} options.interval - 定时器时间间隔。
- * @param {Callback} options.statusCallback - 任务状态的回调函数。
- */
- }, {
- key: "waitForJobCompletion",
- value: function waitForJobCompletion(jobId, identifier, options) {
- var me = this;
- var timer = setInterval(function () {
- var serviceProcessCompleted = function serviceProcessCompleted(serverResult) {
- var state = serverResult.state.runState;
- if (options.statusCallback) {
- options.statusCallback(state);
- }
- switch (state) {
- case 'FINISHED':
- clearInterval(timer);
- me.events.triggerEvent('processCompleted', {
- result: serverResult
- });
- break;
- case 'FAILED':
- clearInterval(timer);
- me.events.triggerEvent('processFailed', {
- result: serverResult
- });
- break;
- case 'CANCELED':
- clearInterval(timer);
- me.events.triggerEvent('processFailed', {
- result: serverResult
- });
- break;
- }
- };
- me._get("".concat(me.url, "/").concat(identifier, "/jobs/").concat(jobId), null, serviceProcessCompleted);
- }, options.interval);
- }
- /**
- * @function SuperMap.GeoprocessingService.prototype.getJobInfo
- * @description 获取地理处理任务的执行信息。
- * @param {string} identifier - 地理处理工具ID。
- * @param {string} jobId - 地理处理任务ID。
- */
- }, {
- key: "getJobInfo",
- value: function getJobInfo(identifier, jobId) {
- this._get("".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId));
- }
- /**
- * @function SuperMap.GeoprocessingService.prototype.cancelJob
- * @description 取消地理处理任务的异步执行。
- * @param {string} identifier - 地理处理工具ID。
- * @param {string} jobId - 地理处理任务ID。
- */
- }, {
- key: "cancelJob",
- value: function cancelJob(identifier, jobId) {
- this._get("".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId, "/cancel"));
- }
- /**
- * @function SuperMap.GeoprocessingService.prototype.getJobs
- * @description 获取地理处理服务任务列表。
- * @param {string} identifier - 地理处理工具ID。(传参代表identifier算子的任务列表,不传参代表所有任务的列表)
- */
- }, {
- key: "getJobs",
- value: function getJobs(identifier) {
- var url = "".concat(this.url, "/jobs");
- if (identifier) {
- url = "".concat(this.url, "/").concat(identifier, "/jobs");
- }
- this._get(url);
- }
- /**
- * @function SuperMap.GeoprocessingService.prototype.getResults
- * @description 地理处理工具执行的结果等,支持结果过滤。
- * @param {string} identifier - 地理处理工具ID。
- * @param {string} jobId - 地理处理任务ID。
- * @param {string} filter - 输出异步结果的id。(可选,传入filter参数时对该地理处理工具执行的结果进行过滤获取,不填参时显示所有的执行结果)
- */
- }, {
- key: "getResults",
- value: function getResults(identifier, jobId, filter) {
- var url = "".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId, "/results");
- if (filter) {
- url = "".concat(url, "/").concat(filter);
- }
- this._get(url);
- }
- }, {
- key: "_get",
- value: function _get(url, paramter, serviceProcessCompleted, serviceProcessFailed) {
- this.request({
- url: url,
- method: 'GET',
- params: paramter,
- headers: {
- 'Content-type': 'application/json'
- },
- scope: this,
- success: serviceProcessCompleted ? serviceProcessCompleted : this.serviceProcessCompleted,
- failure: serviceProcessFailed ? serviceProcessFailed : this.serviceProcessFailed
- });
- }
- }]);
- return GeoprocessingService;
- }(CommonServiceBase);
- SuperMap.GeoprocessingService = GeoprocessingService;
- ;// CONCATENATED MODULE: ./src/common/iServer/GeoRelationAnalystParameters.js
- function GeoRelationAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GeoRelationAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoRelationAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoRelationAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GeoRelationAnalystParameters
- * @category iServer SpatialAnalyst GeoRelationAnalyst
- * @classdesc 空间关系分析服务参数类。使用该类可以为空间关系分析服务提供所需的参数信息。
- * @param {Object} options - 参数。
- * @param {SuperMap.FilterParameter} options.sourceFilter - 空间关系分析中的源数据集查询参数。仅 name, ids, attributeFilter 和 fields 字段有效。
- * @param {SuperMap.FilterParameter} options.referenceFilter - 空间关系分析中的参考数据集查询参数。仅 name, ids, attributeFilter 和 fields 字段有效。
- * @param {SuperMap.SpatialRelationType} options.spatialRelationType - 指定的空间关系类型。
- * @param {boolean} [options.isBorderInside] - 边界处理方式,即位于面边线上的点是否被面包含。此参数仅用于空间关系为包含或被包含的情况。
- * @param {boolean} [options.returnFeature] - 是否返回 Feature 信息。
- * @param {boolean} [options.returnGeoRelatedOnly=true] - 仅返回满足指定空间关系的空间对象。
- * @param {number} [options.startRecord=0] - 分析结果起始记录位置。
- * @param {number} [options.expectCount=500] - 空间关系分析期望返回结果记录数,如果实际不足500条结果则返回所有分析结果。
- */
- var GeoRelationAnalystParameters = /*#__PURE__*/function () {
- function GeoRelationAnalystParameters(options) {
- GeoRelationAnalystParameters_classCallCheck(this, GeoRelationAnalystParameters);
- /**
- * @member {string} SuperMap.GeoRelationAnalystParameters.prototype.dataset
- * @description 源数据集名称。
- */
- this.dataset = null;
- /**
- * @member {SuperMap.FilterParameter} SuperMap.GeoRelationAnalystParameters.prototype.sourceFilter
- * @description 空间关系分析中的源数据集查询参数。仅 ids、attributeFilter 和 fields 字段有效。
- */
- this.sourceFilter = null;
- /**
- * @member {SuperMap.FilterParameter} SuperMap.GeoRelationAnalystParameters.prototype.referenceFilter
- * @description 空间关系分析中的参考数据集查询参数。仅 name,ids,attributeFilter 和 fields 字段有效。
- */
- this.referenceFilter = null;
- /**
- * @member {SuperMap.SpatialRelationType} SuperMap.GeoRelationAnalystParameters.prototype.spatialRelationType
- * @description 指定的空间关系类型。
- */
- this.spatialRelationType = null;
- /**
- * @member {boolean} [SuperMap.GeoRelationAnalystParameters.prototype.isBorderInside]
- * @description 边界处理方式,即位于面边线上的点是否被面包含。此参数仅用于空间关系为包含或被包含的情况。
- */
- this.isBorderInside = null;
- /**
- * @member {boolean} [SuperMap.GeoRelationAnalystParameters.prototype.returnFeature]
- * @description 是否返回 Feature 信息。
- */
- this.returnFeature = null;
- /**
- * @member {boolean} [SuperMap.GeoRelationAnalystParameters.prototype.returnGeoRelatedOnly=true]
- * @description 是否仅返回满足指定空间关系的空间对象。
- */
- this.returnGeoRelatedOnly = null;
- /**
- * @member {number} [SuperMap.GeoRelationAnalystParameters.prototype.returnGeoRelatedOnly=0]
- * @description 分析结果起始记录位置。
- */
- this.startRecord = 0;
- /**
- * @member {number} [SuperMap.GeoRelationAnalystParameters.prototype.expectCount=500]
- * @description 空间关系分析期望返回结果记录数,如果实际不足 500 条结果则返回所有分析结果。
- */
- this.expectCount = 500;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.GeoRelationAnalystParameters";
- }
- /**
- * @function SuperMap.GeoRelationAnalystParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- GeoRelationAnalystParameters_createClass(GeoRelationAnalystParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- if (me.sourceFilter) {
- me.sourceFilter.destroy();
- }
- me.sourceFilter = null;
- if (me.referenceFilter) {
- me.referenceFilter.destroy();
- }
- me.referenceFilter = null;
- me.dataset = null;
- me.spatialRelationType = null;
- me.isBorderInside = null;
- me.returnFeature = null;
- me.returnGeoRelatedOnly = null;
- me.startRecord = null;
- me.expectCount = null;
- }
- }]);
- return GeoRelationAnalystParameters;
- }();
- SuperMap.GeoRelationAnalystParameters = GeoRelationAnalystParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/GeoRelationAnalystService.js
- 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); }
- function GeoRelationAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GeoRelationAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoRelationAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoRelationAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GeoRelationAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoRelationAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GeoRelationAnalystService_setPrototypeOf(o, p) { GeoRelationAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoRelationAnalystService_setPrototypeOf(o, p); }
- 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); }; }
- function GeoRelationAnalystService_possibleConstructorReturn(self, call) { if (call && (GeoRelationAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoRelationAnalystService_assertThisInitialized(self); }
- function GeoRelationAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GeoRelationAnalystService_getPrototypeOf(o) { GeoRelationAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoRelationAnalystService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GeoRelationAnalystService
- * @category iServer SpatialAnalyst GeoRelationAnalyst
- * @classdesc 空间关系分析服务类。该类负责将客户设置的空间关系分析服务参数传递给服务端,并接收服务端返回的空间关系分析结果数据。
- * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
- * @param {Object} options - 参数。</br>
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {SuperMap.SpatialAnalystBase}
- * @example 实例化该类如下例所示:
- * (start code)
- * function datasetGeoRelationAnalystProcess() {
- * var referenceFilter = new SuperMap.FilterParameter({
- * name:"Frame_R@Changchun",
- * attributeFilter:"SmID>0"});
- * var sourceFilter = new SuperMap.FilterParameter({
- * attributeFilter:"SmID>0"});
- * //初始化服务类
- * var datasetGeoRelationService = new SuperMap.GeoRelationAnalystService(
- * "http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst/"),
- * //构建参数类
- * datasetGeoRelationParameters = new SuperMap.GeoRelationAnalystParameters({
- * dataset: "Park@Changchun",
- * startRecord: 0,
- * expectCount: 20,
- * sourceFilter: sourceFilter,
- * referenceFilter: referenceFilter,
- * spatialRelationType: SuperMap.SpatialRelationType.INTERSECT,
- * isBorderInside: true,
- * returnFeature: true,
- * returnGeoRelatedOnly: true
- * });
- * datasetGeoRelationService.events.on({
- * "processCompleted": datasetGeoRelationAnalystCompleted,
- * "processFailed": datasetGeoRelationAnalystFailed});
- * //执行
- * datasetGeoRelationService.processAsync(datasetGeoRelationParameters);
- * }
- * function Completed(datasetGeoRelationAnalystCompleted){//todo};
- * function Error(datasetGeoRelationAnalystFailed){//todo};
- * (end)
- *
- */
- var GeoRelationAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
- GeoRelationAnalystService_inherits(GeoRelationAnalystService, _SpatialAnalystBase);
- var _super = GeoRelationAnalystService_createSuper(GeoRelationAnalystService);
- function GeoRelationAnalystService(url, options) {
- var _this;
- GeoRelationAnalystService_classCallCheck(this, GeoRelationAnalystService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.GeoRelationAnalystService";
- return _this;
- }
- /**
- * @function SuperMap.GeoRelationAnalystService.prototype.destroy
- * @override
- */
- GeoRelationAnalystService_createClass(GeoRelationAnalystService, [{
- key: "destroy",
- value: function destroy() {
- GeoRelationAnalystService_get(GeoRelationAnalystService_getPrototypeOf(GeoRelationAnalystService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.GeoRelationAnalystService.prototype.processAsync
- * @description 负责将客户端的空间关系分析参数传递到服务端
- * @param {SuperMap.GeoRelationAnalystParameters} parameter - 空间关系分析所需的参数信息。
- */
- }, {
- key: "processAsync",
- value: function processAsync(parameter) {
- if (!(parameter instanceof GeoRelationAnalystParameters)) {
- return;
- }
- var me = this;
- me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/georelation');
- var jsonParameters = SuperMap.Util.toJSON(parameter);
- me.url = Util.urlAppend(me.url, 'returnContent=true');
- me.request({
- method: "POST",
- data: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return GeoRelationAnalystService;
- }(SpatialAnalystBase);
- SuperMap.GeoRelationAnalystService = GeoRelationAnalystService;
- ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesParametersBase.js
- function GetFeaturesParametersBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GetFeaturesParametersBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesParametersBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesParametersBase_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GetFeaturesParametersBase
- * @category iServer Data FeatureResults
- * @classdesc 要素查询参数基类。
- * @param {Object} options - 参数。
- * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
- * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
- * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
- * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
- * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
- * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
- */
- var GetFeaturesParametersBase = /*#__PURE__*/function () {
- function GetFeaturesParametersBase(options) {
- GetFeaturesParametersBase_classCallCheck(this, GetFeaturesParametersBase);
- /**
- * @member {Array.<string>} SuperMap.GetFeaturesParametersBase.prototype.datasetName
- * @description 数据集集合中的数据集名称列表。
- */
- this.datasetNames = null;
- /**
- * @member {string} SuperMap.GetFeaturesParametersBase.prototype.targetEpsgCode
- * @description 动态投影的目标坐标系对应的 EPSG Code,使用时需设置 returnContent 参数为 true。
- */
- this.targetEpsgCode = null;
- /**
- * @member {Object} SuperMap.GetFeaturesParametersBase.prototype.targetEpsgCode
- * @description 动态投影的目标坐标系。使用时需设置 returnContent 参数为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
- */
- this.targetPrj = null;
- /**
- * @member {boolean} [SuperMap.GetFeaturesParametersBase.prototype.returnContent=true]
- * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
- * 如果为 true,则直接返回新创建资源,即查询结果的表述。
- * 如果为 false,则返回的是查询结果资源的 URI。
- */
- this.returnContent = true;
- /**
- * @member {number} [SuperMap.GetFeaturesParametersBase.prototype.fromIndex=0]
- * @description 查询结果的最小索引号。如果该值大于查询结果的最大索引号,则查询结果为空。
- */
- this.fromIndex = 0;
- /**
- * @member {number} [SuperMap.GetFeaturesParametersBase.prototype.toIndex=19]
- * @description 查询结果的最大索引号。如果该值大于查询结果的最大索引号,则以查询结果的最大索引号为终止索引号。
- */
- this.toIndex = 19;
- /**
- * @member {boolean} [SuperMap.GetFeaturesParametersBase.prototype.returnCountOnly=false]
- * @description 只返回查询结果的总数。
- */
- this.returnCountOnly = false;
- /**
- * @member {number} [SuperMap.GetFeaturesParametersBase.prototype.maxFeatures=1000]
- * @description 进行 SQL 查询时,用于设置服务端返回查询结果条目数量。
- */
- this.maxFeatures = null;
- /**
- * @member {Object} SuperMap.GetFeaturesParametersBase.prototype.aggregations
- * @description 聚合查询参数,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
- */
- this.aggregations = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.GetFeaturesParametersBase";
- }
- /**
- *
- * @function SuperMap.GetFeaturesParametersBase.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- GetFeaturesParametersBase_createClass(GetFeaturesParametersBase, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.datasetNames = null;
- me.returnContent = null;
- me.fromIndex = null;
- me.toIndex = null;
- me.maxFeatures = null;
- me.targetEpsgCode = null;
- me.targetPrj = null;
- if (me.aggregation) {
- me.aggregation = null;
- }
- }
- }]);
- return GetFeaturesParametersBase;
- }();
- SuperMap.GetFeaturesParametersBase = GetFeaturesParametersBase;
- ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBoundsParameters.js
- 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); }
- function GetFeaturesByBoundsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GetFeaturesByBoundsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBoundsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBoundsParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GetFeaturesByBoundsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBoundsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GetFeaturesByBoundsParameters_setPrototypeOf(o, p) { GetFeaturesByBoundsParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBoundsParameters_setPrototypeOf(o, p); }
- 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); }; }
- function GetFeaturesByBoundsParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBoundsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByBoundsParameters_assertThisInitialized(self); }
- function GetFeaturesByBoundsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GetFeaturesByBoundsParameters_getPrototypeOf(o) { GetFeaturesByBoundsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBoundsParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GetFeaturesByBoundsParameters
- * @category iServer Data FeatureResults
- * @classdesc 数据集范围查询参数类,该类用于设置数据集范围查询的相关参数。
- * @param {Object} options - 参数。
- * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 用于查询的范围对象。
- * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
- * @param {string} [options.attributeFilter] - 范围查询属性过滤条件。
- * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
- * @param {SuperMap.SpatialQueryMode} [options.spatialQueryMode=SuperMap.SpatialQueryMode.CONTAIN] - 空间查询模式常量。
- * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
- * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
- * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
- * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
- * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
- * @extends {SuperMap.GetFeaturesParametersBase}
- */
- var GetFeaturesByBoundsParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
- GetFeaturesByBoundsParameters_inherits(GetFeaturesByBoundsParameters, _GetFeaturesParameter);
- var _super = GetFeaturesByBoundsParameters_createSuper(GetFeaturesByBoundsParameters);
- function GetFeaturesByBoundsParameters(options) {
- var _this;
- GetFeaturesByBoundsParameters_classCallCheck(this, GetFeaturesByBoundsParameters);
- _this = _super.call(this, options);
- /**
- * @member {string} SuperMap.GetFeaturesByBoundsParameters.prototype.getFeatureMode
- * @description 数据集查询模式。范围查询有 "BOUNDS","BOUNDS_ATTRIBUTEFILTER" 两种,当用户设置 attributeFilter 时会自动切换到 BOUNDS_ATTRIBUTEFILTER 访问服务。
- */
- _this.getFeatureMode = GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS;
- /**
- * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.GetFeaturesByBoundsParameters.prototype.bounds
- * @description 用于查询的范围对象。
- *
- */
- _this.bounds = null;
- /**
- * @member {Array.<string>} SuperMap.GetFeaturesByBoundsParameters.prototype.fields
- * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
- */
- _this.fields = null;
- /**
- * @member {string} SuperMap.GetFeaturesByBoundsParameters.prototype.attributeFilter
- * @description 范围查询属性过滤条件。
- */
- _this.attributeFilter = null;
- /**
- * @member {SuperMap.SpatialQueryMode} [SuperMap.GetFeaturesByBoundsParameters.prototype.spatialQueryMode=SuperMap.SpatialQueryMode.CONTAIN]
- * @description 空间查询模式常量。
- */
- _this.spatialQueryMode = SpatialQueryMode.CONTAIN;
- Util.extend(GetFeaturesByBoundsParameters_assertThisInitialized(_this), options);
- _this.CLASS_NAME = "SuperMap.GetFeaturesByBoundsParameters";
- return _this;
- }
- /**
- * @function SuperMap.GetFeaturesByBoundsParameters.prototype.destroy
- * @override
- */
- GetFeaturesByBoundsParameters_createClass(GetFeaturesByBoundsParameters, [{
- key: "destroy",
- value: function destroy() {
- GetFeaturesByBoundsParameters_get(GetFeaturesByBoundsParameters_getPrototypeOf(GetFeaturesByBoundsParameters.prototype), "destroy", this).call(this);
- var me = this;
- if (me.bounds) {
- me.bounds.destroy();
- me.bounds = null;
- }
- if (me.fields) {
- while (me.fields.length > 0) {
- me.fields.pop();
- }
- me.fields = null;
- }
- me.attributeFilter = null;
- me.spatialQueryMode = null;
- me.getFeatureMode = null;
- }
- /**
- * @function SuperMap.GetFeaturesByBoundsParameters.toJsonParameters
- * @description 将 {@link SuperMap.GetFeaturesByBoundsParameters} 对象参数转换为 JSON 字符串。
- * @param {SuperMap.GetFeaturesByBoundsParameters} params - 范围查询参数。
- * @returns {string} 转化后的 JSON 字符串。
- *
- */
- }], [{
- key: "toJsonParameters",
- value: function toJsonParameters(params) {
- var filterParameter, bounds, parasByBounds;
- bounds = {
- "leftBottom": {
- "x": params.bounds.left,
- "y": params.bounds.bottom
- },
- "rightTop": {
- "x": params.bounds.right,
- "y": params.bounds.top
- }
- };
- parasByBounds = {
- datasetNames: params.datasetNames,
- getFeatureMode: GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS,
- bounds: bounds,
- spatialQueryMode: params.spatialQueryMode
- };
- if (params.fields) {
- filterParameter = new FilterParameter();
- filterParameter.name = params.datasetNames;
- filterParameter.fields = params.fields;
- parasByBounds.queryParameter = filterParameter;
- }
- if (params.attributeFilter) {
- parasByBounds.attributeFilter = params.attributeFilter;
- parasByBounds.getFeatureMode = GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS_ATTRIBUTEFILTER;
- }
- if (params.maxFeatures && !isNaN(params.maxFeatures)) {
- parasByBounds.maxFeatures = params.maxFeatures;
- }
- if (params.targetEpsgCode) {
- parasByBounds.targetEpsgCode = params.targetEpsgCode;
- }
- if (!params.targetEpsgCode && params.targetPrj) {
- parasByBounds.targetPrj = params.targetPrj;
- }
- return Util.toJSON(parasByBounds);
- }
- }]);
- return GetFeaturesByBoundsParameters;
- }(GetFeaturesParametersBase);
- GetFeaturesByBoundsParameters.getFeatureMode = {
- "BOUNDS": "BOUNDS",
- "BOUNDS_ATTRIBUTEFILTER": "BOUNDS_ATTRIBUTEFILTER"
- };
- SuperMap.GetFeaturesByBoundsParameters = GetFeaturesByBoundsParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesServiceBase.js
- 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); }
- function GetFeaturesServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GetFeaturesServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GetFeaturesServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GetFeaturesServiceBase_setPrototypeOf(o, p) { GetFeaturesServiceBase_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesServiceBase_setPrototypeOf(o, p); }
- 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); }; }
- function GetFeaturesServiceBase_possibleConstructorReturn(self, call) { if (call && (GetFeaturesServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesServiceBase_assertThisInitialized(self); }
- function GetFeaturesServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GetFeaturesServiceBase_getPrototypeOf(o) { GetFeaturesServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesServiceBase_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GetFeaturesServiceBase
- * @category iServer Data FeatureResults
- * @classdesc 数据服务中数据集查询服务基类。获取结果数据类型为 Object。包含 result 属性,result 的数据格式根据 format 参数决定为 GeoJSON 或者 iServerJSON。
- * @extends SuperMap.CommonServiceBase
- * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务,
- * URL应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/
- * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @example
- * var myService = new SuperMap.GetFeaturesServiceBase(url, {
- * eventListeners: {
- * "processCompleted": getFeatureCompleted,
- * "processFailed": getFeatureError
- * }
- * });
- */
- var GetFeaturesServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
- GetFeaturesServiceBase_inherits(GetFeaturesServiceBase, _CommonServiceBase);
- var _super = GetFeaturesServiceBase_createSuper(GetFeaturesServiceBase);
- function GetFeaturesServiceBase(url, options) {
- var _this;
- GetFeaturesServiceBase_classCallCheck(this, GetFeaturesServiceBase);
- _this = _super.call(this, url, options);
- options = options || {};
- /**
- * @member {boolean} [SuperMap.GetFeaturesServiceBase.prototype.returnContent=true]
- * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
- * 如果为 true,则直接返回新创建资源,即查询结果的表述。
- * 如果为 false,则返回的是查询结果资源的 URI。
- */
- _this.returnContent = true;
- /**
- * @member {number} [SuperMap.GetFeaturesServiceBase.prototype.fromIndex=0]
- * @description 查询结果的最小索引号。如果该值大于查询结果的最大索引号,则查询结果为空。
- */
- _this.fromIndex = 0;
- /**
- * @member {number} [SuperMap.GetFeaturesServiceBase.prototype.toIndex=19]
- * @description 查询结果的最大索引号。
- * 如果该值大于查询结果的最大索引号,则以查询结果的最大索引号为终止索引号。
- */
- _this.toIndex = 19;
- /**
- * @member {number} [SuperMap.GetFeaturesServiceBase.prototype.maxFeatures=1000]
- * @description 进行 SQL 查询时,用于设置服务端返回查询结果条目数量。
- */
- _this.maxFeatures = null;
- /**
- * @member {string} [SuperMap.GetFeaturesServiceBase.prototype.format=SuperMap.DataFormat.GEOJSON]
- * @description 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。
- * 参数格式为 "ISERVER","GEOJSON"。
- */
- _this.format = DataFormat.GEOJSON;
- Util.extend(GetFeaturesServiceBase_assertThisInitialized(_this), options);
- _this.url = Util.urlPathAppend(_this.url, 'featureResults');
- _this.CLASS_NAME = "SuperMap.GetFeaturesServiceBase";
- return _this;
- }
- /**
- * @function SuperMap.GetFeaturesServiceBase.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- GetFeaturesServiceBase_createClass(GetFeaturesServiceBase, [{
- key: "destroy",
- value: function destroy() {
- GetFeaturesServiceBase_get(GetFeaturesServiceBase_getPrototypeOf(GetFeaturesServiceBase.prototype), "destroy", this).call(this);
- var me = this;
- me.returnContent = null;
- me.fromIndex = null;
- me.toIndex = null;
- me.maxFeatures = null;
- me.format = null;
- }
- /**
- * @function SuperMap.GetFeaturesServiceBase.prototype.processAsync
- * @description 将客户端的查询参数传递到服务端。
- * @param {Object} params - 查询参数。
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!params) {
- return;
- }
- var me = this,
- jsonParameters = null,
- firstPara = true;
- me.returnContent = params.returnContent;
- me.fromIndex = params.fromIndex;
- me.toIndex = params.toIndex;
- me.maxFeatures = params.maxFeatures;
- if (me.returnContent) {
- me.url = Util.urlAppend(me.url, 'returnContent=' + me.returnContent);
- firstPara = false;
- }
- var isValidNumber = me.fromIndex != null && me.toIndex != null && !isNaN(me.fromIndex) && !isNaN(me.toIndex);
- if (isValidNumber && me.fromIndex >= 0 && me.toIndex >= 0 && !firstPara) {
- me.url = Util.urlAppend(me.url, "fromIndex=".concat(me.fromIndex, "&toIndex=").concat(me.toIndex));
- }
- if (params.returnCountOnly) {
- me.url = Util.urlAppend(me.url, "&returnCountOnly=" + params.returnContent);
- }
- jsonParameters = me.getJsonParameters(params);
- me.request({
- method: "POST",
- data: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.GetFeaturesServiceBase.prototype.getFeatureComplete
- * @description 查询完成,执行此方法。
- * @param {Object} result - 服务器返回的结果对象。
- */
- }, {
- key: "serviceProcessCompleted",
- value: function serviceProcessCompleted(result) {
- var me = this;
- result = Util.transformResult(result);
- if (me.format === DataFormat.GEOJSON && result.features) {
- var geoJSONFormat = new GeoJSON();
- result.features = geoJSONFormat.toGeoJSON(result.features);
- }
- me.events.triggerEvent("processCompleted", {
- result: result
- });
- }
- }]);
- return GetFeaturesServiceBase;
- }(CommonServiceBase);
- SuperMap.GetFeaturesServiceBase = GetFeaturesServiceBase;
- ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBoundsService.js
- 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); }
- function GetFeaturesByBoundsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GetFeaturesByBoundsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBoundsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBoundsService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GetFeaturesByBoundsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBoundsService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GetFeaturesByBoundsService_setPrototypeOf(o, p) { GetFeaturesByBoundsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBoundsService_setPrototypeOf(o, p); }
- 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); }; }
- function GetFeaturesByBoundsService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBoundsService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByBoundsService_assertThisInitialized(self); }
- function GetFeaturesByBoundsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GetFeaturesByBoundsService_getPrototypeOf(o) { GetFeaturesByBoundsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBoundsService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GetFeaturesByBoundsService
- * @category iServer Data FeatureResults
- * @classdesc 数据集范围查询服务类,查询与指定范围对象符合一定空间关系的矢量要素。
- * @description 数据集范围查询服务类构造函数。
- * @extends {SuperMap.GetFeaturesServiceBase}
- * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务,URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;
- * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @example
- * var myGetFeaturesByBoundsService = new SuperMa.GetFeaturesByBoundsService(url, {
- * eventListeners: {
- * "processCompleted": getFeatureCompleted,
- * "processFailed": getFeatureError
- * }
- * });
- * function getFeatureCompleted(object){//todo};
- * function getFeatureError(object){//todo}
- */
- var GetFeaturesByBoundsService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
- GetFeaturesByBoundsService_inherits(GetFeaturesByBoundsService, _GetFeaturesServiceBa);
- var _super = GetFeaturesByBoundsService_createSuper(GetFeaturesByBoundsService);
- function GetFeaturesByBoundsService(url, options) {
- var _this;
- GetFeaturesByBoundsService_classCallCheck(this, GetFeaturesByBoundsService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.GetFeaturesByBoundsService";
- return _this;
- }
- /**
- * @function SuperMap.GetFeaturesByBoundsService.prototype.destroy
- * @override
- */
- GetFeaturesByBoundsService_createClass(GetFeaturesByBoundsService, [{
- key: "destroy",
- value: function destroy() {
- GetFeaturesByBoundsService_get(GetFeaturesByBoundsService_getPrototypeOf(GetFeaturesByBoundsService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.GetFeaturesByBoundsService.prototype.getJsonParameters
- * @description 将查询参数转化为 JSON 字符串。在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry,Bounds等)。
- * @param params {SuperMap.GetFeaturesByBoundsParameters}
- * @returns {string} 转化后的 JSON 字符串。
- *
- */
- }, {
- key: "getJsonParameters",
- value: function getJsonParameters(params) {
- return GetFeaturesByBoundsParameters.toJsonParameters(params);
- }
- }]);
- return GetFeaturesByBoundsService;
- }(GetFeaturesServiceBase);
- SuperMap.GetFeaturesByBoundsService = GetFeaturesByBoundsService;
- ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBufferParameters.js
- 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); }
- function GetFeaturesByBufferParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GetFeaturesByBufferParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBufferParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBufferParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GetFeaturesByBufferParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBufferParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GetFeaturesByBufferParameters_setPrototypeOf(o, p) { GetFeaturesByBufferParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBufferParameters_setPrototypeOf(o, p); }
- 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); }; }
- function GetFeaturesByBufferParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBufferParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByBufferParameters_assertThisInitialized(self); }
- function GetFeaturesByBufferParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GetFeaturesByBufferParameters_getPrototypeOf(o) { GetFeaturesByBufferParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBufferParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GetFeaturesByBufferParameters
- * @category iServer Data FeatureResults
- * @classdesc 数据服务中数据集缓冲区查询参数类。
- * @param {Object} options - 参数。
- * @param {number} options.bufferDistance - buffer 距离,单位与所查询图层对应的数据集单位相同。
- * @param {Object} options.geometry - 空间查询条件。</br>
- * @param {Array.<string>} options.dataSetNames - 数据集集合中的数据集名称列表。
- * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
- * @param {string} [options.attributeFilter] - 属性查询条件。
- * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
- * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
- * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
- * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
- * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
- * @extends {SuperMap.GetFeaturesParametersBase}
- */
- var GetFeaturesByBufferParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
- GetFeaturesByBufferParameters_inherits(GetFeaturesByBufferParameters, _GetFeaturesParameter);
- var _super = GetFeaturesByBufferParameters_createSuper(GetFeaturesByBufferParameters);
- function GetFeaturesByBufferParameters(options) {
- var _this;
- GetFeaturesByBufferParameters_classCallCheck(this, GetFeaturesByBufferParameters);
- _this = _super.call(this, options);
- /**
- * @member {number} SuperMap.GetFeaturesByBufferParameters.prototype.bufferDistance
- * @description buffer 距离,单位与所查询图层对应的数据集单位相同。
- */
- _this.bufferDistance = null;
- /**
- * @member {string} SuperMap.GetFeaturesByBufferParameters.prototype.attributeFilter
- * @description 属性查询条件。
- */
- _this.attributeFilter = null;
- /**
- * @member {Object} SuperMap.GetFeaturesByBufferParameters.prototype.geometry
- * @description 空间查询条件。 <br>
- * 点类型可以是:{@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>
- * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。</br>
- * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
- */
- _this.geometry = null;
- /**
- * @member {Array.<string>} SuperMap.GetFeaturesByBufferParameters.prototype.fields
- * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
- */
- _this.fields = null;
- Util.extend(GetFeaturesByBufferParameters_assertThisInitialized(_this), options);
- _this.CLASS_NAME = "SuperMap.GetFeaturesByBufferParameters";
- return _this;
- }
- /**
- * @function SuperMap.GetFeaturesByBufferParameters.prototype.destroy
- * @override
- */
- GetFeaturesByBufferParameters_createClass(GetFeaturesByBufferParameters, [{
- key: "destroy",
- value: function destroy() {
- GetFeaturesByBufferParameters_get(GetFeaturesByBufferParameters_getPrototypeOf(GetFeaturesByBufferParameters.prototype), "destroy", this).call(this);
- var me = this;
- me.bufferDistance = null;
- me.attributeFilter = null;
- if (me.fields) {
- while (me.fields.length > 0) {
- me.fields.pop();
- }
- me.fields = null;
- }
- if (me.geometry) {
- me.geometry.destroy();
- me.geometry = null;
- }
- }
- /**
- * @function SuperMap.GetFeaturesByBufferParameters.toJsonParameters
- * @description 将 SuperMap.GetFeaturesByBufferParameters 对象转换为 JSON 字符串。
- * @param {SuperMap.GetFeaturesByBufferParameters} params - 数据集缓冲区查询参数对象。
- * @returns {string} 转化后的 JSON 字符串。
- */
- }], [{
- key: "toJsonParameters",
- value: function toJsonParameters(params) {
- var filterParameter, paramsBySql, geometry;
- geometry = ServerGeometry.fromGeometry(params.geometry);
- paramsBySql = {
- datasetNames: params.datasetNames,
- getFeatureMode: "BUFFER",
- bufferDistance: params.bufferDistance,
- geometry: geometry
- };
- if (params.fields) {
- filterParameter = new FilterParameter();
- filterParameter.name = params.datasetNames;
- filterParameter.fields = params.fields;
- paramsBySql.queryParameter = filterParameter;
- }
- if (params.attributeFilter) {
- paramsBySql.attributeFilter = params.attributeFilter;
- paramsBySql.getFeatureMode = "BUFFER_ATTRIBUTEFILTER";
- }
- if (params.maxFeatures && !isNaN(params.maxFeatures)) {
- paramsBySql.maxFeatures = params.maxFeatures;
- }
- if (params.targetEpsgCode) {
- paramsBySql.targetEpsgCode = params.targetEpsgCode;
- }
- if (!params.targetEpsgCode && params.targetPrj) {
- paramsBySql.targetPrj = params.targetPrj;
- }
- return Util.toJSON(paramsBySql);
- }
- }]);
- return GetFeaturesByBufferParameters;
- }(GetFeaturesParametersBase);
- SuperMap.GetFeaturesByBufferParameters = GetFeaturesByBufferParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBufferService.js
- 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); }
- function GetFeaturesByBufferService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GetFeaturesByBufferService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBufferService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBufferService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GetFeaturesByBufferService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBufferService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GetFeaturesByBufferService_setPrototypeOf(o, p) { GetFeaturesByBufferService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBufferService_setPrototypeOf(o, p); }
- 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); }; }
- function GetFeaturesByBufferService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBufferService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByBufferService_assertThisInitialized(self); }
- function GetFeaturesByBufferService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GetFeaturesByBufferService_getPrototypeOf(o) { GetFeaturesByBufferService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBufferService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GetFeaturesByBufferService
- * @category iServer Data FeatureResults
- * @classdesc 数据服务中数据集缓冲区查询服务类。
- * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务,
- * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;
- * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {SuperMap.GetFeaturesServiceBase}
- * @example
- * var myGetFeaturesByBufferService = new SuperMap.GetFeaturesByBufferService(url, {
- * eventListeners: {
- * "processCompleted": GetFeaturesCompleted,
- * "processFailed": GetFeaturesError
- * }
- * });
- * function GetFeaturesCompleted(object){//todo};
- * function GetFeaturesError(object){//todo};
- */
- var GetFeaturesByBufferService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
- GetFeaturesByBufferService_inherits(GetFeaturesByBufferService, _GetFeaturesServiceBa);
- var _super = GetFeaturesByBufferService_createSuper(GetFeaturesByBufferService);
- function GetFeaturesByBufferService(url, options) {
- var _this;
- GetFeaturesByBufferService_classCallCheck(this, GetFeaturesByBufferService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.GetFeaturesByBufferService";
- return _this;
- }
- /**
- * @function SuperMap.GetFeaturesByBufferService.prototype.destroy
- * @override
- */
- GetFeaturesByBufferService_createClass(GetFeaturesByBufferService, [{
- key: "destroy",
- value: function destroy() {
- GetFeaturesByBufferService_get(GetFeaturesByBufferService_getPrototypeOf(GetFeaturesByBufferService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.GetFeaturesByBufferService.prototype.getJsonParameters
- * @description 将查询参数转化为 JSON 字符串。在本类中重写此方法,可以实现不同种类的查询(IDs, SQL, Buffer, Geometry等)。
- * @param {SuperMap.GetFeaturesByBufferParameters} params - 数据集缓冲区查询参数类。
- * @returns {Object} 转化后的 JSON 字符串。
- */
- }, {
- key: "getJsonParameters",
- value: function getJsonParameters(params) {
- if (!(params instanceof GetFeaturesByBufferParameters)) {
- return;
- }
- return SuperMap.GetFeaturesByBufferParameters.toJsonParameters(params);
- }
- }]);
- return GetFeaturesByBufferService;
- }(GetFeaturesServiceBase);
- SuperMap.GetFeaturesByBufferService = GetFeaturesByBufferService;
- ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByGeometryParameters.js
- 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); }
- function GetFeaturesByGeometryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GetFeaturesByGeometryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByGeometryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByGeometryParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GetFeaturesByGeometryParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByGeometryParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GetFeaturesByGeometryParameters_setPrototypeOf(o, p) { GetFeaturesByGeometryParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByGeometryParameters_setPrototypeOf(o, p); }
- 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); }; }
- function GetFeaturesByGeometryParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByGeometryParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByGeometryParameters_assertThisInitialized(self); }
- function GetFeaturesByGeometryParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GetFeaturesByGeometryParameters_getPrototypeOf(o) { GetFeaturesByGeometryParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByGeometryParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GetFeaturesByGeometryParameters
- * @category iServer Data FeatureResults
- * @classdesc 数据集几何查询参数类。该类用于设置数据集几何查询的相关参数。
- * @param {Object} options - 参数。
- * @param {Object} options.geometry - 用于查询的几何对象。
- * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
- * @param {string} [options.attributeFilter] - 几何查询属性过滤条件。
- * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
- * @param {SuperMap.SpatialQueryMode} [options.spatialQueryMode=SuperMap.SpatialQueryMode.CONTAIN] - 空间查询模式常量。
- * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
- * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
- * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
- * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
- * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
- * @extends {SuperMap.GetFeaturesParametersBase}
- */
- var GetFeaturesByGeometryParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
- GetFeaturesByGeometryParameters_inherits(GetFeaturesByGeometryParameters, _GetFeaturesParameter);
- var _super = GetFeaturesByGeometryParameters_createSuper(GetFeaturesByGeometryParameters);
- function GetFeaturesByGeometryParameters(options) {
- var _this;
- GetFeaturesByGeometryParameters_classCallCheck(this, GetFeaturesByGeometryParameters);
- _this = _super.call(this, options);
- /**
- * @member {string} SuperMap.GetFeaturesByGeometryParameters.prototype.getFeatureMode
- * @description 数据集查询模式。几何查询有 "SPATIAL","SPATIAL_ATTRIBUTEFILTER" 两种,当用户设置 attributeFilter 时会自动切换到 SPATIAL_ATTRIBUTEFILTER 访问服务。
- */
- _this.getFeatureMode = "SPATIAL";
- /**
- * @member {Object} SuperMap.GetFeaturesByGeometryParameters.prototype.geometry
- * @description 用于查询的几何对象。 </br>
- * 点类型可以是:{@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>
- * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。</br>
- * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
- */
- _this.geometry = null;
- /**
- * @member {Array.<string>} SuperMap.GetFeaturesByGeometryParameters.prototype.fields
- * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
- */
- _this.fields = null;
- /**
- * @member {string} SuperMap.GetFeaturesByGeometryParameters.prototype.attributeFilter
- * @description 几何查询属性过滤条件。
- */
- _this.attributeFilter = null;
- /**
- * @member {SuperMap.SpatialQueryMode} [SuperMap.GetFeaturesByGeometryParameters.prototype.spatialQueryMode=SuperMap.SpatialQueryMode.CONTAIN]
- * @description 空间查询模式常量。
- */
- _this.spatialQueryMode = SpatialQueryMode.CONTAIN;
- Util.extend(GetFeaturesByGeometryParameters_assertThisInitialized(_this), options);
- _this.CLASS_NAME = "SuperMap.GetFeaturesByGeometryParameters";
- return _this;
- }
- /**
- * @function SuperMap.GetFeaturesByGeometryParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- GetFeaturesByGeometryParameters_createClass(GetFeaturesByGeometryParameters, [{
- key: "destroy",
- value: function destroy() {
- GetFeaturesByGeometryParameters_get(GetFeaturesByGeometryParameters_getPrototypeOf(GetFeaturesByGeometryParameters.prototype), "destroy", this).call(this);
- var me = this;
- if (me.geometry) {
- me.geometry.destroy();
- me.geometry = null;
- }
- if (me.fields) {
- while (me.fields.length > 0) {
- me.fields.pop();
- }
- me.fields = null;
- }
- me.attributeFilter = null;
- me.spatialQueryMode = null;
- me.getFeatureMode = null;
- }
- /**
- * @function SuperMap.GetFeaturesByGeometryParameters.toJsonParameters
- * @description 将 SuperMap.GetFeaturesByGeometryParameters 对象参数转换为 JSON 字符串。
- * @param {SuperMap.GetFeaturesByGeometryParameters} params - 查询参数对象。
- * @returns {string} 转化后的 JSON 字符串。
- */
- }], [{
- key: "toJsonParameters",
- value: function toJsonParameters(params) {
- var filterParameter, geometry, parasByGeometry;
- geometry = ServerGeometry.fromGeometry(params.geometry);
- parasByGeometry = {
- datasetNames: params.datasetNames,
- getFeatureMode: "SPATIAL",
- geometry: geometry,
- spatialQueryMode: params.spatialQueryMode
- };
- if (params.fields) {
- filterParameter = new FilterParameter();
- filterParameter.name = params.datasetNames;
- filterParameter.fields = params.fields;
- parasByGeometry.queryParameter = filterParameter;
- }
- if (params.attributeFilter) {
- parasByGeometry.attributeFilter = params.attributeFilter;
- parasByGeometry.getFeatureMode = "SPATIAL_ATTRIBUTEFILTER";
- }
- if (params.maxFeatures && !isNaN(params.maxFeatures)) {
- parasByGeometry.maxFeatures = params.maxFeatures;
- }
- if (params.targetEpsgCode) {
- parasByGeometry.targetEpsgCode = params.targetEpsgCode;
- }
- if (!params.targetEpsgCode && params.targetPrj) {
- parasByGeometry.targetPrj = params.targetPrj;
- }
- return Util.toJSON(parasByGeometry);
- }
- }]);
- return GetFeaturesByGeometryParameters;
- }(GetFeaturesParametersBase);
- SuperMap.GetFeaturesByGeometryParameters = GetFeaturesByGeometryParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByGeometryService.js
- 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); }
- function GetFeaturesByGeometryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GetFeaturesByGeometryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByGeometryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByGeometryService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GetFeaturesByGeometryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByGeometryService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GetFeaturesByGeometryService_setPrototypeOf(o, p) { GetFeaturesByGeometryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByGeometryService_setPrototypeOf(o, p); }
- 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); }; }
- function GetFeaturesByGeometryService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByGeometryService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByGeometryService_assertThisInitialized(self); }
- function GetFeaturesByGeometryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GetFeaturesByGeometryService_getPrototypeOf(o) { GetFeaturesByGeometryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByGeometryService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GetFeaturesByGeometryService
- * @category iServer Data FeatureResults
- * @classdesc 数据集几何查询服务类,查询与指定几何对象符合一定空间关系的矢量要素。
- * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务。
- * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data;
- * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data"
- * @param {Object} options - 参数。</br>
- * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {SuperMap.GetFeaturesServiceBase}
- * @example
- * var myService = new SuperMap.GetFeaturesByGeometryService(url, {
- * eventListeners: {
- * "processCompleted": getFeatureCompleted,
- * "processFailed": getFeatureError
- * }
- * });
- * function getFeatureCompleted(object){//todo};
- * function getFeatureError(object){//todo}
- */
- var GetFeaturesByGeometryService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
- GetFeaturesByGeometryService_inherits(GetFeaturesByGeometryService, _GetFeaturesServiceBa);
- var _super = GetFeaturesByGeometryService_createSuper(GetFeaturesByGeometryService);
- function GetFeaturesByGeometryService(url, options) {
- var _this;
- GetFeaturesByGeometryService_classCallCheck(this, GetFeaturesByGeometryService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.GetFeaturesByGeometryService";
- return _this;
- }
- /**
- * @function SuperMap.GetFeaturesByGeometryService.prototype.destroy
- * @override
- */
- GetFeaturesByGeometryService_createClass(GetFeaturesByGeometryService, [{
- key: "destroy",
- value: function destroy() {
- GetFeaturesByGeometryService_get(GetFeaturesByGeometryService_getPrototypeOf(GetFeaturesByGeometryService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.GetFeaturesByGeometryService.prototype.getJsonParameters
- * @param {SuperMap.GetFeaturesByGeometryParameters} params - 数据集几何查询参数类。
- * @description 将查询参数转化为 JSON 字符串。
- * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
- * @returns {Object} 转化后的 JSON 字符串。
- */
- }, {
- key: "getJsonParameters",
- value: function getJsonParameters(params) {
- return GetFeaturesByGeometryParameters.toJsonParameters(params);
- }
- }]);
- return GetFeaturesByGeometryService;
- }(GetFeaturesServiceBase);
- SuperMap.GetFeaturesByGeometryService = GetFeaturesByGeometryService;
- ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByIDsParameters.js
- 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); }
- function GetFeaturesByIDsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GetFeaturesByIDsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByIDsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByIDsParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GetFeaturesByIDsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByIDsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GetFeaturesByIDsParameters_setPrototypeOf(o, p) { GetFeaturesByIDsParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByIDsParameters_setPrototypeOf(o, p); }
- 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); }; }
- function GetFeaturesByIDsParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByIDsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByIDsParameters_assertThisInitialized(self); }
- function GetFeaturesByIDsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GetFeaturesByIDsParameters_getPrototypeOf(o) { GetFeaturesByIDsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByIDsParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GetFeaturesByIDsParameters
- * @category iServer Data FeatureResults
- * @classdesc ID查询参数类。
- * @param {Object} options - 参数。
- * @param {Array.<number>} options.IDs - 所要查询指定的元素 ID 信息。
- * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
- * @param {Array.<string>} options.dataSetNames - 数据集集合中的数据集名称列表。
- * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
- * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
- * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
- * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
- * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
- * @extends {SuperMap.GetFeaturesParametersBase}
- */
- var GetFeaturesByIDsParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
- GetFeaturesByIDsParameters_inherits(GetFeaturesByIDsParameters, _GetFeaturesParameter);
- var _super = GetFeaturesByIDsParameters_createSuper(GetFeaturesByIDsParameters);
- function GetFeaturesByIDsParameters(options) {
- var _this;
- GetFeaturesByIDsParameters_classCallCheck(this, GetFeaturesByIDsParameters);
- _this = _super.call(this, options);
- /**
- * @member {string} SuperMap.GetFeaturesByIDsParameters.prototype.getFeatureMode
- * @description 数据集查询模式。
- */
- _this.getFeatureMode = "ID";
- /**
- * @member {Array.<number>} SuperMap.GetFeaturesByIDsParameters.prototype.IDs
- * @description 所要查询指定的元素 ID 信息。
- */
- _this.IDs = null;
- /**
- * @member {Array.<string>} SuperMap.GetFeaturesByIDsParameters.prototype.fields
- * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
- */
- _this.fields = null;
- Util.extend(GetFeaturesByIDsParameters_assertThisInitialized(_this), options);
- _this.CLASS_NAME = "SuperMap.GetFeaturesByIDsParameters";
- return _this;
- }
- /**
- * @function SuperMap.GetFeaturesByIDsParameters.prototype.destroy
- * @override
- */
- GetFeaturesByIDsParameters_createClass(GetFeaturesByIDsParameters, [{
- key: "destroy",
- value: function destroy() {
- GetFeaturesByIDsParameters_get(GetFeaturesByIDsParameters_getPrototypeOf(GetFeaturesByIDsParameters.prototype), "destroy", this).call(this);
- var me = this;
- me.IDs = null;
- me.getFeatureMode = null;
- if (me.fields) {
- while (me.fields.length > 0) {
- me.fields.pop();
- }
- me.fields = null;
- }
- }
- /**
- * @function SuperMap.GetFeaturesByIDsParameters.toJsonParameters
- * @description 将 SuperMap.GetFeaturesByIDsParameters 对象转换为 JSON 字符串。
- * @param {SuperMap.GetFeaturesByIDsParameters} params - ID 查询参数对象。
- * @returns {string} 转化后的 JSON 字符串。
- */
- }], [{
- key: "toJsonParameters",
- value: function toJsonParameters(params) {
- var parasByIDs, filterParameter;
- parasByIDs = {
- datasetNames: params.datasetNames,
- getFeatureMode: "ID",
- ids: params.IDs
- };
- if (params.fields) {
- filterParameter = new FilterParameter();
- filterParameter.name = params.datasetNames;
- filterParameter.fields = params.fields;
- parasByIDs.queryParameter = filterParameter;
- }
- if (params.targetEpsgCode) {
- parasByIDs.targetEpsgCode = params.targetEpsgCode;
- }
- if (!params.targetEpsgCode && params.targetPrj) {
- parasByIDs.targetPrj = params.targetPrj;
- }
- return Util.toJSON(parasByIDs);
- }
- }]);
- return GetFeaturesByIDsParameters;
- }(GetFeaturesParametersBase);
- SuperMap.GetFeaturesByIDsParameters = GetFeaturesByIDsParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByIDsService.js
- 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); }
- function GetFeaturesByIDsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GetFeaturesByIDsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByIDsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByIDsService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GetFeaturesByIDsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByIDsService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GetFeaturesByIDsService_setPrototypeOf(o, p) { GetFeaturesByIDsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByIDsService_setPrototypeOf(o, p); }
- 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); }; }
- function GetFeaturesByIDsService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByIDsService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByIDsService_assertThisInitialized(self); }
- function GetFeaturesByIDsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GetFeaturesByIDsService_getPrototypeOf(o) { GetFeaturesByIDsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByIDsService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GetFeaturesByIDsService
- * @category iServer Data FeatureResults
- * @classdesc 数据集ID查询服务类。在数据集集合中查找指定 ID 号对应的空间地物要素。
- * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务。
- * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;</br>
- * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
- * @param {Object} options - 参数。</br>
- * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {SuperMap.GetFeaturesServiceBase}
- * @example
- * var myGetFeaturesByIDsService = new SuperMap.GetFeaturesByIDsService(url, {
- * eventListeners: {
- * "processCompleted": getFeatureCompleted,
- * "processFailed": getFeatureError
- * }
- * });
- * function getFeatureCompleted(object){//todo};
- * function getFeatureError(object){//todo}
- */
- var GetFeaturesByIDsService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
- GetFeaturesByIDsService_inherits(GetFeaturesByIDsService, _GetFeaturesServiceBa);
- var _super = GetFeaturesByIDsService_createSuper(GetFeaturesByIDsService);
- function GetFeaturesByIDsService(url, options) {
- var _this;
- GetFeaturesByIDsService_classCallCheck(this, GetFeaturesByIDsService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.GetFeaturesByIDsService";
- return _this;
- }
- /**
- * @function SuperMap.GetFeaturesByIDsService.prototype.destroy
- * @override
- */
- GetFeaturesByIDsService_createClass(GetFeaturesByIDsService, [{
- key: "destroy",
- value: function destroy() {
- GetFeaturesByIDsService_get(GetFeaturesByIDsService_getPrototypeOf(GetFeaturesByIDsService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.GetFeaturesByIDsService.prototype.getJsonParameters
- * @description 将查询参数转化为 JSON 字符串。
- * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
- * @param {SuperMap.GetFeaturesByIDsParameters} params - ID查询参数类。
- * @returns {string} 转化后的 JSON 字符串。
- */
- }, {
- key: "getJsonParameters",
- value: function getJsonParameters(params) {
- return GetFeaturesByIDsParameters.toJsonParameters(params);
- }
- }]);
- return GetFeaturesByIDsService;
- }(GetFeaturesServiceBase);
- SuperMap.GetFeaturesByIDsService = GetFeaturesByIDsService;
- ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesBySQLParameters.js
- 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); }
- function GetFeaturesBySQLParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GetFeaturesBySQLParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesBySQLParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesBySQLParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GetFeaturesBySQLParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesBySQLParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GetFeaturesBySQLParameters_setPrototypeOf(o, p) { GetFeaturesBySQLParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesBySQLParameters_setPrototypeOf(o, p); }
- 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); }; }
- function GetFeaturesBySQLParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesBySQLParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesBySQLParameters_assertThisInitialized(self); }
- function GetFeaturesBySQLParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GetFeaturesBySQLParameters_getPrototypeOf(o) { GetFeaturesBySQLParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesBySQLParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GetFeaturesBySQLParameters
- * @category iServer Data FeatureResults
- * @classdesc 数据服务中数据集 SQL 查询参数类。
- * @param {Object} options - 参数。
- * @param {SuperMap.FilterParameter} options.queryParameter - 查询过滤条件参数。
- * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
- * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
- * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
- * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
- * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
- * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
- * @extends {SuperMap.GetFeaturesParametersBase}
- */
- var GetFeaturesBySQLParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
- GetFeaturesBySQLParameters_inherits(GetFeaturesBySQLParameters, _GetFeaturesParameter);
- var _super = GetFeaturesBySQLParameters_createSuper(GetFeaturesBySQLParameters);
- function GetFeaturesBySQLParameters(options) {
- var _this;
- GetFeaturesBySQLParameters_classCallCheck(this, GetFeaturesBySQLParameters);
- _this = _super.call(this, options);
- /**
- * @member {string} SuperMap.GetFeaturesBySQLParameters.prototype.getFeatureMode
- * @description 数据集查询模式。
- */
- _this.getFeatureMode = "SQL";
- /**
- * @member {SuperMap.FilterParameter} SuperMap.GetFeaturesBySQLParameters.prototype.queryParameter
- * @description 查询过滤条件参数类。
- */
- _this.queryParameter = null;
- Util.extend(GetFeaturesBySQLParameters_assertThisInitialized(_this), options);
- _this.CLASS_NAME = "SuperMap.GetFeaturesBySQLParameters";
- return _this;
- }
- /**
- * @function SuperMap.GetFeaturesBySQLParameters.prototype.destroy
- * @override
- */
- GetFeaturesBySQLParameters_createClass(GetFeaturesBySQLParameters, [{
- key: "destroy",
- value: function destroy() {
- GetFeaturesBySQLParameters_get(GetFeaturesBySQLParameters_getPrototypeOf(GetFeaturesBySQLParameters.prototype), "destroy", this).call(this);
- var me = this;
- me.getFeatureMode = null;
- if (me.queryParameter) {
- me.queryParameter.destroy();
- me.queryParameter = null;
- }
- }
- /**
- * @function SuperMap.GetFeaturesBySQLParameters.prototype.toJsonParameters
- * @description 将 SuperMap.GetFeaturesBySQLParameters 对象转换为 JSON 字符串。
- * @param {SuperMap.GetFeaturesBySQLParameters} params - 数据集 SQL 查询参数对象。
- * @returns {string} 转化后的 JSON 字符串。
- */
- }], [{
- key: "toJsonParameters",
- value: function toJsonParameters(params) {
- var paramsBySql = {
- datasetNames: params.datasetNames,
- getFeatureMode: "SQL",
- queryParameter: params.queryParameter
- };
- if (params.maxFeatures && !isNaN(params.maxFeatures)) {
- paramsBySql.maxFeatures = params.maxFeatures;
- }
- if (params.aggregations) {
- paramsBySql.aggregations = params.aggregations;
- }
- if (params.targetEpsgCode) {
- paramsBySql.targetEpsgCode = params.targetEpsgCode;
- }
- if (!params.targetEpsgCode && params.targetPrj) {
- paramsBySql.targetPrj = params.targetPrj;
- }
- return Util.toJSON(paramsBySql);
- }
- }]);
- return GetFeaturesBySQLParameters;
- }(GetFeaturesParametersBase);
- SuperMap.GetFeaturesBySQLParameters = GetFeaturesBySQLParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesBySQLService.js
- 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); }
- function GetFeaturesBySQLService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GetFeaturesBySQLService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesBySQLService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesBySQLService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GetFeaturesBySQLService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesBySQLService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GetFeaturesBySQLService_setPrototypeOf(o, p) { GetFeaturesBySQLService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesBySQLService_setPrototypeOf(o, p); }
- 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); }; }
- function GetFeaturesBySQLService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesBySQLService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesBySQLService_assertThisInitialized(self); }
- function GetFeaturesBySQLService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GetFeaturesBySQLService_getPrototypeOf(o) { GetFeaturesBySQLService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesBySQLService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GetFeaturesBySQLService
- * @constructs SuperMap.GetFeaturesBySQLService
- * @category iServer Data FeatureResults
- * @classdesc 数据服务中数据集 SQL 查询服务类。在一个或多个指定的图层上查询符合 SQL 条件的空间地物信息。
- * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务,
- * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;</br>
- * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
- * @param {Object} options - 参数。</br>
- * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {SuperMap.GetFeaturesServiceBase}
- * @example
- * var myGetFeaturesBySQLService = new SuperMap.GetFeaturesBySQLService(url, {
- * eventListeners: {
- * "processCompleted": GetFeaturesCompleted,
- * "processFailed": GetFeaturesError
- * }
- * });
- * function getFeaturesCompleted(object){//todo};
- * function getFeaturesError(object){//todo};
- *
- */
- var GetFeaturesBySQLService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
- GetFeaturesBySQLService_inherits(GetFeaturesBySQLService, _GetFeaturesServiceBa);
- var _super = GetFeaturesBySQLService_createSuper(GetFeaturesBySQLService);
- function GetFeaturesBySQLService(url, options) {
- var _this;
- GetFeaturesBySQLService_classCallCheck(this, GetFeaturesBySQLService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.GetFeaturesBySQLService";
- return _this;
- }
- /**
- * @function SuperMap.GetFeaturesBySQLService.prototype.destroy
- * @override
- */
- GetFeaturesBySQLService_createClass(GetFeaturesBySQLService, [{
- key: "destroy",
- value: function destroy() {
- GetFeaturesBySQLService_get(GetFeaturesBySQLService_getPrototypeOf(GetFeaturesBySQLService.prototype), "destroy", this).call(this);
- }
- /*
- * @function SuperMap.GetFeaturesBySQLService.prototype.getJsonParameters
- * @description 将查询参数转化为 JSON 字符串。
- * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
- * @param {SuperMap.GetFeaturesBySQLParameters} params - 数据集SQL查询参数类。
- * @returns {string} 转化后的 JSON 字符串。
- */
- }, {
- key: "getJsonParameters",
- value: function getJsonParameters(params) {
- return GetFeaturesBySQLParameters.toJsonParameters(params);
- }
- }]);
- return GetFeaturesBySQLService;
- }(GetFeaturesServiceBase);
- SuperMap.GetFeaturesBySQLService = GetFeaturesBySQLService;
- ;// CONCATENATED MODULE: ./src/common/iServer/GetFieldsService.js
- 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); }
- function GetFieldsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GetFieldsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFieldsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFieldsService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GetFieldsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFieldsService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GetFieldsService_setPrototypeOf(o, p) { GetFieldsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFieldsService_setPrototypeOf(o, p); }
- 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); }; }
- function GetFieldsService_possibleConstructorReturn(self, call) { if (call && (GetFieldsService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFieldsService_assertThisInitialized(self); }
- function GetFieldsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GetFieldsService_getPrototypeOf(o) { GetFieldsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFieldsService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GetFieldsService
- * @category iServer Data Field
- * @classdesc 字段查询服务,支持查询指定数据集的中所有属性字段(field)的集合。
- * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
- * @param {Object} options - 参数。</br>
- * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {string}options.datasource - 要查询的数据集所在的数据源名称。</br>
- * @param {string}options.dataset - 要查询的数据集名称。</br>
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {SuperMap.CommonServiceBase}
- * @example
- * var myService = new SuperMap.GetFieldsService(url, {eventListeners: {
- * "processCompleted": getFieldsCompleted,
- * "processFailed": getFieldsError
- * },
- * datasource: "World",
- * dataset: "Countries"
- * };
- *
- */
- var GetFieldsService = /*#__PURE__*/function (_CommonServiceBase) {
- GetFieldsService_inherits(GetFieldsService, _CommonServiceBase);
- var _super = GetFieldsService_createSuper(GetFieldsService);
- function GetFieldsService(url, options) {
- var _this;
- GetFieldsService_classCallCheck(this, GetFieldsService);
- _this = _super.call(this, url, options);
- /**
- * @member {string} SuperMap.GetFieldsService.prototype.datasource
- * @description 要查询的数据集所在的数据源名称。
- */
- _this.datasource = null;
- /**
- * @member {string} SuperMap.GetFieldsService.prototype.dataset
- * @description 要查询的数据集名称。
- */
- _this.dataset = null;
- if (options) {
- Util.extend(GetFieldsService_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.GetFieldsService";
- return _this;
- }
- /**
- * @function SuperMap.GetFieldsService.prototype.destroy
- * @override
- */
- GetFieldsService_createClass(GetFieldsService, [{
- key: "destroy",
- value: function destroy() {
- GetFieldsService_get(GetFieldsService_getPrototypeOf(GetFieldsService.prototype), "destroy", this).call(this);
- var me = this;
- me.datasource = null;
- me.dataset = null;
- }
- /**
- * @function SuperMap.GetFieldsService.prototype.processAsync
- * @description 执行服务,查询指定数据集的字段信息。
- */
- }, {
- key: "processAsync",
- value: function processAsync() {
- var me = this;
- me.url = Util.urlPathAppend(me.url, "datasources/".concat(me.datasource, "/datasets/").concat(me.dataset, "/fields"));
- me.request({
- method: "GET",
- data: null,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return GetFieldsService;
- }(CommonServiceBase);
- SuperMap.GetFieldsService = GetFieldsService;
- ;// CONCATENATED MODULE: ./src/common/iServer/GetGridCellInfosParameters.js
- function GetGridCellInfosParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GetGridCellInfosParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetGridCellInfosParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetGridCellInfosParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GetGridCellInfosParameters
- * @category iServer Data Grid
- * @classdesc 数据服务栅格查询参数类。
- * @param {Object} options - 参数。
- * @param {string} options.datasetName - 数据集名称。
- * @param {string} options.dataSourceName - 数据源名称。
- * @param {number} options.X - 要查询的地理位置 X 轴。
- * @param {number} options.Y - 要查询的地理位置 Y 轴。
- */
- var GetGridCellInfosParameters = /*#__PURE__*/function () {
- function GetGridCellInfosParameters(options) {
- GetGridCellInfosParameters_classCallCheck(this, GetGridCellInfosParameters);
- /**
- * @member {string} SuperMap.GetGridCellInfosParameters.prototype.datasetName
- * @description 数据集名称。
- */
- this.datasetName = null;
- /**
- * @member {string} SuperMap.GetGridCellInfosParameters.prototype.dataSourceName
- * @description 数据源名称。
- */
- this.dataSourceName = null;
- /**
- * @member {number} SuperMap.GetGridCellInfosParameters.prototype.X
- * @description 要查询的地理位置 X 轴。
- */
- this.X = null;
- /**
- * @member {number} SuperMap.GetGridCellInfosParameters.prototype.Y
- * @description 要查询的地理位置 Y 轴。
- */
- this.Y = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.GetGridCellInfosParameters";
- }
- /**
- * @function SuperMap.GetGridCellInfosParameters.prototype.destroy
- * @description 释放资源,将引用的资源属性置空。
- */
- GetGridCellInfosParameters_createClass(GetGridCellInfosParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.datasetName = null;
- me.dataSourceName = null;
- me.X = null;
- me.Y = null;
- }
- }]);
- return GetGridCellInfosParameters;
- }();
- SuperMap.GetGridCellInfosParameters = GetGridCellInfosParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/GetGridCellInfosService.js
- 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); }
- function GetGridCellInfosService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GetGridCellInfosService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetGridCellInfosService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetGridCellInfosService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GetGridCellInfosService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetGridCellInfosService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GetGridCellInfosService_setPrototypeOf(o, p) { GetGridCellInfosService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetGridCellInfosService_setPrototypeOf(o, p); }
- 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); }; }
- function GetGridCellInfosService_possibleConstructorReturn(self, call) { if (call && (GetGridCellInfosService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetGridCellInfosService_assertThisInitialized(self); }
- function GetGridCellInfosService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GetGridCellInfosService_getPrototypeOf(o) { GetGridCellInfosService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetGridCellInfosService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GetGridCellInfosService
- * @category iServer Data Grid
- * @classdesc 数据栅格查询服务,支持查询指定地理位置的栅格信息。
- * @param {string} url - 查询服务地址。例如: http://localhost:8090/iserver/services/data-jingjin/rest/data
- * @param {Object} options - 参数。</br>
- * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。<br>
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {SuperMap.CommonServiceBase}
- * @example
- * var myService = new SuperMap.GetGridCellInfosService(url, {eventListeners: {
- * "processCompleted": queryCompleted,
- * "processFailed": queryError
- * }
- * });
- *
- */
- var GetGridCellInfosService = /*#__PURE__*/function (_CommonServiceBase) {
- GetGridCellInfosService_inherits(GetGridCellInfosService, _CommonServiceBase);
- var _super = GetGridCellInfosService_createSuper(GetGridCellInfosService);
- function GetGridCellInfosService(url, options) {
- var _this;
- GetGridCellInfosService_classCallCheck(this, GetGridCellInfosService);
- _this = _super.call(this, url, options);
- /**
- * @member {string} SuperMap.GetGridCellInfosService.prototype.datasetName
- * @description 数据集名称。
- */
- _this.datasetName = null;
- /**
- * @member {string} SuperMap.GetGridCellInfosService.prototype.dataSourceName
- * @description 数据源名称。
- */
- _this.dataSourceName = null;
- /**
- * @member {string} SuperMap.GetGridCellInfosService.prototype.datasetType
- * @description 数据集类型。
- */
- _this.datasetType = null;
- /**
- * @member {number} SuperMap.GetGridCellInfosService.prototype.X
- * @description 要查询的地理位置X轴
- */
- _this.X = null;
- /**
- * @member {number} SuperMap.GetGridCellInfosService.prototype.Y
- * @description 要查询的地理位置Y轴
- */
- _this.Y = null;
- if (options) {
- Util.extend(GetGridCellInfosService_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.GetGridCellInfosService";
- return _this;
- }
- /**
- * @function SuperMap.GetGridCellInfosService.prototype.destroy
- * @override
- */
- GetGridCellInfosService_createClass(GetGridCellInfosService, [{
- key: "destroy",
- value: function destroy() {
- GetGridCellInfosService_get(GetGridCellInfosService_getPrototypeOf(GetGridCellInfosService.prototype), "destroy", this).call(this);
- var me = this;
- me.X = null;
- me.Y = null;
- me.datasetName = null;
- me.dataSourceName = null;
- me.datasetType = null;
- }
- /**
- * @function SuperMap.GetGridCellInfosService.prototype.processAsync
- * @description 执行服务,查询数据集信息。
- * @param {SuperMap.GetGridCellInfosParameters} params - 查询参数。
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof GetGridCellInfosParameters)) {
- return;
- }
- Util.extend(this, params);
- var me = this;
- me.url = Util.urlPathAppend(me.url, "datasources/".concat(me.dataSourceName, "/datasets/").concat(me.datasetName));
- me.queryRequest(me.getDatasetInfoCompleted, me.getDatasetInfoFailed);
- }
- /**
- * @function SuperMap.GetGridCellInfosService.prototype.queryRequest
- * @description 执行服务,查询。
- * @callback {function} successFun - 成功后执行的函数。
- * @callback {function} failedFunc - 失败后执行的函数。
- */
- }, {
- key: "queryRequest",
- value: function queryRequest(successFun, failedFunc) {
- var me = this;
- me.request({
- method: "GET",
- data: null,
- scope: me,
- success: successFun,
- failure: failedFunc
- });
- }
- /**
- * @function SuperMap.GetGridCellInfosService.prototype.getDatasetInfoCompleted
- * @description 数据集查询完成,执行此方法。
- * @param {Object} result - 服务器返回的结果对象。
- */
- }, {
- key: "getDatasetInfoCompleted",
- value: function getDatasetInfoCompleted(result) {
- var me = this;
- result = Util.transformResult(result);
- me.datasetType = result.datasetInfo.type;
- me.queryGridInfos();
- }
- /**
- * @function SuperMap.GetGridCellInfosService.prototype.queryGridInfos
- * @description 执行服务,查询数据集栅格信息信息。
- */
- }, {
- key: "queryGridInfos",
- value: function queryGridInfos() {
- var me = this;
- me.url = Util.urlPathAppend(me.url, me.datasetType == 'GRID' ? 'gridValue' : 'imageValue');
- if (me.X != null && me.Y != null) {
- me.url = Util.urlAppend(me.url, "x=".concat(me.X, "&y=").concat(me.Y));
- }
- me.queryRequest(me.serviceProcessCompleted, me.serviceProcessFailed);
- }
- /**
- * @function SuperMap.GetGridCellInfosService.prototype.getDatasetInfoFailed
- * @description 数据集查询失败,执行此方法。
- * @param {Object} result - 服务器返回的结果对象。
- */
- }, {
- key: "getDatasetInfoFailed",
- value: function getDatasetInfoFailed(result) {
- var me = this;
- me.serviceProcessFailed(result);
- }
- }]);
- return GetGridCellInfosService;
- }(CommonServiceBase);
- SuperMap.GetGridCellInfosService = GetGridCellInfosService;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeMemoryData.js
- function ThemeMemoryData_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeMemoryData_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeMemoryData_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeMemoryData_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeMemoryData
- * @category iServer Map Theme
- * @classdesc 专题图内存数据类。
- * @param {Array} srcData - 原始值数组。
- * @param {Array} targetData - 外部值数组。
- */
- var ThemeMemoryData = /*#__PURE__*/function () {
- function ThemeMemoryData(srcData, targetData) {
- ThemeMemoryData_classCallCheck(this, ThemeMemoryData);
- /**
- * @member {Array} SuperMap.ThemeMemoryData.prototype.srcData
- * @description 原始值数组,该属性值将被 targetData 属性所指定的值替换掉,然后制作专题图,但数据库中的值并不会改变。
- */
- this.srcData = srcData;
- /**
- * @member {Array} SuperMap.ThemeMemoryData.prototype.targetData
- * @description 外部值数组,即用于制作专题图的内存数据,设定该属性值后,会将 srcData 属性所指定的原始值替换掉制作专题图,但数据库中的值并不会改变。
- */
- this.targetData = targetData;
- this.CLASS_NAME = "SuperMap.ThemeMemoryData";
- }
- /**
- * @function SuperMap.ThemeMemoryData.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThemeMemoryData_createClass(ThemeMemoryData, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.srcData = null;
- me.targetData = null;
- }
- /**
- * @function SuperMap.ThemeMemoryData.prototype.toJSON
- * @description 将 SuperMap.ThemeMemoryData 对象转化为 JSON 字符串。
- * @returns {string} 返回转换后的 JSON 字符串。
- */
- }, {
- key: "toJSON",
- value: function toJSON() {
- if (this.srcData && this.targetData) {
- var memoryDataStr = "";
- var count = Math.min(this.srcData.length, this.targetData.length);
- for (var i = 0; i < count; i++) {
- memoryDataStr += "\'" + this.srcData[i] + "\':\'" + this.targetData[i] + "\',";
- } //去除多余的逗号
- if (i > 0) {
- memoryDataStr = memoryDataStr.substring(0, memoryDataStr.length - 1);
- }
- return "{" + memoryDataStr + "}";
- } else {
- return null;
- }
- }
- }]);
- return ThemeMemoryData;
- }();
- SuperMap.ThemeMemoryData = ThemeMemoryData;
- ;// CONCATENATED MODULE: ./src/common/iServer/Theme.js
- function Theme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Theme_createClass(Constructor, protoProps, staticProps) { if (protoProps) Theme_defineProperties(Constructor.prototype, protoProps); if (staticProps) Theme_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Theme
- * @category iServer Map Theme
- * @classdesc 专题图基类。
- * @param {string} type - 专题图类型。
- * @param {Object} options - 参数。
- * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
- */
- var Theme = /*#__PURE__*/function () {
- function Theme(type, options) {
- Theme_classCallCheck(this, Theme);
- if (!type) {
- return this;
- }
- /**
- * @member {SuperMap.ThemeMemoryData} SuperMap.Theme.prototype.memoryData
- * @description 专题图内存数据。<br>
- * 用内存数据制作专题图的方式与表达式制作专题图的方式互斥,前者优先级较高。
- * 第一个参数代表专题值,即数据集中用来做专题图的字段或表达式的值;第二个参数代表外部值。在制作专题图时,会用外部值代替专题值来制作相应的专题图。
- */
- this.memoryData = null;
- /**
- * @member {string} SuperMap.Theme.prototype.type
- * @description 专题图类型。
- */
- this.type = type;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.Theme";
- }
- /**
- * @function SuperMap.Theme.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- Theme_createClass(Theme, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- if (me.memoryData) {
- me.memoryData.destroy();
- me.memoryData = null;
- }
- me.type = null;
- }
- /**
- * @function SuperMap.Theme.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- * @returns {Object} 对应的 JSON 格式对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- //return 子类实现
- return;
- }
- }]);
- return Theme;
- }();
- SuperMap.Theme = Theme;
- ;// CONCATENATED MODULE: ./src/common/iServer/ServerTextStyle.js
- function ServerTextStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ServerTextStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerTextStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerTextStyle_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ServerTextStyle
- * @category iServer Map Theme
- * @classdesc 服务端文本风格类。
- * @description 该类用于定义文本风格的相关属性。
- * @param {Object} options - 参数。
- * @param {SuperMap.TextAlignment} [options.align=SuperMap.TextAlignment.BASELINECENTER] - 文本的对齐方式。
- * @param {SuperMap.ServerColor} [options.backColor] - 文本的背景色。默认 backColor = new ServerColor(255, 255, 255)。
- * @param {SuperMap.ServerColor} [options.foreColor] - 文本的前景色。默认 foreColor = new ServerColor(0, 0, 0)。
- * @param {boolean} [options.backOpaque=false] - 文本背景是否不透明。
- * @param {boolean} [options.sizeFixed=true] - 文本大小是否固定。
- * @param {number} [options.fontHeight=6] - 文本字体的高度。
- * @param {number} [options.fontWidth=0] - 文本字体的宽度。
- * @param {number} [options.fontWeight=400] - 文本字体的磅数。
- * @param {string} [options.fontName='Times New Roman'] - 文本字体的名称。
- * @param {boolean} [options.bold=false] - 文本是否为粗体字。
- * @param {boolean} [options.italic=false] - 文本是否采用斜体。
- * @param {number} [options.italicAngle=0] - 字体倾斜角度。
- * @param {boolean} [options.shadow=false] - 文本是否有阴影。
- * @param {boolean} [options.strikeout=false] - 文本字体是否加删除线。
- * @param {boolean} [options.outline=false] - 是否以轮廓的方式来显示文本的背景。
- * @param {number} [options.opaqueRate=0] - 注记文字的不透明度。
- * @param {boolean} [options.underline=false] - 文本字体是否加下划线。
- * @param {number} [options.rotation=0.0] - 文本旋转的角度。
- */
- var ServerTextStyle = /*#__PURE__*/function () {
- function ServerTextStyle(options) {
- ServerTextStyle_classCallCheck(this, ServerTextStyle);
- /**
- * @member {SuperMap.TextAlignment} [SuperMap.ServerTextStyle.prototype.align= SuperMap.TextAlignment.BASELINECENTER]
- * @description 文本的对齐方式。
- */
- this.align = TextAlignment.BASELINECENTER;
- /**
- * @member {SuperMap.ServerColor} [SuperMap.ServerTextStyle.prototype.backColor=(255, 255, 255)]
- * @description 文本的背景色。
- */
- this.backColor = new ServerColor(255, 255, 255);
- /**
- * @member {SuperMap.ServerColor} [SuperMap.ServerTextStyle.prototype.foreColor=(0, 0, 0)]
- * @description 文本的前景色。
- */
- this.foreColor = new ServerColor(0, 0, 0);
- /**
- * @member {boolean} [SuperMap.ServerTextStyle.prototype.backOpaque=false]
- * @description 文本背景是否不透明。true 表示文本背景不透明。
- */
- this.backOpaque = false;
- /**
- * @member {boolean} [SuperMap.ServerTextStyle.prototype.sizeFixed=true]
- * @description 文本大小是否固定。设置为 true,表示图片为固定像素大小,具体大小请参考 fontHeight。当设为 false 时,图片会随着地图缩放而缩放。
- */
- this.sizeFixed = true;
- /**
- * @member {number} [SuperMap.ServerTextStyle.prototype.fontHeight=6]
- * @description 文本字体的高度,单位与 sizeFixed 有关,当 sizeFixed 为 False 时,即非固定文本大小时使用地图坐标单位,
- * 如地理坐标系下的地图中单位为度;当 sizeFixed 为 True 时,单位为毫米(mm)。
- */
- this.fontHeight = 6;
- /**
- * @member {number} [SuperMap.ServerTextStyle.prototype.fontWidth=0]
- * @description 文本字体的宽度。字体的宽度以英文字符为标准,由于一个中文字符相当于两个英文字符。
- */
- this.fontWidth = 0;
- /**
- * @member {number} [SuperMap.ServerTextStyle.prototype.fontWeight=400]
- * @description 文本字体的磅数。表示粗体的具体数值。取值范围为从0-900之间的整百数。
- */
- this.fontWeight = 400;
- /**
- * @member {string} [SuperMap.ServerTextStyle.prototype.fontName="Times New Roman"]
- * @description 文本字体的名称。
- */
- this.fontName = "Times New Roman";
- /**
- * @member {boolean} [SuperMap.ServerTextStyle.prototype.bold=false]
- * @description 文本是否为粗体字。true 表示为粗体。false 表示文本不是粗体字。
- */
- this.bold = false;
- /**
- * @member {boolean} [SuperMap.ServerTextStyle.prototype.italic=false]
- * @description 文本是否采用斜体。true 表示采用斜体。
- */
- this.italic = false;
- /**
- * @member {number} [SuperMap.ServerTextStyle.prototype.italicAngle=0]
- * @description 字体倾斜角度。正负度之间,以度为单位,精确到0.1度。当倾斜角度为0度,为系统默认的字体倾斜样式。
- * 正负度是指以纵轴为起始零度线,其纵轴左侧为正,右侧为负。允许的最大角度为60,最小-60。大于60按照60处理,小于-60按照-60处理。目前只对标签专题图有效。
- */
- this.italicAngle = 0;
- /**
- * @member {boolean} [SuperMap.ServerTextStyle.prototype.shadow=false]
- * @description 文本是否有阴影。true 表示给文本增加阴影。false 表示文本没有阴影。
- */
- this.shadow = false;
- /**
- * @member {boolean} [SuperMap.ServerTextStyle.prototype.strikeout=false]
- * @description 文本字体是否加删除线。true 表示加删除线。false 表示文本字体不加删除线。
- */
- this.strikeout = false;
- /**
- * @member {boolean} [SuperMap.ServerTextStyle.prototype.outline=false]
- * @description 是否以轮廓的方式来显示文本的背景。true 表示以轮廓的方式来显示文本的背景。false 表示不以轮廓的方式来显示文本的背景。
- */
- this.outline = false;
- /**
- * @member {number} [SuperMap.ServerTextStyle.prototype.opaqueRate=0]
- * @description 注记文字的不透明度。不透明度的范围为0-100。0表示透明。
- */
- this.opaqueRate = 0;
- /**
- * @member {boolean} [SuperMap.ServerTextStyle.prototype.underline=false]
- * @description 文本字体是否加下划线。true 表示加下划线。
- */
- this.underline = false;
- /**
- * @member {number} [SuperMap.ServerTextStyle.prototype.rotation=0.0]
- * @description 文本旋转的角度。逆时针方向为正方向,单位为度,精确到0.1度。
- */
- this.rotation = 0.0;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ServerTextStyle";
- }
- /**
- * @function SuperMap.ServerTextStyle.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ServerTextStyle_createClass(ServerTextStyle, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.align = null;
- if (me.backColor) {
- me.backColor.destroy();
- me.backColor = null;
- }
- if (me.foreColor) {
- me.foreColor.destroy();
- me.foreColor = null;
- }
- me.backOpaque = null;
- me.sizeFixed = null;
- me.fontHeight = null;
- me.fontWidth = null;
- me.fontWeight = null;
- me.fontName = null;
- me.bold = null;
- me.italic = null;
- me.italicAngle = null;
- me.shadow = null;
- me.strikeout = null;
- me.outline = null;
- me.opaqueRate = null;
- me.underline = null;
- me.rotation = null;
- }
- /**
- * @function SuperMap.ServerTextStyle.fromObj
- * @description 从传入对象获服务端文本风格类。
- * @param {Object} obj - 传入对象
- * @returns {SuperMap.ServerTextStyle} 返回服务端文本风格对象
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- var res = new ServerTextStyle(obj);
- Util.copy(res, obj);
- res.backColor = ServerColor.fromJson(obj.backColor);
- res.foreColor = ServerColor.fromJson(obj.foreColor);
- return res;
- }
- }]);
- return ServerTextStyle;
- }();
- SuperMap.ServerTextStyle = ServerTextStyle;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelItem.js
- function ThemeLabelItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeLabelItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelItem_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeLabelItem
- * @category iServer Map Theme
- * @classdesc 分段标签专题图的子项。
- * @description 标签专题图用专题值对点、线、面等对象做标注,值得注意的是,分段标签专题图允许用户通过 rangeExpression
- * 字段指定用于分段的数值型字段,同一范围段内的标签具有相同的显示风格,其中每一个范围段就是一个专题图子项,
- * 每一个子项都具有其名称、风格、起始值和终止值。注意:每个分段所表示的范围为 [Start, End)。例如:标签专题图的分段点有两个子项,
- * 他们所代表的分段区间分别为[0,5),[5,10)。那么需要分别设置 SuperMap.ThemeLabelItem[0].start=0,
- * SuperMap.ThemeLabelItem[0].end=5,SuperMap.ThemeLabelItem[1].start=5,SuperMap.ThemeLabelItem[1].end=10。
- * @param {Object} options - 参数。
- * @param {string} [options.caption] - 专题图子项的名称。
- * @param {number} [options.end=0] - 标签专题图子项的终止值。
- * @param {number} [options.start=0] - 标签专题图子项的分段起始值。
- * @param {boolean} [options.visible=true] - 标签专题图子项是否可见。
- * @param {SuperMap.ServerTextStyle} [options.style] - 标签专题图子项文本的显示风格。
- */
- var ThemeLabelItem = /*#__PURE__*/function () {
- function ThemeLabelItem(options) {
- ThemeLabelItem_classCallCheck(this, ThemeLabelItem);
- /**
- * @member {string} [SuperMap.ThemeLabelItem.prototype.caption]
- * @description 标签专题子项的标题。
- */
- this.caption = null;
- /**
- * @member {number} [SuperMap.ThemeLabelItem.prototype.end=0]
- * @description 标签专题图子项的终止值。如果该子项是分段中最后一个子项,那么该终止值就是分段的最大值;
- * 如果不是最后一项,该终止值必须与其下一子项的起始值相同,否则系统抛出异常。
- */
- this.end = 0;
- /**
- * @member {number} [SuperMap.ThemeLabelItem.prototype.start=0]
- * @description 标签专题图子项的分段起始值。如果该子项是分段中第一项,那么该起始值就是分段的最小值;
- * 如果该子项的序号大于等于 1 的时候,该起始值必须与前一子项的终止值相同,否则系统会抛出异常。
- */
- this.start = 0;
- /**
- * @member {boolean} [SuperMap.ThemeLabelItem.prototype.visible=true]
- * @description 标签专题图子项是否可见。如果标签专题图子项可见,则为 true,否则为 false。
- */
- this.visible = true;
- /**
- * @member {SuperMap.ServerTextStyle} SuperMap.ThemeLabelItem.prototype.style
- * @description 标签专题图子项文本的显示风格。各种风格的优先级从高到低为:<br>
- * uniformMixedStyle(标签文本的复合风格),SuperMap.ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
- */
- this.style = new ServerTextStyle();
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ThemeLabelItem";
- }
- /**
- * @function SuperMap.ThemeLabelItem.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThemeLabelItem_createClass(ThemeLabelItem, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.caption = null;
- me.end = null;
- me.start = null;
- if (me.style) {
- me.style.destroy();
- me.style = null;
- }
- me.visible = null;
- }
- /**
- * @function SuperMap.ThemeLabelItem.fromObj
- * @description 从传入对象获取分段标签专题图的子项类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeLabelItem} ThemeLabelItem 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- if (!obj) {
- return;
- }
- var t = new ThemeLabelItem();
- Util.copy(t, obj);
- return t;
- }
- }]);
- return ThemeLabelItem;
- }();
- SuperMap.ThemeLabelItem = ThemeLabelItem;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeUniqueItem.js
- function ThemeUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeUniqueItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeUniqueItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeUniqueItem_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeUniqueItem
- * @category iServer Map Theme
- * @classdesc 单值专题图子项类。
- * @description 单值专题图是将专题值相同的要素归为一类,为每一类设定一种渲染风格,其中每一类就是一个专题图子项。比如,利用单值专题图制作行政区划图,Name 字段代表
- * 省/直辖市名,该字段用来做专题变量,如果该字段的字段值总共有 5 种不同值,则该行政区划图有 5 个专题图子项。
- * @param {Object} options - 参数。
- * @param {string} options.unique - 单值专题图子项的单值。
- * @param {string} [options.caption] - 单值专题图子项的标题。
- * @param {SuperMap.ServerStyle} [options.style] - 单值专题图子项的风格。
- * @param {boolean} [options.visible=true] - 单值专题图子项是否可见。
- */
- var ThemeUniqueItem = /*#__PURE__*/function () {
- function ThemeUniqueItem(options) {
- ThemeUniqueItem_classCallCheck(this, ThemeUniqueItem);
- /**
- * @member {string} [SuperMap.ThemeUniqueItem.prototype.caption]
- * @description 单值专题图子项的标题。
- */
- this.caption = null;
- /**
- * @member {SuperMap.ServerStyle} [SuperMap.ThemeUniqueItem.prototype.style]
- * @description 单值专题图子项的显示风格。
- */
- this.style = new ServerStyle();
- /**
- * @member {string} SuperMap.ThemeUniqueItem.prototype.unique
- * @description 单值专题图子项的值,可以为数字、字符串等。
- */
- this.unique = null;
- /**
- * @member {boolean} [SuperMap.ThemeUniqueItem.prototype.visible=true]
- * @description 单值专题图子项的可见性。
- */
- this.visible = true;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ThemeUniqueItem";
- }
- /**
- * @function SuperMap.ThemeUniqueItem.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThemeUniqueItem_createClass(ThemeUniqueItem, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.caption = null;
- me.unique = null;
- if (me.style) {
- me.style.destroy();
- me.style = null;
- }
- me.visible = null;
- }
- /**
- * @function SuperMap.ThemeUniqueItem.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- * @returns {Object} 对应的 JSON 格式对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- var obj = {};
- obj = Util.copyAttributes(obj, this);
- if (obj.style) {
- if (obj.style.toServerJSONObject) {
- obj.style = obj.style.toServerJSONObject();
- }
- }
- return obj;
- }
- /**
- * @function SuperMap.ThemeUniqueItem.fromObj
- * @description 从传入对象获取单值专题图子项类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeUniqueItem} ThemeUniqueItem 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- var res = new ThemeUniqueItem();
- Util.copy(res, obj);
- res.style = ServerStyle.fromJson(obj.style);
- return res;
- }
- }]);
- return ThemeUniqueItem;
- }();
- SuperMap.ThemeUniqueItem = ThemeUniqueItem;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeFlow.js
- function ThemeFlow_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeFlow_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeFlow_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeFlow_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeFlow
- * @category iServer Map Theme
- * @classdesc 标签或符号流动显示和牵引线风格设置类。
- * 通过该类可以设置专题图中符号是否流动显示、是否使用牵引线以及牵引线风格。
- * @param {Object} options - 参数。
- * @param {boolean} [options.flowEnabled=false] - 是否流动显示标签或符号。
- * @param {boolean} [options.leaderLineDisplayed=false] - 是否显示标签或符号和它标注的对象之间的牵引线。
- * @param {SuperMap.ServerStyle} [options.leaderLineStyle] - 标签或符号与其标注对象之间牵引线的风格。
- */
- var ThemeFlow = /*#__PURE__*/function () {
- function ThemeFlow(options) {
- ThemeFlow_classCallCheck(this, ThemeFlow);
- /**
- * @member {boolean} [SuperMap.ThemeFlow.prototype.flowEnabled=false]
- * @description 是否流动显示标签或符号。<br>
- * 对于标签专题图而言,对于跨越比较大的区域和线条状的几何对象,在一个地图窗口中不能完全显示的情况下,如果其标签位置比较固定,
- * 在当前地图窗口中该对象的标签不可见,则需要通过平移地图来查看对象的标签信息。如果采用了流动显示的效果,在当前地图窗口中,对象即使是部分显示,
- * 其标签也会显示在当前地图窗口中。当平移地图时,对象的标签会随之移动,以保证在当前地图窗口中部分或全部显示的对象其标签都可见,从而可以方便地查看各要素的标签信息。
- */
- this.flowEnabled = false;
- /**
- * @member {boolean} [SuperMap.ThemeFlow.prototype.leaderLineDisplayed=false]
- * @description 是否显示标签或符号和它标注的对象之间的牵引线。false表示不显示标签或符号和它标注的对象之间的牵引线。<br>
- * 只有当 flowEnabled 为 true 时,牵引线才起作用。在当标签流动显示时,其位置不固定,由于牵引线始终指向要素的内点,
- * 因而通过牵引线显示功能可以找到流动的标签或符号实际对应的要素。或者渲染符号偏移它所指向的对象时,图与对象之间可以采用牵引线进行连接。
- */
- this.leaderLineDisplayed = false;
- /**
- * @member {SuperMap.ServerStyle} SuperMap.ThemeFlow.prototype.leaderLineStyle
- * @description 标签或符号与其标注对象之间牵引线的风格。
- */
- this.leaderLineStyle = new ServerStyle();
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ThemeFlow";
- }
- /**
- * @function SuperMap.ThemeFlow.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThemeFlow_createClass(ThemeFlow, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.flowEnabled = null;
- me.leaderLineDisplayed = null;
- if (me.leaderLineStyle) {
- me.leaderLineStyle.destroy();
- me.leaderLineStyle = null;
- }
- }
- /**
- * @function SuperMap.ThemeFlow.fromObj
- * @description 从传入对象获取标签或符号流动显示和牵引线风格设置类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeFlow} ThemeFlow 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- if (!obj) {
- return;
- }
- var res = new ThemeFlow();
- Util.copy(res, obj);
- res.leaderLineStyle = ServerStyle.fromJson(obj.leaderLineStyle);
- return res;
- }
- }]);
- return ThemeFlow;
- }();
- SuperMap.ThemeFlow = ThemeFlow;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeOffset.js
- function ThemeOffset_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeOffset_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeOffset_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeOffset_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeOffset
- * @category iServer Map Theme
- * @classdesc 专题图中文本或符号相对于要素内点的偏移量设置类。
- * 通过该类可以设置专题图中标记文本或符号的偏移量以及偏移量是否随地图缩放而改变。
- * @param {Object} options - 参数。
- * @param {boolean} [options.offsetFixed=false] - 当前专题图是否固定标记文本或符号的偏移量。
- * @param {string} [options.offsetX='0.0'] - 专题图中文本或符号相对于要素内点的水平偏移量。
- * @param {string} [options.offsetY='0.0'] - 专题图中文本或符号相对于要素内点的垂直偏移量。
- */
- var ThemeOffset = /*#__PURE__*/function () {
- function ThemeOffset(options) {
- ThemeOffset_classCallCheck(this, ThemeOffset);
- /**
- * @member {boolean} [SuperMap.ThemeOffset.prototype.offsetFixed=false]
- * @description 当前专题图是否固定标记文本或符号的偏移量。所谓固定偏移量,则文本或符号的偏移量不随地图的缩放而变化。
- */
- this.offsetFixed = false;
- /**
- * @member {string} [SuperMap.ThemeOffset.prototype.offsetX=0.0]
- * @description 专题图中文本或符号相对于要素内点的水平偏移量。偏移量的单位为地图单位。
- * 该偏移量的值为一个常量值或者字段表达式所表示的值,即如果字段表达式为 SmID,其中 SmID = 2,那么水平偏移量为2。
- */
- this.offsetX = "0.0";
- /**
- * @member {string} [SuperMap.ThemeOffset.prototype.offsetY=0.0]
- * @description 专题图中文本或符号相对于要素内点的垂直偏移量。偏移量的单位为地图单位。
- * 该偏移量的值为一个常量值或者字段表达式所表示的值,即如果字段表达式为 SmID,其中 SmID = 2,那么垂直偏移量为2。
- */
- this.offsetY = "0.0";
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ThemeOffset";
- }
- /**
- * @function SuperMap.ThemeOffset.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThemeOffset_createClass(ThemeOffset, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.offsetFixed = null;
- me.offsetX = null;
- me.offsetY = null;
- }
- /**
- * @function SuperMap.ThemeOffset.fromObj
- * @description 从传入对象获取专题图中文本或符号相对于要素内点的偏移量设置类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeOffset} ThemeOffset 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- if (!obj) {
- return;
- }
- var res = new ThemeOffset();
- Util.copy(res, obj);
- return res;
- }
- }]);
- return ThemeOffset;
- }();
- SuperMap.ThemeOffset = ThemeOffset;
- ;// CONCATENATED MODULE: ./src/common/iServer/LabelMixedTextStyle.js
- function LabelMixedTextStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function LabelMixedTextStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelMixedTextStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelMixedTextStyle_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.LabelMixedTextStyle
- * @category iServer Map Theme
- * @classdesc 标签文本复合风格类
- * @description 该类主要用于对标签专题图中标签的文本内容进行风格设置。通过该类用户可以使标签的文字显示不同的风格,比如文本 “喜马拉雅山”,通过本类可以将前三个字用红色显示,后两个字用蓝色显示。对同一文本设置不同的风格实质上是对文本的字符进行分段,同一分段内的字符具有相同的显示风格。对字符分段有两种方式,一种是利用分隔符对文本进行分段;另一种是根据分段索引值进行分段。<br>
- * 1. 利用分隔符对文本进行分段: 比如文本 “5&109” 被分隔符 “&” 分为 “5” 和 “109” 两部分,
- * 在显示时,“5” 和分隔符 “&” 使用同一个风格,字符串 “109” 使用相同的风格。<br>
- * 2. 利用分段索引值进行分段: 文本中字符的索引值是以0开始的整数,比如文本 “珠穆朗玛峰”,
- * 第一个字符(“珠”)的索引值为 0,第二个字符(“穆”)的索引值为 1,以此类推;当设置分段索引值为 1,3,4,9 时,
- * 字符分段范围相应的就是 (-∞,1),[1,3),[3,4),[4,9),[9,+∞),可以看出索引号为 0 的字符(即“珠” )在第一个分段内,
- * 索引号为 1,2 的字符(即“穆”、“朗”)位于第二个分段内,索引号为 3 的字符(“玛”)在第三个分段内,索引号为 4 的字符(“峰”)在第四个分段内,其余分段中没有字符。
- * @param {Object} options - 参数。
- * @param {SuperMap.ServerTextStyle} [options.defaultStyle] - 默认的文本复合风格。
- * @param {string} [options.separator] - 文本的分隔符。
- * @param {boolean} [options.separatorEnabled=false] - 文本的分隔符是否有效。
- * @param {Array.<number>} [options.splitIndexes] - 分段索引值,分段索引值用来对文本中的字符进行分段。
- * @param {Array.<SuperMap.ServerTextStyle>} [options.styles] - 文本样式集合。
- */
- var LabelMixedTextStyle = /*#__PURE__*/function () {
- function LabelMixedTextStyle(options) {
- LabelMixedTextStyle_classCallCheck(this, LabelMixedTextStyle);
- /**
- * @member {SuperMap.ServerTextStyle} SuperMap.LabelMixedTextStyle.prototype.defaultStyle
- * @description 默认的文本复合风格,即 SuperMap.ServerTextStyle 各字段的默认值。
- */
- this.defaultStyle = null;
- /**
- * @member {string} SuperMap.LabelMixedTextStyle.prototype.separator
- * @description 文本的分隔符,分隔符的风格与前一个字符的风格一样。文本的分隔符是一个将文本分割开的符号,
- * 比如文本 “5_109” 被 “_” 隔符为 “5” 和 “109” 两部分,假设有风格数组:style1、style2。
- * 在显示时,“5” 和分隔符 “_” 使用 Style1 风格渲染,字符串 “109” 使用 Style2 的风格。
- */
- this.separator = null;
- /**
- * @member {boolean} [SuperMap.LabelMixedTextStyle.prototype.separatorEnabled=false]
- * @description 文本的分隔符是否有效。分隔符有效时利用分隔符对文本进行分段;无效时根据文本中字符的位置进行分段。
- * 分段后,同一分段内的字符具有相同的显示风格。
- */
- this.separatorEnabled = false;
- /**
- * @member {Array.<number>} SuperMap.LabelMixedTextStyle.prototype.splitIndexes
- * @description 分段索引值,分段索引值用来对文本中的字符进行分段。
- * 文本中字符的索引值是以 0 开始的整数,比如文本“珠穆朗玛峰”,第一个字符(“珠”)的索引值为0,第二个字符(“穆”)的索引值为 1,
- * 以此类推;当设置分段索引值数组为 [1,3,4,9] 时,字符分段范围相应的就是 (-∞,1),[1,3),[3,4),[4,9),[9,+∞),
- * 可以看出索引号为 0 的字符(即 “珠”)在第一个分段内,索引号为 1,2 的字符(即 “穆”、“朗”)位于第二个分段内,
- * 索引号为 3 的字符(“玛”)在第三个分段内,索引号为 4 的字符(“峰”)在第四个分段内,其余分段中没有字符。
- */
- this.splitIndexes = null;
- /**
- * @member {Array.<SuperMap.ServerTextStyle>} SuperMap.LabelMixedTextStyle.prototype.styles
- * @description 文本样式集合。文本样式集合中的样式根据索引与不同分段一一对应,
- * 如果有分段没有风格对应则使用 defaultStyle。
- */
- this.styles = new ServerTextStyle();
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.LabelMixedTextStyle";
- }
- /**
- * @function SuperMap.LabelMixedTextStyle.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- LabelMixedTextStyle_createClass(LabelMixedTextStyle, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- if (me.defaultStyle) {
- me.defaultStyle.destroy();
- me.defaultStyle = null;
- }
- me.separator = null;
- me.separatorEnabled = null;
- if (me.splitIndexes) {
- me.splitIndexes = null;
- }
- if (me.styles) {
- for (var i = 0, styles = me.styles, len = styles.length; i < len; i++) {
- styles[i].destroy();
- }
- me.styles = null;
- }
- }
- /**
- * @function SuperMap.LabelMixedTextStyle.fromObj
- * @description 从传入对象获取标签文本复合风格类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.LabelMixedTextStyle} 返回新的 LabelMixedTextStyle 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- if (!obj) {
- return;
- }
- var res = new LabelMixedTextStyle();
- var stys = obj.styles;
- Util.copy(res, obj);
- res.defaultStyle = new ServerTextStyle(obj.defaultStyle);
- if (stys) {
- res.styles = [];
- for (var i = 0, len = stys.length; i < len; i++) {
- res.styles.push(new ServerTextStyle(stys[i]));
- }
- }
- return res;
- }
- }]);
- return LabelMixedTextStyle;
- }();
- SuperMap.LabelMixedTextStyle = LabelMixedTextStyle;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelText.js
- function ThemeLabelText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeLabelText_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelText_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelText_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeLabelText
- * @category iServer Map Theme
- * @classdesc 标签中文本风格类。
- * 通过该类可以设置标签中的文本字体大小和显示风格。
- * @param {Object} options - 参数。
- * @param {number} [options.maxTextHeight=0] - 标签中文本的最大高度。
- * @param {number} [options.maxTextWidth=0] - 标签中文本的最大宽度。
- * @param {number} [options.minTextHeight=0] - 标签中文本的最小高度。
- * @param {number} [options.minTextWidth=0] - 标签中文本的最小宽度。
- * @param {SuperMap.ServerTextStyle} [options.uniformStyle] - 统一文本风格。
- * @param {SuperMap.LabelMixedTextStyle} [options.uniformMixedStyle] - 标签专题图统一的文本复合风格。
- */
- var ThemeLabelText = /*#__PURE__*/function () {
- function ThemeLabelText(options) {
- ThemeLabelText_classCallCheck(this, ThemeLabelText);
- /**
- * @member {number} [SuperMap.ThemeLabelText.prototype.maxTextHeight=0]
- * @description 标签中文本的最大高度。当标签文本不固定大小时,即 SuperMap.ServerTextStyle.sizeFixed = false 有效,
- * 当放大后的文本高度超过最大高度之后就不再放大。高度单位为 0.1 毫米。
- */
- this.maxTextHeight = 0;
- /**
- * @member {number} [SuperMap.ThemeLabelText.prototype.maxTextWidth=0]
- * @description 标签中文本的最大宽度。当标签文本不固定大小时,即 SuperMap.ServerTextStyle.sizeFixed = false 有效,
- * 当放大后的文本宽度超过最大高度之后就不再放大。宽度单位为 0.1 毫米。
- */
- this.maxTextWidth = 0;
- /**
- * @member {number} [SuperMap.ThemeLabelText.prototype.minTextHeight=0]
- * @description 标签中文本的最小高度。当标签文本不固定大小时,即 SuperMap.ServerTextStyle.sizeFixed = false 有效,
- * 当缩小后的文本高度小于最小高度之后就不再缩小。高度单位为 0.1 毫米。
- */
- this.minTextHeight = 0;
- /**
- * @member {number} [SuperMap.ThemeLabelText.prototype.minTextWidth=0]
- * @description 标签中文本的最小宽度。当标签文本不固定大小时,即 SuperMap.ServerTextStyle.sizeFixed = false 有效,
- * 当缩小后的文本宽度小于最小宽度之后就不再缩小。宽度单位为 0.1 毫米。
- */
- this.minTextWidth = 0;
- /**
- * @member {SuperMap.ServerTextStyle} [SuperMap.ThemeLabelText.prototype.uniformStyle]
- * @description 统一文本风格。当标签专题图子项的个数大于等于1时,
- * uniformStyle 不起作用,各标签的风格使用子项中设置的风格。各种风格的优先级从高到低为:uniformMixedStyle(标签文本的复合风格),
- * SuperMap.ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
- */
- this.uniformStyle = new ServerTextStyle();
- /**
- *@member {SuperMap.LabelMixedTextStyle} [SuperMap.ThemeLabelText.prototype.uniformMixedStyle]
- *@description 标签专题图统一的文本复合风格。通过该类可以使同一个标
- * 签中的文字使用多种风格显示。各种风格的优先级从高到低为:uniformMixedStyle(标签文本的复合风格),
- * SuperMap.ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
- */
- this.uniformMixedStyle = null;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ThemeLabelText";
- }
- /**
- * @function SuperMap.ThemeLabelText.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThemeLabelText_createClass(ThemeLabelText, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.maxTextHeight = null;
- me.maxTextWidth = null;
- me.minTextHeight = null;
- me.minTextWidth = null;
- if (me.uniformStyle) {
- me.uniformStyle.destroy();
- me.uniformStyle = null;
- }
- if (me.uniformMixedStyle) {
- me.uniformMixedStyle.destroy();
- me.uniformMixedStyle = null;
- }
- }
- /**
- * @function SuperMap.ThemeLabelText.fromObj
- * @description 从传入对象获取标签中文本风格类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeLabelText} ThemeLabelText 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- if (!obj) {
- return;
- }
- var res = new ThemeLabelText();
- Util.copy(res, obj);
- res.uniformStyle = ServerTextStyle.fromObj(obj.uniformStyle);
- res.uniformMixedStyle = LabelMixedTextStyle.fromObj(obj.uniformMixedStyle);
- return res;
- }
- }]);
- return ThemeLabelText;
- }();
- SuperMap.ThemeLabelText = ThemeLabelText;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelAlongLine.js
- function ThemeLabelAlongLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeLabelAlongLine_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelAlongLine_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelAlongLine_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeLabelAlongLine
- * @category iServer Map Theme
- * @classdesc 标签沿线标注样式类。
- * @param {Object} options - 参数。
- * @param {boolean} [options.isAlongLine=true] - 是否沿线显示文本。
- * @param {SuperMap.AlongLineDirection} [options.alongLineDirection=SuperMap.AlongLineDirection.LB_TO_RT] - 标签沿线标注方向。
- * @param {boolean} [options.angleFixed=false] - 当沿线显示文本时,是否将文本角度固定。
- * @param {boolean} [options.repeatedLabelAvoided=false] - 沿线循环标注时是否避免标签重复标注。
- * @param {boolean} [options.repeatIntervalFixed=false] - 循环标注间隔是否固定。
- * @param {number} [options.labelRepeatInterval=0] - 沿线且循环标注时循环标注的间隔。
- */
- var ThemeLabelAlongLine = /*#__PURE__*/function () {
- function ThemeLabelAlongLine(options) {
- ThemeLabelAlongLine_classCallCheck(this, ThemeLabelAlongLine);
- /**
- * @member {boolean} [SuperMap.ThemeLabelAlongLine.prototype.isAlongLine=true]
- * @description 是否沿线显示文本。true 表示沿线显示文本,false 表示正常显示文本。
- */
- this.isAlongLine = true;
- /**
- * @member {SuperMap.AlongLineDirection} [SuperMap.ThemeLabelAlongLine.prototype.alongLineDirection=SuperMap.AlongLineDirection.LB_TO_RT]
- * @description 标签沿线标注方向。
- */
- this.alongLineDirection = AlongLineDirection.LB_TO_RT;
- /**
- * @member {boolean} [SuperMap.ThemeLabelAlongLine.prototype.angleFixed=false]
- * @description 当沿线显示文本时,是否将文本角度固定。true 表示按固定文本角度显示文本,false 表示按照沿线角度显示文本。
- * 如果固定角度,则所有标签均按所设置的文本风格中字体的旋转角度来显示,不考虑沿线标注的方向;
- * 如果不固定角度,在显示标签时会同时考虑字体的旋转角度和沿线标注的方向。
- */
- this.angleFixed = false;
- /**
- * @member {boolean} SuperMap.ThemeLabelAlongLine.prototype.repeatedLabelAvoided
- * @description 沿线循环标注时是否避免标签重复标注。
- */
- this.repeatedLabelAvoided = false;
- /**
- * @member {boolean} [SuperMap.ThemeLabelAlongLine.prototype.repeatIntervalFixed=false]
- * @description 循环标注间隔是否固定。true 表示使用固定循环标注间隔,即使用逻辑坐标来显示循环标注间隔;
- * false 表示循环标注间隔随地图的缩放而变化,即使用地理坐标来显示循环标注间隔。
- */
- this.repeatIntervalFixed = false;
- /**
- * @member {number} [SuperMap.ThemeLabelAlongLine.prototype.labelRepeatInterval=0]
- * @description 沿线且循环标注时循环标注的间隔。长度的单位与地图的地理单位一致。只有设定 RepeatedLabelAvoided 为 true
- * 的时候,labelRepeatInterval 属性才有效。
- */
- this.labelRepeatInterval = 0;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ThemeLabelAlongLine";
- }
- /**
- * @function SuperMap.ThemeLabelAlongLine.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThemeLabelAlongLine_createClass(ThemeLabelAlongLine, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.isAlongLine = null;
- me.alongLineDirection = null;
- me.angleFixed = null;
- me.repeatedLabelAvoided = null;
- me.repeatIntervalFixed = null;
- me.labelRepeatInterval = null;
- }
- /**
- * @function SuperMap.ThemeLabelAlongLine.fromObj
- * @description 从传入对象获取标签沿线标注样式类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeLabelAlongLine} ThemeLabelAlongLine 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- if (!obj) {
- return;
- }
- var t = new ThemeLabelAlongLine();
- Util.copy(t, obj);
- return t;
- }
- }]);
- return ThemeLabelAlongLine;
- }();
- SuperMap.ThemeLabelAlongLine = ThemeLabelAlongLine;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelBackground.js
- function ThemeLabelBackground_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeLabelBackground_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelBackground_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelBackground_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeLabelBackground
- * @category iServer Map Theme
- * @classdesc 标签背景风格类。通过该类可以设置标签的背景形状和风格。
- * @param {Object} options - 参数。
- * @param {SuperMap.LabelBackShape} [options.labelBackShape=SuperMap.LabelBackShape.NONE] - 标签专题图中标签背景风格。
- * @param {SuperMap.ServerStyle} [options.backStyle=SuperMap.LabelBackShape.NONE] - 标签专题图中标签背景的形状枚举类。
- */
- var ThemeLabelBackground = /*#__PURE__*/function () {
- function ThemeLabelBackground(options) {
- ThemeLabelBackground_classCallCheck(this, ThemeLabelBackground);
- /**
- * @member {SuperMap.LabelBackShape} [SuperMap.ThemeLabelBackground.prototype.labelBackShape=SuperMap.LabelBackShape.NONE]
- * @description 标签专题图中标签背景风格。当背景形状
- * labelBackShape 属性设为 NONE(即无背景形状) 时,backStyle 属性无效。
- */
- this.labelBackShape = LabelBackShape.NONE;
- /**
- * @member {SuperMap.ServerStyle} [SuperMap.ThemeLabelBackground.prototype.backStyle=SuperMap.LabelBackShape.NON]
- * @description 标签专题图中标签背景的形状枚举类。背景类型可
- * 以是矩形、圆角矩形、菱形、椭圆形、三角形和符号等,即不使用任何的形状作为标签的背景。
- */
- this.backStyle = new ServerStyle();
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ThemeLabelBackground";
- }
- /**
- * @function SuperMap.ThemeLabelBackground.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThemeLabelBackground_createClass(ThemeLabelBackground, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.labelBackShape = null;
- if (me.backStyle) {
- me.backStyle.destroy();
- me.backStyle = null;
- }
- }
- /**
- * @function SuperMap.ThemeLabelBackground.fromObj
- * @description 从传入对象获取标签背景风格类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeLabelBackground} ThemeLabelBackground 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- if (!obj) {
- return;
- }
- var t = new ThemeLabelBackground();
- t.labelBackShape = obj.labelBackShape;
- t.backStyle = ServerStyle.fromJson(obj.backStyle);
- return t;
- }
- }]);
- return ThemeLabelBackground;
- }();
- SuperMap.ThemeLabelBackground = ThemeLabelBackground;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabel.js
- 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); }
- function ThemeLabel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeLabel_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabel_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabel_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function ThemeLabel_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeLabel_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function ThemeLabel_setPrototypeOf(o, p) { ThemeLabel_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeLabel_setPrototypeOf(o, p); }
- 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); }; }
- function ThemeLabel_possibleConstructorReturn(self, call) { if (call && (ThemeLabel_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeLabel_assertThisInitialized(self); }
- function ThemeLabel_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function ThemeLabel_getPrototypeOf(o) { ThemeLabel_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeLabel_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeLabel
- * @category iServer Map Theme
- * @classdesc 标签专题图类。
- * @extends SuperMap.Theme
- * @param {Object} options - 参数。
- * @param {Array.<SuperMap.ThemeUniqueItem>} options.items - 分段标签专题图的子项数组。
- * @param {string} options.labelExpression - 标注字段表达式。
- * @param {Array.<SuperMap.LabelMatrixCell>} options.matrixCells - 矩阵标签元素数组。
- * @param {SuperMap.ThemeLabelAlongLine} [options.alongLine] - 标签沿线标注方向样式类。
- * @param {SuperMap.ThemeLabelBackground} [options.background] - 标签专题图中标签的背景风格类。
- * @param {SuperMap.ThemeFlow} [options.flow] - 标签专题图标签流动显示与牵引线设置类。
- * @param {SuperMap.LabelOverLengthMode} [options.labelOverLengthMode=SuperMap.LabelOverLengthMode.NONE] - 标签专题图中超长标签的处理模式枚举类。
- * @param {number} [options.maxLabelLength=256] - 标签在每一行显示的最大长度。
- * @param {number} [options.numericPrecision=0] - 通过该字段设置其显示的精度。
- * @param {SuperMap.ThemeOffset} [options.offset] - 用于设置标签专题图中标记文本相对于要素内点的偏移量对象。
- * @param {boolean} [options.overlapAvoided=true] - 是否允许以文本避让方式显示文本。
- * @param {string} [options.rangeExpression] - 制作分段标签专题的分段字段或字段表达式。
- * @param {boolean} [options.smallGeometryLabeled=false] - 是否显示长度大于被标注对象本身长度的标签。
- * @param {SuperMap.ThemeLabelText} options.text - 标签中文本风格。
- * @param {number} [options.textSpace=0] - 沿线标注,相邻两个文字之间的间距,单位当前设置的字高。
- * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
- */
- var ThemeLabel = /*#__PURE__*/function (_Theme) {
- ThemeLabel_inherits(ThemeLabel, _Theme);
- var _super = ThemeLabel_createSuper(ThemeLabel);
- function ThemeLabel(options) {
- var _this;
- ThemeLabel_classCallCheck(this, ThemeLabel);
- _this = _super.call(this, "LABEL", options);
- /**
- * @member {SuperMap.ThemeLabelAlongLine} [SuperMap.ThemeLabel.prototype.alongLine]
- * @description 标签沿线标注方向样式类。
- * 在该类中可以设置标签是否沿线标注以及沿线标注的多种方式。沿线标注属性只适用于线数据集专题图。
- */
- _this.alongLine = new ThemeLabelAlongLine();
- /**
- * @member {SuperMap.ThemeLabelBackground} [SuperMap.ThemeLabel.prototype.background]
- * @description 标签专题图中标签的背景风格类。通过该字段可以设置标签的背景形状和风格。
- */
- _this.background = new ThemeLabelBackground();
- /**
- * @member {SuperMap.ThemeFlow} [SuperMap.ThemeLabel.prototype.flow]
- * @description 标签专题图标签流动显示与牵引线设置类。通过该字段可以设置标签是否流动显示和牵引线风格。
- */
- _this.flow = new ThemeFlow();
- /**
- * @member {Array.<SuperMap.ThemeUniqueItem>} [SuperMap.ThemeLabel.prototype.items]
- * @description 分段标签专题图的子项数组。分段标签专题图使用 rangeExpression
- * 指定数字型的字段作为分段数据,items 中的每个子对象的 [start,end) 分段值必须来源于属性 rangeExpression 的字段值。每个子项拥有自己的风格。
- */
- _this.items = null;
- /**
- * @member {Array.<SuperMap.ThemeLabelUniqueItem>} SuperMap.ThemeLabel.prototype.uniqueItems
- * @description 单值标签专题图子项数组。单值标签专题图使用 uniqueExpression单值标签专题图子项集合。
- */
- _this.uniqueItems = null;
- /**
- * @member {string} SuperMap.ThemeLabel.prototype.labelExpression
- * @description 标注字段表达式。系统将 labelExpression 对应的字段或字段表达式的值以标签的形式显示在图层中。
- */
- _this.labelExpression = null;
- /**
- * @member {SuperMap.LabelOverLengthMode} [SuperMap.ThemeLabel.prototype.labelOverLengthMode=SuperMap.LabelOverLengthMode.NONE] - 标签专题图中超长标签的处理模式枚举类。
- * @description 对于标签的长度超过设置的标签最大长度 maxLabelLength 时称为超长标签。
- */
- _this.labelOverLengthMode = LabelOverLengthMode.NONE;
- /**
- * @member {Array.<SuperMap.LabelMatrixCell>} SuperMap.ThemeLabel.prototype.matrixCells
- * @description 矩阵标签元素数组,用于制作矩阵标签专题图。
- * 数组中可以放置符号类型的矩阵标签元素和图片类型的矩阵标签元素。
- */
- _this.matrixCells = null;
- /**
- * @member {number} [SuperMap.ThemeLabel.prototype.maxLabelLength=256]
- * @description 标签在每一行显示的最大长度,一个中文为两个字符。
- * 如果超过最大长度,可以采用两种方式来处理,一种是换行的模式进行显示,另一种是以省略号方式显示。单位为字符。
- */
- _this.maxLabelLength = 256;
- /**
- * @member {number} [SuperMap.ThemeLabel.prototype.numericPrecision=0]
- * @description 如果显示的标签内容为数字,通过该字段设置其显示的精度。例如标签对应的数字是8071.64529347,
- * 如果该属性为0时,显示8071;为1时,显示8071.6;为3时,则是8071.645。
- */
- _this.numericPrecision = 0;
- /**
- * @member {SuperMap.ThemeOffset} [SuperMap.ThemeLabel.prototype.offset]
- * @description 用于设置标签专题图中标记文本相对于要素内点的偏移量对象。
- */
- _this.offset = new ThemeOffset();
- /**
- * @member {boolean} [SuperMap.ThemeLabel.prototype.overlapAvoided=true]
- * @description 是否允许以文本避让方式显示文本。true 表示自动避免文本叠盖。只针对该标签专题图层中的文本数据。
- * 在标签重叠度很大的情况下,即使使用自动避让功能,可能也无法完全避免标签重叠现象。
- */
- _this.overlapAvoided = true;
- /**
- * @member {string} SuperMap.ThemeLabel.prototype.rangeExpression
- * @description 制作分段标签专题的分段字段或字段表达式。该表达式对应的字段(或者字段表达式)的值应该为数值型。
- * 该字段与 items 分段子项联合使用,每个子项的起始值 [start,end)来源于 rangeExpression 字段值。
- * 最后 labelExpression 指定的标签字段(标签专题图要显示的具体内容)会根据分段子项的风格进行分段显示。
- */
- _this.rangeExpression = null;
- /**
- * @member {string} SuperMap.ThemeLabel.prototype.uniqueExpression
- * @description 用于制作单值专题图的字段或字段表达式。
- * 该字段值的数据类型可以为数值型或字符型。如果设置字段表达式,只能是相同数据类型字段间的运算。必须与labelExpression一起使用。
- */
- _this.uniqueExpression = null;
- /**
- * @member {boolean} [SuperMap.ThemeLabel.prototype.smallGeometryLabeled=false]
- * @description 是否显示长度大于被标注对象本身长度的标签。在标签的长度大于线或者面对象本身的长度时,
- * 如果该值为 true,则标签文字会叠加在一起显示,为了清楚完整的显示该标签,
- * 可以采用换行模式来显示标签,但必须保证每行的长度小于对象本身的长度。
- */
- _this.smallGeometryLabeled = false;
- /**
- * @member {SuperMap.ThemeLabelText} SuperMap.ThemeLabel.prototype.text
- * @description 标签中文本风格。
- */
- _this.text = new ThemeLabelText();
- /**
- * @member {number} [SuperMap.ThemeLabel.prototype.textSpace=0]
- * @description 沿线标注,相邻两个文字之间的间距,单位当前设置的字高。
- */
- _this.textSpace = 0;
- if (options) {
- Util.extend(ThemeLabel_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.ThemeLabel";
- return _this;
- }
- /**
- * @function SuperMap.ThemeLabel.prototype.destroy
- * @override
- */
- ThemeLabel_createClass(ThemeLabel, [{
- key: "destroy",
- value: function destroy() {
- ThemeLabel_get(ThemeLabel_getPrototypeOf(ThemeLabel.prototype), "destroy", this).call(this);
- var me = this;
- me.alongLine = null;
- if (me.background) {
- me.background.destroy();
- me.background = null;
- }
- me.flow = null;
- if (me.items) {
- for (var i = 0, items = me.items, len = items.length; i < len; i++) {
- items[i].destroy();
- }
- me.items = null;
- }
- if (me.uniqueItems) {
- for (var j = 0, uniqueItems = me.uniqueItems, uniqueLen = uniqueItems.length; j < uniqueLen; j++) {
- uniqueItems[j].destory();
- }
- me.uniqueItems = null;
- }
- me.labelExpression = null;
- me.labelOverLengthMode = null;
- me.matrixCells = null;
- me.maxLabelLength = null;
- me.numericPrecision = null;
- me.overlapAvoided = null;
- me.rangeExpression = null;
- me.uniqueExpression = null;
- if (me.offset) {
- me.offset.destroy();
- me.offset = null;
- }
- me.overlapAvoided = null;
- me.smallGeometryLabeled = null;
- if (me.text) {
- me.text.destroy();
- me.text = null;
- }
- me.textSpace = null;
- }
- /**
- * @function SuperMap.ThemeLabel.prototype.toJSON
- * @description 将themeLabel对象转化为 JSON 字符串。
- * @returns {string} 返回转换后的 JSON 字符串。
- */
- }, {
- key: "toJSON",
- value: function toJSON() {
- return Util.toJSON(this.toServerJSONObject());
- }
- /**
- * @function SuperMap.ThemeLabel.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- * @returns {Object} 对应的 JSON 格式对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- var obj = {};
- obj.type = this.type;
- obj.memoryData = this.memoryData;
- if (this.alongLine) {
- obj.alongLine = this.alongLine.isAlongLine;
- obj.alongLineDirection = this.alongLine.alongLineDirection;
- obj.angleFixed = this.alongLine.angleFixed;
- obj.isLabelRepeated = this.alongLine.isLabelRepeated;
- obj.labelRepeatInterval = this.alongLine.labelRepeatInterval;
- obj.repeatedLabelAvoided = this.alongLine.repeatedLabelAvoided;
- obj.repeatIntervalFixed = this.alongLine.repeatIntervalFixed;
- }
- if (this.offset) {
- obj.offsetFixed = this.offset.offsetFixed;
- obj.offsetX = this.offset.offsetX;
- obj.offsetY = this.offset.offsetY;
- }
- if (this.flow) {
- obj.flowEnabled = this.flow.flowEnabled;
- obj.leaderLineDisplayed = this.flow.leaderLineDisplayed;
- obj.leaderLineStyle = this.flow.leaderLineStyle;
- }
- if (this.text) {
- obj.maxTextHeight = this.text.maxTextHeight;
- obj.maxTextWidth = this.text.maxTextWidth;
- obj.minTextHeight = this.text.minTextHeight;
- obj.minTextWidth = this.text.minTextWidth;
- obj.uniformStyle = this.text.uniformStyle;
- obj.uniformMixedStyle = this.text.uniformMixedStyle;
- }
- if (this.background) {
- obj.labelBackShape = this.background.labelBackShape;
- obj.backStyle = this.background.backStyle;
- }
- obj.labelOverLengthMode = this.labelOverLengthMode;
- obj.maxLabelLength = this.maxLabelLength;
- obj.smallGeometryLabeled = this.smallGeometryLabeled;
- obj.rangeExpression = this.rangeExpression;
- obj.uniqueExpression = this.uniqueExpression;
- obj.numericPrecision = this.numericPrecision;
- obj.items = this.items;
- obj.uniqueItems = this.uniqueItems;
- obj.labelExpression = this.labelExpression;
- obj.overlapAvoided = this.overlapAvoided;
- obj.matrixCells = this.matrixCells;
- obj.textSpace = this.textSpace;
- return obj;
- }
- /**
- * @function SuperMap.ThemeLabel.fromObj
- * @description 从传入对象获取标签专题图类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeLabel} ThemeLabel 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- if (!obj) {
- return;
- }
- var lab = new ThemeLabel();
- var itemsL = obj.items,
- itemsU = obj.uniqueItems,
- cells = obj.matrixCells;
- obj.matrixCells = null;
- Util.copy(lab, obj);
- lab.alongLine = ThemeLabelAlongLine.fromObj(obj);
- lab.background = ThemeLabelBackground.fromObj(obj);
- lab.flow = new ThemeFlow({
- flowEnabled: obj.flowEnabled,
- leaderLineDisplayed: obj.leaderLineDisplayed,
- leaderLineStyle: obj.leaderLineStyle
- });
- if (itemsL) {
- lab.items = [];
- for (var i = 0, len = itemsL.length; i < len; i++) {
- lab.items.push(ThemeLabelItem.fromObj(itemsL[i]));
- }
- }
- if (itemsU) {
- lab.uniqueItems = [];
- for (var j = 0, uniqueLen = itemsU.length; j < uniqueLen; j++) {
- lab.uniqueItems.push(ThemeUniqueItem.fromObj(itemsU[j]));
- }
- }
- if (cells) {
- lab.matrixCells = [];
- for (var _i = 0, _len = cells.length; _i < _len; _i++) {//TODO
- //lab.matrixCells.push(SuperMap.LabelMatrixCell.fromObj(cells[i]));
- }
- }
- lab.offset = ThemeOffset.fromObj(obj);
- lab.text = ThemeLabelText.fromObj(obj);
- return lab;
- }
- }]);
- return ThemeLabel;
- }(Theme);
- SuperMap.ThemeLabel = ThemeLabel;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeUnique.js
- 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); }
- function ThemeUnique_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeUnique_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeUnique_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeUnique_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function ThemeUnique_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeUnique_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function ThemeUnique_setPrototypeOf(o, p) { ThemeUnique_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeUnique_setPrototypeOf(o, p); }
- 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); }; }
- function ThemeUnique_possibleConstructorReturn(self, call) { if (call && (ThemeUnique_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeUnique_assertThisInitialized(self); }
- function ThemeUnique_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function ThemeUnique_getPrototypeOf(o) { ThemeUnique_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeUnique_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeUnique
- * @category iServer Map Theme
- * @classdesc 单值专题图。
- * @description 单值专题图是利用不同的颜色或符号(线型、填充)表示图层中某一属性信息的不同属性值,属性值相同的要素具有相同的渲染风格。单值专题图多用于具有分类属性的地图上,
- * 比如土壤类型分布图、土地利用图、行政区划图等。单值专题图着重表示现象质的差别,一般不表示数量的特征。尤其是有交叉或重叠现象时,此类不推荐使用,例如:民族分布区等。
- * @extends {SuperMap.Theme}
- * @param {Object} options - 参数。
- * @param {Array.<SuperMap.ThemeUniqueItem>} options.items - 单值专题图子项类数组。
- * @param {string} options.uniqueExpression - 用于制作单值专题图的字段或字段表达式。
- * @param {SuperMap.ServerStyle} [options.defaultStyle] - 未参与单值专题图制作的对象的显示风格。
- * @param {SuperMap.ColorGradientType} [options.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
- * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
- */
- var ThemeUnique = /*#__PURE__*/function (_Theme) {
- ThemeUnique_inherits(ThemeUnique, _Theme);
- var _super = ThemeUnique_createSuper(ThemeUnique);
- function ThemeUnique(options) {
- var _this;
- ThemeUnique_classCallCheck(this, ThemeUnique);
- _this = _super.call(this, "UNIQUE", options);
- /**
- * @member {SuperMap.ServerStyle} SuperMap.ThemeUnique.prototype.defaultStyle
- * @description 未参与单值专题图制作的对象的显示风格。
- * 通过单值专题图子项数组 (items)可以指定某些要素参与单值专题图制作,对于那些没有被包含的要素,即不参加单值专题表达的要素,使用该风格显示。
- */
- _this.defaultStyle = new ServerStyle();
- /**
- * @member {Array.<SuperMap.ThemeUniqueItem>} SuperMap.ThemeUnique.prototype.items
- * @description 单值专题图子项类数组。
- * 单值专题图是将专题值相同的要素归为一类,为每一类设定一种渲染风格,其中每一类就是一个专题图子项。比如,利用单值专题图制作行政区划图,
- * Name 字段代表省/直辖市名,该字段用来做专题变量,如果该字段的字段值总共有5种不同值,则该行政区划图有 5 个专题图子项。
- */
- _this.items = null;
- /**
- * @member {string} SuperMap.ThemeUnique.prototype.uniqueExpression
- * @description 用于制作单值专题图的字段或字段表达式。
- * 该字段值的数据类型可以为数值型或字符型。如果设置字段表达式,只能是相同数据类型字段间的运算。
- */
- _this.uniqueExpression = null;
- /**
- * @member {SuperMap.ColorGradientType} [SuperMap.ThemeUnique.prototype.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED]
- * @description 渐变颜色枚举类。
- * 渐变色是由起始色根据一定算法逐渐过渡到终止色的一种混合型颜色。
- * 该类作为单值专题图参数类、分段专题图参数类的属性,负责设置单值专题图、分段专题图的配色方案,在默认情况下专题图所有子项会根据这个配色方案完成填充。
- * 但如果为某几个子项的风格进行单独设置后(设置了 ThemeUniqueItem 或 ThemeRangeItem 类中Style属性),
- * 该配色方案对于这几个子项将不起作用。
- */
- _this.colorGradientType = ColorGradientType.YELLOW_RED;
- if (options) {
- Util.extend(ThemeUnique_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.ThemeUnique";
- return _this;
- }
- /**
- * @function SuperMap.ThemeUnique.prototype.destroy
- * @override
- */
- ThemeUnique_createClass(ThemeUnique, [{
- key: "destroy",
- value: function destroy() {
- ThemeUnique_get(ThemeUnique_getPrototypeOf(ThemeUnique.prototype), "destroy", this).call(this);
- var me = this;
- me.uniqueExpression = null;
- me.colorGradientType = null;
- if (me.items) {
- if (me.items.length > 0) {
- for (var item in me.items) {
- me.items[item].destroy();
- me.items[item] = null;
- }
- }
- me.items = null;
- }
- if (me.defaultStyle) {
- me.defaultStyle.destroy();
- me.defaultStyle = null;
- }
- }
- /**
- * @function SuperMap.ThemeUnique.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- * @returns {Object} 对应的 JSON 格式对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- var obj = {};
- obj = Util.copyAttributes(obj, this);
- if (obj.defaultStyle) {
- if (obj.defaultStyle.toServerJSONObject) {
- obj.defaultStyle = obj.defaultStyle.toServerJSONObject();
- }
- }
- if (obj.items) {
- var items = [],
- len = obj.items.length;
- for (var i = 0; i < len; i++) {
- items.push(obj.items[i].toServerJSONObject());
- }
- obj.items = items;
- }
- return obj;
- }
- /**
- * @function SuperMap.ThemeUnique.fromObj
- * @description 从传入对象获取单值专题图类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeUnique} ThemeUnique 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- var res = new ThemeUnique();
- var uItems = obj.items;
- var len = uItems ? uItems.length : 0;
- Util.extend(res, obj);
- res.items = [];
- res.defaultStyle = ServerStyle.fromJson(obj.defaultStyle);
- for (var i = 0; i < len; i++) {
- res.items.push(ThemeUniqueItem.fromObj(uItems[i]));
- }
- return res;
- }
- }]);
- return ThemeUnique;
- }(Theme);
- SuperMap.ThemeUnique = ThemeUnique;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphAxes.js
- function ThemeGraphAxes_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeGraphAxes_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphAxes_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphAxes_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeGraphAxes
- * @category iServer Map Theme
- * @classdesc 统计专题图坐标轴样式类。
- * @param {Object} options - 参数。
- * @param {SuperMap.ServerColor} [options.axesColor=(0, 0, 0)] - 坐标轴颜色。
- * @param {boolean} [options.axesDisplayed=false] - 是否显示坐标轴。
- * @param {boolean} [options.axesGridDisplayed=false] - 是否在统计图坐标轴上显示网格。
- * @param {boolean} [options.axesTextDisplayed=false] - 是否显示坐标轴的文本标注。
- * @param {SuperMap.ServerTextStyle} [options.axesTextStyle] - 统计符号的最大最小尺寸。
- */
- var ThemeGraphAxes = /*#__PURE__*/function () {
- function ThemeGraphAxes(options) {
- ThemeGraphAxes_classCallCheck(this, ThemeGraphAxes);
- /**
- * @member {SuperMap.ServerColor} [SuperMap.ThemeGraphAxes.prototype.axesColor=(0, 0, 0)]
- * @description 坐标轴颜色。当 axesDisplayed = true 时有效。
- */
- this.axesColor = new ServerColor(0, 0, 0);
- /**
- * @member {boolean} [SuperMap.ThemeGraphAxes.prototype.axesDisplayed=false]
- * @description 是否显示坐标轴。<br>
- * 由于饼状图和环状图无坐标轴,故该属性以及所有与坐标轴设置相关的属性都不适用于它们。并且只有当该值为 true 时,其它设置坐标轴的属性才起作用。
- */
- this.axesDisplayed = false;
- /**
- * @member {boolean} [SuperMap.ThemeGraphAxes.prototype.axesGridDisplayed=false]
- * @description 是否在统计图坐标轴上显示网格。
- */
- this.axesGridDisplayed = false;
- /**
- * @member {boolean} [SuperMap.ThemeGraphAxes.prototype.axesTextDisplayed=false]
- * @description 是否显示坐标轴的文本标注。
- */
- this.axesTextDisplayed = false;
- /**
- * @member {SuperMap.ServerTextStyle} SuperMap.ThemeGraphAxes.prototype.axesTextStyle
- * @description 坐标轴文本风格。当 axesTextDisplayed = true 时有效。
- */
- this.axesTextStyle = new ServerTextStyle();
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ThemeGraphAxes";
- }
- /**
- * @function SuperMap.ThemeGraphAxes.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThemeGraphAxes_createClass(ThemeGraphAxes, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- if (me.axesColor) {
- me.axesColor.destroy();
- me.axesColor = null;
- }
- me.axesDisplayed = null;
- me.axesGridDisplayed = null;
- me.axesTextDisplayed = null;
- if (me.axesTextStyle) {
- me.axesTextStyle.destroy();
- me.axesTextStyle = null;
- }
- }
- /**
- * @function SuperMap.ThemeGraphAxes.fromObj
- * @description 从传入对象获取统计专题图坐标轴样式类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeGraphAxes} ThemeGraphAxes 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- if (!obj) {
- return;
- }
- var res = new ThemeGraphAxes();
- Util.copy(res, obj);
- res.axesColor = ServerColor.fromJson(obj.axesColor);
- res.axesTextStyle = ServerTextStyle.fromObj(obj.axesTextStyle);
- return res;
- }
- }]);
- return ThemeGraphAxes;
- }();
- SuperMap.ThemeGraphAxes = ThemeGraphAxes;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphSize.js
- function ThemeGraphSize_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeGraphSize_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphSize_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphSize_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeGraphSize
- * @category iServer Map Theme
- * @classdesc 统计专题图符号尺寸类。
- * @param {Object} options - 参数。
- * @param {number} [options.maxGraphSize=0] - 统计图中显示的最大图表尺寸基准值。
- * @param {number} [options.minGraphSize=0] - 统计图中显示的最小图表尺寸基准值。
- */
- var ThemeGraphSize = /*#__PURE__*/function () {
- function ThemeGraphSize(options) {
- ThemeGraphSize_classCallCheck(this, ThemeGraphSize);
- /**
- * @member {number} [SuperMap.ThemeGraphSize.prototype.maxGraphSize=0]
- * @description 获取或设置统计图中显示的最大图表尺寸基准值,单位为像素。
- */
- this.maxGraphSize = 0;
- /**
- * @member {number} [SuperMap.ThemeGraphSize.prototype.minGraphSize=0]
- * @description 获取或设置统计图中显示的最小图表尺寸基准值,单位为像素。
- */
- this.minGraphSize = 0;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ThemeGraphSize";
- }
- /**
- * @function SuperMap.ThemeGraphSize.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThemeGraphSize_createClass(ThemeGraphSize, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.maxGraphSize = null;
- me.minGraphSize = null;
- }
- /**
- * @function SuperMap.ThemeGraphSize.fromObj
- * @description 从传入对象获统计专题图符号尺寸类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeGraphSize} ThemeGraphSize 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- var res = new ThemeGraphSize();
- Util.copy(res, obj);
- return res;
- }
- }]);
- return ThemeGraphSize;
- }();
- SuperMap.ThemeGraphSize = ThemeGraphSize;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphText.js
- function ThemeGraphText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeGraphText_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphText_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphText_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeGraphText
- * @category iServer Map Theme
- * @classdesc 统计图文字标注风格类。
- * @param {Object} options - 可选参数。
- * @param {boolean} [options.graphTextDisplayed=false] - 是否显示统计图上的文字标注。
- * @param {SuperMap.ThemeGraphTextFormat} [options.graphTextFormat=SuperMap.ThemeGraphTextFormat.CAPTION] - 统计专题图文本显示格式。
- * @param {SuperMap.ServerTextStyle} [options.graphTextStyle] - 统计图上的文字标注风格。
- */
- var ThemeGraphText = /*#__PURE__*/function () {
- function ThemeGraphText(options) {
- ThemeGraphText_classCallCheck(this, ThemeGraphText);
- /**
- * @member {boolean} [SuperMap.ThemeGraphText.prototype.graphTextDisplayed=false]
- * @description 是否显示统计图上的文字标注。
- */
- this.graphTextDisplayed = false;
- /**
- * @member {SuperMap.ThemeGraphTextFormat} [SuperMap.ThemeGraphText.prototype.graphTextFormat=SuperMap.ThemeGraphTextFormat.CAPTION]
- * @description 统计专题图文本显示格式。
- * 文本显示格式包括百分数、真实数值、标题、标题+百分数、标题+真实数值。
- */
- this.graphTextFormat = ThemeGraphTextFormat.CAPTION;
- /**
- * @member {SuperMap.ServerTextStyle} SuperMap.ThemeGraphText.prototype.graphTextStyle
- * @description 统计图上的文字标注风格。
- */
- this.graphTextStyle = new ServerTextStyle();
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ThemeGraphText";
- }
- /**
- * @function SuperMap.ThemeGraphText.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThemeGraphText_createClass(ThemeGraphText, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.graphTextDisplayed = null;
- me.graphTextFormat = null;
- if (me.graphTextStyle) {
- me.graphTextStyle.destroy();
- me.graphTextStyle = null;
- }
- }
- /**
- * @function SuperMap.ThemeGraphText.fromObj
- * @description 从传入对象获取统计图文字标注风格类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeGraphText} ThemeGraphText 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- var res = new ThemeGraphText();
- Util.copy(res, obj);
- res.graphTextStyle = ServerTextStyle.fromObj(obj.graphTextStyle);
- return res;
- }
- }]);
- return ThemeGraphText;
- }();
- SuperMap.ThemeGraphText = ThemeGraphText;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphItem.js
- function ThemeGraphItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeGraphItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphItem_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeGraphItem
- * @category iServer Map Theme
- * @classdesc 统计专题图子项类。
- * @param {Object} options - 参数。
- * @param {string} [options.caption] - 专题图子项的名称。
- * @param {string} options.graphExpression - 统计专题图的专题变量。
- * @param {Array.<number>} [options.memoryDoubleValues] - 内存数组方式制作专题图时的值数组。
- * @param {SuperMap.ServerStyle} [options.uniformStyle] - 统计专题图子项的显示风格
- */
- var ThemeGraphItem = /*#__PURE__*/function () {
- function ThemeGraphItem(options) {
- ThemeGraphItem_classCallCheck(this, ThemeGraphItem);
- /**
- * @member {string} [SuperMap.ThemeGraphItem.prototype.caption]
- * @description 专题图子项的名称。
- */
- this.caption = null;
- /**
- * @member {string} SuperMap.ThemeGraphItem.prototype.graphExpression
- * @description 统计专题图的专题变量。专题变量可以是一个字段或字段表达式。字段必须为数值型;表达式只能为数值型的字段间的运算。
- */
- this.graphExpression = null;
- /**
- * @member {Array.<number>} [SuperMap.ThemeGraphItem.prototype.memoryDoubleValues]
- * @description 内存数组方式制作专题图时的值数组。<br>
- * 内存数组方式制作专题图时,只对 SmID 值在键数组({@link SuperMap.ThemeGraph.memoryKeys})中的记录制作专题图。
- * 值数组的数值个数必须与键数组中数值的个数一致。 值数组中的值将代替原来的专题值来制作统计专题图。
- * 比如:利用面积字段和周长字段(即有两个统计专题图子项 )作为专题变量制作统计专题图。
- */
- this.memoryDoubleValues = null;
- /**
- * @member {SuperMap.ServerStyle} [SuperMap.ThemeGraphItem.prototype.uniformStyle]
- * @description 统计专题图子项的显示风格。
- * 每一个统计专题图子项都对应一种显示风格。
- */
- this.uniformStyle = new ServerStyle();
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ThemeGraphItem";
- }
- /**
- * @function SuperMap.ThemeGraphItem.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThemeGraphItem_createClass(ThemeGraphItem, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.caption = null;
- me.graphExpression = null;
- me.memoryDoubleValues = null;
- me.uniformStyle = null;
- }
- /**
- * @function SuperMap.ThemeGraphItem.fromObj
- * @description 从传入对象获取统计专题图子项类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeGraphItem} ThemeGraphItem 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- if (!obj) {
- return;
- }
- var res = new ThemeGraphItem();
- Util.copy(res, obj);
- res.uniformStyle = ServerStyle.fromJson(obj.uniformStyle);
- return res;
- }
- }]);
- return ThemeGraphItem;
- }();
- SuperMap.ThemeGraphItem = ThemeGraphItem;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraph.js
- 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); }
- function ThemeGraph_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeGraph_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraph_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraph_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function ThemeGraph_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGraph_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function ThemeGraph_setPrototypeOf(o, p) { ThemeGraph_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGraph_setPrototypeOf(o, p); }
- 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); }; }
- function ThemeGraph_possibleConstructorReturn(self, call) { if (call && (ThemeGraph_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeGraph_assertThisInitialized(self); }
- function ThemeGraph_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function ThemeGraph_getPrototypeOf(o) { ThemeGraph_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGraph_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeGraph
- * @category iServer Map Theme
- * @classdesc 统计专题图类。
- * @extends {SuperMap.Theme}
- * @param {Object} options - 参数。
- * @param {Array.<SuperMap.ThemeGraphItem>} options.items - 统计专题图子项集合。
- * @param {number} [options.barWidth=0] - 柱状专题图中每一个柱的宽度。
- * @param {SuperMap.ThemeFlow} [options.flow] - 统计专题图流动显示与牵引线设置。
- * @param {SuperMap.GraduatedMode} [options.graduatedMode=SuperMap.GraduatedMode.CONSTANT] - 统计图中地理要素的值与图表尺寸间的映射关系。
- * @param {SuperMap.ThemeGraphAxes} [options.graphAxes] - 统计图中坐标轴样式相关信息。
- * @param {SuperMap.ThemeGraphSize} [options.graphSize=0] - 统计符号的最大最小尺寸。
- * @param {boolean} [options.graphSizeFixed=false] - 缩放地图时统计图符号是否固定大小。
- * @param {SuperMap.ThemeGraphText} [options.graphText] - 统计图上的文字是否可以见以及文字标注风格。
- * @param {SuperMap.GraphAxesTextDisplayMode} [options.graphAxesTextDisplayMode=SuperMap.GraphAxesTextDisplayMode.NONE] - 统计专题图坐标轴文本显示模式。
- * @param {SuperMap.ThemeGraphType} [options.graphType=SuperMap.ThemeGraphType.AREA] - 统计专题图类型。
- * @param {Array.<number>} [options.memoryKeys] - 以内存数组方式制作专题图时的键数组。
- * @param {boolean} [options.negativeDisplayed=false] - 专题图中是否显示属性为负值的数据。
- * @param {SuperMap.ThemeOffset} [options.offset] - 统计图相对于要素内点的偏移量。
- * @param {boolean} [options.overlapAvoided=true] - 统计图是否采用避让方式显示。
- * @param {number} [options.roseAngle=0] - 统计图中玫瑰图或三维玫瑰图用于等分的角度。
- * @param {number} [options.startAngle=0] - 饼状统计图扇形的起始角度。
- */
- var ThemeGraph = /*#__PURE__*/function (_Theme) {
- ThemeGraph_inherits(ThemeGraph, _Theme);
- var _super = ThemeGraph_createSuper(ThemeGraph);
- function ThemeGraph(options) {
- var _this;
- ThemeGraph_classCallCheck(this, ThemeGraph);
- _this = _super.call(this, "GRAPH", options);
- /**
- * @member {number} [SuperMap.ThemeGraph.prototype.barWidth=0]
- * @description 柱状专题图中每一个柱的宽度。使用地图坐标单位。
- * 只有选择的统计图类型为柱状图(柱状图、三维柱状图、堆叠柱状图、三维堆叠柱状图)时,此项才可设置。
- */
- _this.barWidth = 0;
- /**
- * @member {SuperMap.ThemeFlow} SuperMap.ThemeGraph.prototype.flow
- * @description 统计专题图流动显示与牵引线设置。
- * 通过该字段可以设置统计符号是否流动显示和牵引线风格。
- */
- _this.flow = new ThemeFlow();
- /**
- * @member {SuperMap.GraduatedMode} [SuperMap.ThemeGraph.prototype.graduatedMode=SuperMap.GraduatedMode.CONSTANT]
- * @description 统计图中地理要素的值与图表尺寸间的映射关系(常数、对数、平方根),即分级方式。
- * 分级主要是为了减少制作统计专题图中数据大小之间的差异,使得统计图的视觉效果比较好,同时不同类别之间的比较也还是有意义的。
- * 提供三种分级模式:常数、对数和平方根,对于有值为负数的字段,不可以采用对数和平方根的分级方式。不同的等级方式用于确定符号大小的数值是不相同的。
- */
- _this.graduatedMode = GraduatedMode.CONSTANT;
- /**
- * @member {SuperMap.ThemeGraphAxes} SuperMap.ThemeGraph.prototype.graphAxes
- * @description 用于设置统计图中坐标轴样式相关信息,如坐标轴颜色、是否显示、坐标文本样式等。
- */
- _this.graphAxes = new ThemeGraphAxes();
- /**
- * @member {SuperMap.ThemeGraphSize} [SuperMap.ThemeGraph.prototype.graphSize=0]
- * @description 用于设置统计符号的最大最小尺寸。
- */
- _this.graphSize = new ThemeGraphSize();
- /**
- * @member {boolean} [SuperMap.ThemeGraph.prototype.graphSizeFixed=false]
- * @description 缩放地图时统计图符号是否固定大小。即统计图符号将随地图缩放。
- */
- _this.graphSizeFixed = false;
- /**
- * @member {SuperMap.ThemeGraphText} SuperMap.ThemeGraph.prototype.graphText
- * @description 统计图上的文字是否可以见以及文字标注风格。
- */
- _this.graphText = new ThemeGraphText();
- /**
- * @member {SuperMap.ThemeGraphType} [SuperMap.ThemeGraph.prototype.graphType=SuperMap.ThemeGraphType.AREA]
- * @description 统计专题图类型。SuperMap 提供了多种类型的统计图,
- * 分别为面积图、阶梯图、折线图、点状图、柱状图、三维柱状图、饼图、三维饼图、玫瑰图、三维玫瑰图、堆叠柱状图、三维堆叠柱状图、环状图。默认为面积图。
- */
- _this.graphType = ThemeGraphType.AREA;
- /**
- * @member {SuperMap.GraphAxesTextDisplayMode} [SuperMap.ThemeGraph.prototype.graphAxesTextDisplayMode=SuperMap.GraphAxesTextDisplayMode.NONE]
- * @description 统计专题图坐标轴文本显示模式。
- */
- _this.graphAxesTextDisplayMode = GraphAxesTextDisplayMode.NONE;
- /**
- * @member {Array.<SuperMap.ThemeGraphItem>} SuperMap.ThemeGraph.prototype.items
- * @description 统计专题图子项集合。
- * 统计专题图可以基于多个变量,反映多种属性,即可以将多个专题变量的值绘制在一个统计图上。每一个专题变量对应的统计图即为一个专题图子项。
- * 对于每个专题图子项可以为其设置标题、风格,甚至可以将该子项再制作成范围分段专题图。
- */
- _this.items = null;
- /**
- * @member {Array.<number>} SuperMap.ThemeGraph.prototype.memoryKeys
- * @description 以内存数组方式制作专题图时的键数组。
- * 键数组内的数值代表 SmID 值,它与 SuperMap.ThemeGraphItem 类中的值数组(SuperMap.ThemeGraphItem.memoryDoubleValues)要关联起来应用。
- * 键数组中数值的个数必须要与值数组的数值个数一致。值数组中的值将代替原来的专题值来制作统计专题图。
- * 目前所有的专题图都支持以内存数组的方式制作专题图,但统计专题图与其他专题图指定内存数组的方式不同,
- * 统计专题图使用 memoryKeys 指定内存数组,而其他专题图则使用 memoryData 来指定内存数组。
- * @example
- * memoryKeys 的使用方法如下:
- * function addThemeGraph() {
- * removeTheme();
- * //创建统计专题图对象,SuperMap.ThemeGraph 必设 items。
- * //专题图参数 ThemeParameters 必设 theme(即以设置好的分段专题图对象)、dataSourceName 和 datasetName
- * var style1 = new SuperMap.ServerStyle({
- * fillForeColor: new SuperMap.ServerColor(92,73,234),
- * lineWidth: 0.1
- * }),
- * style2 = new SuperMap.ServerStyle({
- * fillForeColor: new SuperMap.ServerColor(211,111,240),
- * lineWidth: 0.1
- * }),
- * item1 = new SuperMap.ThemeGraphItem({
- * memoryDoubleValues:[1.18,0.95,0.37,1.31,0.8,1.5],
- * caption: "1992-1995人口增长率",
- * graphExpression: "Pop_Rate95",
- * uniformStyle: style1
- * }),
- * item2 = new SuperMap.ThemeGraphItem({
- * //以内存数组方式制作专题图时的值数组
- * memoryDoubleValues:[2.71,0,0.74,3.1,2.2,3.5],
- * caption: "1995-1999人口增长率", //专题图子项的名称
- * graphExpression: "Pop_Rate99", //统计专题图的专题变量
- * uniformStyle: style2 //统计专题图子项的显示风格
- * }),
- * themeGraph = new SuperMap.ThemeGraph({
- * //以内存数组方式制作专题图时的键数组,键数组内的数值代表 SmID 值
- * memoryKeys:[1,2,4,8,10,12],
- * items: new Array(item1,item2),
- * barWidth: 0.03,
- * //统计图中地理要素的值与图表尺寸间的映射关系为平方根
- * graduatedMode: SuperMap.GraduatedMode.SQUAREROOT,
- * //graphAxes用于设置统计图中坐标轴样式相关信息
- * graphAxes: new SuperMap.ThemeGraphAxes({
- * axesDisplayed: true
- * }),
- * graphSize: new SuperMap.ThemeGraphSize({
- * maxGraphSize: 1,
- * minGraphSize: 0.35
- * }),
- * //统计图上的文字是否可以见以及文字标注风格
- * graphText: new SuperMap.ThemeGraphText({
- * graphTextDisplayed: true,
- * graphTextFormat: SuperMap.ThemeGraphTextFormat.VALUE,
- * graphTextStyle: new SuperMap.ServerTextStyle({
- * sizeFixed: true,
- * fontHeight: 9,
- * fontWidth: 5
- * })
- * }),
- * //统计专题图类型为三维柱状图
- * graphType: SuperMap.ThemeGraphType.BAR3D
- * }),
- * //专题图参数对象
- * themeParameters = new SuperMap.ThemeParameters({
- * themes: [themeGraph],
- * dataSourceNames: ["Jingjin"],
- * datasetNames: ["BaseMap_R"]
- * }),
- * //与服务端交互
- * themeService=new SuperMap.ThemeService(url, {
- * eventListeners: {
- * "processCompleted": ThemeCompleted,
- * "processFailed": themeFailed
- * }
- * });
- * themeService.processAsync(themeParameters);
- * }
- */
- _this.memoryKeys = null;
- /**
- * @member {boolean} [SuperMap.ThemeGraph.prototype.negativeDisplayed=false]
- * @description 专题图中是否显示属性为负值的数据。true 表示显示;falese 不显示。
- */
- _this.negativeDisplayed = false;
- /**
- * @member {SuperMap.ThemeOffset} SuperMap.ThemeGraph.prototype.offset
- * @description 用于设置统计图相对于要素内点的偏移量。
- */
- _this.offset = new ThemeOffset();
- /**
- * @member {boolean} SuperMap.ThemeGraph.prototype.overlapAvoided
- * @description 统计图是否采用避让方式显示。<br>
- * 1.对数据集制作统计专题图:当统计图采用避让方式显示时,如果 overlapAvoided 为 true,则在统计图重叠度很大的情况下,
- * 会出现无法完全避免统计图重叠的现象;如果 overlapAvoided 为 false,会过滤掉一些统计图,从而保证所有的统计图均不重叠。<br>
- * 2.对数据集同时制作统计专题图和标签专题图:当统计图不显示子项文本时,标签专题图的标签即使和统计图重叠,两者也都可正常显示;
- * 当统计图显示子项文本时,如果统计图中的子项文本和标签专题图中的标签不重叠,则两者均正常显示;如果重叠,则会过滤掉统计图的子项文本,只显示标签。
- */
- _this.overlapAvoided = true;
- /**
- * @member {number} [SuperMap.ThemeGraph.prototype.roseAngle=0]
- * @description 统计图中玫瑰图或三维玫瑰图用于等分的角度,默认为 0 度,精确到 0.1 度。在角度为0或者大于 360 度的情况下均使用 360 度来等分制作统计图的字段数。
- */
- _this.roseAngle = 0;
- /**
- * @member {number} [SuperMap.ThemeGraph.prototype.startAngle=0]
- * @description 饼状统计图扇形的起始角度。精确到 0.1 度,以水平方向为正向。只有选择的统计图类型为饼状图(饼图、三维饼图、玫瑰图、三维玫瑰图)时,此项才可设置。
- */
- _this.startAngle = 0;
- if (options) {
- Util.extend(ThemeGraph_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.ThemeGraph";
- return _this;
- }
- /**
- * @function SuperMap.ThemeGraph.prototype.destroy
- * @override
- */
- ThemeGraph_createClass(ThemeGraph, [{
- key: "destroy",
- value: function destroy() {
- ThemeGraph_get(ThemeGraph_getPrototypeOf(ThemeGraph.prototype), "destroy", this).call(this);
- var me = this;
- me.barWidth = null;
- if (me.flow) {
- me.flow.destroy();
- me.flow = null;
- }
- me.graduatedMode = null;
- if (me.graphAxes) {
- me.graphAxes.destroy();
- me.graphAxes = null;
- }
- if (me.graphSize) {
- me.graphSize.destroy();
- me.graphSize = null;
- }
- me.graphSizeFixed = null;
- if (me.graphText) {
- me.graphText.destroy();
- me.graphText = null;
- }
- me.graphType = null;
- if (me.items) {
- for (var i = 0, items = me.items, len = items.length; i < len; i++) {
- items[i].destroy();
- }
- me.items = null;
- }
- me.memoryKeys = null;
- me.negativeDisplayed = null;
- if (me.offset) {
- me.offset.destroy();
- me.offset = null;
- }
- me.overlapAvoided = null;
- me.roseAngle = null;
- me.startAngle = null;
- me.graphAxesTextDisplayMode = null;
- }
- /**
- * @function SuperMap.ThemeGraph.prototype.toJSON
- * @description 将 SuperMap.ThemeGraph 对象转化为 JSON 字符串。
- * @returns {string} 返回转换后的 JSON 字符串。
- */
- }, {
- key: "toJSON",
- value: function toJSON() {
- return Util.toJSON(this.toServerJSONObject());
- }
- /**
- * @function SuperMap.ThemeGraph.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- * @returns {Object} 对应的 JSON 格式对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- var obj = {};
- obj.type = this.type;
- if (this.graphText) {
- obj.graphTextDisplayed = this.graphText.graphTextDisplayed;
- obj.graphTextFormat = this.graphText.graphTextFormat;
- obj.graphTextStyle = this.graphText.graphTextStyle;
- }
- if (this.flow) {
- obj.flowEnabled = this.flow.flowEnabled;
- obj.leaderLineDisplayed = this.flow.leaderLineDisplayed;
- obj.leaderLineStyle = this.flow.leaderLineStyle;
- }
- if (this.graphAxes) {
- obj.axesColor = this.graphAxes.axesColor;
- obj.axesDisplayed = this.graphAxes.axesDisplayed;
- obj.axesGridDisplayed = this.graphAxes.axesGridDisplayed;
- obj.axesTextDisplayed = this.graphAxes.axesTextDisplayed;
- obj.axesTextStyle = this.graphAxes.axesTextStyle;
- }
- if (this.graphSize) {
- obj.maxGraphSize = this.graphSize.maxGraphSize;
- obj.minGraphSize = this.graphSize.minGraphSize;
- }
- if (this.offset) {
- obj.offsetFixed = this.offset.offsetFixed;
- obj.offsetX = this.offset.offsetX;
- obj.offsetY = this.offset.offsetY;
- }
- obj.barWidth = this.barWidth;
- obj.graduatedMode = this.graduatedMode;
- obj.graphSizeFixed = this.graphSizeFixed;
- obj.graphType = this.graphType;
- obj.graphAxesTextDisplayMode = this.graphAxesTextDisplayMode;
- obj.items = this.items;
- obj.memoryKeys = this.memoryKeys;
- obj.negativeDisplayed = this.negativeDisplayed;
- obj.overlapAvoided = this.overlapAvoided;
- obj.roseAngle = this.roseAngle;
- obj.startAngle = this.startAngle;
- return obj;
- }
- /**
- * @function SuperMap.ThemeGraph.fromObj
- * @description 从传入对象获取统计专题图类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeGraph} ThemeGraph 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- var res = new ThemeGraph();
- var itemsG = obj.items;
- var len = itemsG ? itemsG.length : 0;
- Util.copy(res, obj);
- res.items = [];
- res.flow = ThemeFlow.fromObj(obj);
- res.graphAxes = ThemeGraphAxes.fromObj(obj);
- res.graphSize = ThemeGraphSize.fromObj(obj);
- res.graphText = ThemeGraphText.fromObj(obj);
- res.offset = ThemeOffset.fromObj(obj);
- for (var i = 0; i < len; i++) {
- res.items.push(ThemeGraphItem.fromObj(itemsG[i]));
- }
- return res;
- }
- }]);
- return ThemeGraph;
- }(Theme);
- SuperMap.ThemeGraph = ThemeGraph;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeDotDensity.js
- 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); }
- function ThemeDotDensity_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeDotDensity_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeDotDensity_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeDotDensity_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function ThemeDotDensity_setPrototypeOf(o, p) { ThemeDotDensity_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeDotDensity_setPrototypeOf(o, p); }
- 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); }; }
- function ThemeDotDensity_possibleConstructorReturn(self, call) { if (call && (ThemeDotDensity_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeDotDensity_assertThisInitialized(self); }
- function ThemeDotDensity_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function ThemeDotDensity_getPrototypeOf(o) { ThemeDotDensity_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeDotDensity_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeDotDensity
- * @category iServer Map Theme
- * @classdesc 点密度专题图。
- * @description 点密度专题图用一定大小、形状相同的点表示现象分布范围、数量特征和分布密度。点的多少和所代表的意义由地图的内容确定。
- * 点密度专题图利用图层的某一数值属性信息(专题值)映射为不同等级,每一级别使用不同数量或表现为密度的点符号来表示。
- * 该专题值在各个分区内的分布情况,体现不同区域的相对数量差异。多用于具有数量特征的地图上,
- * 比如表示不同地区的粮食产量、GDP、人口等的分级,主要针对区域或面状的要素,因而,点密度专题图适用于面数据集。
- * 注意:点密度专题图中点的分布是随机的,并不代表实际的分布位置。即使在相关设置完全相同的情况下,
- * 每次制作出的专题图,点的数量相同,但点的位置都有差异。
- * @extends {SuperMap.Theme}
- * @param {Object} options - 参数。
- * @param {string} options.dotExpression - 创建点密度专题图的字段或字段表达式。
- * @param {SuperMap.ServerStyle} [options.style] - 点密度专题图中点的风格。
- * @param {number} [options.value] - 专题图中每一个点所代表的数值。
- * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
- */
- var ThemeDotDensity = /*#__PURE__*/function (_Theme) {
- ThemeDotDensity_inherits(ThemeDotDensity, _Theme);
- var _super = ThemeDotDensity_createSuper(ThemeDotDensity);
- function ThemeDotDensity(options) {
- var _this;
- ThemeDotDensity_classCallCheck(this, ThemeDotDensity);
- _this = _super.call(this, "DOTDENSITY", options);
- /**
- * @member {string} SuperMap.ThemeDotDensity.prototype.dotExpression
- * @description 创建点密度专题图的字段或字段表达式。点的数目或密集程度的来源。
- */
- _this.dotExpression = null;
- /**
- * @member {SuperMap.ServerStyle} SuperMap.ThemeDotDensity.prototype.style
- * @description 点密度专题图中点的风格。
- */
- _this.style = new ServerStyle();
- /**
- * @member {number} SuperMap.ThemeDotDensity.prototype.value
- * @description 专题图中每一个点所代表的数值。<br>
- * 点值的确定与地图比例尺以及点的大小有关。地图比例尺越大,相应的图面范围也越大,
- * 点相应就可以越多,此时点值就可以设置相对小一些。点形状越大,
- * 点值相应就应该设置的小一些。点值过大或过小都是不合适的。
- */
- _this.value = null;
- if (options) {
- Util.extend(ThemeDotDensity_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.ThemeDotDensity";
- return _this;
- }
- /**
- * @function SuperMap.ThemeDotDensity.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThemeDotDensity_createClass(ThemeDotDensity, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.dotExpression = null;
- me.value = null;
- if (me.style) {
- me.style.destroy();
- me.style = null;
- }
- }
- /**
- * @function SuperMap.ThemeDotDensity.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- * @returns {Object} 对应的 JSON 格式对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- var obj = {};
- obj = Util.copyAttributes(obj, this);
- if (obj.style) {
- if (obj.style.toServerJSONObject) {
- obj.style = obj.style.toServerJSONObject();
- }
- }
- return obj;
- }
- /**
- * @function SuperMap.ThemeDotDensity.fromObj
- * @description 从传入对象获取点密度专题图中点的风格。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeDotDensity} ThemeDotDensity 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- if (!obj) {
- return;
- }
- var res = new ThemeDotDensity();
- Util.copy(res, obj);
- res.style = ServerStyle.fromJson(obj.style);
- return res;
- }
- }]);
- return ThemeDotDensity;
- }(Theme);
- SuperMap.ThemeDotDensity = ThemeDotDensity;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraduatedSymbolStyle.js
- function ThemeGraduatedSymbolStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeGraduatedSymbolStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraduatedSymbolStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraduatedSymbolStyle_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeGraduatedSymbolStyle
- * @category iServer Map Theme
- * @classdesc 等级符号专题图正负零值显示风格类。
- * @param {Object} options - 参数。
- * @param {boolean} [options.negativeDisplayed=false] - 是否显示负值。
- * @param {SuperMap.ServerStyle} [options.negativeStyle] - 负值的等级符号风格。
- * @param {SuperMap.ServerStyle} [options.positiveStyle] - 正值的等级符号风格。
- * @param {boolean} [options.zeroDisplayed=false] - 是否显示 0 值。
- * @param {SuperMap.ServerStyle} [options.zeroStyle] - 0 值的等级符号风格。
- */
- var ThemeGraduatedSymbolStyle = /*#__PURE__*/function () {
- function ThemeGraduatedSymbolStyle(options) {
- ThemeGraduatedSymbolStyle_classCallCheck(this, ThemeGraduatedSymbolStyle);
- /**
- * @member {boolean} [SuperMap.ThemeGraduatedSymbolStyle.prototype.negativeDisplayed=false]
- * @description 是否显示负值。
- */
- this.negativeDisplayed = false;
- /**
- * @member {SuperMap.ServerStyle} [SuperMap.ThemeGraduatedSymbolStyle.prototype.negativeStyle]
- * @description 负值的等级符号风格。
- */
- this.negativeStyle = new ServerStyle();
- /**
- * @member {SuperMap.ServerStyle} [SuperMap.ThemeGraduatedSymbolStyle.prototype.positiveStyle]
- * @description 正值的等级符号风格。
- */
- this.positiveStyle = new ServerStyle();
- /**
- * @member {boolean} [SuperMap.ThemeGraduatedSymbolStyle.prototype.zeroDisplayed=false]
- * @description 是否显示 0 值。
- */
- this.zeroDisplayed = false;
- /**
- * @member {SuperMap.ServerStyle} SuperMap.ThemeGraduatedSymbolStyle.prototype.zeroStyle
- * @description 0 值的等级符号风格。
- */
- this.zeroStyle = new ServerStyle();
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ThemeGraduatedSymbolStyle";
- }
- /**
- * @function SuperMap.ThemeGraduatedSymbolStyle.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThemeGraduatedSymbolStyle_createClass(ThemeGraduatedSymbolStyle, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.negativeDisplayed = null;
- me.negativeStyle = null;
- me.positiveStyle = null;
- me.zeroDisplayed = null;
- me.zeroStyle = null;
- }
- /**
- * @function SuperMap.ThemeGraduatedSymbolStyle.fromObj
- * @description 从传入对象获取等级符号专题图正负零值显示风格类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeGraduatedSymbolStyle} ThemeGraduatedSymbolStyle 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- if (!obj) {
- return;
- }
- var res = new ThemeGraduatedSymbolStyle();
- Util.copy(res, obj);
- res.negativeStyle = ServerStyle.fromJson(obj.negativeStyle);
- res.positiveStyle = ServerStyle.fromJson(obj.positiveStyle);
- res.zeroStyle = ServerStyle.fromJson(obj.zeroStyle);
- return res;
- }
- }]);
- return ThemeGraduatedSymbolStyle;
- }();
- SuperMap.ThemeGraduatedSymbolStyle = ThemeGraduatedSymbolStyle;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraduatedSymbol.js
- 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); }
- function ThemeGraduatedSymbol_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeGraduatedSymbol_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraduatedSymbol_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraduatedSymbol_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function ThemeGraduatedSymbol_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGraduatedSymbol_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function ThemeGraduatedSymbol_setPrototypeOf(o, p) { ThemeGraduatedSymbol_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGraduatedSymbol_setPrototypeOf(o, p); }
- 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); }; }
- function ThemeGraduatedSymbol_possibleConstructorReturn(self, call) { if (call && (ThemeGraduatedSymbol_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeGraduatedSymbol_assertThisInitialized(self); }
- function ThemeGraduatedSymbol_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function ThemeGraduatedSymbol_getPrototypeOf(o) { ThemeGraduatedSymbol_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGraduatedSymbol_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeGraduatedSymbol
- * @category iServer Map Theme
- * @classdesc 等级符号专题图。
- * @extends {SuperMap.Theme}
- * @param {Object} options - 参数。
- * @param {SuperMap.ThemeGraduatedSymbolStyle} options.style - 用于设置等级符号图正负和零值显示风格。
- * @param {string} options.expression - 等级符号专题图的字段或字段表达式。
- * @param {number} [options.baseValue=0] - 等级符号专题图的基准值,单位同专题变量的单位。
- * @param {SuperMap.ThemeFlow} [options.flow] - 等级符号专题图符号流动显示与牵引线设置类。
- * @param {SuperMap.GraduatedMode} [options.graduatedMode=SuperMap.GraduatedMode.CONSTANT] - 等级符号专题图分级模式。
- * @param {SuperMap.ThemeOffset} [options.offset] - 用于设置标签专题图中标记文本相对于要素内点的偏移量对象。
- * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
- */
- var ThemeGraduatedSymbol = /*#__PURE__*/function (_Theme) {
- ThemeGraduatedSymbol_inherits(ThemeGraduatedSymbol, _Theme);
- var _super = ThemeGraduatedSymbol_createSuper(ThemeGraduatedSymbol);
- function ThemeGraduatedSymbol(options) {
- var _this;
- ThemeGraduatedSymbol_classCallCheck(this, ThemeGraduatedSymbol);
- _this = _super.call(this, "GRADUATEDSYMBOL", options);
- /**
- * @member {number} [SuperMap.ThemeGraduatedSymbol.prototype.baseValue=0]
- * @description 等级符号专题图的基准值,单位同专题变量的单位。<br>
- * 依据此值系统会自动根据分级方式计算其余值对应的符号大小,每个符号的显示大小等于
- * ThemeValueSection.positiveStyle(或 zeroStyle,negativeStyle).markerSize * value / basevalue,
- * 其中 value 是 expression 所指定字段对应的值经过分级计算之后的值。默认值为0,建议通过多次尝试设置该值才能达到较好的显示效果。
- */
- _this.baseValue = 0;
- /**
- * @member {string} SuperMap.ThemeGraduatedSymbol.prototype.expression
- * @description 用于创建等级符号专题图的字段或字段表达式,字段或字段表达式应为数值型。
- */
- _this.expression = null;
- /**
- * @member {SuperMap.ThemeFlow} SuperMap.ThemeGraduatedSymbol.prototype.flow
- * @description 等级符号专题图符号流动显示与牵引线设置类。<br>
- * 通过该字段可以设置等级符号是否流动显示和牵引线风格。
- */
- _this.flow = new ThemeFlow();
- /**
- * @member {SuperMap.GraduatedMode} [SuperMap.ThemeGraduatedSymbol.prototype.graduatedMode=SuperMap.GraduatedMode.CONSTANT]
- * @description 等级符号专题图分级模式。<br>
- * 分级主要是为了减少制作等级符号专题图中数据大小之间的差异。如果数据之间差距较大,则可以采用对数或者平方根的分级方式来进行,
- * 这样就减少了数据之间的绝对大小的差异,使得等级符号图的视觉效果比较好,同时不同类别之间的比较也是有意义的。
- * 有三种分级模式:常数、对数和平方根,对于有值为负数的字段,在用对数或平方根方式分级时,默认对负数取正。
- * 不同的分级模式用于确定符号大小的数值是不相同的:常数按照字段的原始数据进行;对数则是对每条记录对应的专题变量取自然对数;
- * 平方根则是对其取平方根,然后用最终得到的结果来确定其等级符号的大小。
- */
- _this.graduatedMode = SuperMap.GraduatedMode.CONSTAN;
- /**
- * @member {SuperMap.ThemeOffset} [SuperMap.ThemeGraduatedSymbol.prototype.offset]
- * @description 用于设置等级符号图相对于要素内点的偏移量。
- */
- _this.offset = new ThemeOffset();
- /**
- * @member {SuperMap.ThemeGraduatedSymbolStyle} SuperMap.ThemeGraduatedSymbol.prototype.style
- * @description 用于设置等级符号图正负和零值显示风格。
- */
- _this.style = new ThemeGraduatedSymbolStyle();
- if (options) {
- Util.extend(ThemeGraduatedSymbol_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.ThemeGraduatedSymbol";
- return _this;
- }
- /**
- * @function SuperMap.ThemeGraduatedSymbol.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThemeGraduatedSymbol_createClass(ThemeGraduatedSymbol, [{
- key: "destroy",
- value: function destroy() {
- ThemeGraduatedSymbol_get(ThemeGraduatedSymbol_getPrototypeOf(ThemeGraduatedSymbol.prototype), "destroy", this).call(this);
- var me = this;
- me.expression = null;
- if (me.flow) {
- me.flow.destroy();
- me.flow = null;
- }
- me.graduatedMode = GraduatedMode.CONSTANT;
- if (me.offset) {
- me.offset.destroy();
- me.offset = null;
- }
- if (me.style) {
- me.style.destroy();
- me.style = null;
- }
- }
- /**
- * @function SuperMap.ThemeGraduatedSymbol.prototype.toJSON
- * @description 将 themeLabel 对象转化为 JSON 字符串。
- * @returns {string} 返回转换后的 JSON 字符串。
- */
- }, {
- key: "toJSON",
- value: function toJSON() {
- return Util.toJSON(this.toServerJSONObject());
- }
- /**
- * @function SuperMap.ThemeGraduatedSymbol.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- * @returns {Object} 对应的 JSON 格式对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- var obj = {};
- obj.type = this.type;
- obj.memoryData = this.memoryData;
- obj.baseValue = this.baseValue;
- obj.expression = this.expression;
- obj.graduatedMode = this.graduatedMode;
- if (this.flow) {
- obj.flowEnabled = this.flow.flowEnabled;
- obj.leaderLineDisplayed = this.flow.leaderLineDisplayed;
- obj.leaderLineStyle = this.flow.leaderLineStyle;
- }
- if (this.offset) {
- obj.offsetFixed = this.offset.offsetFixed;
- obj.offsetX = this.offset.offsetX;
- obj.offsetY = this.offset.offsetY;
- }
- if (this.style) {
- obj.negativeStyle = this.style.negativeStyle;
- obj.negativeDisplayed = this.style.negativeDisplayed;
- obj.positiveStyle = this.style.positiveStyle;
- obj.zeroDisplayed = this.style.zeroDisplayed;
- obj.zeroStyle = this.style.zeroStyle;
- }
- return obj;
- }
- /**
- * @function SuperMap.ThemeGraduatedSymbol.fromObj
- * @description 从传入对象获取等级符号专题图。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeGraduatedSymbol} 等级符号专题图对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- if (!obj) {
- return;
- }
- var res = new SuperMap.ThemeGraduatedSymbol();
- Util.copy(res, obj);
- res.flow = ThemeFlow.fromObj(obj);
- res.offset = ThemeOffset.fromObj(obj);
- res.style = ThemeGraduatedSymbolStyle.fromObj(obj);
- return res;
- }
- }]);
- return ThemeGraduatedSymbol;
- }(Theme);
- SuperMap.ThemeGraduatedSymbol = ThemeGraduatedSymbol;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeRangeItem.js
- function ThemeRangeItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeRangeItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeRangeItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeRangeItem_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeRangeItem
- * @category iServer Map Theme
- * @classdesc 范围分段专题图子项类。
- * @description 在分段专题图中,字段值按照某种分段模式被分成多个范围段,每个范围段即为一个子项,同一范围段的要素属于同一个分段专题图子项。
- * 每个子项都有其分段起始值、终止值、名称和风格等。每个分段所表示的范围为[start, end)。
- * @param {Object} options - 参数。
- * @param {string} [options.caption] - 分段专题图子项的标题。
- * @param {number} [options.end=0] - 分段专题图子项的终止值。
- * @param {number} [options.start=0] - 分段专题图子项的起始值。
- * @param {SuperMap.ServerStyle} options.style - 分段专题图子项的风格。
- * @param {boolean} [options.visible=true] - 分段专题图子项是否可见。
- */
- var ThemeRangeItem = /*#__PURE__*/function () {
- function ThemeRangeItem(options) {
- ThemeRangeItem_classCallCheck(this, ThemeRangeItem);
- /**
- * @member {string} [SuperMap.ThemeRangeItem.prototype.caption]
- * @description 分段专题图子项的标题。
- */
- this.caption = null;
- /**
- * @member {number} [SuperMap.ThemeRangeItem.prototype.end=0]
- * @description 分段专题图子项的终止值,即该段专题值范围的最大值。<br>
- * 如果该子项是分段中最后一个子项,则该终止值应大于分段字段(ThemeRange 类的 rangeExpression 属性)的最大值,若该终止值小于分段字段最大值,
- * 则剩余部分由内部随机定义其颜色;如果不是最后一项,该终止值必须与其下一子项的起始值相同,否则系统抛出异常;
- * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按您设置的值对分段结果进行调整。
- */
- this.end = 0;
- /**
- * @member {number} [SuperMap.ThemeRangeItem.prototype.start=0]
- * @description 分段专题图子项的起始值,即该段专题值范围的最小值。<br>
- * 如果该子项是分段中第一个子项,那么该起始值就是分段的最小值;如果子项的序号大于等于 1 的时候,该起始值必须与前一子项的终止值相同,否则系统会抛出异常。
- * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按您设置的值对分段结果进行调整。
- */
- this.start = 0;
- /**
- * @member {SuperMap.ServerStyle} SuperMap.ThemeRangeItem.prototype.style
- * @description 分段专题图子项的风格。
- * 每一个分段专题图子项都对应一种显示风格。
- */
- this.style = new ServerStyle();
- /**
- * @member {boolean} [SuperMap.ThemeRangeItem.prototype.visible=true]
- * @description 分段专题图子项是否可见。
- */
- this.visible = true;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ThemeRangeItem";
- }
- /**
- * @function SuperMap.ThemeRangeItem.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThemeRangeItem_createClass(ThemeRangeItem, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.caption = null;
- me.end = null;
- me.start = null;
- if (me.style) {
- me.style.destroy();
- me.style = null;
- }
- me.visible = null;
- }
- /**
- * @function SuperMap.ThemeRangeItem.prototypetoServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- * @returns {Object} 对应的 JSON 格式对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- var obj = {};
- obj = Util.copyAttributes(obj, this);
- if (obj.style) {
- if (obj.style.toServerJSONObject) {
- obj.style = obj.style.toServerJSONObject();
- }
- }
- return obj;
- }
- /**
- * @function SuperMap.ThemeRangeItem.fromObj
- * @description 从传入对象获取范围分段专题图子项类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeRangeItem} ThemeRangeItem 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- if (!obj) {
- return;
- }
- var res = new ThemeRangeItem();
- Util.copy(res, obj);
- res.style = ServerStyle.fromJson(obj.style);
- return res;
- }
- }]);
- return ThemeRangeItem;
- }();
- SuperMap.ThemeRangeItem = ThemeRangeItem;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeRange.js
- 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); }
- function ThemeRange_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeRange_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeRange_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeRange_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function ThemeRange_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeRange_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function ThemeRange_setPrototypeOf(o, p) { ThemeRange_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeRange_setPrototypeOf(o, p); }
- 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); }; }
- function ThemeRange_possibleConstructorReturn(self, call) { if (call && (ThemeRange_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeRange_assertThisInitialized(self); }
- function ThemeRange_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function ThemeRange_getPrototypeOf(o) { ThemeRange_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeRange_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeRange
- * @category iServer Map Theme
- * @classdesc 范围分段专题图。
- * @description 范围分段专题图是按照指定的分段方法(如:等距离分段法)对字段的属性值进行分段,使用不同的颜色或符号(线型、填充)表示不同范围段落的属性值在整体上的分布情况,体现区域的差异。
- * 在分段专题图中,专题值按照某种分段方式被分成多个范围段,要素根据各自的专题值被分配到其中一个范围段中,在同一个范围段中的要素使用相同的颜色,填充,符号等风格进行显示。
- * 分段专题图所基于的专题变量必须为数值型,分段专题图一般用来反映连续分布现象的数量或程度特征,如降水量的分布,土壤侵蚀强度的分布等。
- * @extends {SuperMap.Theme}
- * @param {Object} options - 参数。
- * @param {Array.<SuperMap.ThemeRangeItem>} options.items - 分段专题图子项数组。
- * @param {string} options.rangeExpression - 分段字段表达式。
- * @param {number} options.rangeParameter - 分段参数。
- * @param {number} options.rangeParameter - 分段参数。
- * @param {SuperMap.RangeMode} [options.rangeMode=SuperMap.RangeMode.EQUALINTERVAL] - 分段专题图的分段模式。
- * @param {SuperMap.ColorGradientType} [options.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
- * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
- */
- var ThemeRange = /*#__PURE__*/function (_Theme) {
- ThemeRange_inherits(ThemeRange, _Theme);
- var _super = ThemeRange_createSuper(ThemeRange);
- function ThemeRange(options) {
- var _this;
- ThemeRange_classCallCheck(this, ThemeRange);
- _this = _super.call(this, "RANGE", options);
- /**
- * @member {string} SuperMap.ThemeRange.prototype.precision
- * @description 精准度
- */
- _this.precision = '1.0E-12';
- /**
- * @member {Array.<SuperMap.ThemeRangeItem>} SuperMap.ThemeRange.prototype.items
- * @description 分段专题图子项数组。<br>
- * 在分段专题图中,字段值按照某种分段模式被分成多个范围段,每个范围段即为一个子项,同一范围段的要素属于同一个分段专题图子项。
- * 每个子项都有其分段起始值、终止值、名称和风格等。每个分段所表示的范围为 [start, end)。
- * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按照您设置的值对分段结果进行调整。
- */
- _this.items = null;
- /**
- * @member {string} SuperMap.ThemeRange.prototype.rangeExpression
- * @description 分段字段表达式。<br>
- * 由于范围分段专题图基于各种分段方法根据一定的距离进行分段,因而范围分段专题图所基于的字段值的数据类型必须为数值型。对于字段表达式,只能为数值型的字段间的运算。
- */
- _this.rangeExpression = null;
- /**
- * @member {SuperMap.RangeMode} [SuperMap.ThemeRange.prototype.rangeMode=SuperMap.RangeMode.EQUALINTERVAL]
- * @description 分段专题图的分段模式。<br>
- * 在分段专题图中,作为专题变量的字段或表达式的值按照某种分段方式被分成多个范围段。
- * 目前 SuperMap 提供的分段方式包括:等距离分段法、平方根分段法、标准差分段法、对数分段法、等计数分段法和自定义距离法,
- * 显然这些分段方法根据一定的距离进行分段,因而范围分段专题图所基于的专题变量必须为数值型。
- */
- _this.rangeMode = RangeMode.EQUALINTERVAL;
- /**
- * @member {number} SuperMap.ThemeRange.prototype.rangeParameter
- * @description 分段参数。
- * 当分段模式为等距离分段法,平方根分段,对数分段法,计数分段法其中一种模式时,该参数用于设置分段个数;当分段模式为标准差分段法时,
- * 该参数不起作用;当分段模式为自定义距离时,该参数用于设置自定义距离。
- */
- _this.rangeParameter = 0;
- /**
- * @member {SuperMap.ColorGradientType} [SuperMap.ThemeRange.prototype.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED]
- * @description 渐变颜色枚举类。<br>
- * 渐变色是由起始色根据一定算法逐渐过渡到终止色的一种混合型颜色。
- * 该类作为单值专题图参数类、分段专题图参数类的属性,负责设置单值专题图、分段专题图的配色方案,在默认情况下专题图所有子项会根据这个配色
- * 方案完成填*充。但如果为某几个子项的风格进行单独设置后(设置了 {@link SuperMap.ThemeUniqueItem} 或 {@link SuperMap.ThemeRangeItem} 类中Style属性),
- * 该配色方案对于这几个子项将不起作用。
- */
- _this.colorGradientType = ColorGradientType.YELLOW_RED;
- if (options) {
- Util.extend(ThemeRange_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.ThemeRange";
- return _this;
- }
- /**
- * @function SuperMap.ThemeRange.prototype.destroy
- * @override
- */
- ThemeRange_createClass(ThemeRange, [{
- key: "destroy",
- value: function destroy() {
- ThemeRange_get(ThemeRange_getPrototypeOf(ThemeRange.prototype), "destroy", this).call(this);
- var me = this;
- if (me.items) {
- if (me.items.length > 0) {
- for (var item in me.items) {
- me.items[item].destroy();
- me.items[item] = null;
- }
- }
- me.items = null;
- }
- me.rangeExpression = null;
- me.rangeMode = null;
- me.rangeParameter = null;
- me.colorGradientType = null;
- }
- /**
- * @function SuperMap.ThemeRange.fromObj
- * @description 从传入对象获取范围分段专题图类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeRange} ThemeRange 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- if (!obj) {
- return;
- }
- var res = new ThemeRange();
- Util.copy(res, obj);
- var itemsR = obj.items;
- var len = itemsR ? itemsR.length : 0;
- res.items = [];
- for (var i = 0; i < len; i++) {
- res.items.push(ThemeRangeItem.fromObj(itemsR[i]));
- }
- return res;
- }
- }]);
- return ThemeRange;
- }(Theme);
- SuperMap.ThemeRange = ThemeRange;
- ;// CONCATENATED MODULE: ./src/common/iServer/UGCLayer.js
- function UGCLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function UGCLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UGCLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UGCLayer_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.UGCLayer
- * @category iServer Map Layer
- * @classdesc UGC 图层类。
- * @param {Object} options - 参数。
- * @param {SuperMap.Bounds} options.bounds - 图层范围。
- * @param {string} options.name - 图层的名称。
- * @param {SuperMap.UGCLayerType} options.type - 图层类型
- * @param {string} [options.caption] - 图层的标题。
- * @param {string} [options.description] - 图层的描述信息。
- * @param {boolean} [options.queryable] - 图层中的对象是否可以查询。
- * @param {boolean} [options.subUGCLayers] - 是否允许图层的符号大小随图缩放。
- * @param {boolean} [options.visible=false] - 地图对象在同一范围内时,是否重叠显示。
- */
- var UGCLayer = /*#__PURE__*/function () {
- function UGCLayer(options) {
- UGCLayer_classCallCheck(this, UGCLayer);
- options = options || {};
- /**
- * @member {SuperMap.Bounds} SuperMap.UGCLayer.prototype.bounds
- * @description 图层范围。
- */
- this.bounds = null;
- /**
- * @member {string} [SuperMap.UGCLayer.prototype.caption]
- * @description 图层的标题。默认情况下图层的标题与图层的名称一致。在图例、图层控制列表中显示的图层名称就是该图层的标题值。
- */
- this.caption = null;
- /**
- * @member {string} SuperMap.UGCLayer.prototype.description
- * @description 图层的描述信息。
- */
- this.description = null;
- /**
- * @member {string} SuperMap.UGCLayer.prototype.name
- * @description 图层的名称。图层的名称在图层所在的地图中唯一标识此图层。该属性区分大小写。
- */
- this.name = null;
- /**
- * @member {boolean} SuperMap.UGCLayer.prototype.queryable
- * @description 图层中的对象是否可以查询。
- */
- this.queryable = null;
- /**
- * @member {Array} SuperMap.UGCLayer.prototype.subLayers
- * @description 子图层集。
- */
- this.subLayers = null;
- /**
- * @member {SuperMap.UGCLayerType} SuperMap.UGCLayer.prototype.type
- * @description 图层类型。
- */
- this.type = null;
- /**
- * @member {boolean} SuperMap.UGCLayer.prototype.visible
- * @description 地图对象在同一范围内时,是否重叠显示。
- */
- this.visible = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.UGCLayer";
- }
- /**
- * @function SuperMap.UGCLayer.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- UGCLayer_createClass(UGCLayer, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- Util.reset(me);
- }
- /**
- * @function SuperMap.UGCLayer.prototype.fromJson
- * @description 将服务端 JSON 对象转换成当前客户端对象。
- * @param {Object} jsonObject - 要转换的 JSON 对象。
- */
- }, {
- key: "fromJson",
- value: function fromJson(jsonObject) {
- jsonObject = jsonObject ? jsonObject : {};
- Util.extend(this, jsonObject);
- var b = this.bounds;
- if (b) {
- this.bounds = new Bounds(b.leftBottom.x, b.leftBottom.y, b.rightTop.x, b.rightTop.y);
- }
- }
- /**
- * @function SuperMap.UGCLayer.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- * @returns {Object} 对应的 JSON 格式对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- var jsonObject = {};
- jsonObject = Util.copyAttributes(jsonObject, this);
- if (jsonObject.bounds) {
- if (jsonObject.bounds.toServerJSONObject) {
- jsonObject.bounds = jsonObject.bounds.toServerJSONObject();
- }
- }
- return jsonObject;
- }
- }]);
- return UGCLayer;
- }();
- SuperMap.UGCLayer = UGCLayer;
- ;// CONCATENATED MODULE: ./src/common/iServer/OverlapDisplayedOptions.js
- function OverlapDisplayedOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function OverlapDisplayedOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlapDisplayedOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlapDisplayedOptions_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.OverlapDisplayedOptions
- * @category iServer Map Layer
- * @classdesc 地图压盖过滤显示选项。
- * @description 在文本或专题图元素显示较密集的区域,文本之间或专题元素之间会发生相互压盖的现象,
- * 该类可以分别控制各种类型的对象的压盖显示情况,进而很好地处理地图中各种类型对象的压盖显示问题。
- * @param {Object} options - 参数。
- * @param {boolean} [options.allowPointOverlap=true] - 点和点压盖时是否显示压盖的点对象。
- * @param {boolean} [options.allowPointWithTextDisplay=true] - 标签和相应普通图层上的点是否一起过滤显示,如果过滤显示,
- * 只以图层集合中对应数据集的索引最小的图层的点风格来绘制点。
- * @param {boolean} [options.allowTextOverlap=false] - 文本压盖时是否显示压盖的文本对象。
- * @param {boolean} [options.allowTextAndPointOverlap=true] - 文本和点压盖时是否显示压盖的文本或点对象(此属性不处理文本之间的压盖和点之间的压盖)。
- * @param {boolean} [options.allowThemeGraduatedSymbolOverlap=false] - 等级符号元素压盖时是否显示压盖的等级符号元素。
- * @param {boolean} [options.allowThemeGraphOverlap=false] - 统计专题图元素压盖时是否显示压盖的统计专题图元素。
- * @param {number} [options.horizontalOverlappedSpaceSize=0] - 两个对象之间的横向压盖间距,单位为 0.1 毫米,跟 verticalOverlappedSpaceSize 结合使用,
- * 当两个对象的横向间距小于该值,且纵向间距小于 verticalOverlappedSpaceSize 时认为压盖。
- * @param {number} [options.verticalOverlappedSpaceSize=0] - 两个对象之间的纵向压盖间距,单位为 0.1 毫米,跟 horizontalOverlappedSpaceSize 结合使用,
- * 当两个对象的纵向间距小于该值,且横向间距小于 horizontalOverlappedSpaceSize 时认为压盖。
- */
- var OverlapDisplayedOptions = /*#__PURE__*/function () {
- function OverlapDisplayedOptions(options) {
- OverlapDisplayedOptions_classCallCheck(this, OverlapDisplayedOptions);
- options = options || {};
- /**
- * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowPointOverlap=true]
- * @description 点和点压盖时是否显示压盖的点对象。
- */
- this.allowPointOverlap = true;
- /**
- * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowPointWithTextDisplay=true]
- * @description 标签和相应普通图层上的点是否一起过滤显示,如果过滤显示,
- * 只以图层集合中对应数据集的索引最小的图层的点风格来绘制点。
- */
- this.allowPointWithTextDisplay = true;
- /**
- * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowTextOverlap=false]
- * @description 文本压盖时是否显示压盖的文本对象。
- */
- this.allowTextOverlap = false;
- /**
- * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowTextAndPointOverlap=true]
- * @description 文本和点压盖时是否显示压盖的文本或点对象(此属性不处理文本之间的压盖和点之间的压盖)。
- */
- this.allowTextAndPointOverlap = true;
- /**
- * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowThemeGraduatedSymbolOverlap=false]
- * @description 等级符号元素压盖时是否显示压盖的等级符号元素。
- */
- this.allowThemeGraduatedSymbolOverlap = false;
- /**
- * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowThemeGraphOverlap=false]
- * @description 统计专题图元素压盖时是否显示压盖的统计专题图元素。
- */
- this.allowThemeGraphOverlap = false;
- /**
- * @member {number} [SuperMap.OverlapDisplayedOptions.prototype.horizontalOverlappedSpaceSize=0]
- * @description 两个对象之间的横向压盖间距,单位为0.1毫米,跟 verticalOverlappedSpaceSize 结合使用,
- * 当两个对象的横向间距小于该值,且纵向间距小于 verticalOverlappedSpaceSize 时认为压盖。
- */
- this.horizontalOverlappedSpaceSize = 0;
- /**
- * @member {number} [SuperMap.OverlapDisplayedOptions.prototype.verticalOverlappedSpaceSize=0]
- * @description 两个对象之间的纵向压盖间距,单位为0.1毫米,跟 horizontalOverlappedSpaceSize 结合使用,
- * 当两个对象的纵向间距小于该值,且横向间距小于 horizontalOverlappedSpaceSize 时认为压盖。
- */
- this.verticalOverlappedSpaceSize = 0;
- Util.extend(this, options);
- this.ugcLayer = new UGCLayer(options);
- this.CLASS_NAME = "SuperMap.OverlapDisplayedOptions";
- }
- /**
- * @function SuperMap.OverlapDisplayedOptions.prototype.destroy
- * @description 释放资源,将资源的属性置空。
- */
- OverlapDisplayedOptions_createClass(OverlapDisplayedOptions, [{
- key: "destroy",
- value: function destroy() {
- Util.reset(this);
- }
- /**
- * @function SuperMap.OverlapDisplayedOptions.prototype.fromJson
- * @description 将服务端 JSON 对象转换成当前客户端对象。
- * @param {Object} jsonObject - 要转换的 JSON 对象。
- */
- }, {
- key: "fromJson",
- value: function fromJson(jsonObject) {
- this.ugcLayer.fromJson.apply(this, [jsonObject]);
- }
- /**
- * @function SuperMap.OverlapDisplayedOptions.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- * @returns {Object} 对应的 JSON 格式对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- var jsonObject = this.ugcLayer.toServerJSONObject.apply(this, arguments);
- return jsonObject;
- }
- /**
- * @function SuperMap.OverlapDisplayedOptions.prototype.toString
- * @description 转换成对应的 tileLayer 请求瓦片时 overlapDisplayedOptions 参数。
- * @returns {string} 对应的 tileLayer 请求瓦片时 overlapDisplayedOptions 参数。
- */
- }, {
- key: "toString",
- value: function toString() {
- var jsonObject = this.ugcLayer.toServerJSONObject.apply(this, arguments);
- var str = "{";
- for (var attr in jsonObject) {
- if (jsonObject.hasOwnProperty(attr)) {
- str += "'" + attr + "':" + jsonObject[attr] + ",";
- }
- }
- str = str.substr(0, str.length - 1);
- str += "}";
- return str;
- }
- }]);
- return OverlapDisplayedOptions;
- }();
- SuperMap.OverlapDisplayedOptions = OverlapDisplayedOptions;
- ;// CONCATENATED MODULE: ./src/common/iServer/UGCMapLayer.js
- 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); }
- function UGCMapLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function UGCMapLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UGCMapLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UGCMapLayer_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function UGCMapLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UGCMapLayer_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function UGCMapLayer_setPrototypeOf(o, p) { UGCMapLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UGCMapLayer_setPrototypeOf(o, p); }
- 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); }; }
- function UGCMapLayer_possibleConstructorReturn(self, call) { if (call && (UGCMapLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return UGCMapLayer_assertThisInitialized(self); }
- function UGCMapLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function UGCMapLayer_getPrototypeOf(o) { UGCMapLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UGCMapLayer_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.UGCMapLayer
- * @category iServer Map Layer
- * @classdesc UGC 地图图层类。
- * @extends {SuperMap.UGCLayer}
- * @param {Object} options - 参数。
- * @param {boolean} [options.completeLineSymbolDisplayed] - 是否显示完整线型。
- * @param {number} [options.maxScale] - 地图最大比例尺。
- * @param {number} [options.minScale] - 地图最小比例尺。
- * @param {number} [options.minVisibleGeometrySize] - 几何对象的最小可见大小,以像素为单位。
- * @param {number} [options.opaqueRate] - 图层的不透明度。
- * @param {boolean} [options.symbolScalable] - 是否允许图层的符号大小随图缩放。
- * @param {number} [options.symbolScale] - 图层的符号缩放基准比例尺。
- * @param {boolean} [options.overlapDisplayed=false] - 地图对象在同一范围内时,是否重叠显示。
- * @param {SuperMap.OverlapDisplayedOptions} [options.overlapDisplayedOptions] - 地图的压盖过滤显示选项,当overlapDisplayed 为 false 时有效。
- */
- var UGCMapLayer = /*#__PURE__*/function (_UGCLayer) {
- UGCMapLayer_inherits(UGCMapLayer, _UGCLayer);
- var _super = UGCMapLayer_createSuper(UGCMapLayer);
- function UGCMapLayer(options) {
- var _this;
- UGCMapLayer_classCallCheck(this, UGCMapLayer);
- options = options || {};
- _this = _super.call(this, options);
- /**
- * @member {boolean} SuperMap.UGCMapLayer.prototype.completeLineSymbolDisplayed
- * @description 是否显示完整线型。
- */
- _this.completeLineSymbolDisplayed = null;
- /**
- * @member {number} SuperMap.UGCMapLayer.prototype.maxScale
- * @description 地图最大比例尺。
- */
- _this.maxScale = null;
- /**
- * @member {number} SuperMap.UGCMapLayer.prototype.minScale
- * @description 地图最小比例尺。
- */
- _this.minScale = null;
- /**
- * @member {number} SuperMap.UGCMapLayer.prototype.minVisibleGeometrySize
- * @description 几何对象的最小可见大小,以像素为单位。
- */
- _this.minVisibleGeometrySize = null;
- /**
- * @member {number} SuperMap.UGCMapLayer.prototype.opaqueRate
- * @description 图层的不透明度。
- */
- _this.opaqueRate = null;
- /**
- * @member {boolean} SuperMap.UGCMapLayer.prototype.symbolScalable
- * @description 是否允许图层的符号大小随图缩放。
- */
- _this.symbolScalable = null;
- /**
- * @member {number} SuperMap.UGCMapLayer.prototype.symbolScale
- * @description 图层的符号缩放基准比例尺。
- */
- _this.symbolScale = null;
- /**
- * @member {boolean} [SuperMap.UGCMapLayer.prototype.overlapDisplayed=false]
- * @description 地图对象在同一范围内时,是否重叠显示。
- */
- _this.overlapDisplayed = null;
- /**
- * @member {SuperMap.OverlapDisplayedOptions} SuperMap.UGCMapLayer.prototype.overlapDisplayedOptions
- * @description 地图的压盖过滤显示选项,当 overlapDisplayed 为 false 时有效。
- */
- _this.overlapDisplayedOptions = null;
- _this.CLASS_NAME = "SuperMap.UGCMapLayer";
- return _this;
- }
- /**
- * @function SuperMap.UGCMapLayer.prototype.destroy
- * @override
- */
- UGCMapLayer_createClass(UGCMapLayer, [{
- key: "destroy",
- value: function destroy() {
- UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "destroy", this).call(this);
- Util.reset(this);
- }
- /**
- * @function SuperMap.UGCMapLayer.prototype.fromJson
- * @description 将服务端 JSON 对象转换成当前客户端对象
- * @param {Object} jsonObject - 要转换的 JSON 对象。
- */
- }, {
- key: "fromJson",
- value: function fromJson(jsonObject) {
- UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "fromJson", this).call(this, jsonObject);
- }
- /**
- * @function SuperMap.UGCMapLayer.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- * @returns {Object} 对应的 JSON 格式对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- return UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "toServerJSONObject", this).call(this);
- }
- }]);
- return UGCMapLayer;
- }(UGCLayer);
- SuperMap.UGCMapLayer = UGCMapLayer;
- ;// CONCATENATED MODULE: ./src/common/iServer/UGCSubLayer.js
- 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); }
- function UGCSubLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function UGCSubLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UGCSubLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UGCSubLayer_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function UGCSubLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UGCSubLayer_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function UGCSubLayer_setPrototypeOf(o, p) { UGCSubLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UGCSubLayer_setPrototypeOf(o, p); }
- 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); }; }
- function UGCSubLayer_possibleConstructorReturn(self, call) { if (call && (UGCSubLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return UGCSubLayer_assertThisInitialized(self); }
- function UGCSubLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function UGCSubLayer_getPrototypeOf(o) { UGCSubLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UGCSubLayer_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.UGCSubLayer
- * @category iServer Map Layer
- * @classdesc 地图服务图层属性信息类。影像图层(Image)、专题图层(ServerTheme)、栅格图层(Grid)、矢量图层(Vector)等图层均继承该类。
- * @extends {SuperMap.UGCMapLayer}
- * @param {Object} options - 参数。
- * @param {SuperMap.DatasetInfo} options.datasetInfo - 数据集信息。
- * @param {string} [options.displayFilter] - 图层显示过滤条件。
- * @param {SuperMap.JoinItem} [options.joinItems] - 连接信息类。
- * @param {string} [options.representationField] - 存储制图表达信息的字段。
- * @param {SuperMap.LayerType} [options.ugcLayerType] - 图层类型。
- */
- var UGCSubLayer = /*#__PURE__*/function (_UGCMapLayer) {
- UGCSubLayer_inherits(UGCSubLayer, _UGCMapLayer);
- var _super = UGCSubLayer_createSuper(UGCSubLayer);
- function UGCSubLayer(options) {
- var _this;
- UGCSubLayer_classCallCheck(this, UGCSubLayer);
- options = options || {};
- _this = _super.call(this, options);
- /**
- * @member {SuperMap.DatasetInfo} SuperMap.UGCSubLayer.prototype.datasetInfo
- * @description 数据集信息。
- */
- _this.datasetInfo = null;
- /**
- * @member {string} SuperMap.UGCSubLayer.prototype.displayFilter
- * @description 图层显示过滤条件。
- */
- _this.displayFilter = null;
- /**
- * @member {SuperMap.JoinItem} SuperMap.UGCSubLayer.prototype.joinItems
- * @description 连接信息类。
- */
- _this.joinItems = null;
- /**
- * @member {string} SuperMap.UGCSubLayer.prototype.representationField
- * @description 存储制图表达信息的字段。
- */
- _this.representationField = null;
- /**
- * @member {SuperMap.LayerType} SuperMap.UGCSubLayer.prototype.ugcLayerType
- * @description 图层类型。
- */
- _this.ugcLayerType = null;
- _this.CLASS_NAME = "SuperMap.UGCSubLayer";
- return _this;
- }
- /**
- * @function SuperMap.UGCSubLayer.prototype.fromJson
- * @description 将服务端 JSON 对象转换成当前客户端对象
- * @param {Object} jsonObject - 要转换的 JSON 对象。
- */
- UGCSubLayer_createClass(UGCSubLayer, [{
- key: "fromJson",
- value: function fromJson(jsonObject) {
- UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "fromJson", this).call(this, jsonObject);
- if (this.datasetInfo) {
- this.datasetInfo = new DatasetInfo(this.datasetInfo);
- }
- if (this.joinItems && this.joinItems.length) {
- var newJoinItems = [];
- for (var i = 0; i < this.joinItems.length; i++) {
- newJoinItems[i] = new JoinItem(this.joinItems[i]);
- }
- this.joinItems = newJoinItems;
- }
- }
- /**
- * @function SuperMap.UGCSubLayer.prototype.destroy
- * @override
- */
- }, {
- key: "destroy",
- value: function destroy() {
- UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "destroy", this).call(this);
- Util.reset(this);
- }
- /**
- * @function SuperMap.UGCSubLayer.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- * @returns {Object} 对应的 JSON 格式对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- var jsonObject = UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "toServerJSONObject", this).call(this);
- if (jsonObject.joinItems) {
- var joinItems = [];
- for (var i = 0; i < jsonObject.joinItems.length; i++) {
- if (jsonObject.joinItems[i].toServerJSONObject) {
- joinItems[i] = jsonObject.joinItems[i].toServerJSONObject();
- }
- }
- jsonObject.joinItems = joinItems;
- }
- if (jsonObject.datasetInfo) {
- if (jsonObject.datasetInfo.toServerJSONObject) {
- jsonObject.datasetInfo = jsonObject.datasetInfo.toServerJSONObject();
- }
- }
- return jsonObject;
- }
- }]);
- return UGCSubLayer;
- }(UGCMapLayer);
- SuperMap.UGCSubLayer = UGCSubLayer;
- ;// CONCATENATED MODULE: ./src/common/iServer/ServerTheme.js
- 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); }
- function ServerTheme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ServerTheme_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerTheme_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerTheme_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function ServerTheme_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ServerTheme_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function ServerTheme_setPrototypeOf(o, p) { ServerTheme_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ServerTheme_setPrototypeOf(o, p); }
- 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); }; }
- function ServerTheme_possibleConstructorReturn(self, call) { if (call && (ServerTheme_typeof(call) === "object" || typeof call === "function")) { return call; } return ServerTheme_assertThisInitialized(self); }
- function ServerTheme_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function ServerTheme_getPrototypeOf(o) { ServerTheme_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ServerTheme_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ServerTheme
- * @category iServer Map Theme
- * @classdesc UGC 专题图图层类。
- * @extends {SuperMap.UGCSubLayer}
- * @param {SuperMap.Theme} theme - 专题图对象。
- * @param {SuperMap.LonLat} themeElementPosition - 专题图元素位置。
- */
- var ServerTheme = /*#__PURE__*/function (_UGCSubLayer) {
- ServerTheme_inherits(ServerTheme, _UGCSubLayer);
- var _super = ServerTheme_createSuper(ServerTheme);
- function ServerTheme(options) {
- var _this;
- ServerTheme_classCallCheck(this, ServerTheme);
- options = options || {};
- _this = _super.call(this, options);
- /**
- * @member {SuperMap.Theme} SuperMap.ServerTheme.prototype.theme
- * @description 专题图对象。
- */
- _this.theme = null;
- /**
- * @member {SuperMap.LonLat} SuperMap.ServerTheme.prototype.themeElementPosition
- * @description 专题图元素位置。
- */
- _this.themeElementPosition = null;
- _this.CLASS_NAME = "SuperMap.ServerTheme";
- return _this;
- }
- /**
- * @function SuperMap.ServerTheme.prototype.destroy
- * @override
- */
- ServerTheme_createClass(ServerTheme, [{
- key: "destroy",
- value: function destroy() {
- ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "destroy", this).call(this);
- Util.reset(this);
- }
- /**
- * @function SuperMap.ServerTheme.prototype.fromJson
- * @description 将服务端 JSON 对象转换成当前客户端对象
- * @param {Object} jsonObject - 要转换的 JSON 对象。
- */
- }, {
- key: "fromJson",
- value: function fromJson(jsonObject) {
- ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "fromJson", this).call(this, jsonObject);
- var themeObj = this.theme;
- var themeT = themeObj && themeObj.type;
- switch (themeT) {
- case 'LABEL':
- this.theme = ThemeLabel.fromObj(themeObj);
- break;
- case 'UNIQUE':
- this.theme = ThemeUnique.fromObj(themeObj);
- break;
- case 'GRAPH':
- this.theme = ThemeGraph.fromObj(themeObj);
- break;
- case 'DOTDENSITY':
- this.theme = ThemeDotDensity.fromObj(themeObj);
- break;
- case 'GRADUATEDSYMBOL':
- this.theme = ThemeGraduatedSymbol.fromObj(themeObj);
- break;
- case 'RANGE':
- this.theme = ThemeRange.fromObj(themeObj);
- break;
- default:
- break;
- }
- if (this.themeElementPosition) {
- //待测试
- this.themeElementPosition = new LonLat(this.themeElementPosition.x, this.themeElementPosition.y);
- }
- }
- /**
- * @function SuperMap.ServerTheme.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- //普通属性直接赋值
- var jsonObject = ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "toServerJSONObject", this).call(this);
- if (jsonObject.themeElementPosition) {
- if (jsonObject.themeElementPosition.toServerJSONObject) {
- jsonObject.themeElementPosition = jsonObject.themeElementPosition.toServerJSONObject();
- }
- }
- if (jsonObject.theme) {
- if (jsonObject.theme.toServerJSONObject) {
- jsonObject.theme = jsonObject.theme.toServerJSONObject();
- }
- }
- return jsonObject;
- }
- }]);
- return ServerTheme;
- }(UGCSubLayer);
- SuperMap.ServerTheme = ServerTheme;
- ;// CONCATENATED MODULE: ./src/common/iServer/Grid.js
- 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); }
- function Grid_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Grid_createClass(Constructor, protoProps, staticProps) { if (protoProps) Grid_defineProperties(Constructor.prototype, protoProps); if (staticProps) Grid_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Grid_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Grid_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function Grid_setPrototypeOf(o, p) { Grid_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Grid_setPrototypeOf(o, p); }
- 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); }; }
- function Grid_possibleConstructorReturn(self, call) { if (call && (Grid_typeof(call) === "object" || typeof call === "function")) { return call; } return Grid_assertThisInitialized(self); }
- function Grid_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Grid_getPrototypeOf(o) { Grid_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Grid_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Grid
- * @category iServer Map Layer
- * @classdesc UGC 栅格图层类。
- * @extends {SuperMap.UGCSubLayer}
- * @param {Object} options - 参数。
- * @param {Array.<Object>} [options.colorDictionary] - 颜色对照表对象。
- * @param {number} [options.brightness] - Grid 图层的亮度。
- * @param {SuperMap.ColorGradientType} [options.colorGradientType] - 颜色渐变枚举。
- * @param {SuperMap.ServerColor} [options.colors] - 颜色表对象。
- * @param {number} [options.contrast] - Grid 图层的对比度。
- * @param {SuperMap.GridType} [options.gridType] - 格网类型。
- * @param {number} [options.horizontalSpacing] - 格网水平间隔大小。
- * @param {boolean} [options.sizeFixed] - 格网是否固定大小,如果不固定大小,则格网随着地图缩放。
- * @param {SuperMap.ServerStyle} [options.solidStyle] - 格网实线的样式。
- * @param {SuperMap.ServerColor} [options.specialColor] - 栅格数据集无值数据的颜色。
- * @param {number} [options.specialValue] - 图层的特殊值。
- * @param {boolean} [options.specialValueTransparent] - 图层的特殊值(specialValue)所处区域是否透明。
- * @param {number} [options.verticalSpacing] - 格网垂直间隔大小。
- */
- var Grid = /*#__PURE__*/function (_UGCSubLayer) {
- Grid_inherits(Grid, _UGCSubLayer);
- var _super = Grid_createSuper(Grid);
- function Grid(options) {
- var _this;
- Grid_classCallCheck(this, Grid);
- options = options || {};
- _this = _super.call(this, options);
- /**
- * @member {Array.<SuperMap.ColorDictionary>} SuperMap.Grid.prototype.colorDictionarys
- * @description 颜色对照表对象。
- */
- _this.colorDictionarys = null;
- /**
- * @member {number} SuperMap.Grid.prototype.brightness
- * @description Grid 图层的亮度。
- */
- _this.brightness = null;
- /**
- * @member {SuperMap.ColorGradientType} SuperMap.Grid.prototype.colorGradientType
- * @description 渐变颜色枚举值。
- */
- _this.colorGradientType = null;
- /**
- * @member {SuperMap.ServerColor} SuperMap.Grid.prototype.colors
- * @description 颜色表对象。
- */
- _this.colors = null;
- /**
- * @member {number} SuperMap.Grid.prototype.contrast
- * @description Grid 图层的对比度。
- */
- _this.contrast = null;
- /**
- * @member {SuperMap.ServerStyle} SuperMap.Grid.prototype.dashStyle
- * @description 栅格数据集特殊值数据的颜色。
- */
- _this.dashStyle = null;
- /**
- * @member {SuperMap.GridType} SuperMap.Grid.prototype.gridType
- * @description 格网类型。
- */
- _this.gridType = null;
- /**
- * @member {number} SuperMap.Grid.prototype.horizontalSpacing
- * @description 格网水平间隔大小。
- */
- _this.horizontalSpacing = null;
- /**
- * @member {boolean} SuperMap.Grid.prototype.sizeFixed
- * @description 格网是否固定大小,如果不固定大小,则格网随着地图缩放。
- */
- _this.sizeFixed = null;
- /**
- * @member {SuperMap.ServerStyle} SuperMap.Grid.prototype.solidStyle
- * @description 格网实线的样式。
- */
- _this.solidStyle = null;
- /**
- * @member {SuperMap.ServerColor} SuperMap.Grid.prototype.specialColor
- * @description 栅格数据集无值数据的颜色。
- */
- _this.specialColor = null;
- /**
- * @member {number} SuperMap.Grid.prototype.specialValue
- * @description 图层的特殊值。
- */
- _this.specialValue = null;
- /**
- * @member {boolean} SuperMap.Grid.prototype.specialValueTransparent
- * @description 图层的特殊值(specialValue)所处区域是否透明。
- */
- _this.specialValueTransparent = null;
- /**
- * @member {number} SuperMap.Grid.prototype.verticalSpacing
- * @description 格网垂直间隔大小。
- */
- _this.verticalSpacing = null;
- _this.CLASS_NAME = "SuperMap.Grid";
- return _this;
- }
- /**
- * @function SuperMap.Grid.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- Grid_createClass(Grid, [{
- key: "destroy",
- value: function destroy() {
- Grid_get(Grid_getPrototypeOf(Grid.prototype), "destroy", this).call(this);
- Util.reset(this);
- }
- /**
- * @function SuperMap.Grid.prototype.fromJson
- * @description 将服务端 JSON 对象转换成当前客户端对象。
- * @param {Object} jsonObject - 要转换的 JSON 对象。
- */
- }, {
- key: "fromJson",
- value: function fromJson(jsonObject) {
- Grid_get(Grid_getPrototypeOf(Grid.prototype), "fromJson", this).call(this, jsonObject);
- if (this.specialColor) {
- this.specialColor = new ServerColor(this.specialColor.red, this.specialColor.green, this.specialColor.blue);
- }
- if (this.colors) {
- var colors = [],
- color;
- for (var i in this.colors) {
- color = this.colors[i];
- colors.push(new ServerColor(color.red, color.green, color.blue));
- }
- this.colors = colors;
- }
- if (this.dashStyle) {
- this.dashStyle = new ServerStyle(this.dashStyle);
- }
- if (this.solidStyle) {
- this.solidStyle = new ServerStyle(this.solidStyle);
- }
- if (this.colorDictionary) {
- var colorDics = [],
- colorDic;
- for (var key in this.colorDictionary) {
- colorDic = this.colorDictionary[key];
- colorDics.push(new ColorDictionary({
- elevation: key,
- color: colorDic
- }));
- }
- this.colorDictionarys = colorDics;
- }
- delete this.colorDictionary;
- }
- /**
- * @function SuperMap.Grid.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 对象。
- * @returns JSON 对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- var jsonObject = Grid_get(Grid_getPrototypeOf(Grid.prototype), "toServerJSONObject", this).call(this);
- if (jsonObject.dashStyle) {
- if (jsonObject.dashStyle.toServerJSONObject) {
- jsonObject.dashStyle = jsonObject.dashStyle.toServerJSONObject();
- }
- }
- if (jsonObject.solidStyle) {
- if (jsonObject.solidStyle.toServerJSONObject) {
- jsonObject.solidStyle = jsonObject.solidStyle.toServerJSONObject();
- }
- }
- return jsonObject;
- }
- }]);
- return Grid;
- }(UGCSubLayer);
- SuperMap.Grid = Grid;
- ;// CONCATENATED MODULE: ./src/common/iServer/Image.js
- 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); }
- function Image_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Image_createClass(Constructor, protoProps, staticProps) { if (protoProps) Image_defineProperties(Constructor.prototype, protoProps); if (staticProps) Image_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Image_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Image_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function Image_setPrototypeOf(o, p) { Image_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Image_setPrototypeOf(o, p); }
- 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); }; }
- function Image_possibleConstructorReturn(self, call) { if (call && (Image_typeof(call) === "object" || typeof call === "function")) { return call; } return Image_assertThisInitialized(self); }
- function Image_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Image_getPrototypeOf(o) { Image_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Image_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Image
- * @category iServer Map Layer
- * @classdesc UGC 影像图层类
- * @extends {SuperMap.UGCSubLayer}
- * @param {Object} options - 参数。
- * @param {SuperMap.ColorSpaceType} [options.colorSpaceType] - 返回影像图层的色彩显示模式。
- * @param {number} [options.brightness] - 影像图层的亮度。
- * @param {Array.<number>} [options.displayBandIndexes] - 返回当前影像图层显示的波段索引。
- * @param {number} [options.contrast] - 影像图层的对比度。
- * @param {boolean} [options.transparent] - 是否背景透明。
- * @param {SuperMap.ServerColor} [options.transparentColor] - 返回背景透明色。
- * @param {number} [options.transparentColorTolerance] - 背景透明色容限。
- */
- var UGCImage = /*#__PURE__*/function (_UGCSubLayer) {
- Image_inherits(UGCImage, _UGCSubLayer);
- var _super = Image_createSuper(UGCImage);
- function UGCImage(options) {
- var _this;
- Image_classCallCheck(this, UGCImage);
- options = options || {};
- _this = _super.call(this, options);
- /**
- * @member {number} SuperMap.Image.prototype.brightness
- * @description 影像图层的亮度。
- */
- _this.brightness = null;
- /**
- * @member {SuperMap.ColorSpaceType} SuperMap.Image.prototype.colorSpaceType
- * @description 返回影像图层的色彩显示模式。
- */
- _this.colorSpaceType = null;
- /**
- * @member {number} SuperMap.Image.prototype.contrast
- * @description 影像图层的对比度。
- */
- _this.contrast = null;
- /**
- * @member {Array.<number>} SuperMap.Image.prototype.displayBandIndexes
- * @description 返回当前影像图层显示的波段索引。
- */
- _this.displayBandIndexes = null;
- /**
- * @member {boolean} SuperMap.Image.prototype.transparent
- * @description 是否背景透明。
- */
- _this.transparent = null;
- /**
- * @member {SuperMap.ServerColor} SuperMap.Image.prototype.transparentColor
- * @description 返回背景透明色。
- */
- _this.transparentColor = null;
- /**
- * @member {number} SuperMap.Image.prototype.transparentColorTolerance
- * @description 背景透明色容限。
- */
- _this.transparentColorTolerance = null;
- _this.CLASS_NAME = "SuperMap.Image";
- return _this;
- }
- /**
- * @function SuperMap.Image.prototype.destroy
- * @override
- */
- Image_createClass(UGCImage, [{
- key: "destroy",
- value: function destroy() {
- Image_get(Image_getPrototypeOf(UGCImage.prototype), "destroy", this).call(this);
- Util.reset(this);
- }
- /**
- * @function SuperMap.Image.prototype.fromJson
- * @description 将服务端 JSON 对象转换成当前客户端对象。
- * @param {Object} jsonObject - 要转换的 JSON 对象。
- */
- }, {
- key: "fromJson",
- value: function fromJson(jsonObject) {
- Image_get(Image_getPrototypeOf(UGCImage.prototype), "fromJson", this).call(this, jsonObject);
- if (this.transparentColor) {
- this.transparentColor = new ServerColor(this.transparentColor.red, this.transparentColor.green, this.transparentColor.blue);
- }
- }
- /**
- * @function SuperMap.Image.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- return Image_get(Image_getPrototypeOf(UGCImage.prototype), "toServerJSONObject", this).call(this);
- }
- }]);
- return UGCImage;
- }(UGCSubLayer);
- SuperMap.Image = UGCImage;
- ;// CONCATENATED MODULE: ./src/common/iServer/Vector.js
- 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); }
- function iServer_Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function iServer_Vector_createClass(Constructor, protoProps, staticProps) { if (protoProps) iServer_Vector_defineProperties(Constructor.prototype, protoProps); if (staticProps) iServer_Vector_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function iServer_Vector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = iServer_Vector_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- 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); }
- 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); }; }
- function iServer_Vector_possibleConstructorReturn(self, call) { if (call && (iServer_Vector_typeof(call) === "object" || typeof call === "function")) { return call; } return iServer_Vector_assertThisInitialized(self); }
- function iServer_Vector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- 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); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Vector
- * @category iServer Map TileFeature
- * @classdesc UGC 矢量图层类。
- * @extends {SuperMap.UGCSubLayer}
- * @param {Object} options - 参数。
- * @param {SuperMap.ServerStyle} [options.style] - 矢量图层的风格。
- */
- var Vector_Vector = /*#__PURE__*/function (_UGCSubLayer) {
- iServer_Vector_inherits(Vector, _UGCSubLayer);
- var _super = iServer_Vector_createSuper(Vector);
- function Vector(options) {
- var _this;
- iServer_Vector_classCallCheck(this, Vector);
- options = options || {};
- _this = _super.call(this, options);
- /**
- * @member {SuperMap.ServerStyle} SuperMap.Vector.prototype.style
- * @description 矢量图层的风格。
- */
- _this.style = null;
- _this.CLASS_NAME = "SuperMap.Vector";
- return _this;
- }
- /**
- * @function SuperMap.Vector.prototype.destroy
- * @override
- */
- iServer_Vector_createClass(Vector, [{
- key: "destroy",
- value: function destroy() {
- iServer_Vector_get(iServer_Vector_getPrototypeOf(Vector.prototype), "destroy", this).call(this);
- Util.reset(this);
- }
- /**
- * @function SuperMap.Vector.prototype.fromJson
- * @description 将服务端 JSON 对象转换成当前客户端对象。
- * @param {Object} jsonObject - 要转换的 JSON 对象。
- */
- }, {
- key: "fromJson",
- value: function fromJson(jsonObject) {
- iServer_Vector_get(iServer_Vector_getPrototypeOf(Vector.prototype), "fromJson", this).call(this, jsonObject);
- var sty = this.style;
- if (sty) {
- this.style = new ServerStyle(sty);
- }
- }
- /**
- * @function SuperMap.Vector.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- * @returns {Object} 对应的 JSON 格式对象
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- var jsonObject = SuperMap.toServerJSONObject();
- if (jsonObject.style) {
- if (jsonObject.style.toServerJSONObject) {
- jsonObject.style = jsonObject.style.toServerJSONObject();
- }
- }
- return jsonObject;
- }
- }]);
- return Vector;
- }(UGCSubLayer);
- SuperMap.Vector = Vector_Vector;
- ;// CONCATENATED MODULE: ./src/common/iServer/GetLayersInfoService.js
- 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); }
- function GetLayersInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GetLayersInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetLayersInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetLayersInfoService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GetLayersInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetLayersInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GetLayersInfoService_setPrototypeOf(o, p) { GetLayersInfoService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetLayersInfoService_setPrototypeOf(o, p); }
- 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); }; }
- function GetLayersInfoService_possibleConstructorReturn(self, call) { if (call && (GetLayersInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetLayersInfoService_assertThisInitialized(self); }
- function GetLayersInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GetLayersInfoService_getPrototypeOf(o) { GetLayersInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetLayersInfoService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GetLayersInfoService
- * @category iServer Map Layer
- * @classdesc 获取图层信息服务类构造函数。
- * @extends {SuperMap.CommonServiceBase}
- * @param {string} url - 与客户端交互的地图服务地址。请求地图服务,URL 应为:
- * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
- * 如 http://localhost:8090/iserver/services/map-world/rest/maps/World 。
- * 如果查询临时图层的信息,请指定完成的url,包含临时图层ID信息,如:
- * http://localhost:8090/iserver/services/map-world/rest/maps/World/tempLayersSet/resourceID
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @param {boolean} options.isTempLayers - 当前url对应的图层是否是临时图层。
- */
- var GetLayersInfoService = /*#__PURE__*/function (_CommonServiceBase) {
- GetLayersInfoService_inherits(GetLayersInfoService, _CommonServiceBase);
- var _super = GetLayersInfoService_createSuper(GetLayersInfoService);
- function GetLayersInfoService(url, options) {
- var _this;
- GetLayersInfoService_classCallCheck(this, GetLayersInfoService);
- _this = _super.call(this, url, options);
- /**
- * @member {boolean} SuperMap.GetLayersInfoService.prototype.isTempLayers
- * @description 当前url对应的图层是否是临时图层。
- */
- _this.isTempLayers = false;
- if (options) {
- Util.extend(GetLayersInfoService_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.GetLayersInfoService";
- return _this;
- }
- /**
- * @function SuperMap.GetLayersInfoService.prototype.destroy
- * @override
- */
- GetLayersInfoService_createClass(GetLayersInfoService, [{
- key: "destroy",
- value: function destroy() {
- GetLayersInfoService_get(GetLayersInfoService_getPrototypeOf(GetLayersInfoService.prototype), "destroy", this).call(this);
- Util.reset(this);
- }
- /**
- * @function SuperMap.GetLayersInfoService.prototype.processAsync
- * @description 负责将客户端的更新参数传递到服务端。
- */
- }, {
- key: "processAsync",
- value: function processAsync() {
- var me = this,
- method = "GET";
- if (!me.isTempLayers) {
- me.url = Util.urlPathAppend(me.url, 'layers');
- }
- me.request({
- method: method,
- params: null,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.GetLayersInfoService.prototype.serviceProcessCompleted
- * @description 编辑完成,执行此方法。
- * @param {Object} result - 服务器返回的结果对象。
- */
- }, {
- key: "serviceProcessCompleted",
- value: function serviceProcessCompleted(result) {
- var me = this,
- existRes,
- layers,
- len;
- result = Util.transformResult(result);
- existRes = !!result && result.length > 0;
- layers = existRes ? result[0].subLayers.layers : null;
- len = layers ? layers.length : 0;
- me.handleLayers(len, layers);
- me.events.triggerEvent("processCompleted", {
- result: result[0]
- });
- }
- /**
- * TODO 专题图时候可能会用到
- * @function SuperMap.GetLayersInfoService.prototype.handleLayers
- * @description 处理 iServer 新增图层组数据 (subLayers.layers 中可能还会含有 subLayers.layers)
- * @param {number} len - subLayers.layers的长度
- * @param {Array.<number>} layers - subLayers.layers的长度数组
- */
- }, {
- key: "handleLayers",
- value: function handleLayers(len, layers) {
- var me = this,
- tempLayer;
- if (len) {
- for (var i = 0; i < len; i++) {
- if (layers[i].subLayers && layers[i].subLayers.layers && layers[i].subLayers.layers.length > 0) {
- me.handleLayers(layers[i].subLayers.layers.length, layers[i].subLayers.layers);
- } else {
- var type = layers[i].ugcLayerType;
- switch (type) {
- case 'THEME':
- tempLayer = new ServerTheme();
- tempLayer.fromJson(layers[i]);
- layers[i] = tempLayer;
- break;
- case 'GRID':
- tempLayer = new Grid();
- tempLayer.fromJson(layers[i]);
- layers[i] = tempLayer;
- break;
- case 'IMAGE':
- tempLayer = new UGCImage();
- tempLayer.fromJson(layers[i]);
- layers[i] = tempLayer;
- break;
- case 'VECTOR':
- tempLayer = new Vector_Vector();
- tempLayer.fromJson(layers[i]);
- layers[i] = tempLayer;
- break;
- default:
- break;
- }
- }
- }
- }
- }
- }]);
- return GetLayersInfoService;
- }(CommonServiceBase);
- SuperMap.GetLayersInfoService = GetLayersInfoService;
- ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationAnalystParameters.js
- function InterpolationAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function InterpolationAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.InterpolationAnalystParameters
- * @category iServer SpatialAnalyst InterpolationAnalyst
- * @classdesc 插值分析参数类。
- * @param {Object} options - 参数。
- * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
- * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
- * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
- * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。
- * @param {string} [options.dataset] - 用于做插值分析的数据源中数据集的名称。当插值分析类型(InterpolationAnalystType)为 dataset 时,此参数为必选。
- * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystType)为 geometry 时,此参数为必设参数。
- * @param {number} [options.searchRadius=0] - 查找半径,即参与运算点的查找范围,与点数据集单位相同。
- * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
- * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
- * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
- * @param {SuperMap.PixelFormat} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
- * @param {string} [options.InterpolationAnalystType="dataset"] - 插值分析类型("dataset" 或 "geometry")。
- */
- var InterpolationAnalystParameters = /*#__PURE__*/function () {
- function InterpolationAnalystParameters(options) {
- InterpolationAnalystParameters_classCallCheck(this, InterpolationAnalystParameters);
- if (!options) {
- return;
- }
- /**
- * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.InterpolationAnalystParameters.prototype.bounds
- * @description 插值分析的范围,用于确定结果栅格数据集的范围。
- * 如果缺省,则默认为原数据集的范围。鉴于此插值方法为内插方法,原数据集的范围内的插值结果才相对有参考价值,
- * 因此建议此参数不大于原数据集范围。
- */
- this.bounds = null;
- /**
- * @member {number} [SuperMap.InterpolationAnalystParameters.prototype.searchRadius=0]
- * @description 查找半径,即参与运算点的查找范围,与点数据集单位相同。
- * 计算某个位置的Z 值时,会以该位置为圆心,以查找范围的值为半径,落在这个范围内的采样点都将参与运算。
- * 该值需要根据待插值点数据的分布状况和点数据集范围进行设置。
- */
- this.searchRadius = 0;
- /**
- * @member {string} SuperMap.InterpolationAnalystParameters.prototype.zValueFieldName
- * @description 数据集插值分析中,用于指定进行插值分析的目标字段名,插值分析不支持文本类型的字段。
- * 含义为每个插值点在插值过程中的权重,可以将所有点此字段值设置为 1,即所有点在整体插值中权重相同。
- * 当插值分析类型(InterpolationAnalystType)为 dataset 时,此为必选参数。
- */
- this.zValueFieldName = null;
- /**
- * @member {number} [SuperMap.InterpolationAnalystParameters.prototype.zValueScale=1]
- * @description 用于进行插值分析值的缩放比率。
- * 参加插值分析的值将乘以该参数值后再进行插值,也就是对进行插值分析的值进行统一的扩大或缩小。
- */
- this.zValueScale = 1;
- /**
- * @member {number} SuperMap.InterpolationAnalystParameters.prototype.resolution
- * @description 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
- * 该值不能超过待分析数据集的范围边长。
- * 且该值设置时,应该考虑点数据集范围大小来取值,一般为结果栅格行列值(即结果栅格数据集范围除以分辨率),在 500 以内可以较好地体现密度走势。
- */
- this.resolution = null;
- /**
- * @member {SuperMap.FilterParameter} [SuperMap.InterpolationAnalystParameters.prototype.filterQueryParameter]
- * @description 过滤条件,对分析数据集中的点进行过滤,设置为 null 表示对数据集中的所有点进行分析。
- */
- this.filterQueryParameter = null;
- /**
- * @member {string} SuperMap.InterpolationAnalystParameters.prototype.outputDatasetName
- * @description 插值分析结果数据集的名称。
- */
- this.outputDatasetName = null;
- /**
- * @member {string} SuperMap.InterpolationAnalystParameters.prototype.outputDatasourceName
- * @description 插值分析结果数据源的名称。
- */
- this.outputDatasourceName = null;
- /**
- * @member {SuperMap.PixelFormat} [SuperMap.InterpolationAnalystParameters.prototype.pixelFormat]
- * @description 指定结果栅格数据集存储的像素格式。支持存储的像素格式有 BIT16、BIT32、DOUBLE、SINGLE、UBIT1、UBIT4、UBIT8、UBIT24、UBIT32。
- */
- this.pixelFormat = null;
- /**
- * @member {string} [SuperMap.InterpolationAnalystParameters.prototype.dataset]
- * @description 用来做插值分析的数据源中数据集的名称,该名称用形如 "数据集名称@数据源别名" 形式来表示。
- * 当插值分析类型(InterpolationAnalystType)为 dataset 时,此参数为必选。
- */
- this.dataset = null;
- /**
- * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [SuperMap.InterpolationAnalystParameters.prototype.inputPoints]
- * @description 用于做插值分析的离散点(离散点包括Z值)集合。
- * 当插值分析类型(InterpolationAnalystType)为 geometry 时,此参数为必设参数。
- * 通过离散点直接进行插值分析不需要指定输入数据集inputDatasourceName,inputDatasetName以及zValueFieldName。
- */
- this.inputPoints = null;
- /**
- * @member {string} [SuperMap.InterpolationAnalystParameters.prototype.InterpolationAnalystType="dataset"]
- * @description 插值分析类型。差值分析包括数据集插值分析和几何插值分析两类,
- * "dataset" 表示对数据集进行插值分析,"geometry" 表示对离散点数组进行插值分析。
- */
- this.InterpolationAnalystType = "dataset";
- /**
- * @member {Object} SuperMap.InterpolationAnalystParameters.prototype.clipParam
- * @description 对插值分析结果进行裁剪的参数。
- */
- this.clipParam = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.InterpolationAnalystParameters";
- }
- /**
- * @function SuperMap.InterpolationAnalystParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- InterpolationAnalystParameters_createClass(InterpolationAnalystParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.bounds = null;
- me.searchRadius = null;
- me.zValueFieldName = null;
- me.zValueScale = null;
- me.resolution = null;
- me.filterQueryParameter = null;
- me.outputDatasetName = null;
- me.pixelFormat = null;
- }
- /**
- * @function SuperMap.InterpolationAnalystParameters.toObject
- * @param {SuperMap.InterpolationAnalystParameters} interpolationAnalystParameters - 插值分析参数类。
- * @param {SuperMap.InterpolationAnalystParameters} tempObj - 插值分析参数对象。
- * @description 将插值分析参数对象转换成 JSON 对象。
- * @returns JSON 对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(interpolationAnalystParameters, tempObj) {
- for (var name in interpolationAnalystParameters) {
- if (name === "inputPoints" && interpolationAnalystParameters.InterpolationAnalystType === "geometry") {
- var objs = [];
- for (var i = 0; i < interpolationAnalystParameters.inputPoints.length; i++) {
- var item = interpolationAnalystParameters.inputPoints[i];
- var obj = {
- x: item.x,
- y: item.y,
- z: item.tag
- };
- objs.push(obj);
- }
- tempObj[name] = objs;
- } else {
- tempObj[name] = interpolationAnalystParameters[name];
- }
- }
- }
- }]);
- return InterpolationAnalystParameters;
- }();
- SuperMap.InterpolationAnalystParameters = InterpolationAnalystParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationRBFAnalystParameters.js
- 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); }
- function InterpolationRBFAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function InterpolationRBFAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationRBFAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationRBFAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function InterpolationRBFAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationRBFAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function InterpolationRBFAnalystParameters_setPrototypeOf(o, p) { InterpolationRBFAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationRBFAnalystParameters_setPrototypeOf(o, p); }
- 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); }; }
- function InterpolationRBFAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationRBFAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return InterpolationRBFAnalystParameters_assertThisInitialized(self); }
- function InterpolationRBFAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function InterpolationRBFAnalystParameters_getPrototypeOf(o) { InterpolationRBFAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationRBFAnalystParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.InterpolationRBFAnalystParameters
- * @category iServer SpatialAnalyst InterpolationAnalyst
- * @classdesc 样条插值(径向基函数插值法)分析参数类。
- * @extends {SuperMap.InterpolationAnalystParameters}
- * @param {Object} options - 参数。
- * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
- * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。
- * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
- * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
- * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
- * @param {number} [options.smooth=0.1] - 光滑系数,该值表示插值函数曲线与点的逼近程度,值域为0到1。
- * @param {number} [options.tension=40] - 张力系数,用于调整结果栅格数据表面的特性。
- * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置参与差值运算的点数。
- * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置参与运算点的查找范围。
- * @param {number} [options.maxPointCountForInterpolation=200] - 【块查找】方式下,设置最多参与插值的点数。
- * @param {number} [options.maxPointCountInNode=50] - 【块查找】方式下,设置单个块内最多参与运算点数。
- * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
- * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
- * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
- * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
- * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如”数据集名称@数据源别名”形式来表示。当插值分析类型(InterpolationAnalystType)为 dataset 时。此参数为必选。
- * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystType)为 geometry 时。此参数为必选。
- * @example
- * var myInterpolationRBFAnalystParameters = new SuperMap.InterpolationRBFAnalystParameters({
- * dataset:"SamplesP@Interpolation",
- * smooth: 0.1,
- * tension: 40,
- * searchMode: "QUADTREE",
- * maxPointCountForInterpolation: 20,
- * maxPointCountInNode: 5,
- * pixelFormat: "BIT16",
- * zValueFieldName: "AVG_TMP",
- * resolution: 3000,
- * filterQueryParameter: {
- * attributeFilter: ""
- * },
- * outputDatasetName: "myRBF"
- * });
- */
- var InterpolationRBFAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
- InterpolationRBFAnalystParameters_inherits(InterpolationRBFAnalystParameters, _InterpolationAnalyst);
- var _super = InterpolationRBFAnalystParameters_createSuper(InterpolationRBFAnalystParameters);
- function InterpolationRBFAnalystParameters(options) {
- var _this;
- InterpolationRBFAnalystParameters_classCallCheck(this, InterpolationRBFAnalystParameters);
- _this = _super.call(this, options);
- /**
- * @member {number} [SuperMap.InterpolationRBFAnalystParameters.prototype.smooth=0.1]
- * @description 光滑系数,值域为 0 到 1,常用取值如 0、0.001、0.01、0.1、和 0.5。
- * 该值表示插值函数曲线与点的逼近程度,此数值越大,函数曲线与点的偏差越大,反之越小。
- */
- _this.smooth = 0.1;
- /**
- * @member {number} [SuperMap.InterpolationRBFAnalystParameters.prototype.tension=40]
- * @description 张力系数,常用取值如 0、1、5 和 10。
- * 用于调整结果栅格数据表面的特性,张力越大,插值时每个点对计算结果影响越小,反之越大。
- */
- _this.tension = 40;
- /**
- * @member {SuperMap.SearchMode} SuperMap.InterpolationRBFAnalystParameters.prototype.searchMode
- * @description 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。必设参数。
- * 具体如下:
- * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。
- * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。
- * {QUADTREE} 使用 QUADTREE 方式查找参与内插分析的点(块查找)。
- */
- _this.searchMode = null;
- /**
- * @member {number} [SuperMap.InterpolationRBFAnalystParameters.prototype.expectedCount=12]
- * @description 【固定点数查找】方式下,设置待查找的点数,即参与差值运算的点数。
- */
- _this.expectedCount = 12;
- /**
- * @member {number} [SuperMap.InterpolationRBFAnalystParameters.prototype.maxPointCountForInterpolation=200]
- * @description 【块查找】方式下,最多参与插值的点数。
- */
- _this.maxPointCountForInterpolation = 200;
- /**
- * @member {number} [SuperMap.InterpolationRBFAnalystParameters.prototype.maxPointCountInNode=50]
- * @description 【块查找】方式下,单个块内最多参与运算点数。
- */
- _this.maxPointCountInNode = 50;
- if (options) {
- Util.extend(InterpolationRBFAnalystParameters_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.InterpolationRBFAnalystParameters";
- return _this;
- }
- /**
- * @function SuperMap.InterpolationRBFAnalystParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- InterpolationRBFAnalystParameters_createClass(InterpolationRBFAnalystParameters, [{
- key: "destroy",
- value: function destroy() {
- InterpolationRBFAnalystParameters_get(InterpolationRBFAnalystParameters_getPrototypeOf(InterpolationRBFAnalystParameters.prototype), "destroy", this).call(this);
- var me = this;
- me.smooth = null;
- me.tension = null;
- me.searchMode = null;
- me.expectedCount = null;
- me.maxPointCountForInterpolation = null;
- me.maxPointCountInNode = null;
- }
- /**
- * @function SuperMap.InterpolationRBFAnalystParameters.toObject
- * @param {SuperMap.InterpolationRBFAnalystParameters} datasetInterpolationRBFAnalystParameters - 样条插值(径向基函数插值法)分析参数类
- * @param {SuperMap.InterpolationRBFAnalystParameters} tempObj - 样条插值(径向基函数插值法)分析参数对象
- * @description 将样条插值(径向基函数插值法)分析参数对象转换为 JSON 对象。
- * @returns JSON 对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(datasetInterpolationRBFAnalystParameters, tempObj) {
- for (var name in datasetInterpolationRBFAnalystParameters) {
- tempObj[name] = datasetInterpolationRBFAnalystParameters[name];
- }
- }
- }]);
- return InterpolationRBFAnalystParameters;
- }(InterpolationAnalystParameters);
- SuperMap.InterpolationRBFAnalystParameters = InterpolationRBFAnalystParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationDensityAnalystParameters.js
- 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); }
- function InterpolationDensityAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function InterpolationDensityAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationDensityAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationDensityAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function InterpolationDensityAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationDensityAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function InterpolationDensityAnalystParameters_setPrototypeOf(o, p) { InterpolationDensityAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationDensityAnalystParameters_setPrototypeOf(o, p); }
- 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); }; }
- function InterpolationDensityAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationDensityAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return InterpolationDensityAnalystParameters_assertThisInitialized(self); }
- function InterpolationDensityAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function InterpolationDensityAnalystParameters_getPrototypeOf(o) { InterpolationDensityAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationDensityAnalystParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.InterpolationDensityAnalystParameters
- * @category iServer SpatialAnalyst InterpolationAnalyst
- * @classdesc 点密度差值分析参数类。
- * @param {Object} options - 参数。
- * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
- * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
- * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
- * @param {number} [options.searchRadius=0] - 查找半径,即参与运算点的查找范围,与点数据集单位相同。
- * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型( SuperMap.InterpolationAnalystType)为 dataset 时。此为必选参数。
- * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
- * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
- * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
- * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
- * @param {string} [options.dataset] - 用来做插值分析的数据源中数据集的名称,该名称用形如 "数据集名称@数据源别名" 形式来表示。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,必设参数。
- * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(SuperMap.InterpolationAnalystType)为 geometry 时,必设参数。
- * @extends {SuperMap.InterpolationAnalystParameters}
- * @example
- * var myInterpolationDensityAnalystParameters = new SuperMap.InterpolationDensityAnalystParameters({
- * dataset: "SamplesP@Interpolation",
- * searchRadius: "100000",
- * pixelFormat: "BIT16",
- * zValueFieldName: "AVG_TMP",
- * resolution: 3000,
- * filterQueryParameter: {
- * attributeFilter: ""
- * },
- * outputDatasetName: "myDensity"
- * });
- */
- var InterpolationDensityAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
- InterpolationDensityAnalystParameters_inherits(InterpolationDensityAnalystParameters, _InterpolationAnalyst);
- var _super = InterpolationDensityAnalystParameters_createSuper(InterpolationDensityAnalystParameters);
- function InterpolationDensityAnalystParameters(options) {
- var _this;
- InterpolationDensityAnalystParameters_classCallCheck(this, InterpolationDensityAnalystParameters);
- _this = _super.call(this, options);
- if (options) {
- Util.extend(InterpolationDensityAnalystParameters_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.InterpolationDensityAnalystParameters";
- return _this;
- }
- /**
- * @function SuperMap.InterpolationDensityAnalystParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- InterpolationDensityAnalystParameters_createClass(InterpolationDensityAnalystParameters, [{
- key: "destroy",
- value: function destroy() {
- InterpolationDensityAnalystParameters_get(InterpolationDensityAnalystParameters_getPrototypeOf(InterpolationDensityAnalystParameters.prototype), "destroy", this).call(this);
- }
- }]);
- return InterpolationDensityAnalystParameters;
- }(InterpolationAnalystParameters);
- SuperMap.InterpolationDensityAnalystParameters = InterpolationDensityAnalystParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationIDWAnalystParameters.js
- 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); }
- function InterpolationIDWAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function InterpolationIDWAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationIDWAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationIDWAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function InterpolationIDWAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationIDWAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function InterpolationIDWAnalystParameters_setPrototypeOf(o, p) { InterpolationIDWAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationIDWAnalystParameters_setPrototypeOf(o, p); }
- 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); }; }
- function InterpolationIDWAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationIDWAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return InterpolationIDWAnalystParameters_assertThisInitialized(self); }
- function InterpolationIDWAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function InterpolationIDWAnalystParameters_getPrototypeOf(o) { InterpolationIDWAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationIDWAnalystParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.InterpolationIDWAnalystParameters
- * @category iServer SpatialAnalyst InterpolationAnalyst
- * @classdesc 反距离加权插值(IDW)分析参数类。
- * @param {Object} options - 参数。
- * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
- * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,支持固定点数查找、定长查找。
- * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
- * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
- * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
- * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置待查找的点数,即参与差值运算的点数。
- * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置查找半径,即参与运算点的查找范围,与点数据集单位相同。
- * @param {number} [options.power=2] - 距离权重计算的幂次。
- * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
- * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
- * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
- * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
- * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如”数据集名称@数据源别名”形式来表示。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,必设参数。
- * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(SuperMap.InterpolationAnalystType)为 geometry 时,必设参数。
- * @extends {SuperMap.InterpolationAnalystParameters}
- * @example 例如:
- * var myInterpolationIDWAnalystParameters = new SuperMap.InterpolationIDWAnalystParameters({
- * dataset:"SamplesP@Interpolation",
- * power: 2,
- * searchMode: "KDTREE_FIXED_COUNT",
- * expectedCount: 12,
- * pixelFormat: "BIT16",
- * zValueFieldName: "AVG_TMP",
- * resolution: 3000,
- * filterQueryParameter: {
- * attributeFilter: ""
- * },
- * outputDatasetName: "myIDW"
- * });
- *
- */
- var InterpolationIDWAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
- InterpolationIDWAnalystParameters_inherits(InterpolationIDWAnalystParameters, _InterpolationAnalyst);
- var _super = InterpolationIDWAnalystParameters_createSuper(InterpolationIDWAnalystParameters);
- function InterpolationIDWAnalystParameters(options) {
- var _this;
- InterpolationIDWAnalystParameters_classCallCheck(this, InterpolationIDWAnalystParameters);
- _this = _super.call(this, options);
- /**
- * @member {number} [SuperMap.InterpolationIDWAnalystParameters.prototype.power=2]
- * @description 距离权重计算的幂次。
- * 该值决定了权值下降的速度,幂次越大,随距离的增大权值下降越快,距离预测点越远的点的权值也越小。
- * 理论上,参数值必须大于0,但是0.5到3之间时运算结果更合理,因此推荐值为0.5~3。
- */
- _this.power = 2;
- /**
- * @member {SuperMap.SearchMode} SuperMap.InterpolationIDWAnalystParameters.prototype.searchMode
- * @description 插值运算时,查找参与运算点的方式,支持固定点数查找、定长查找。
- * 具体如下:
- * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。
- * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。
- */
- _this.searchMode = null;
- /**
- * @member {number} [SuperMap.InterpolationIDWAnalystParameters.prototype.expectedCount=12]
- * @description 【固定点数查找】方式下,设置待查找的点数,即参与差值运算的点数。
- */
- _this.expectedCount = 12;
- if (options) {
- Util.extend(InterpolationIDWAnalystParameters_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.InterpolationIDWAnalystParameters";
- return _this;
- }
- /**
- * @function SuperMap.InterpolationIDWAnalystParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- InterpolationIDWAnalystParameters_createClass(InterpolationIDWAnalystParameters, [{
- key: "destroy",
- value: function destroy() {
- InterpolationIDWAnalystParameters_get(InterpolationIDWAnalystParameters_getPrototypeOf(InterpolationIDWAnalystParameters.prototype), "destroy", this).call(this);
- var me = this;
- me.power = null;
- me.searchMode = null;
- me.expectedCount = null;
- }
- }]);
- return InterpolationIDWAnalystParameters;
- }(InterpolationAnalystParameters);
- SuperMap.InterpolationIDWAnalystParameters = InterpolationIDWAnalystParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationKrigingAnalystParameters.js
- 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); }
- function InterpolationKrigingAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function InterpolationKrigingAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationKrigingAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationKrigingAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function InterpolationKrigingAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationKrigingAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function InterpolationKrigingAnalystParameters_setPrototypeOf(o, p) { InterpolationKrigingAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationKrigingAnalystParameters_setPrototypeOf(o, p); }
- 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); }; }
- function InterpolationKrigingAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationKrigingAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return InterpolationKrigingAnalystParameters_assertThisInitialized(self); }
- function InterpolationKrigingAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function InterpolationKrigingAnalystParameters_getPrototypeOf(o) { InterpolationKrigingAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationKrigingAnalystParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.InterpolationKrigingAnalystParameters
- * @category iServer SpatialAnalyst InterpolationAnalyst
- * @classdesc 克吕金插值分析参数类。
- * @description 通过该类可以设置克吕金插值分析所需的参数。
- * 克吕金(Kriging)法为地统计学上一种空间数据内插处理方法,主要的目的是利用各数据点间变异数(variance)的大小来推求某一未知点与各已知点的权重关系,
- * 再由各数据点的值和其与未知点的权重关系推求未知点的值。Kriging 法最大的特色不仅是提供一个最小估计误差的预测值,并且可明确的指出误差值的大小。
- * 一般而言,许多地质参数,如地形面,本身即具有连续性,故在一段距离内的任两点必有空间上的关系。反之,在一不规则面上的两点若相距甚远,
- * 则在统计意义上可视为互为独立 (stastically indepedent)。这种随距离而改变的空间上连续性,可用半变异图 (semivariogram) 来表现。
- * 因此,若想由已知的散乱点来推求某一未知点的值,则可利用半变异图推求各已知点与未知点的空间关系,即以下四个参数。
- * 然后,由此空间参数推求半变异数,由各数据点间的半变异数可推求未知点与已知点间的权重关系,进而推求出未知点的值。<br>
- *
- * · 块金值(nugget):当采样点间距为0时,理论上半变异函数值为0,但时间上两采样点非常接近时半变异函数值并不为0,即产生了上图所示的块金效应,
- * 对应的半变异函数值为块金值。块金值可能由于测量误差或者空间变异产生。<br>
- *
- * · 基台值(sill):随着采样点间距的不断增大,半变异函数的值趋向一个稳定的常数,该常数成为基台值。到达基台值后,半变异函数的值不再随采样点间距而改变,
- * 即大于此间距的采样点不再具有空间相关性。<br>
- *
- * · 偏基台值:基台值与块金值的差值。<br>
- *
- * · 自相关阈值(range):也称变程,是半变异函数值达到基台值时,采样点的间距。超过自相关阈值的采样点不再具有空间相关性,将不对预测结果产生影响。<br>
- *
- * 由上述可知,半变异函数是克吕金插值的关键,因此选择合适的半变异函数模型非常重要,SuperMap 提供了以下三种半变异函数模型:<br>
- *
- * · 指数型(EXPONENTIAL):适用于空间相关关系随样本间距的增加成指数递减的情况,其空间自相关关系在样本间距的无穷远处完全消失。<br>
- *
- * · 球型(SPHERICAL):适用于空间自相关关系随样本间距的增加而逐渐减少,直到超出一定的距离时空间自相关关系消失的情况。<br>
- *
- * · 高斯型(GAUSSIAN):适用于半变异函数值渐进地逼近基台值的情况。<br>
- *
- * 半变异函数中,有一个关键参数即插值的字段值的期望(平均值),由于对于此参数的不同处理方法而衍生出了不同的 Kriging 方法。SuperMap的差值功能基于以下三种常用 Kriging 算法:<br>
- *
- * 1. 简单克吕金(Simple Kriging):该方法假定用于插值的字段值的期望(平均值)已知的某一常数。<br>
- *
- * 2. 普通克吕金(Kriging):该方法假定用于插值的字段值的期望(平均值)未知且恒定。它利用一定的数学函数,通过对给定的空间点进行拟合来估算单元格的值,<br>
- * 生成格网数据集。它不仅可以生成一个表面,还可以给出预测结果的精度或者确定性的度量。因此,此方法计算精度较高,常用于地学领域。
- *
- * 3. 泛克吕金(Universal Kriging):该方法假定用于插值的字段值的期望(平均值)是未知的变量。在样点数据中存在某种主导趋势且该趋势可以通过某一个确定<br>
- * 的函数或者多项式进行拟合的情况下,适用泛克吕金插值法。
- *
- * 克吕金法的优点是以空间统计学作为其坚实的理论基础,物理含义明确;不但能估计测定参数的空间变异分布,而且还可以估算参数的方差分布。克吕金法的缺点是计算步骤较烦琐,
- * 计算量大,且变异函数有时需要根据经验人为选定。
- * @param {Object} options - 参数。
- * @param {string} options.type - 克吕金插值的类型。
- * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
- * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。
- * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
- * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
- * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
- * @param {number} [options.mean] - 【简单克吕金】类型下,插值字段的平均值。
- * @param {number} [options.angle=0] - 克吕金算法中旋转角度值。
- * @param {number} [options.nugget=0] - 克吕金算法中块金效应值。
- * @param {number} [options.range=0] - 克吕金算法中自相关阈值,单位与原数据集单位相同。
- * @param {number} [options.sill=0] - 克吕金算法中基台值。
- * @param {string} [options.variogramMode="SPHERICAL"] - 克吕金插值时的半变函数类型。
- * @param {string} [options.exponent='exp1'] - 【泛克吕金】类型下,用于插值的样点数据中趋势面方程的阶数,可选值为 exp1、exp2。
- * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置待查找的点数;【定长查找】方式下,设置查找的最小点数。
- * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置参与运算点的查找范围。
- * @param {number} [options.maxPointCountForInterpolation=200] - 【块查找】方式下,设置最多参与插值的点数。
- * @param {number} [options.maxPointCountInNode=50] - 【块查找】方式下,设置单个块内最多参与运算点数。
- * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
- * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
- * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
- * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
- * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如 ”数据集名称@数据源别名” 形式来表示。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时。
- * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystType)为 geometry 时。
- * @extends {SuperMap.InterpolationAnalystParameters}
- * @example 例如:
- * var myInterpolationKrigingAnalystParameters = new SuperMap.InterpolationKrigingAnalystParameters({
- * dataset:"SamplesP@Interpolation",
- * type: "KRIGING",
- * angle: 0,
- * mean: 5,
- * nugget: 30,
- * range: 50,
- * sill: 300,
- * variogramMode: "EXPONENTIAL",
- * searchMode: "QUADTREE",
- * maxPointCountForInterpolation: 20,
- * maxPointCountInNode: 5,
- * pixelFormat: "BIT16",
- * zValueFieldName: "AVG_TMP",
- * resolution: 30000,
- * filterQueryParameter: {
- * attributeFilter: ""
- * },
- * outputDatasetName: "myKriging"
- * });
- *
- */
- var InterpolationKrigingAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
- InterpolationKrigingAnalystParameters_inherits(InterpolationKrigingAnalystParameters, _InterpolationAnalyst);
- var _super = InterpolationKrigingAnalystParameters_createSuper(InterpolationKrigingAnalystParameters);
- function InterpolationKrigingAnalystParameters(options) {
- var _this;
- InterpolationKrigingAnalystParameters_classCallCheck(this, InterpolationKrigingAnalystParameters);
- _this = _super.call(this, options);
- /**
- * @member {SuperMap.InterpolationAlgorithmType} SuperMap.InterpolationKrigingAnalystParameters.prototype.type
- * @description 克吕金插值的类型。
- * 具体如下:<br>
- * {KRIGING} 普通克吕金插值法。
- * {SimpleKriging} 简单克吕金插值法。
- * {UniversalKriging} 泛克吕金插值法。
- */
- _this.type = null;
- /**
- * @member {number} SuperMap.InterpolationKrigingAnalystParameters.prototype.mean
- * @description 【简单克吕金】方式下,插值字段的平均值。
- * 即采样点插值字段值总和除以采样点数目。
- */
- _this.mean = null;
- /**
- * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.angle=0]
- * @description 克吕金算法中旋转角度值。
- * 此角度值指示了每个查找邻域相对于水平方向逆时针旋转的角度。
- */
- _this.angle = 0;
- /**
- * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.nugget=0]
- * @description 克吕金算法中块金效应值。
- */
- _this.nugget = 0;
- /**
- * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.range=0]
- * @description 克吕金算法中自相关阈值,单位与原数据集单位相同。
- */
- _this.range = 0;
- /**
- * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.sill=0]
- * @description 克吕金算法中基台值。
- */
- _this.sill = 0;
- /**
- * @member {SuperMap.VariogramMode} [SuperMap.InterpolationKrigingAnalystParameters.prototype.variogramMode=SuperMap.VariogramMode.SPHERICAL]
- * @description 克吕金插值时的半变函数类型。
- * 用户所选择的半变函数类型会影响未知点的预测,特别是曲线在原点处的不同形状有重要意义。
- * 曲线在原点处越陡,则较近领域对该预测值的影响就越大,因此输出表面就会越不光滑。
- */
- _this.variogramMode = VariogramMode.SPHERICAL;
- /**
- * @member {SuperMap.Exponent} [SuperMap.InterpolationKrigingAnalystParameters.prototype.exponent=SuperMap.Exponent.EXP1]
- * @description 【泛克吕金】类型下,用于插值的样点数据中趋势面方程的阶数。
- */
- _this.exponent = Exponent.EXP1;
- /**
- * @member {SuperMap.SearchMode} SuperMap.InterpolationKrigingAnalystParameters.prototype.searchMode
- * @description 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。必设参数。
- * 简单克吕金和泛克吕金不支持块查找。
- * 具体如下:<br>
- * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。<br>
- * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。<br>
- * {QUADTREE} 使用 QUADTREE 方式查找参与内插分析的点(块查找)。
- */
- _this.searchMode = null;
- /**
- * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.expectedCount=12]
- * @description 【固定点数查找】方式下,设置待查找的点数,即参与差值运算的点数,默认值为12。
- * 【定长查找】方式下,设置查找的最小点数,默认值为12。
- */
- _this.expectedCount = 12;
- /**
- * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.maxPointCountForInterpolation=200]
- * @description 【块查找】方式下,最多参与插值的点数。
- * 仅用于普通克吕金插值,简单克吕金和泛克吕金不支持块查找。
- */
- _this.maxPointCountForInterpolation = 200;
- /**
- * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.maxPointCountForInterpolation=50]
- * @description 【块查找】方式下,设置单个块内最多参与运算点数。
- * 仅用于普通克吕金插值,简单克吕金和泛克吕金不支持块查找。
- */
- _this.maxPointCountInNode = 50;
- if (options) {
- Util.extend(InterpolationKrigingAnalystParameters_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.InterpolationKrigingAnalystParameters";
- return _this;
- }
- /**
- * @function SuperMap.InterpolationKrigingAnalystParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- InterpolationKrigingAnalystParameters_createClass(InterpolationKrigingAnalystParameters, [{
- key: "destroy",
- value: function destroy() {
- InterpolationKrigingAnalystParameters_get(InterpolationKrigingAnalystParameters_getPrototypeOf(InterpolationKrigingAnalystParameters.prototype), "destroy", this).call(this);
- var me = this;
- me.type = null;
- me.mean = null;
- me.angle = null;
- me.nugget = null;
- me.range = null;
- me.sill = null;
- me.variogramMode = null;
- me.exponent = null;
- me.searchMode = null;
- me.expectedCount = null;
- me.maxPointCountForInterpolation = null;
- me.maxPointCountInNode = null;
- }
- }]);
- return InterpolationKrigingAnalystParameters;
- }(InterpolationAnalystParameters);
- SuperMap.InterpolationKrigingAnalystParameters = InterpolationKrigingAnalystParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationAnalystService.js
- 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); }
- function InterpolationAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function InterpolationAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function InterpolationAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function InterpolationAnalystService_setPrototypeOf(o, p) { InterpolationAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationAnalystService_setPrototypeOf(o, p); }
- 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); }; }
- function InterpolationAnalystService_possibleConstructorReturn(self, call) { if (call && (InterpolationAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return InterpolationAnalystService_assertThisInitialized(self); }
- function InterpolationAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function InterpolationAnalystService_getPrototypeOf(o) { InterpolationAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationAnalystService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.InterpolationAnalystService
- * @category iServer SpatialAnalyst InterpolationAnalyst
- * @classdesc 插值分析服务类。
- * 插值分析可以将有限的采样点数据,通过插值算法对采样点周围的数值情况进行预测,可以掌握研究区域内数据的总体分布状况,从而使采样的离散点不仅仅反映其所在位置的数值情况,
- * 还可以反映区域的数值分布。目前SuperMap iServer的插值功能提供从点数据集插值得到栅格数据集的功能,支持以下常用的内插方法,
- * 包括:反距离加权插值、克吕金(Kriging)插值法、样条(径向基函数,Radial Basis Function)插值、点密度插值。
- * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
- * @param {Object} options - 参数。</br>
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {SuperMap.SpatialAnalystBase}
- * @example 例如:
- * (start code)
- * var myTInterpolationAnalystService = new SuperMap.InterpolationAnalystService(url);
- * myTInterpolationAnalystService.events.on({
- * "processCompleted": processCompleted,
- * "processFailed": processFailed
- * }
- * );
- * (end)
- *
- */
- var InterpolationAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
- InterpolationAnalystService_inherits(InterpolationAnalystService, _SpatialAnalystBase);
- var _super = InterpolationAnalystService_createSuper(InterpolationAnalystService);
- function InterpolationAnalystService(url, options) {
- var _this;
- InterpolationAnalystService_classCallCheck(this, InterpolationAnalystService);
- _this = _super.call(this, url, options);
- /**
- * @member {string} SuperMap.InterpolationAnalystService.prototype.mode
- * @description 插值分析类型。
- */
- _this.mode = null;
- if (options) {
- Util.extend(InterpolationAnalystService_assertThisInitialized(_this), options);
- }
- return _this;
- }
- /**
- * @function SuperMap.InterpolationAnalystService.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- InterpolationAnalystService_createClass(InterpolationAnalystService, [{
- key: "destroy",
- value: function destroy() {
- InterpolationAnalystService_get(InterpolationAnalystService_getPrototypeOf(InterpolationAnalystService.prototype), "destroy", this).call(this);
- this.mode = null;
- this.CLASS_NAME = "SuperMap.InterpolationAnalystService";
- }
- /**
- * @function SuperMap.InterpolationAnalystService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.InterpolationAnalystParameters} parameter - 插值分析参数类。
- */
- }, {
- key: "processAsync",
- value: function processAsync(parameter) {
- var parameterObject = {};
- var me = this;
- if (parameter instanceof InterpolationDensityAnalystParameters) {
- me.mode = 'Density';
- if (parameter.InterpolationAnalystType === 'geometry') {
- me.url = Util.urlPathAppend(me.url, 'geometry/interpolation/density');
- } else {
- me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/density');
- }
- } else if (parameter instanceof InterpolationIDWAnalystParameters) {
- me.mode = 'IDW';
- if (parameter.InterpolationAnalystType === 'geometry') {
- me.url = Util.urlPathAppend(me.url, 'geometry/interpolation/idw');
- } else {
- me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/idw');
- }
- } else if (parameter instanceof InterpolationRBFAnalystParameters) {
- me.mode = 'RBF';
- if (parameter.InterpolationAnalystType === 'geometry') {
- me.url = Util.urlPathAppend(me.url, 'geometry/interpolation/rbf');
- } else {
- me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/rbf');
- }
- } else if (parameter instanceof InterpolationKrigingAnalystParameters) {
- me.mode = 'Kriging';
- if (parameter.InterpolationAnalystType === 'geometry') {
- me.url = Util.urlPathAppend(me.url, 'geometry/interpolation/kriging');
- } else {
- me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/kriging');
- }
- }
- InterpolationAnalystParameters.toObject(parameter, parameterObject);
- var jsonParameters = Util.toJSON(parameterObject);
- me.url = Util.urlAppend(me.url, 'returnContent=true');
- me.request({
- method: "POST",
- data: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return InterpolationAnalystService;
- }(SpatialAnalystBase);
- SuperMap.InterpolationAnalystService = InterpolationAnalystService;
- ;// CONCATENATED MODULE: ./src/common/iServer/KernelDensityJobParameter.js
- function KernelDensityJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function KernelDensityJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) KernelDensityJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) KernelDensityJobParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.KernelDensityJobParameter
- * @category iServer ProcessingService DensityAnalyst
- * @classdesc 密度分析任务参数类。
- * @param {Object} options - 参数。
- * @param {string} options.datasetName - 数据集名。
- * @param {string} options.fields - 权重索引。
- * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.query] - 分析范围(默认为全图范围)。
- * @param {number} [options.resolution=80] - 分辨率。
- * @param {number} [options.method=0] - 分析方法。
- * @param {number} [options.meshType=0] - 分析类型。
- * @param {number} [options.radius=300] - 分析的影响半径。
- * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
- * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
- */
- var KernelDensityJobParameter = /*#__PURE__*/function () {
- function KernelDensityJobParameter(options) {
- KernelDensityJobParameter_classCallCheck(this, KernelDensityJobParameter);
- if (!options) {
- return;
- }
- /**
- * @member {string} SuperMap.KernelDensityJobParameter.prototype.datasetName
- * @description 数据集名。
- */
- this.datasetName = "";
- /**
- * @member {SuperMap.Bounds|L.Bounds|ol.extent} [SuperMap.KernelDensityJobParameter.prototype.query]
- * @description 分析范围。
- */
- this.query = "";
- /**
- * @member {number} [SuperMap.KernelDensityJobParameter.prototype.resolution=80]
- * @description 网格大小。
- */
- this.resolution = 80;
- /**
- * @member {number} [SuperMap.KernelDensityJobParameter.prototype.method=0]
- * @description 分析方法。
- */
- this.method = 0;
- /**
- * @member {number} [SuperMap.KernelDensityJobParameter.prototype.meshType=0]
- * @description 分析类型。
- */
- this.meshType = 0;
- /**
- * @member {string} SuperMap.KernelDensityJobParameter.prototype.fields
- * @description 权重索引。
- */
- this.fields = "";
- /**
- * @member {number} [SuperMap.KernelDensityJobParameter.prototype.radius=300]
- * @description 分析的影响半径。
- */
- this.radius = 300;
- /**
- * @member {SuperMap.AnalystSizeUnit} [SuperMap.KernelDensityJobParameter.prototype.meshSizeUnit=SuperMap.AnalystSizeUnit.METER]
- * @description 网格大小单位。
- */
- this.meshSizeUnit = AnalystSizeUnit.METER;
- /**
- * @member {SuperMap.AnalystSizeUnit} [SuperMap.KernelDensityJobParameter.prototype.radiusUnit=SuperMap.AnalystSizeUnit.METER]
- * @description 搜索半径单位。
- */
- this.radiusUnit = AnalystSizeUnit.METER;
- /**
- * @member {SuperMap.AnalystAreaUnit} [SuperMap.KernelDensityJobParameter.prototype.areaUnit=SuperMap.AnalystAreaUnit.SQUAREMILE]
- * @description 面积单位。
- */
- this.areaUnit = AnalystAreaUnit.SQUAREMILE;
- /**
- * @member {SuperMap.OutputSetting} SuperMap.KernelDensityJobParameter.prototype.output
- * @description 输出参数设置类
- */
- this.output = null;
- /**
- * @member {SuperMap.MappingParameters} [SuperMap.KernelDensityJobParameter.prototype.mappingParameters]
- * @description 分析后结果可视化的参数类。
- */
- this.mappingParameters = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.KernelDensityJobParameter";
- }
- /**
- * @function SuperMap.KernelDensityJobParameter.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- KernelDensityJobParameter_createClass(KernelDensityJobParameter, [{
- key: "destroy",
- value: function destroy() {
- this.datasetName = null;
- this.query = null;
- this.resolution = null;
- this.method = null;
- this.radius = null;
- this.meshType = null;
- this.fields = null;
- this.meshSizeUnit = null;
- this.radiusUnit = null;
- this.areaUnit = null;
- if (this.output instanceof OutputSetting) {
- this.output.destroy();
- this.output = null;
- }
- if (this.mappingParameters instanceof MappingParameters) {
- this.mappingParameters.destroy();
- this.mappingParameters = null;
- }
- }
- /**
- * @function SuperMap.KernelDensityJobParameter.toObject
- * @param {SuperMap.KernelDensityJobParameter} kernelDensityJobParameter - 密度分析任务参数类。
- * @param {SuperMap.KernelDensityJobParameter} tempObj - 密度分析任务参数对象。
- * @description 将密度分析任务参数对象转换为 JSON 对象。
- * @returns JSON 对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(kernelDensityJobParameter, tempObj) {
- for (var name in kernelDensityJobParameter) {
- if (name === "datasetName") {
- tempObj['input'] = tempObj['input'] || {};
- tempObj['input'][name] = kernelDensityJobParameter[name];
- continue;
- }
- if (name === "output") {
- tempObj['output'] = tempObj['output'] || {};
- tempObj['output'] = kernelDensityJobParameter[name];
- continue;
- }
- tempObj['analyst'] = tempObj['analyst'] || {};
- if (name === 'query' && kernelDensityJobParameter[name]) {
- tempObj['analyst'][name] = kernelDensityJobParameter[name].toBBOX();
- } else {
- tempObj['analyst'][name] = kernelDensityJobParameter[name];
- }
- if (name === 'mappingParameters') {
- tempObj['analyst'][name] = tempObj['analyst'][name] || {};
- tempObj['analyst']['mappingParameters'] = kernelDensityJobParameter[name];
- }
- }
- }
- }]);
- return KernelDensityJobParameter;
- }();
- SuperMap.KernelDensityJobParameter = KernelDensityJobParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/KernelDensityJobsService.js
- 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); }
- function KernelDensityJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function KernelDensityJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) KernelDensityJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) KernelDensityJobsService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function KernelDensityJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = KernelDensityJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function KernelDensityJobsService_setPrototypeOf(o, p) { KernelDensityJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return KernelDensityJobsService_setPrototypeOf(o, p); }
- 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); }; }
- function KernelDensityJobsService_possibleConstructorReturn(self, call) { if (call && (KernelDensityJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return KernelDensityJobsService_assertThisInitialized(self); }
- function KernelDensityJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function KernelDensityJobsService_getPrototypeOf(o) { KernelDensityJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return KernelDensityJobsService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.KernelDensityJobsService
- * @category iServer ProcessingService DensityAnalyst
- * @classdesc 核密度分析服务类
- * @extends {SuperMap.ProcessingServiceBase}
- * @param {string} url -核密度分析服务地址。
- * @param {Object} options - 交互服务时所需可选参数。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var KernelDensityJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
- KernelDensityJobsService_inherits(KernelDensityJobsService, _ProcessingServiceBas);
- var _super = KernelDensityJobsService_createSuper(KernelDensityJobsService);
- function KernelDensityJobsService(url, options) {
- var _this;
- KernelDensityJobsService_classCallCheck(this, KernelDensityJobsService);
- _this = _super.call(this, url, options);
- _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/density');
- _this.CLASS_NAME = "SuperMap.KernelDensityJobsService";
- return _this;
- }
- /**
- * @function SuperMap.KernelDensityJobsService.prototype.destroy
- * @override
- */
- KernelDensityJobsService_createClass(KernelDensityJobsService, [{
- key: "destroy",
- value: function destroy() {
- KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.KernelDensityJobsService.prototype.getKernelDensityJobs
- * @description 获取核密度分析任务
- */
- }, {
- key: "getKernelDensityJobs",
- value: function getKernelDensityJobs() {
- KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "getJobs", this).call(this, this.url);
- }
- /**
- * @function SuperMap.KernelDensityJobsService.prototype.getKernelDensityJobs
- * @description 获取指定id的核密度分析服务
- * @param {string} id - 指定要获取数据的id
- */
- }, {
- key: "getKernelDensityJob",
- value: function getKernelDensityJob(id) {
- KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
- }
- /**
- * @function SuperMap.KernelDensityJobsService.prototype.addKernelDensityJob
- * @description 新建核密度分析服务
- * @param {SuperMap.KernelDensityJobParameter} params - 创建一个空间分析的请求参数。
- * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
- */
- }, {
- key: "addKernelDensityJob",
- value: function addKernelDensityJob(params, seconds) {
- KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "addJob", this).call(this, this.url, params, KernelDensityJobParameter, seconds);
- }
- }]);
- return KernelDensityJobsService;
- }(ProcessingServiceBase);
- SuperMap.KernelDensityJobsService = KernelDensityJobsService;
- ;// CONCATENATED MODULE: ./src/common/iServer/LabelMatrixCell.js
- function LabelMatrixCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.LabelMatrixCell
- * @category iServer Map Theme
- * @classdesc 矩阵标签元素抽象类。
- * @description 该类可以包含 n*n 个矩阵标签元素,矩阵标签元素的类型可以是图片,符号,标签专题图等。
- * 符号类型的矩阵标签元素类、图片类型的矩阵标签元素类和专题图类型的矩阵标签元素类均继承自该类。
- */
- var LabelMatrixCell = function LabelMatrixCell() {
- LabelMatrixCell_classCallCheck(this, LabelMatrixCell);
- this.CLASS_NAME = "LabelMatrixCell";
- };
- SuperMap.LabelMatrixCell = LabelMatrixCell;
- ;// CONCATENATED MODULE: ./src/common/iServer/LabelImageCell.js
- 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); }
- function LabelImageCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function LabelImageCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelImageCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelImageCell_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function LabelImageCell_setPrototypeOf(o, p) { LabelImageCell_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LabelImageCell_setPrototypeOf(o, p); }
- 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); }; }
- function LabelImageCell_possibleConstructorReturn(self, call) { if (call && (LabelImageCell_typeof(call) === "object" || typeof call === "function")) { return call; } return LabelImageCell_assertThisInitialized(self); }
- function LabelImageCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function LabelImageCell_getPrototypeOf(o) { LabelImageCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelImageCell_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.LabelImageCell
- * @category iServer Map Theme
- * @classdesc 图片类型的矩阵标签元素类。
- * @description 该类继承自 {@link SuperMap.LabelMatrixCell}类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
- * 矩阵标签专题图是标签专题图(ThemeLabel)的一种,其中矩阵标签中的填充元素又可分为图片类型({@link SuperMap.LabelImageCell})、
- * 符号类型({@link SuperMap.LabelSymbolCell})、专题图类型({@link SuperMap.LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
- * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应) 、大小等。
- * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link SuperMap.ThemeLabel.matrixCells} 属性即可。matrixCells 是一个二维数组,
- * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
- * @extends {SuperMap.LabelMatrixCell}
- * @param {Object} options - 参数。
- * @param {number} [options.height=0] - 设置图片的高度,单位为毫米。
- * @param {string} [options.pathField] - 设置矩阵标签元素所使用图片的路径。
- * @param {number} [options.rotation=0.0] - 图片的旋转角度。逆时针方向为正方向,单位为度,精确到0.1度。
- * @param {number} [options.width=0] - 设置图片的宽度,单位为毫米。
- * @param {boolean} [options.sizeFixed=false] - 是否固定图片的大小。
- */
- var LabelImageCell = /*#__PURE__*/function (_LabelMatrixCell) {
- LabelImageCell_inherits(LabelImageCell, _LabelMatrixCell);
- var _super = LabelImageCell_createSuper(LabelImageCell);
- function LabelImageCell(options) {
- var _this;
- LabelImageCell_classCallCheck(this, LabelImageCell);
- _this = _super.call(this, options);
- /**
- * @member {number} SuperMap.LabelImageCell.prototype.height
- * @description 设置图片的高度,单位为毫米。
- */
- _this.height = 0;
- /**
- * @member {string} SuperMap.LabelImageCell.prototype.pathField
- * @description 设置矩阵标签元素所使用的图片路径对应的字段名。
- */
- _this.pathField = null;
- /**
- * @member {number} [SuperMap.LabelImageCell.prototype.rotation=0.0]
- * @description 图片的旋转角度。逆时针方向为正方向,单位为度,精确到0.1度。
- */
- _this.rotation = 0.0;
- /**
- * @member {number} SuperMap.LabelImageCell.prototype.width
- * @description 设置图片的宽度,单位为毫米。
- */
- _this.width = 0;
- /**
- * @member {boolean} [SuperMap.LabelImageCell.prototype.sizeFixed=false]
- * @description 是否固定图片的大小。
- */
- _this.sizeFixed = false;
- /**
- * @member {string} SuperMap.LabelImageCell.prototype.type
- * @description 制作矩阵专题图时是必须的。
- */
- _this.type = "IMAGE";
- if (options) {
- Util.extend(LabelImageCell_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.LabelImageCell";
- return _this;
- }
- /**
- * @function SuperMap.LabelImageCell.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- LabelImageCell_createClass(LabelImageCell, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.height = null;
- me.pathField = null;
- me.rotation = null;
- me.width = null;
- me.sizeFixed = null;
- }
- }]);
- return LabelImageCell;
- }(LabelMatrixCell);
- SuperMap.LabelImageCell = LabelImageCell;
- ;// CONCATENATED MODULE: ./src/common/iServer/LabelSymbolCell.js
- 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); }
- function LabelSymbolCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function LabelSymbolCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelSymbolCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelSymbolCell_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function LabelSymbolCell_setPrototypeOf(o, p) { LabelSymbolCell_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LabelSymbolCell_setPrototypeOf(o, p); }
- 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); }; }
- function LabelSymbolCell_possibleConstructorReturn(self, call) { if (call && (LabelSymbolCell_typeof(call) === "object" || typeof call === "function")) { return call; } return LabelSymbolCell_assertThisInitialized(self); }
- function LabelSymbolCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function LabelSymbolCell_getPrototypeOf(o) { LabelSymbolCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelSymbolCell_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.LabelSymbolCell
- * @category iServer Map Theme
- * @classdesc 符号类型的矩阵标签元素类。
- * @description 该类继承自 {@link SuperMap.LabelMatrixCell}类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
- * 矩阵标签专题图是标签专题图({@link SuperMap.ThemeLabel})的一种,其中矩阵标签中的填充元素又可分为图片类型({@link SuperMap.LabelImageCell})、
- * 符号类型({@link SuperMap.LabelSymbolCell})、专题图类型({@link SuperMap.LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
- * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应) 、大小等。
- * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link SuperMap.ThemeLabel.matrixCells} 属性即可。matrixCells 属是一个二维数组,
- * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
- * @extends {SuperMap.LabelMatrixCell}
- * @param {Object} options - 参数。
- * @param {SuperMap.ServerStyle} options.style - 获取或设置符号样式。
- * @param {string} options.symbolIDField - 符号 ID 或符号 ID 所对应的字段名称。
- */
- var LabelSymbolCell = /*#__PURE__*/function (_LabelMatrixCell) {
- LabelSymbolCell_inherits(LabelSymbolCell, _LabelMatrixCell);
- var _super = LabelSymbolCell_createSuper(LabelSymbolCell);
- function LabelSymbolCell(options) {
- var _this;
- LabelSymbolCell_classCallCheck(this, LabelSymbolCell);
- _this = _super.call(this, options);
- /**
- * @member {SuperMap.ServerStyle} SuperMap.LabelSymbolCell.prototype.style
- * @description 获取或设置符号样式—— {@link SuperMap.ServerStyle} 对象,包括符号大小({@link SuperMap.ServerStyle.markerSize})
- * 和符号旋转({@link SuperMap.ServerStyle.markerAngle})角度,其中用于设置符号 ID 的属性({@link SuperMap.ServerStyle.markerSymbolID})在此处不起作用。
- */
- _this.style = new ServerStyle();
- /**
- * @member {string} SuperMap.LabelSymbolCell.prototype.symbolIDField
- * @description 获取或设置符号 ID 或符号 ID 所对应的字段名称。
- */
- _this.symbolIDField = null;
- /**
- * @member {string} SuperMap.LabelSymbolCell.prototype.type
- * @description 制作矩阵专题图时是必须的。
- */
- _this.type = "SYMBOL";
- if (options) {
- Util.extend(LabelSymbolCell_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.LabelSymbolCell";
- return _this;
- }
- /**
- * @function SuperMap.LabelSymbolCell.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- LabelSymbolCell_createClass(LabelSymbolCell, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- if (me.style) {
- me.style.destroy();
- me.style = null;
- }
- me.symbolIDField = null;
- }
- }]);
- return LabelSymbolCell;
- }(LabelMatrixCell);
- SuperMap.LabelSymbolCell = LabelSymbolCell;
- ;// CONCATENATED MODULE: ./src/common/iServer/LabelThemeCell.js
- 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); }
- function LabelThemeCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function LabelThemeCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelThemeCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelThemeCell_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function LabelThemeCell_setPrototypeOf(o, p) { LabelThemeCell_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LabelThemeCell_setPrototypeOf(o, p); }
- 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); }; }
- function LabelThemeCell_possibleConstructorReturn(self, call) { if (call && (LabelThemeCell_typeof(call) === "object" || typeof call === "function")) { return call; } return LabelThemeCell_assertThisInitialized(self); }
- function LabelThemeCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function LabelThemeCell_getPrototypeOf(o) { LabelThemeCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelThemeCell_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.LabelThemeCell
- * @category iServer Map Theme
- * @classdesc 专题图类型的矩阵标签元素类。
- * @description 该类继承自 {@link SuperMap.LabelMatrixCell} 类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
- * 矩阵标签专题图是标签专题图({@link SuperMap.ThemeLabel})的一种,其中矩阵标签中的填充元素又可分为图片类型({@link SuperMap.LabelImageCell})、
- * 符号类型({@link SuperMap.LabelSymbolCell})、专题图类型({@link SuperMap.LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
- * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应) 、大小等。
- * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link SuperMap.ThemeLabel.matrixCells} 属性即可。matrixCells 属是一个二维数组,
- * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
- * @extends {SuperMap.LabelMatrixCell}
- * @param {Object} options -参数。
- * @param {SuperMap.ThemeLabel} options.themeLabel - 使用专题图对象作为矩阵标签的一个元素。
- */
- var LabelThemeCell = /*#__PURE__*/function (_LabelMatrixCell) {
- LabelThemeCell_inherits(LabelThemeCell, _LabelMatrixCell);
- var _super = LabelThemeCell_createSuper(LabelThemeCell);
- function LabelThemeCell(options) {
- var _this;
- LabelThemeCell_classCallCheck(this, LabelThemeCell);
- _this = _super.call(this, options);
- /**
- * @member {SuperMap.ThemeLabel} SuperMap.LabelThemeCell.prototype.themeLabel
- * @description 使用专题图对象作为矩阵标签的一个元素。
- */
- _this.themeLabel = new ThemeLabel();
- /**
- * @member {string} SuperMap.LabelThemeCell.prototype.type
- * @description 制作矩阵专题图时是必须的。
- */
- _this.type = "THEME";
- if (options) {
- Util.extend(LabelThemeCell_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = " SuperMap.LabelThemeCell";
- return _this;
- }
- /**
- * @function SuperMap.LabelThemeCell.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- LabelThemeCell_createClass(LabelThemeCell, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- if (me.themeLabel) {
- me.themeLabel.destroy();
- me.themeLabel = null;
- }
- }
- }]);
- return LabelThemeCell;
- }(LabelMatrixCell);
- SuperMap.LabelThemeCell = LabelThemeCell;
- ;// CONCATENATED MODULE: ./src/common/iServer/LayerStatus.js
- function LayerStatus_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function LayerStatus_createClass(Constructor, protoProps, staticProps) { if (protoProps) LayerStatus_defineProperties(Constructor.prototype, protoProps); if (staticProps) LayerStatus_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.LayerStatus
- * @category iServer Map Theme
- * @classdesc 子图层显示参数类。
- * @description 该类存储了各个子图层的名字和是否可见的状态。
- * @param {Object} options - 参数。
- * @param {string} options.layerName - 获取或设置图层名称。
- * @param {boolean} [options.isVisible=true] - 获取或设置图层是否可见,true 表示可见。
- * @param {string} [options.displayFilter] - 图层显示 SQL 过滤条件。
- */
- var LayerStatus = /*#__PURE__*/function () {
- function LayerStatus(options) {
- LayerStatus_classCallCheck(this, LayerStatus);
- /**
- * @member {string} SuperMap.LayerStatus.prototype.layerName
- * @description 获取或设置图层名称。
- */
- this.layerName = null;
- /**
- * @member {boolean} SuperMap.LayerStatus.prototype.isVisible
- * @description 获取或设置图层是否可见,true 表示可见。
- */
- this.isVisible = null;
- /**
- * @member {string} [SuperMap.LayerStatus.prototype.displayFilter]
- * @description 图层显示 SQL 过滤条件,如 layerStatus.displayFilter = "smid < 10",表示仅显示 smid 值小于 10 的对象。
- */
- this.displayFilter = null;
- /**
- * @member {Object} [SuperMap.LayerStatus.prototype.fieldValuesDisplayFilter]
- * @property {Array.<number>} values - 要过滤的值。
- * @property {string} fieldName - 要过滤的字段名称只支持数字类型的字段。
- * @property {string} fieldValuesDisplayMode - 目前有两个 DISPLAY/DISABLE。当为 DISPLAY 时,表示只显示以上设置的相应属性值的要素,否则表示不显示以上设置的相应属性值的要素。
- */
- this.fieldValuesDisplayFilter = null;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.LayerStatus";
- }
- /**
- * @function SuperMap.LayerStatus.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- LayerStatus_createClass(LayerStatus, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.layerName = null;
- me.isVisible = null;
- me.displayFilter = null;
- }
- /**
- * @function SuperMap.LayerStatus.prototype.toJSON
- * @description 生成对应的 JSON。
- * @returns {Object} 对应的 JSON。
- */
- }, {
- key: "toJSON",
- value: function toJSON() {
- var json = '{';
- json += '"type":"UGC",';
- var v = [];
- if (this.layerName) {
- v.push('"name":"' + this.layerName + '"');
- v.push('"visible":' + this.isVisible);
- }
- if (this.displayFilter) {
- v.push('"displayFilter":"' + this.displayFilter + '"');
- }
- if (this.minScale || this.minScale == 0) {
- v.push('"minScale":' + this.minScale);
- }
- if (this.maxScale || this.maxScale == 0) {
- v.push('"maxScale":' + this.maxScale);
- }
- if (this.fieldValuesDisplayFilter) {
- v.push('"fieldValuesDisplayFilter":' + Util.toJSON(this.fieldValuesDisplayFilter));
- }
- json += v;
- json += '}';
- return json;
- }
- }]);
- return LayerStatus;
- }();
- SuperMap.LayerStatus = LayerStatus;
- ;// CONCATENATED MODULE: ./src/common/iServer/MapService.js
- 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); }
- function MapService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function MapService_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapService_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function MapService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MapService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function MapService_setPrototypeOf(o, p) { MapService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MapService_setPrototypeOf(o, p); }
- 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); }; }
- function MapService_possibleConstructorReturn(self, call) { if (call && (MapService_typeof(call) === "object" || typeof call === "function")) { return call; } return MapService_assertThisInitialized(self); }
- function MapService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function MapService_getPrototypeOf(o) { MapService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MapService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.MapService
- * @category iServer Map
- * @classdesc 地图信息服务类。
- * @extends {SuperMap.CommonServiceBase}
- * @example
- * var myMapService = new SuperMap.MapService(url, {
- * eventListeners:{
- * "processCompleted": MapServiceCompleted,
- * "processFailed": MapServiceFailed
- * }
- * });
- *
- * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var MapService = /*#__PURE__*/function (_CommonServiceBase) {
- MapService_inherits(MapService, _CommonServiceBase);
- var _super = MapService_createSuper(MapService);
- function MapService(url, options) {
- var _this;
- MapService_classCallCheck(this, MapService);
- _this = _super.call(this, url, options);
- /**
- * @member {string} SuperMap.MapService.prototype.projection
- * @description 根据投影参数获取地图状态信息。如"EPSG:4326"
- */
- _this.projection = null;
- _this.CLASS_NAME = "SuperMap.MapService";
- if (options) {
- Util.extend(MapService_assertThisInitialized(_this), options);
- }
- var me = MapService_assertThisInitialized(_this);
- if (me.projection) {
- var arr = me.projection.split(":");
- if (arr instanceof Array) {
- if (arr.length === 2) {
- me.url = Util.urlAppend(me.url, "prjCoordSys=".concat(encodeURIComponent("{\"epsgCode\":\"".concat(arr[1], "\"}"))));
- }
- if (arr.length === 1) {
- me.url = Util.urlAppend(me.url, "prjCoordSys=".concat(encodeURIComponent("{\"epsgCode\":\"".concat(arr[0], "\"}"))));
- }
- }
- }
- return _this;
- }
- /**
- * @function destroy
- * @description 释放资源,将引用的资源属性置空。
- */
- MapService_createClass(MapService, [{
- key: "destroy",
- value: function destroy() {
- MapService_get(MapService_getPrototypeOf(MapService.prototype), "destroy", this).call(this);
- var me = this;
- if (me.events) {
- me.events.un(me.eventListeners);
- me.events.listeners = null;
- me.events.destroy();
- me.events = null;
- me.eventListeners = null;
- }
- }
- /**
- * @function SuperMap.MapService.prototype.processAsync
- * @description 负责将客户端的设置的参数传递到服务端,与服务端完成异步通讯。
- */
- }, {
- key: "processAsync",
- value: function processAsync() {
- var me = this;
- me.request({
- method: "GET",
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /*
- * Method: getMapStatusCompleted
- * 获取地图状态完成,执行此方法。
- *
- * Parameters:
- * {Object} result - 服务器返回的结果对象。
- */
- }, {
- key: "serviceProcessCompleted",
- value: function serviceProcessCompleted(result) {
- var me = this;
- result = Util.transformResult(result);
- var codeStatus = result.code >= 200 && result.code < 300 || result.code == 0 || result.code === 304;
- var isCodeValid = result.code && codeStatus;
- if (!result.code || isCodeValid) {
- me.events && me.events.triggerEvent("processCompleted", {
- result: result
- });
- } else {
- ////在没有token是返回的是200,但是其实是没有权限,所以这里也应该是触发失败事件
- me.events.triggerEvent("processFailed", {
- error: result
- });
- }
- }
- }]);
- return MapService;
- }(CommonServiceBase);
- SuperMap.MapService = MapService;
- ;// CONCATENATED MODULE: ./src/common/iServer/MathExpressionAnalysisParameters.js
- function MathExpressionAnalysisParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function MathExpressionAnalysisParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) MathExpressionAnalysisParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) MathExpressionAnalysisParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.MathExpressionAnalysisParameters
- * @category iServer SpatialAnalyst GridMathAnalyst
- * @classdesc 栅格代数运算参数类。
- * @param {Object} options - 参数。
- * @param {string} options.dataset - 要用来做栅格代数运算数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示,例如:BaseMap_P@Jingjin。
- * @param {string} options.resultGridName - 指定结果数据集名称。
- * @param {string} options.expression - 指定的栅格运算表达式。如:[DatasourceAlias1.Raster1]*2-10。
- * @param {string} options.targetDatasource - 指定存储结果数据集的数据源。
- * @param {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [options.extractRegion] - 栅格代数运算的范围,指定数据集中参与栅格代数运算的区域。
- * 如果缺省,则计算全部区域,如果参与运算的数据集范围不一致,将使用所有数据集的范围的交集作为计算区域 。
- * @param {boolean} [options.isZip=false] - 是否对结果数据集进行压缩处理。
- * @param {boolean} [options.ignoreNoValue=false] - 是否忽略无值栅格数据。true 表示忽略无值数据,即无值栅格不参与运算。
- * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
- */
- var MathExpressionAnalysisParameters = /*#__PURE__*/function () {
- function MathExpressionAnalysisParameters(options) {
- MathExpressionAnalysisParameters_classCallCheck(this, MathExpressionAnalysisParameters);
- if (!options) {
- return;
- }
- /**
- * @member {string} SuperMap.MathExpressionAnalysisParameters.prototype.dataset
- * @description 要用来做栅格代数运算数据源中数据集的名称。
- * 该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
- *
- */
- this.dataset = null;
- /**
- * @member {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [SuperMap.MathExpressionAnalysisParameters.prototype.extractRegion]
- * @description 栅格代数运算的范围,指定数据集中参与栅格代数运算的区域。
- * 如果缺省,则计算全部区域,如果参与运算的数据集范围不一致,将使用所有数据集的范围的交集作为计算区域 。
- */
- this.extractRegion = null;
- /**
- * @member {string} SuperMap.MathExpressionAnalysisParameters.prototype.expression
- * @description 指定的栅格运算表达式。如:"[DatasourceAlias1.Raster1]*2-10"。
- */
- this.expression = null;
- /**
- * @member {boolean} [SuperMap.MathExpressionAnalysisParameters.prototype.isZip=false]
- * @description 是否对结果数据集进行压缩处理。
- */
- this.isZip = false;
- /**
- * @member {boolean} [SuperMap.MathExpressionAnalysisParameters.prototype.ignoreNoValue=false]
- * @description 是否忽略无值栅格数据。
- */
- this.ignoreNoValue = false;
- /**
- * @member {string} SuperMap.MathExpressionAnalysisParameters.prototype.targetDatasource
- * @description 指定存储结果数据集的数据源。
- */
- this.targetDatasource = null;
- /**
- * @member {string} SuperMap.MathExpressionAnalysisParameters.prototype.resultGridName
- * @description 指定结果数据集名称。
- */
- this.resultGridName = null;
- /**
- * @member {boolean} [SuperMap.MathExpressionAnalysisParameters.prototype.deleteExistResultDataset=false]
- * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
- */
- this.deleteExistResultDataset = false;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.MathExpressionAnalysisParameters";
- }
- /**
- * @function SuperMap.MathExpressionAnalysisParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- MathExpressionAnalysisParameters_createClass(MathExpressionAnalysisParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.dataset = null;
- me.bounds = null;
- me.expression = null;
- me.isZip = true;
- me.ignoreNoValue = true;
- me.targetDatasource = null;
- me.resultGridName = null;
- me.deleteExistResultDataset = null;
- }
- /**
- * @function SuperMap.MathExpressionAnalysisParameters.toObject
- * @param {Object} mathExpressionAnalysisParameters - 栅格代数运算参数。
- * @param {Object} tempObj - 目标对象。
- * @description 生成栅格代数运算对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(mathExpressionAnalysisParameters, tempObj) {
- for (var name in mathExpressionAnalysisParameters) {
- if (name !== "dataset") {
- tempObj[name] = mathExpressionAnalysisParameters[name];
- }
- if (name === "extractRegion") {
- if (mathExpressionAnalysisParameters[name]) {
- var bs = mathExpressionAnalysisParameters[name].components[0].components;
- var region = {},
- points = [],
- type = "REGION";
- var len = bs.length;
- for (var i = 0; i < len - 1; i++) {
- var poi = {};
- poi["x"] = bs[i].x;
- poi["y"] = bs[i].y;
- points.push(poi);
- }
- region["points"] = points;
- region["type"] = type;
- tempObj[name] = region;
- }
- }
- }
- }
- }]);
- return MathExpressionAnalysisParameters;
- }();
- SuperMap.MathExpressionAnalysisParameters = MathExpressionAnalysisParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/MathExpressionAnalysisService.js
- 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); }
- function MathExpressionAnalysisService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function MathExpressionAnalysisService_createClass(Constructor, protoProps, staticProps) { if (protoProps) MathExpressionAnalysisService_defineProperties(Constructor.prototype, protoProps); if (staticProps) MathExpressionAnalysisService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function MathExpressionAnalysisService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MathExpressionAnalysisService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function MathExpressionAnalysisService_setPrototypeOf(o, p) { MathExpressionAnalysisService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MathExpressionAnalysisService_setPrototypeOf(o, p); }
- 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); }; }
- function MathExpressionAnalysisService_possibleConstructorReturn(self, call) { if (call && (MathExpressionAnalysisService_typeof(call) === "object" || typeof call === "function")) { return call; } return MathExpressionAnalysisService_assertThisInitialized(self); }
- function MathExpressionAnalysisService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function MathExpressionAnalysisService_getPrototypeOf(o) { MathExpressionAnalysisService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MathExpressionAnalysisService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.MathExpressionAnalysisService
- * @category iServer SpatialAnalyst GridMathAnalyst
- * @classdesc 栅格代数运算服务类。
- * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
- * @param {Object} options - 参数。</br>
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {SuperMap.SpatialAnalystBase}
- * @example 例如:
- * (start code)
- * var myMathExpressionAnalysisService = new SuperMap.MathExpressionAnalysisService(url);
- * myMathExpressionAnalysisService.on({
- * "processCompleted": processCompleted,
- * "processFailed": processFailed
- * }
- * );
- * (end)
- *
- */
- var MathExpressionAnalysisService = /*#__PURE__*/function (_SpatialAnalystBase) {
- MathExpressionAnalysisService_inherits(MathExpressionAnalysisService, _SpatialAnalystBase);
- var _super = MathExpressionAnalysisService_createSuper(MathExpressionAnalysisService);
- function MathExpressionAnalysisService(url, options) {
- var _this;
- MathExpressionAnalysisService_classCallCheck(this, MathExpressionAnalysisService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.MathExpressionAnalysisService";
- return _this;
- }
- /**
- * @override
- */
- MathExpressionAnalysisService_createClass(MathExpressionAnalysisService, [{
- key: "destroy",
- value: function destroy() {
- MathExpressionAnalysisService_get(MathExpressionAnalysisService_getPrototypeOf(MathExpressionAnalysisService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.MathExpressionAnalysisService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.MathExpressionAnalysisParameters} parameter - 栅格代数运算参数类。
- */
- }, {
- key: "processAsync",
- value: function processAsync(parameter) {
- var me = this;
- var parameterObject = {};
- if (parameter instanceof MathExpressionAnalysisParameters) {
- me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/mathanalyst');
- }
- MathExpressionAnalysisParameters.toObject(parameter, parameterObject);
- var jsonParameters = Util.toJSON(parameterObject);
- me.url = Util.urlAppend(me.url, 'returnContent=true');
- me.request({
- method: "POST",
- data: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return MathExpressionAnalysisService;
- }(SpatialAnalystBase);
- SuperMap.MathExpressionAnalysisService = MathExpressionAnalysisService;
- ;// CONCATENATED MODULE: ./src/common/iServer/MeasureParameters.js
- function MeasureParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function MeasureParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) MeasureParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) MeasureParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.MeasureParameters
- * @category iServer Map Measure
- * @classdesc 量算参数类。
- * @param {Object} geometry - 要量算的几何对象。
- * @param {Object} options - 参数。
- * @param {SuperMap.Unit} [options.unit=SuperMap.Unit.METER] - 量算单位。
- * @param {string} [options.prjCoordSys] - 用来指定该量算操作所使用的投影。
- * @param {string} [options.distanceMode="Geodesic"] - 用来指定量算的方式为按球面长度 'Geodesic' 或者平面长度 'Planar' 来计算。
- */
- var MeasureParameters = /*#__PURE__*/function () {
- function MeasureParameters(geometry, options) {
- MeasureParameters_classCallCheck(this, MeasureParameters);
- if (!geometry) {
- return;
- }
- /**
- * @member {Object} SuperMap.MeasureParameters.prototype.geometry
- * @description 要量算的几何对象。<br>
- * 点类型可以是:{@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>
- * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。<br>
- * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
- */
- this.geometry = geometry;
- /**
- * @member {SuperMap.Unit} [SuperMap.MeasureParameters.prototype.unit=SuperMap.Unit.METER]
- * @description 量算单位。即量算结果以米为单位。
- */
- this.unit = Unit.METER;
- /**
- * @member {string} [SuperMap.MeasureParameters.prototype.prjCoordSys]
- * @description 用来指定该量算操作所使用的投影。
- */
- this.prjCoordSys = null;
- /**
- * @member {string} [SuperMap.MeasureParameters.prototype.distanceMode="Geodesic"]
- * @description 用来指定量算的方式为按球面长度 'Geodesic' 或者平面长度 'Planar' 来计算。
- * @example
- * var param = new SuperMap.MeasureParameters(getmetry,{distanceMode:'Planar'});
- */
- this.distanceMode = null;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.MeasureParameters";
- }
- /**
- * @function SuperMap.MeasureParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- MeasureParameters_createClass(MeasureParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.geometry = null;
- me.unit = null;
- me.prjCoordSys = null;
- }
- }]);
- return MeasureParameters;
- }();
- SuperMap.MeasureParameters = MeasureParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/MeasureService.js
- 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); }
- function MeasureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function MeasureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) MeasureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) MeasureService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function MeasureService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MeasureService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function MeasureService_setPrototypeOf(o, p) { MeasureService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MeasureService_setPrototypeOf(o, p); }
- 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); }; }
- function MeasureService_possibleConstructorReturn(self, call) { if (call && (MeasureService_typeof(call) === "object" || typeof call === "function")) { return call; } return MeasureService_assertThisInitialized(self); }
- function MeasureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function MeasureService_getPrototypeOf(o) { MeasureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MeasureService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.MeasureService
- * @category iServer Map Measure
- * @classdesc 量算服务类。
- * 该类负责将量算参数传递到服务端,并获取服务端返回的量算结果。
- * @extends {SuperMap.CommonServiceBase}
- * @example
- * var myMeasuerService = new SuperMap.MeasureService(url, {
- * measureMode: SuperMap.MeasureMode.DISTANCE,
- * eventListeners:{
- * "processCompleted": measureCompleted
- * }
- * });
- * @param {string} url - 服务访问的地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @param {MeasureMode} options.measureMode - 量算模式,包括距离量算模式和面积量算模式。
- */
- var MeasureService = /*#__PURE__*/function (_CommonServiceBase) {
- MeasureService_inherits(MeasureService, _CommonServiceBase);
- var _super = MeasureService_createSuper(MeasureService);
- function MeasureService(url, options) {
- var _this;
- MeasureService_classCallCheck(this, MeasureService);
- _this = _super.call(this, url, options);
- /**
- * @member {SuperMap.MeasureMode} [SuperMap.MeasureService.prototype.measureMode=MeasureMode.DISTANCE]
- * @description 量算模式,包括距离量算模式和面积量算模式。
- */
- _this.measureMode = MeasureMode.DISTANCE;
- if (options) {
- Util.extend(MeasureService_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.MeasureService";
- return _this;
- }
- /**
- * @override
- */
- MeasureService_createClass(MeasureService, [{
- key: "destroy",
- value: function destroy() {
- MeasureService_get(MeasureService_getPrototypeOf(MeasureService.prototype), "destroy", this).call(this);
- var me = this;
- me.measureMode = null;
- }
- /**
- * @function SuperMap.MeasureService.prototype.processAsync
- * @description 负责将客户端的量算参数传递到服务端。
- * @param {SuperMap.MeasureParameters} params - 量算参数。
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof MeasureParameters)) {
- return;
- }
- var me = this,
- geometry = params.geometry,
- pointsCount = 0,
- point2ds = null;
- if (!geometry) {
- return;
- }
- me.url = Util.urlPathAppend(me.url, me.measureMode === MeasureMode.AREA ? 'area' : 'distance');
- var serverGeometry = ServerGeometry.fromGeometry(geometry);
- if (!serverGeometry) {
- return;
- }
- pointsCount = serverGeometry.parts[0];
- point2ds = serverGeometry.points.splice(0, pointsCount);
- var prjCoordSysTemp, prjCodeTemp, paramsTemp;
- if (params.prjCoordSys) {
- if (MeasureService_typeof(params.prjCoordSys) === "object") {
- prjCodeTemp = params.prjCoordSys.projCode;
- prjCoordSysTemp = '{"epsgCode"' + prjCodeTemp.substring(prjCodeTemp.indexOf(":"), prjCodeTemp.length) + "}";
- } else if (typeof params.prjCoordSys === "string") {
- prjCoordSysTemp = '{"epsgCode"' + params.prjCoordSys.substring(params.prjCoordSys.indexOf(":"), params.prjCoordSys.length) + "}";
- }
- paramsTemp = {
- "point2Ds": Util.toJSON(point2ds),
- "unit": params.unit,
- "prjCoordSys": prjCoordSysTemp
- };
- } else {
- paramsTemp = {
- "point2Ds": Util.toJSON(point2ds),
- "unit": params.unit
- };
- }
- me.request({
- method: "GET",
- params: paramsTemp,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return MeasureService;
- }(CommonServiceBase);
- SuperMap.MeasureService = MeasureService;
- ;// CONCATENATED MODULE: ./src/common/iServer/OverlayAnalystService.js
- 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); }
- function OverlayAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function OverlayAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function OverlayAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = OverlayAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function OverlayAnalystService_setPrototypeOf(o, p) { OverlayAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return OverlayAnalystService_setPrototypeOf(o, p); }
- 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); }; }
- function OverlayAnalystService_possibleConstructorReturn(self, call) { if (call && (OverlayAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return OverlayAnalystService_assertThisInitialized(self); }
- function OverlayAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function OverlayAnalystService_getPrototypeOf(o) { OverlayAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OverlayAnalystService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.OverlayAnalystService
- * @category iServer SpatialAnalyst OverlayAnalyst
- * @classdesc 叠加分析服务类。
- * 该类负责将客户设置的叠加分析参数传递给服务端,并接收服务端返回的叠加分析结果数据。
- * 叠加分析结果通过该类支持的事件的监听函数参数获取
- * @param {string} url - 服务的访问地址。如http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
- * @param {Object} options - 参数。</br>
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {SuperMap.CommonServiceBase}
- * @example 例如:
- * (start code)
- * var myOverlayAnalystService = new SuperMap.OverlayAnalystService(url, {
- * eventListeners: {
- * "processCompleted": OverlayCompleted,
- * "processFailed": OverlayFailed
- * }
- * });
- * (end)
- */
- var OverlayAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
- OverlayAnalystService_inherits(OverlayAnalystService, _SpatialAnalystBase);
- var _super = OverlayAnalystService_createSuper(OverlayAnalystService);
- function OverlayAnalystService(url, options) {
- var _this;
- OverlayAnalystService_classCallCheck(this, OverlayAnalystService);
- _this = _super.call(this, url, options);
- /**
- * @member {string} SuperMap.OverlayAnalystService.prototype.mode
- * @description 叠加分析类型
- */
- _this.mode = null;
- if (options) {
- Util.extend(OverlayAnalystService_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.OverlayAnalystService";
- return _this;
- }
- /**
- * @override
- */
- OverlayAnalystService_createClass(OverlayAnalystService, [{
- key: "destroy",
- value: function destroy() {
- OverlayAnalystService_get(OverlayAnalystService_getPrototypeOf(OverlayAnalystService.prototype), "destroy", this).call(this);
- this.mode = null;
- }
- /**
- * @function SuperMap.OverlayAnalystService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.OverlayAnalystParameters} parameter - 叠加分析参数类。
- */
- }, {
- key: "processAsync",
- value: function processAsync(parameter) {
- var parameterObject = {};
- var me = this;
- if (parameter instanceof DatasetOverlayAnalystParameters) {
- me.mode = "datasets";
- me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.sourceDataset + '/overlay');
- DatasetOverlayAnalystParameters.toObject(parameter, parameterObject);
- } else if (parameter instanceof GeometryOverlayAnalystParameters) {
- me.mode = "geometry"; //支持传入多个几何要素进行叠加分析
- if (parameter.operateGeometries && parameter.sourceGeometries) {
- me.url = Util.urlPathAppend(me.url, 'geometry/overlay/batch');
- me.url = Util.urlAppend(me.url, 'ignoreAnalystParam=true');
- } else {
- me.url = Util.urlPathAppend(me.url, 'geometry/overlay');
- }
- GeometryOverlayAnalystParameters.toObject(parameter, parameterObject);
- }
- me.url = Util.urlAppend(me.url, 'returnContent=true');
- var jsonParameters = Util.toJSON(parameterObject);
- me.request({
- method: "POST",
- data: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return OverlayAnalystService;
- }(SpatialAnalystBase);
- SuperMap.OverlayAnalystService = OverlayAnalystService;
- ;// CONCATENATED MODULE: ./src/common/iServer/OverlayGeoJobParameter.js
- function OverlayGeoJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function OverlayGeoJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayGeoJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayGeoJobParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.OverlayGeoJobParameter
- * @category iServer ProcessingService OverlayAnalyst
- * @classdesc 叠加分析任务参数类。
- * @param {Object} options - 参数。
- * @param {string} options.datasetName - 数据集名。
- * @param {string} options.datasetOverlay - 叠加对象所在的数据集名称。
- * @param {string} options.srcFields - 输入数据需要保留的字段。
- * @param {string} [options.overlayFields] - 叠加数据需要保留的字段。对分析模式为 clip、update、erase 时,此参数无效。
- * @param {string} [options.mode] - 叠加分析模式。
- * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
- * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
- */
- var OverlayGeoJobParameter = /*#__PURE__*/function () {
- function OverlayGeoJobParameter(options) {
- OverlayGeoJobParameter_classCallCheck(this, OverlayGeoJobParameter);
- if (!options) {
- return;
- }
- /**
- * @member {string} SuperMap.OverlayGeoJobParameter.prototype.datasetName
- * @description 数据集名。
- */
- this.datasetName = "";
- /**
- * @member {string} SuperMap.OverlayGeoJobParameter.prototype.datasetOverlay
- * @description 叠加对象所在的数据集名称。
- */
- this.datasetOverlay = "";
- /**
- * @member {string} [SuperMap.OverlayGeoJobParameter.prototype.mode]
- * @description 叠加分析模式。
- */
- this.mode = "";
- /**
- * @member {string} SuperMap.OverlayGeoJobParameter.prototype.srcFields
- * @description 输入数据需要保留的字段。
- */
- this.srcFields = "";
- /**
- * @member {string} SuperMap.OverlayGeoJobParameter.prototype.overlayFields
- * @description 叠加数据需要保留的字段,对分析模式为 clip、update、erase 时,此参数无效。
- */
- this.overlayFields = "";
- /**
- * @member {SuperMap.OutputSetting} [SuperMap.OverlayGeoJobParameter.prototype.output]
- * @description 输出参数设置类。
- */
- this.output = null;
- /**
- * @member {SuperMap.MappingParameters} [SuperMap.OverlayGeoJobParameter.prototype.mappingParameters]
- * @description 分析后结果可视化的参数类。
- */
- this.mappingParameters = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.OverlayGeoJobParameter";
- }
- /**
- * @function SuperMap.OverlayGeoJobParameter.destroy
- * @override
- */
- OverlayGeoJobParameter_createClass(OverlayGeoJobParameter, [{
- key: "destroy",
- value: function destroy() {
- this.datasetName = null;
- this.datasetOverlay = null;
- this.mode = null;
- this.srcFields = null;
- this.overlayFields = null;
- if (this.output instanceof OutputSetting) {
- this.output.destroy();
- this.output = null;
- }
- if (this.mappingParameters instanceof MappingParameters) {
- this.mappingParameters.destroy();
- this.mappingParameters = null;
- }
- }
- /**
- * @function SuperMap.OverlayGeoJobParameter.toObject
- * @param {Object} OverlayGeoJobParameter - 点聚合分析任务参数。
- * @param {Object} tempObj - 目标对象。
- * @description 生成点聚合分析任务对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(OverlayGeoJobParameter, tempObj) {
- for (var name in OverlayGeoJobParameter) {
- if (name == "datasetName") {
- tempObj['input'] = tempObj['input'] || {};
- tempObj['input'][name] = OverlayGeoJobParameter[name];
- continue;
- }
- if (name === "output") {
- tempObj['output'] = tempObj['output'] || {};
- tempObj['output'] = OverlayGeoJobParameter[name];
- continue;
- }
- tempObj['analyst'] = tempObj['analyst'] || {};
- tempObj['analyst'][name] = OverlayGeoJobParameter[name];
- if (name === 'mappingParameters') {
- tempObj['analyst'][name] = tempObj['analyst'][name] || {};
- tempObj['analyst']['mappingParameters'] = OverlayGeoJobParameter[name];
- }
- }
- }
- }]);
- return OverlayGeoJobParameter;
- }();
- SuperMap.OverlayGeoJobParameter = OverlayGeoJobParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/OverlayGeoJobsService.js
- 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); }
- function OverlayGeoJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function OverlayGeoJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayGeoJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayGeoJobsService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function OverlayGeoJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = OverlayGeoJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function OverlayGeoJobsService_setPrototypeOf(o, p) { OverlayGeoJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return OverlayGeoJobsService_setPrototypeOf(o, p); }
- 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); }; }
- function OverlayGeoJobsService_possibleConstructorReturn(self, call) { if (call && (OverlayGeoJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return OverlayGeoJobsService_assertThisInitialized(self); }
- function OverlayGeoJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function OverlayGeoJobsService_getPrototypeOf(o) { OverlayGeoJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OverlayGeoJobsService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.OverlayGeoJobsService
- * @category iServer ProcessingService OverlayAnalyst
- * @classdesc 叠加分析任务类。
- * @param {string} url - 叠加分析任务地址。
- * @param {Object} options - 参数。
- * @param {SuperMap.Events} options.events - 处理所有事件的对象。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
- * @param {number} options.index - 服务访问地址在数组中的位置。
- * @param {number} options.length - 服务访问地址数组长度。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var OverlayGeoJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
- OverlayGeoJobsService_inherits(OverlayGeoJobsService, _ProcessingServiceBas);
- var _super = OverlayGeoJobsService_createSuper(OverlayGeoJobsService);
- function OverlayGeoJobsService(url, options) {
- var _this;
- OverlayGeoJobsService_classCallCheck(this, OverlayGeoJobsService);
- _this = _super.call(this, url, options);
- _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/overlay');
- _this.CLASS_NAME = 'SuperMap.OverlayGeoJobsService';
- return _this;
- }
- /**
- * @override
- */
- OverlayGeoJobsService_createClass(OverlayGeoJobsService, [{
- key: "destroy",
- value: function destroy() {
- OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.OverlayGeoJobsService.prototype.getOverlayGeoJobs
- * @description 获取叠加分析任务
- */
- }, {
- key: "getOverlayGeoJobs",
- value: function getOverlayGeoJobs() {
- OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "getJobs", this).call(this, this.url);
- }
- /**
- * @function SuperMap.OverlayGeoJobsService.prototype.getOverlayGeoJob
- * @description 获取指定id的叠加分析任务
- * @param {string} id - 指定要获取数据的id
- */
- }, {
- key: "getOverlayGeoJob",
- value: function getOverlayGeoJob(id) {
- OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
- }
- /**
- * @function SuperMap.OverlayGeoJobsService.prototype.addOverlayGeoJob
- * @description 新建点叠加析服务
- * @param {SuperMap.OverlayGeoJobParameter} params - 创建一个叠加分析的请求参数。
- * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
- */
- }, {
- key: "addOverlayGeoJob",
- value: function addOverlayGeoJob(params, seconds) {
- OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "addJob", this).call(this, this.url, params, OverlayGeoJobParameter, seconds);
- }
- }]);
- return OverlayGeoJobsService;
- }(ProcessingServiceBase);
- SuperMap.OverlayGeoJobsService = OverlayGeoJobsService;
- ;// CONCATENATED MODULE: ./src/common/iServer/QueryByBoundsParameters.js
- 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); }
- function QueryByBoundsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function QueryByBoundsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByBoundsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByBoundsParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function QueryByBoundsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByBoundsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function QueryByBoundsParameters_setPrototypeOf(o, p) { QueryByBoundsParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByBoundsParameters_setPrototypeOf(o, p); }
- 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); }; }
- function QueryByBoundsParameters_possibleConstructorReturn(self, call) { if (call && (QueryByBoundsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByBoundsParameters_assertThisInitialized(self); }
- function QueryByBoundsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function QueryByBoundsParameters_getPrototypeOf(o) { QueryByBoundsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByBoundsParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.QueryByBoundsParameters
- * @category iServer Map QueryResults
- * @classdesc Bounds 查询参数类。该类用于设置 Bounds 查询的相关参数。
- * @extends {SuperMap.QueryParameters}
- * @param {Object} options - 参数。
- * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 指定的查询范围。
- * @param {Array.<SuperMap.FilterParameter>} options.queryParams - 查询过滤条件参数数组。
- * @param {string} [options.customParams] - 自定义参数,供扩展使用。
- * @param {Object} [options.prjCoordSys] -自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
- * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
- * @param {SuperMap.GeometryType} [options.networkType=SuperMap.GeometryType.LINE] - 网络数据集对应的查询类型。
- * @param {SuperMap.QueryOption} [options.queryOption=SuperMap.QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
- * @param {number} [options.startRecord=0] - 查询起始记录号。
- * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
- * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
- * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
- * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
- */
- var QueryByBoundsParameters = /*#__PURE__*/function (_QueryParameters) {
- QueryByBoundsParameters_inherits(QueryByBoundsParameters, _QueryParameters);
- var _super = QueryByBoundsParameters_createSuper(QueryByBoundsParameters);
- function QueryByBoundsParameters(options) {
- var _this;
- QueryByBoundsParameters_classCallCheck(this, QueryByBoundsParameters);
- if (!options) {
- return QueryByBoundsParameters_possibleConstructorReturn(_this);
- }
- _this = _super.call(this, options);
- /**
- * @member {boolean} [SuperMap.QueryByBoundsParameters.prototype.returnContent=true]
- * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
- * 如果为 true,则直接返回新创建资源,即查询结果的表述。
- * 为 false,则返回的是查询结果资源的 URI。
- */
- _this.returnContent = true;
- /**
- * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.QueryByBoundsParameters.prototype.bounds
- * @description 指定的查询范围。
- */
- _this.bounds = null;
- Util.extend(QueryByBoundsParameters_assertThisInitialized(_this), options);
- _this.CLASS_NAME = "SuperMap.QueryByBoundsParameters";
- return _this;
- }
- /**
- * @function SuperMap.QueryByBoundsParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- QueryByBoundsParameters_createClass(QueryByBoundsParameters, [{
- key: "destroy",
- value: function destroy() {
- QueryByBoundsParameters_get(QueryByBoundsParameters_getPrototypeOf(QueryByBoundsParameters.prototype), "destroy", this).call(this);
- var me = this;
- me.returnContent = null;
- if (me.bounds) {
- me.bounds = null;
- }
- }
- }]);
- return QueryByBoundsParameters;
- }(QueryParameters);
- SuperMap.QueryByBoundsParameters = QueryByBoundsParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/QueryService.js
- 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); }
- function QueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function QueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function QueryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function QueryService_setPrototypeOf(o, p) { QueryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryService_setPrototypeOf(o, p); }
- 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); }; }
- function QueryService_possibleConstructorReturn(self, call) { if (call && (QueryService_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryService_assertThisInitialized(self); }
- function QueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function QueryService_getPrototypeOf(o) { QueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.QueryService
- * @category iServer Map QueryResults
- * @classdesc 查询服务基类。
- * @extends {SuperMap.CommonServiceBase}
- * @param {string} url - 服务地址。请求地图查询服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @example
- * var myService = new SuperMap.QueryService(url, {
- * eventListeners: {
- * "processCompleted": queryCompleted,
- * "processFailed": queryError
- * }
- * };
- */
- var QueryService = /*#__PURE__*/function (_CommonServiceBase) {
- QueryService_inherits(QueryService, _CommonServiceBase);
- var _super = QueryService_createSuper(QueryService);
- /**
- * @function SuperMap.QueryService.prototype.constructor
- * @description 查询服务基类构造函数。
- * @param {string} url - 服务地址。请求地图查询服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
- * @param {Object} options -参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- */
- function QueryService(url, options) {
- var _this;
- QueryService_classCallCheck(this, QueryService);
- _this = _super.call(this, url, options);
- /**
- * @member {boolean} SuperMap.QueryService.prototype.returnContent
- * @description 是否立即返回新创建资源的表述还是返回新资源的URI。
- */
- _this.returnContent = false;
- /**
- * @member {string} SuperMap.QueryService.prototype.format
- * @description 查询结果返回格式,目前支持iServerJSON 和GeoJSON两种格式。参数格式为"ISERVER","GEOJSON"。
- */
- _this.format = DataFormat.GEOJSON;
- _this.returnFeatureWithFieldCaption = false;
- if (options) {
- Util.extend(QueryService_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.QueryService";
- if (!_this.url) {
- return QueryService_possibleConstructorReturn(_this);
- }
- if (options && options.format) {
- _this.format = options.format.toUpperCase();
- }
- _this.url = Util.urlPathAppend(_this.url, 'queryResults');
- return _this;
- }
- /**
- * @function SuperMap.QueryService.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- QueryService_createClass(QueryService, [{
- key: "destroy",
- value: function destroy() {
- QueryService_get(QueryService_getPrototypeOf(QueryService.prototype), "destroy", this).call(this);
- var me = this;
- me.returnContent = null;
- me.format = null;
- }
- /**
- * @function SuperMap.QueryService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.QueryParameters} params - 查询参数。
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof QueryParameters)) {
- return;
- }
- var me = this,
- returnCustomResult = null,
- jsonParameters = null;
- me.returnContent = params.returnContent;
- jsonParameters = me.getJsonParameters(params);
- if (me.returnContent) {
- me.url = Util.urlAppend(me.url, 'returnContent=' + me.returnContent);
- } else {
- //仅供三维使用 获取高亮图片的bounds
- returnCustomResult = params.returnCustomResult;
- if (returnCustomResult) {
- me.url = Util.urlAppend(me.url, 'returnCustomResult=' + returnCustomResult);
- }
- }
- me.returnFeatureWithFieldCaption = params.returnFeatureWithFieldCaption;
- me.request({
- method: "POST",
- data: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.QueryService.prototype.serviceProcessCompleted
- * @description 查询完成,执行此方法。
- * @param {Object} result - 服务器返回的结果对象。
- */
- }, {
- key: "serviceProcessCompleted",
- value: function serviceProcessCompleted(result) {
- var me = this;
- result = Util.transformResult(result);
- var geoJSONFormat = new GeoJSON();
- if (result && result.recordsets) {
- for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
- if (recordsets[i].features) {
- if (me.returnFeatureWithFieldCaption === true) {
- recordsets[i].features.map(function (feature) {
- feature.fieldNames = recordsets[i].fieldCaptions;
- return feature;
- });
- }
- if (me.format === DataFormat.GEOJSON) {
- recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
- }
- }
- }
- }
- me.events.triggerEvent("processCompleted", {
- result: result
- });
- }
- /**
- * @function SuperMap.QueryService.prototype.getQueryParameters
- * @description 将 JSON 对象表示的查询参数转化为 QueryParameters 对象。
- * @param {Object} params - JSON 字符串表示的查询参数。
- * @returns {SuperMap.QueryParameters} 返回转化后的 QueryParameters 对象。
- */
- }, {
- key: "getQueryParameters",
- value: function getQueryParameters(params) {
- return new QueryParameters({
- customParams: params.customParams,
- expectCount: params.expectCount,
- networkType: params.networkType,
- queryOption: params.queryOption,
- queryParams: params.queryParams,
- startRecord: params.startRecord,
- prjCoordSys: params.prjCoordSys,
- holdTime: params.holdTime
- });
- }
- }]);
- return QueryService;
- }(CommonServiceBase);
- SuperMap.QueryService = QueryService;
- ;// CONCATENATED MODULE: ./src/common/iServer/QueryByBoundsService.js
- 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); }
- function QueryByBoundsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function QueryByBoundsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByBoundsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByBoundsService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function QueryByBoundsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByBoundsService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function QueryByBoundsService_setPrototypeOf(o, p) { QueryByBoundsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByBoundsService_setPrototypeOf(o, p); }
- 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); }; }
- function QueryByBoundsService_possibleConstructorReturn(self, call) { if (call && (QueryByBoundsService_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByBoundsService_assertThisInitialized(self); }
- function QueryByBoundsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function QueryByBoundsService_getPrototypeOf(o) { QueryByBoundsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByBoundsService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.QueryByBoundsService
- * @category iServer Map QueryResults
- * @classdesc Bounds 查询服务类。
- * @augments {SuperMap.QueryService}
- * @example
- * (start end)
- * var myQueryByBoundsService = new SuperMap.QueryByBoundsService(url, {
- * eventListeners: {
- * "processCompleted": queryCompleted,
- * "processFailed": queryError
- * }
- * });
- * function queryCompleted(object){//todo};
- * function queryError(object){//todo};
- * (end)
- * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
- * @param {Object} options - 参数。<br>
- * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。<br>
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var QueryByBoundsService = /*#__PURE__*/function (_QueryService) {
- QueryByBoundsService_inherits(QueryByBoundsService, _QueryService);
- var _super = QueryByBoundsService_createSuper(QueryByBoundsService);
- function QueryByBoundsService(url, options) {
- var _this;
- QueryByBoundsService_classCallCheck(this, QueryByBoundsService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.QueryByBoundsService";
- return _this;
- }
- /**
- * @override
- */
- QueryByBoundsService_createClass(QueryByBoundsService, [{
- key: "destroy",
- value: function destroy() {
- QueryByBoundsService_get(QueryByBoundsService_getPrototypeOf(QueryByBoundsService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.QueryByBoundsService.prototype.getJsonParameters
- * @description 将查询参数转化为 JSON 字符串。
- * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds 等)。
- * @param {SuperMap.QueryByBoundsParameters} params - Bounds 查询参数。
- * @returns {Object} 转化后的 JSON 字符串。
- */
- }, {
- key: "getJsonParameters",
- value: function getJsonParameters(params) {
- if (!(params instanceof QueryByBoundsParameters)) {
- return null;
- }
- var me = this,
- jsonParameters = "",
- qp = null,
- bounds = params.bounds;
- qp = me.getQueryParameters(params);
- jsonParameters += "'queryMode':'BoundsQuery','queryParameters':";
- jsonParameters += Util.toJSON(qp);
- jsonParameters += ",'bounds': {'rightTop':{'y':" + bounds.top + ",'x':" + bounds.right + "},'leftBottom':{'y':" + bounds.bottom + ",'x':" + bounds.left + "}}";
- jsonParameters = "{" + jsonParameters + "}";
- return jsonParameters;
- }
- }]);
- return QueryByBoundsService;
- }(QueryService);
- SuperMap.QueryByBoundsService = QueryByBoundsService;
- ;// CONCATENATED MODULE: ./src/common/iServer/QueryByDistanceParameters.js
- 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); }
- function QueryByDistanceParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function QueryByDistanceParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByDistanceParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByDistanceParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function QueryByDistanceParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByDistanceParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function QueryByDistanceParameters_setPrototypeOf(o, p) { QueryByDistanceParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByDistanceParameters_setPrototypeOf(o, p); }
- 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); }; }
- function QueryByDistanceParameters_possibleConstructorReturn(self, call) { if (call && (QueryByDistanceParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByDistanceParameters_assertThisInitialized(self); }
- function QueryByDistanceParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function QueryByDistanceParameters_getPrototypeOf(o) { QueryByDistanceParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByDistanceParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.QueryByDistanceParameters
- * @category iServer Map QueryResults
- * @classdesc Distance 查询参数类。
- * 该类用于设置 Distance 查询的相关参数。
- * @extends {SuperMap.QueryParameters}
- * @param {Object} options - 参数。
- * @param {Object} options.geometry - 用于查询的几何对象。
- * @param {Array.<SuperMap.FilterParameter>} options.queryParams - 查询过滤条件参数数组。
- * @param {string} [options.customParams] - 自定义参数,供扩展使用。
- * @param {Object} [options.prjCoordSys] -自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
- * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
- * @param {SuperMap.GeometryType} [options.networkType=SuperMap.GeometryType.LINE] - 网络数据集对应的查询类型。
- * @param {SuperMap.QueryOption} [options.queryOption=SuperMap.QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
- * @param {number} [options.startRecord=0] - 查询起始记录号。
- * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
- * @param {boolean} [options.returnCustomResult=false] -仅供三维使用。
- * @param {number} [options.distance=0] - 查询距离。
- * @param {boolean} [options.isNearest=false] - 是否为最近距离查询。
- * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
- * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
- */
- var QueryByDistanceParameters = /*#__PURE__*/function (_QueryParameters) {
- QueryByDistanceParameters_inherits(QueryByDistanceParameters, _QueryParameters);
- var _super = QueryByDistanceParameters_createSuper(QueryByDistanceParameters);
- function QueryByDistanceParameters(options) {
- var _this;
- QueryByDistanceParameters_classCallCheck(this, QueryByDistanceParameters);
- if (!options) {
- return QueryByDistanceParameters_possibleConstructorReturn(_this);
- }
- _this = _super.call(this, options);
- /**
- * @member {number} [SuperMap.QueryByDistanceParameters.prototype.distance=0]
- * @description 查询距离,单位与所查询图层对应的数据集单位相同。
- * 当查找最近地物时,该属性无效。
- */
- _this.distance = 0;
- /**
- * @member SuperMap.QueryByDistanceParameters.prototype.geometry
- * @description 用于查询的地理对象。<br>
- * 点类型可以是:{@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>
- * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。<br>
- * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
- */
- _this.geometry = null;
- /**
- * @member {boolean} [SuperMap.QueryByDistanceParameters.prototype.isNearest=false]
- * @description 是否为最近距离查询。<br>
- * 建议该属性与 expectCount(继承自 {@link SuperMap.QueryParameters})属性联合使用。
- * 当该属性为 true 时,即表示查找最近地物,如果查询结果数大于期望返回的结果记录数(expectCount),
- * 则查找结果为查询总记录中距离中心最近的 expectCount 个地物。
- * 当该属性为不为 true 时,如果查询结果数大于期望返回的结果记录数(expectCount),
- * 则查找结果为从查询总记录中随机抽取的 expectCount 个地物。
- * 目前查询结果不支持按远近距离排序。
- */
- _this.isNearest = null;
- /**
- * @member {boolean} [SuperMap.QueryByDistanceParameters.prototype.returnContent=true]
- * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
- * 如果为 true,则直接返回新创建资源,即查询结果的表述。
- * 为 false,则返回的是查询结果资源的 URI。
- */
- _this.returnContent = true;
- Util.extend(QueryByDistanceParameters_assertThisInitialized(_this), options);
- _this.CLASS_NAME = "SuperMap.QueryByDistanceParameters";
- return _this;
- }
- /**
- * @function SuperMap.QueryByDistanceParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- QueryByDistanceParameters_createClass(QueryByDistanceParameters, [{
- key: "destroy",
- value: function destroy() {
- QueryByDistanceParameters_get(QueryByDistanceParameters_getPrototypeOf(QueryByDistanceParameters.prototype), "destroy", this).call(this);
- var me = this;
- me.returnContent = null;
- me.distance = null;
- me.isNearest = null;
- if (me.geometry) {
- me.geometry.destroy();
- me.geometry = null;
- }
- }
- }]);
- return QueryByDistanceParameters;
- }(QueryParameters);
- SuperMap.QueryByDistanceParameters = QueryByDistanceParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/QueryByDistanceService.js
- 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); }
- function QueryByDistanceService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function QueryByDistanceService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByDistanceService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByDistanceService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function QueryByDistanceService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByDistanceService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function QueryByDistanceService_setPrototypeOf(o, p) { QueryByDistanceService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByDistanceService_setPrototypeOf(o, p); }
- 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); }; }
- function QueryByDistanceService_possibleConstructorReturn(self, call) { if (call && (QueryByDistanceService_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByDistanceService_assertThisInitialized(self); }
- function QueryByDistanceService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function QueryByDistanceService_getPrototypeOf(o) { QueryByDistanceService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByDistanceService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.QueryByDistanceService
- * @category iServer Map QueryResults
- * @classdesc Distance查询服务类。
- * @extends {SuperMap.QueryService}
- * @example
- * var myQueryByDistService = new SuperMap.QueryByDistanceService(url, {
- * eventListeners: {
- * "processCompleted": queryCompleted,
- * "processFailed": queryError
- * }
- * });
- * function queryCompleted(object){//todo};
- * function queryError(object){//todo};
- * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var QueryByDistanceService = /*#__PURE__*/function (_QueryService) {
- QueryByDistanceService_inherits(QueryByDistanceService, _QueryService);
- var _super = QueryByDistanceService_createSuper(QueryByDistanceService);
- function QueryByDistanceService(url, options) {
- var _this;
- QueryByDistanceService_classCallCheck(this, QueryByDistanceService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.QueryByDistanceService";
- return _this;
- }
- /**
- * @override
- */
- QueryByDistanceService_createClass(QueryByDistanceService, [{
- key: "destroy",
- value: function destroy() {
- QueryByDistanceService_get(QueryByDistanceService_getPrototypeOf(QueryByDistanceService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.QueryByDistanceService.prototype.getJsonParameters
- * @description 将查询参数转化为 JSON 字符串。
- * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
- * @param {SuperMap.QueryByDistanceParameters} params - Distance 查询参数类。
- * @returns {Object} 转化后的 JSON 字符串。
- */
- }, {
- key: "getJsonParameters",
- value: function getJsonParameters(params) {
- if (!(params instanceof QueryByDistanceParameters)) {
- return;
- }
- var me = this,
- jsonParameters = "",
- qp = me.getQueryParameters(params);
- var sg = ServerGeometry.fromGeometry(params.geometry);
- jsonParameters += params.isNearest ? "'queryMode':'FindNearest','queryParameters':" : "'queryMode':'DistanceQuery','queryParameters':";
- jsonParameters += Util.toJSON(qp);
- jsonParameters += ",'geometry':" + Util.toJSON(sg) + ",'distance':" + params.distance;
- jsonParameters = "{" + jsonParameters + "}";
- return jsonParameters;
- }
- }]);
- return QueryByDistanceService;
- }(QueryService);
- SuperMap.QueryByDistanceService = QueryByDistanceService;
- ;// CONCATENATED MODULE: ./src/common/iServer/QueryByGeometryParameters.js
- 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); }
- function QueryByGeometryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function QueryByGeometryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByGeometryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByGeometryParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function QueryByGeometryParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByGeometryParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function QueryByGeometryParameters_setPrototypeOf(o, p) { QueryByGeometryParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByGeometryParameters_setPrototypeOf(o, p); }
- 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); }; }
- function QueryByGeometryParameters_possibleConstructorReturn(self, call) { if (call && (QueryByGeometryParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByGeometryParameters_assertThisInitialized(self); }
- function QueryByGeometryParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function QueryByGeometryParameters_getPrototypeOf(o) { QueryByGeometryParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByGeometryParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.QueryByGeometryParameters
- * @category iServer Map QueryResults
- * @classdesc Geometry 查询参数类。
- * 该类用于设置 Geometry查询的相关参数。
- * @extends {SuperMap.QueryParameters}
- * @param {Object} options - 参数。
- * @param {Array.<SuperMap.FilterParameter>} options.queryParams - 查询过滤条件参数数组。
- * @param {Object} options.geometry - 用于查询的几何对象。
- * @param {string} [options.customParams] - 自定义参数,供扩展使用。
- * @param {SuperMap.QueryOption} [options.queryOption=SuperMap.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
- * @param {Object} [options.prjCoordSys] -自定义参数,供SuperMap Online提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
- * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
- * @param {SuperMap.GeometryType} [options.networkType=SuperMap.GeometryType.LINE] - 网络数据集对应的查询类型。
- * @param {boolean} [options.returnCustomResult=false] -仅供三维使用。
- * @param {number} [options.startRecord=0] - 查询起始记录号。
- * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
- * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
- * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
- * @param {SuperMap.SpatialQueryMode} [spatialQueryMode=SuperMap.SpatialQueryMode.INTERSECT] - 空间查询模式。
- */
- var QueryByGeometryParameters = /*#__PURE__*/function (_QueryParameters) {
- QueryByGeometryParameters_inherits(QueryByGeometryParameters, _QueryParameters);
- var _super = QueryByGeometryParameters_createSuper(QueryByGeometryParameters);
- function QueryByGeometryParameters(options) {
- var _this;
- QueryByGeometryParameters_classCallCheck(this, QueryByGeometryParameters);
- if (!options) {
- return QueryByGeometryParameters_possibleConstructorReturn(_this);
- }
- _this = _super.call(this, options);
- /**
- * @member {boolean} [SuperMap.QueryByGeometryParameters.prototype.returnContent=true]
- * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。<br>
- * 如果为 true,则直接返回新创建资源,即查询结果的表述。<br>
- * 为 false,则返回的是查询结果资源的 URI。
- */
- _this.returnContent = true;
- /**
- * @member {Object} SuperMap.QueryByGeometryParameters.prototype.geometry
- * @description 用于查询的几何对象。<br>
- * 点类型可以是:{@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>
- * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。<br>
- * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
- */
- _this.geometry = null;
- /**
- * @member {SuperMap.SpatialQueryMode} [SuperMap.QueryByGeometryParameters.prototype.spatialQueryMode=SuperMap.SpatialQueryMode.INTERSECT]
- * @description 空间查询模式。
- */
- _this.spatialQueryMode = SpatialQueryMode.INTERSECT;
- Util.extend(QueryByGeometryParameters_assertThisInitialized(_this), options);
- _this.CLASS_NAME = "SuperMap.QueryByGeometryParameters";
- return _this;
- }
- /**
- * @function SuperMap.QueryByGeometryParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- QueryByGeometryParameters_createClass(QueryByGeometryParameters, [{
- key: "destroy",
- value: function destroy() {
- QueryByGeometryParameters_get(QueryByGeometryParameters_getPrototypeOf(QueryByGeometryParameters.prototype), "destroy", this).call(this);
- var me = this;
- me.returnContent = null;
- me.geometry = null;
- me.spatialQueryMode = null;
- }
- }]);
- return QueryByGeometryParameters;
- }(QueryParameters);
- SuperMap.QueryByGeometryParameters = QueryByGeometryParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/QueryByGeometryService.js
- 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); }
- function QueryByGeometryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function QueryByGeometryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByGeometryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByGeometryService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function QueryByGeometryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByGeometryService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function QueryByGeometryService_setPrototypeOf(o, p) { QueryByGeometryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByGeometryService_setPrototypeOf(o, p); }
- 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); }; }
- function QueryByGeometryService_possibleConstructorReturn(self, call) { if (call && (QueryByGeometryService_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByGeometryService_assertThisInitialized(self); }
- function QueryByGeometryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function QueryByGeometryService_getPrototypeOf(o) { QueryByGeometryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByGeometryService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.QueryByGeometryService
- * @category iServer Map QueryResults
- * @classdesc Geometry查询服务类。
- * @extends {SuperMap.QueryService}
- * @example
- * var myQueryByGeometryService = new SuperMap.QueryByGeometryService(url, {
- * eventListeners: {
- * "processCompleted": queryCompleted,
- * "processFailed": queryError
- * }
- * });
- * function queryCompleted(object){//todo};
- * function queryError(object){//todo};
- * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var QueryByGeometryService = /*#__PURE__*/function (_QueryService) {
- QueryByGeometryService_inherits(QueryByGeometryService, _QueryService);
- var _super = QueryByGeometryService_createSuper(QueryByGeometryService);
- /**
- * @function SuperMap.QueryByGeometryService.prototype.constructor
- * @description Geometry 查询服务类构造函数。
- * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- */
- function QueryByGeometryService(url, options) {
- var _this;
- QueryByGeometryService_classCallCheck(this, QueryByGeometryService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.QueryByGeometryService";
- return _this;
- }
- /**
- * @override
- */
- QueryByGeometryService_createClass(QueryByGeometryService, [{
- key: "destroy",
- value: function destroy() {
- QueryByGeometryService_get(QueryByGeometryService_getPrototypeOf(QueryByGeometryService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.QueryByGeometryService.prototype.getJsonParameters
- * @description 将查询参数转化为 JSON 字符串。
- * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
- * @param {SuperMap.QueryByGeometryParameters} params - Geometry 查询参数类。
- * @returns {Object} 转化后的 JSON 字符串。
- */
- }, {
- key: "getJsonParameters",
- value: function getJsonParameters(params) {
- if (!(params instanceof QueryByGeometryParameters)) {
- return;
- }
- var me = this,
- jsonParameters = "",
- qp = null,
- geometry = params.geometry,
- sg = ServerGeometry.fromGeometry(geometry);
- qp = me.getQueryParameters(params);
- jsonParameters += "'queryMode':'SpatialQuery','queryParameters':";
- jsonParameters += Util.toJSON(qp) + ",'geometry':" + Util.toJSON(sg) + ",'spatialQueryMode':" + Util.toJSON(params.spatialQueryMode);
- jsonParameters = "{" + jsonParameters + "}";
- return jsonParameters;
- }
- }]);
- return QueryByGeometryService;
- }(QueryService);
- SuperMap.QueryByGeometryService = QueryByGeometryService;
- ;// CONCATENATED MODULE: ./src/common/iServer/QueryBySQLParameters.js
- 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); }
- function QueryBySQLParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function QueryBySQLParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryBySQLParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryBySQLParameters_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function QueryBySQLParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryBySQLParameters_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function QueryBySQLParameters_setPrototypeOf(o, p) { QueryBySQLParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryBySQLParameters_setPrototypeOf(o, p); }
- 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); }; }
- function QueryBySQLParameters_possibleConstructorReturn(self, call) { if (call && (QueryBySQLParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryBySQLParameters_assertThisInitialized(self); }
- function QueryBySQLParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function QueryBySQLParameters_getPrototypeOf(o) { QueryBySQLParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryBySQLParameters_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.QueryBySQLParameters
- * @category iServer Map QueryResults
- * @classdesc SQL 查询参数类。
- * 该类用于设置 SQL 查询的相关参数。
- * @extends {SuperMap.QueryParameters}
- * @param {Object} options - 参数。
- * @param {Array.<SuperMap.FilterParameter>} options.queryParams - 查询过滤条件参数数组。
- * @param {string} [options.customParams] - 自定义参数,供扩展使用。
- * @param {Object} [options.prjCoordSys] - 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
- * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
- * @param {SuperMap.GeometryType} [options.networkType=SuperMap.GeometryType.LINE] - 网络数据集对应的查询类型。
- * @param {SuperMap.QueryOption} [options.queryOption=SuperMap.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
- * @param {number} [options.startRecord=0] - 查询起始记录号。
- * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
- * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
- * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
- * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
- */
- var QueryBySQLParameters = /*#__PURE__*/function (_QueryParameters) {
- QueryBySQLParameters_inherits(QueryBySQLParameters, _QueryParameters);
- var _super = QueryBySQLParameters_createSuper(QueryBySQLParameters);
- function QueryBySQLParameters(options) {
- var _this;
- QueryBySQLParameters_classCallCheck(this, QueryBySQLParameters);
- if (!options) {
- return QueryBySQLParameters_possibleConstructorReturn(_this);
- }
- _this = _super.call(this, options);
- /**
- * @member {boolean} [SuperMap.QueryBySQLParameters.prototype.returnContent=true]
- * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
- * 如果为 true,则直接返回新创建资源,即查询结果的表述。
- * 为 false,则返回的是查询结果资源的 URI。
- */
- _this.returnContent = true;
- Util.extend(QueryBySQLParameters_assertThisInitialized(_this), options);
- _this.CLASS_NAME = "SuperMap.QueryBySQLParameters";
- return _this;
- }
- /**
- * @function SuperMap.QueryBySQLParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- QueryBySQLParameters_createClass(QueryBySQLParameters, [{
- key: "destroy",
- value: function destroy() {
- QueryBySQLParameters_get(QueryBySQLParameters_getPrototypeOf(QueryBySQLParameters.prototype), "destroy", this).call(this);
- var me = this;
- me.returnContent = null;
- }
- }]);
- return QueryBySQLParameters;
- }(QueryParameters);
- SuperMap.QueryBySQLParameters = QueryBySQLParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/QueryBySQLService.js
- 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); }
- function QueryBySQLService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function QueryBySQLService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryBySQLService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryBySQLService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function QueryBySQLService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryBySQLService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function QueryBySQLService_setPrototypeOf(o, p) { QueryBySQLService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryBySQLService_setPrototypeOf(o, p); }
- 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); }; }
- function QueryBySQLService_possibleConstructorReturn(self, call) { if (call && (QueryBySQLService_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryBySQLService_assertThisInitialized(self); }
- function QueryBySQLService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function QueryBySQLService_getPrototypeOf(o) { QueryBySQLService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryBySQLService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.QueryBySQLService
- * @category iServer Map QueryResults
- * @classdesc SQL 查询服务类。在一个或多个指定的图层上查询符合 SQL 条件的空间地物信息。
- * @extends {SuperMap.QueryService}
- * @example
- * var queryParam = new SuperMap.FilterParameter({
- * name: "Countries@World.1",
- * attributeFilter: "Pop_1994>1000000000 and SmArea>900"
- * });
- * var queryBySQLParams = new SuperMap.QueryBySQLParameters({
- * queryParams: [queryParam]
- * });
- * var myQueryBySQLService = new SuperMap.QueryBySQLService(url, {eventListeners: {
- * "processCompleted": queryCompleted,
- * "processFailed": queryError
- * }
- * });
- * queryBySQLService.processAsync(queryBySQLParams);
- * function queryCompleted(object){//todo};
- * function queryError(object){//todo};
- * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var QueryBySQLService = /*#__PURE__*/function (_QueryService) {
- QueryBySQLService_inherits(QueryBySQLService, _QueryService);
- var _super = QueryBySQLService_createSuper(QueryBySQLService);
- /**
- * @function SuperMap.QueryBySQLService.prototype.constructor
- * @description SQL 查询服务类构造函数。
- * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- */
- function QueryBySQLService(url, options) {
- var _this;
- QueryBySQLService_classCallCheck(this, QueryBySQLService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.QueryBySQLService";
- return _this;
- }
- /**
- * @override
- */
- QueryBySQLService_createClass(QueryBySQLService, [{
- key: "destroy",
- value: function destroy() {
- QueryBySQLService_get(QueryBySQLService_getPrototypeOf(QueryBySQLService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.QueryBySQLService.prototype.getJsonParameters
- * @description 将查询参数转化为 JSON 字符串。
- * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
- * @param {SuperMap.QueryBySQLParameters} params - SQL 查询参数类。
- * @returns {Object} 转化后的 JSON 字符串。
- */
- }, {
- key: "getJsonParameters",
- value: function getJsonParameters(params) {
- if (!(params instanceof QueryBySQLParameters)) {
- return;
- }
- var me = this,
- jsonParameters = "",
- qp = null;
- qp = me.getQueryParameters(params);
- jsonParameters += "'queryMode':'SqlQuery','queryParameters':";
- jsonParameters += Util.toJSON(qp);
- jsonParameters = "{" + jsonParameters + "}";
- return jsonParameters;
- }
- }]);
- return QueryBySQLService;
- }(QueryService);
- SuperMap.QueryBySQLService = QueryBySQLService;
- ;// CONCATENATED MODULE: ./src/common/iServer/RouteCalculateMeasureParameters.js
- function RouteCalculateMeasureParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function RouteCalculateMeasureParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteCalculateMeasureParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteCalculateMeasureParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.RouteCalculateMeasureParameters
- * @category iServer SpatialAnalyst RouteCalculateMeasure
- * @classdesc 基于路由对象计算指定点 M 值操作的参数类。通过该类提供参数信息。
- * @param {Object} options - 参数。
- * @param {(SuperMap.Route|L.Polyline|ol.geom.LineString)} options.sourceRoute - 路由对象。该对象可以是用户自己生成或在数据源中查询得到的符合标准的路由对象。
- * @param {(SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point)} options.point - 二维地理坐标点对象,包含 x,y 坐标值属性的对象。
- * @param {float} [options.tolerance] - 容限值。
- * @param {boolean} [options.isIgnoreGap=false] - 是否忽略子对象之间的距离。
- */
- var RouteCalculateMeasureParameters = /*#__PURE__*/function () {
- function RouteCalculateMeasureParameters(options) {
- RouteCalculateMeasureParameters_classCallCheck(this, RouteCalculateMeasureParameters);
- if (!options) {
- return this;
- }
- /**
- * @member {(SuperMap.Route|L.Polyline|ol.geom.LineString)} SuperMap.RouteCalculateMeasureParameters.prototype.sourceRoute
- * @description 路由对象。该对象可以是用户自己生成或在数据源中查询得到的符合标准的路由对象。
- */
- this.sourceRoute = null;
- /**
- * @member {(SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point)} SuperMap.RouteCalculateMeasureParameters.prototype.point
- * @description 二维地理坐标点对象,包含 x,y 坐标值属性的对象。
- */
- this.point = null;
- /**
- * @member {float} [SuperMap.RouteCalculateMeasureParameters.prototype.tolerance]
- * @description 容限值。
- */
- this.tolerance = null;
- /**
- * @member {boolean} [SuperMap.RouteCalculateMeasureParameters.prototype.isIgnoreGap=false]
- * @description 是否忽略子对象之间的距离。
- */
- this.isIgnoreGap = false;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.RouteCalculateMeasureParameters";
- }
- /**
- * @function SuperMap.RouteCalculateMeasureParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- RouteCalculateMeasureParameters_createClass(RouteCalculateMeasureParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.sourceRoute = null;
- me.point = null;
- if (me.tolerance) {
- me.tolerance = null;
- }
- if (me.isIgnoreGap) {
- me.isIgnoreGap = false;
- }
- }
- }]);
- return RouteCalculateMeasureParameters;
- }();
- SuperMap.RouteCalculateMeasureParameters = RouteCalculateMeasureParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/RouteCalculateMeasureService.js
- 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); }
- function RouteCalculateMeasureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function RouteCalculateMeasureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteCalculateMeasureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteCalculateMeasureService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function RouteCalculateMeasureService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RouteCalculateMeasureService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function RouteCalculateMeasureService_setPrototypeOf(o, p) { RouteCalculateMeasureService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RouteCalculateMeasureService_setPrototypeOf(o, p); }
- 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); }; }
- function RouteCalculateMeasureService_possibleConstructorReturn(self, call) { if (call && (RouteCalculateMeasureService_typeof(call) === "object" || typeof call === "function")) { return call; } return RouteCalculateMeasureService_assertThisInitialized(self); }
- function RouteCalculateMeasureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function RouteCalculateMeasureService_getPrototypeOf(o) { RouteCalculateMeasureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RouteCalculateMeasureService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.RouteCalculateMeasureService
- * @category iServer SpatialAnalyst RouteCalculateMeasure
- * @classdesc 基于路由对象计算指定点 M 值操作的服务类。
- * 该类负责将客户设置的计算指定点的 M 值参数传递给服务端,并接收服务端返回的
- * 指定点的 M 值。通过该类支持的事件的监听函数参数获取。
- * @extends {SuperMap.SpatialAnalystBase}
- * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @example 实例化该类如下例所示:
- * (start code)
- * var parameters = new SuperMap.RouteCalculateMeasureParameters({
- * "sourceRoute":{
- * "type":"LINEM",
- * "parts":[4],
- * "points":[
- * {
- * "measure":0,
- * "y":-6674.466867067764,
- * "x":3817.3527876130133
- * },
- * {
- * "measure":199.57954019411724,
- * "y":-6670.830929417594,
- * "x":3617.806369901496
- * },
- * {
- * "measure":609.3656478634477,
- * "y":-6877.837541432356,
- * "x":3264.1498746678444
- * },
- * {
- * "measure":936.0174126282958,
- * "y":-7038.687780615184,
- * "x":2979.846206068903
- * }
- * ]
- * },
- * "tolerance":1,
- * "point":{
- * "x":3330.7754269417,
- * "y":-6838.8394457216
- * },
- * "isIgnoreGap":false
- * });
- *
- * var routeCalculateMeasureService = new SuperMap.RouteCalculateMeasureService(spatialAnalystURL, {
- * eventListeners:{
- * processCompleted:calculateCompleted,
- * processFailed:calculateFailded
- * }
- * );
- * routeCalculateMeasureService.processAsync(parameters);
- *
- * //执行
- * function calculateCompleted(){todo}
- * function calculateFailded(){todo}
- * (end)
- *
- */
- var RouteCalculateMeasureService = /*#__PURE__*/function (_SpatialAnalystBase) {
- RouteCalculateMeasureService_inherits(RouteCalculateMeasureService, _SpatialAnalystBase);
- var _super = RouteCalculateMeasureService_createSuper(RouteCalculateMeasureService);
- function RouteCalculateMeasureService(url, options) {
- var _this;
- RouteCalculateMeasureService_classCallCheck(this, RouteCalculateMeasureService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.RouteCalculateMeasureService";
- return _this;
- }
- /**
- * @override
- */
- RouteCalculateMeasureService_createClass(RouteCalculateMeasureService, [{
- key: "destroy",
- value: function destroy() {
- RouteCalculateMeasureService_get(RouteCalculateMeasureService_getPrototypeOf(RouteCalculateMeasureService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.RouteCalculateMeasureService.prototype.processAsync
- * @description 负责将客户端的基于路由对象计算指定点 M 值操作的参数传递到服务端。
- * @param {SuperMap.RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof RouteCalculateMeasureParameters)) {
- return;
- }
- var me = this,
- jsonParameters;
- jsonParameters = me.getJsonParameters(params);
- me.request({
- method: "POST",
- data: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.RouteCalculateMeasureService.prototype.getJsonParameters
- * @description 将参数转化为 JSON 字符串。
- * @param {SuperMap.RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
- * @returns {Object} 转化后的 JSON 字符串。
- */
- }, {
- key: "getJsonParameters",
- value: function getJsonParameters(params) {
- var jsonParameters,
- jsonStr = "geometry/calculatemeasure",
- me = this;
- me.url = Util.urlPathAppend(me.url, jsonStr);
- me.url = Util.urlAppend(me.url, 'returnContent=true');
- jsonParameters = Util.toJSON(params);
- return jsonParameters;
- }
- }]);
- return RouteCalculateMeasureService;
- }(SpatialAnalystBase);
- SuperMap.RouteCalculateMeasureService = RouteCalculateMeasureService;
- ;// CONCATENATED MODULE: ./src/common/iServer/RouteLocatorParameters.js
- function RouteLocatorParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function RouteLocatorParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteLocatorParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteLocatorParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.RouteLocatorParameters
- * @category iServer SpatialAnalyst RouteLocator
- * @classdesc 路由对象定位空间对象的参数类。
- * 参数有两种方式,分别为 Geometry 和 Dataset 两种,前者需要指定 sourceRoute 对象作为参数,后者需要 dataset,routeIDField,routeID 三个参数
- * 如果用户两种参数均设置,优先选择 Dataset 方式。
- * @param {Object} options - 参数。
- * @param {(SuperMap.Route|L.Polyline|ol.geom.LineString)} options.sourceRoute - 路由对象。
- * @param {float} options.measure - 定位点的 M 值。只当路由对象定位点时有意义。
- * @param {string} [options.type] - 类型:点 or 线。
- * @param {float} [options.offset=0] - 定位点偏移量。只当路由对象定位点时有意义。
- * @param {boolean} [options.isIgnoreGap=false] - 是否忽略子对象之间的距离。即不忽略子对象之间的距离。
- * @param {float} [options.startMeasure] - 定位线的起始 M 值。只当路由对象定位线时有意义。
- * @param {float} [options.endMeasure] - 定位线的终止 M 值。只当路由对象定位线时有意义。
- */
- var RouteLocatorParameters = /*#__PURE__*/function () {
- function RouteLocatorParameters(options) {
- RouteLocatorParameters_classCallCheck(this, RouteLocatorParameters);
- if (!options) {
- return this;
- }
- /**
- * @member {(SuperMap.Route|L.Polyline|ol.geom.LineString)} SuperMap.RouteLocatorParameters.prototype.sourceRoute
- * @description 路由对象。
- */
- this.sourceRoute = null;
- /**
- * @member {string} SuperMap.RouteLocatorParameters.prototype.dataset
- * @description 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示。
- */
- this.dataset = null;
- /**
- * @member {string} SuperMap.RouteLocatorParameters.prototype.routeIDField
- * @description 路由对象所在的字段名称。
- *
- */
- this.routeIDField = null;
- /**
- * @member {number} SuperMap.RouteLocatorParameters.prototype.routeID
- * @description 路由对象标识。
- *
- */
- this.routeID = null;
- /**
- * @member {string} [SuperMap.RouteLocatorParameters.prototype.type]
- * @description 类型:点 or 线。
- * 可选值为:
- * LINE :根据起始 M 值及终止 M 值定位线对象。
- * POINT : 根据 M 值定位点对象。
- */
- this.type = null;
- /**
- * @member {float} SuperMap.RouteLocatorParameters.prototype.measure
- * @description 定位点的 M 值。只当路由对象定位点时有意义。
- */
- this.measure = null;
- /**
- * @member {float} [SuperMap.RouteLocatorParameters.prototype.offset=0]
- * @description 定位点偏移量。只当路由对象定位点时有意义。
- */
- this.offset = 0;
- /**
- * @member {boolean} [SuperMap.RouteLocatorParameters.prototype.isIgnoreGap=false]
- * @description 是否忽略子对象之间的距离。
- */
- this.isIgnoreGap = false;
- /**
- * @member {float} [SuperMap.RouteLocatorParameters.prototype.startMeasure]
- * @description 定位线的起始 M 值。只当路由对象定位线时有意义。
- */
- this.startMeasure = null;
- /**
- * @member {float} [SuperMap.RouteLocatorParameters.prototype.endMeasure]
- * @description 定位线的终止 M 值。只当路由对象定位线时有意义。
- */
- this.endMeasure = null;
- var routeFromClient = options.sourceRoute;
- var routeHandle = {};
- if (routeFromClient && routeFromClient instanceof Geometry && routeFromClient.components) {
- routeHandle.type = routeFromClient.type;
- routeHandle.parts = routeFromClient.parts;
- var parts = [];
- for (var i = 0, len = routeFromClient.components.length; i < len; i++) {
- parts = parts.concat(routeFromClient.components[i].components);
- }
- routeHandle.points = parts;
- options.sourceRoute = routeHandle;
- }
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.RouteLocatorParameters";
- }
- /**
- * @function SuperMap.RouteLocatorParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- RouteLocatorParameters_createClass(RouteLocatorParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.sourceRoute = null;
- me.type = null;
- me.measure = null;
- me.offset = 0;
- me.isIgnoreGap = false;
- me.startMeasure = null;
- me.endMeasure = null;
- me.dataset = null;
- me.routeID = null;
- me.routeIDField = null;
- }
- }]);
- return RouteLocatorParameters;
- }();
- SuperMap.RouteLocatorParameters = RouteLocatorParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/RouteLocatorService.js
- 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); }
- function RouteLocatorService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function RouteLocatorService_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteLocatorService_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteLocatorService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function RouteLocatorService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RouteLocatorService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function RouteLocatorService_setPrototypeOf(o, p) { RouteLocatorService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RouteLocatorService_setPrototypeOf(o, p); }
- 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); }; }
- function RouteLocatorService_possibleConstructorReturn(self, call) { if (call && (RouteLocatorService_typeof(call) === "object" || typeof call === "function")) { return call; } return RouteLocatorService_assertThisInitialized(self); }
- function RouteLocatorService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function RouteLocatorService_getPrototypeOf(o) { RouteLocatorService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RouteLocatorService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.RouteLocatorService
- * @category iServer SpatialAnalyst RouteLocator
- * @classdesc 路由对象定位空间对象的服务类。
- * @extends {SuperMap.SpatialAnalystBase}
- * @param {string} url -服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
- * @param {Object} options - 参数。</br>
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @example 实例化该类如下例所示:
- * (start code)
- * var routeLocatorParameters_point = new SuperMap.RouteLocatorParameters({
- * "sourceRoute":{
- * "type":"LINEM",
- * "parts":[4],
- * "points":[
- * {
- * "measure":0,
- * "y":-6674.466867067764,
- * "x":3817.3527876130133
- * },
- * {
- * "measure":199.57954019411724,
- * "y":-6670.830929417594,
- * "x":3617.806369901496
- * },
- * {
- * "measure":609.3656478634477,
- * "y":-6877.837541432356,
- * "x":3264.1498746678444
- * },
- * {
- * "measure":936.0174126282958,
- * "y":-7038.687780615184,
- * "x":2979.846206068903
- * }
- * ]
- * },
- * "type":"POINT",
- * "measure":10,
- * "offset":3,
- * "isIgnoreGap":true
- * });
- * var routeLocatorService = new SuperMap.RouteLocatorService(spatialAnalystURL, {
- * eventListeners:{
- * processCompleted:routeLocatorCompleted,
- * processFailed:routeLocatorFailded
- * }
- * );
- * routeLocatorService.processAsync(routeLocatorParameters_point);
- *
- * //执行
- * function routeLocatorCompleted(){todo}
- * function routeLocatorFailded(){todo}
- * (end)
- *
- */
- var RouteLocatorService = /*#__PURE__*/function (_SpatialAnalystBase) {
- RouteLocatorService_inherits(RouteLocatorService, _SpatialAnalystBase);
- var _super = RouteLocatorService_createSuper(RouteLocatorService);
- function RouteLocatorService(url, options) {
- var _this;
- RouteLocatorService_classCallCheck(this, RouteLocatorService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.RouteLocatorService";
- return _this;
- }
- /**
- * @override
- */
- RouteLocatorService_createClass(RouteLocatorService, [{
- key: "destroy",
- value: function destroy() {
- RouteLocatorService_get(RouteLocatorService_getPrototypeOf(RouteLocatorService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.RouteLocatorService.prototype.processAsync
- * @description 负责将客户端的基于路由对象计算指定点 M 值操作的参数传递到服务端。
- * @param {SuperMap.RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof RouteLocatorParameters)) {
- return;
- }
- var me = this,
- jsonParameters;
- jsonParameters = me.getJsonParameters(params);
- me.request({
- method: "POST",
- data: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.RouteLocatorService.prototype.processAsync
- * @description 将参数转化为 JSON 字符串。
- * @param {SuperMap.RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
- * @returns {Object} 转化后的JSON字符串。
- */
- }, {
- key: "getJsonParameters",
- value: function getJsonParameters(params) {
- var jsonParameters,
- jsonStr = "geometry/routelocator",
- me = this;
- if (params.dataset) {
- jsonStr = "datasets/" + params.dataset + "/linearreferencing/routelocator";
- params.sourceRoute = null;
- }
- me.url = Util.urlPathAppend(me.url, jsonStr);
- me.url = Util.urlAppend(me.url, 'returnContent=true');
- jsonParameters = Util.toJSON(params);
- return jsonParameters;
- }
- }]);
- return RouteLocatorService;
- }(SpatialAnalystBase);
- SuperMap.RouteLocatorService = RouteLocatorService;
- ;// CONCATENATED MODULE: ./src/common/iServer/ServerFeature.js
- function ServerFeature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ServerFeature_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerFeature_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerFeature_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ServerFeature
- * @category iServer
- * @classdesc 服务端矢量要素类。该类描述了服务端返回的矢量要素的相关信息,包括字段和几何信息。
- * @param {Object} options - 参数。
- * @param {SuperMap.ServerGeometry} geometry - 矢量要素的几何信息。
- * @param {Array.<string>} [options.fieldNames] - 矢量要素的属性字段名集合。
- * @param {Array.<string>} [options.fieldValues] - 矢量要素的属性字段值集合。
- */
- var ServerFeature = /*#__PURE__*/function () {
- function ServerFeature(options) {
- ServerFeature_classCallCheck(this, ServerFeature);
- /**
- * @member {Array.<string>} [SuperMap.ServerFeature.prototype.fieldNames]
- * @description 矢量要素的属性字段名集合。
- */
- this.fieldNames = null;
- /**
- * @member {Array.<string>} [SuperMap.ServerFeature.prototype.fieldValues]
- * @description 矢量要素的属性字段值集合。
- */
- this.fieldValues = null;
- /**
- * @member {SuperMap.ServerGeometry} SuperMap.ServerFeature.prototype.geometry
- * @description 矢量要素的几何信息。
- */
- this.geometry = null;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ServerFeature";
- }
- /**
- * @function SuperMap.ServerFeature.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ServerFeature_createClass(ServerFeature, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.fieldNames = null;
- me.fieldValues = null;
- if (me.geometry) {
- me.geometry.destroy();
- me.geometry = null;
- }
- }
- /**
- * @function SuperMap.ServerFeature.prototype.toFeature
- * @description 将服务端矢量要素 ServerFeature 转换为客户端矢量要素 Feature。
- * @returns {SuperMap.Vector} 转换后的客户端矢量要素。
- */
- }, {
- key: "toFeature",
- value: function toFeature() {
- var names,
- values,
- geo,
- attr = {},
- me = this,
- feature;
- names = me.fieldNames;
- values = me.fieldValues;
- for (var i in names) {
- attr[names[i]] = values[i];
- }
- if (me.geometry) {
- geo = me.geometry.toGeometry();
- }
- feature = new Vector(geo, attr);
- if (me.geometry && me.geometry.id) {
- feature.fid = me.geometry.id;
- }
- return feature;
- }
- /**
- * @function SuperMap.ServerFeature.prototype.fromJson
- * @description 将 JSON 对象表示服务端矢量要素转换为 ServerFeature。
- * @param {Object} jsonObject - 要转换的 JSON 对象。
- * @returns {SuperMap.ServerFeature} 转化后的 ServerFeature 对象。
- */
- }], [{
- key: "fromJson",
- value: function fromJson(jsonObject) {
- var geo = null;
- if (!jsonObject) {
- return;
- }
- geo = jsonObject.geometry;
- if (geo) {
- geo = ServerGeometry.fromJson(geo);
- }
- return new ServerFeature({
- fieldNames: jsonObject.fieldNames,
- fieldValues: jsonObject.fieldValues,
- geometry: geo
- });
- }
- }]);
- return ServerFeature;
- }();
- SuperMap.ServerFeature = ServerFeature;
- ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerInfoParameters.js
- function SetLayerInfoParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SetLayerInfoParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerInfoParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerInfoParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.SetLayerInfoParameters
- * @category iServer Map TempLayersSet
- * @classdesc 设置图层信息参数类.
- * @param {Object} options - 参数。
- * @param {string} options.resourceID - 临时图层的资源 ID。
- * @param {string} options.tempLayerName - 临时图层下的子图层名。
- * @param {string} options.layerInfo - 要更新的图层信息。
- */
- var SetLayerInfoParameters = /*#__PURE__*/function () {
- function SetLayerInfoParameters(options) {
- SetLayerInfoParameters_classCallCheck(this, SetLayerInfoParameters);
- options = options || {};
- /**
- * @member {string} SuperMap.SetLayerInfoParameters.prototype.resourceID
- * @description 临时图层的资源 ID。
- */
- this.resourceID = null;
- /**
- * @member {string} SuperMap.SetLayerInfoParameters.prototype.tempLayerName
- * @description 临时图层下子图层(或者其子图层)名,如:Countries@World.3@@World。
- */
- this.tempLayerName = null;
- /**
- * @member {Object} SuperMap.SetLayerInfoParameters.prototype.layerInfo
- * @description 要更新的图层信息(包含修改和未修改的所有字段)。该参数可以通过图层信息服务获取,然后对返回值中 subLayers.layers[i] 图层信息属性进行修改。
- */
- this.layerInfo = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.SetLayerInfoParameters";
- }
- /**
- * @function SuperMap.SetLayerInfoParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- SetLayerInfoParameters_createClass(SetLayerInfoParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.resourceID = null;
- me.tempLayerName = null;
- me.layerInfo = null;
- }
- }]);
- return SetLayerInfoParameters;
- }();
- SuperMap.SetLayerInfoParameters = SetLayerInfoParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerInfoService.js
- 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); }
- function SetLayerInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SetLayerInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerInfoService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SetLayerInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayerInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SetLayerInfoService_setPrototypeOf(o, p) { SetLayerInfoService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SetLayerInfoService_setPrototypeOf(o, p); }
- 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); }; }
- function SetLayerInfoService_possibleConstructorReturn(self, call) { if (call && (SetLayerInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } return SetLayerInfoService_assertThisInitialized(self); }
- function SetLayerInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SetLayerInfoService_getPrototypeOf(o) { SetLayerInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayerInfoService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.SetLayerInfoService
- * @category iServer Map TempLayersSet
- * @classdesc 设置图层信息服务类。可以实现临时图层中子图层的修改
- * 该类负责将图层设置参数传递到服务端,并获取服务端返回的结果信息。
- * @extends {SuperMap.CommonServiceBase}
- * @param {string} url - 与客户端交互的地图服务地址。请求地图服务,URL 应为:
- * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World";
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var SetLayerInfoService = /*#__PURE__*/function (_CommonServiceBase) {
- SetLayerInfoService_inherits(SetLayerInfoService, _CommonServiceBase);
- var _super = SetLayerInfoService_createSuper(SetLayerInfoService);
- function SetLayerInfoService(url, options) {
- var _this;
- SetLayerInfoService_classCallCheck(this, SetLayerInfoService);
- _this = _super.call(this, url, options);
- if (options) {
- Util.extend(SetLayerInfoService_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.SetLayerInfoService";
- return _this;
- }
- /**
- * @override
- */
- SetLayerInfoService_createClass(SetLayerInfoService, [{
- key: "destroy",
- value: function destroy() {
- SetLayerInfoService_get(SetLayerInfoService_getPrototypeOf(SetLayerInfoService.prototype), "destroy", this).call(this);
- Util.reset(this);
- }
- /**
- * @function SuperMap.SetLayerInfoService.prototype.processAsync
- * @description 负责将客户端的更新参数传递到服务端。
- * @param {Object} params - 修改后的图层资源信息。
- * 该参数可以使用获取图层信息服务<{@link SuperMap.GetLayersInfoService}>返回图层信息,解析结果result.subLayers.layers[i],然后对其属性进行修改来获取。
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!params) {
- return;
- }
- var me = this;
- var jsonParamsStr = Util.toJSON(params);
- me.request({
- method: "PUT",
- data: jsonParamsStr,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return SetLayerInfoService;
- }(CommonServiceBase);
- SuperMap.SetLayerInfoService = SetLayerInfoService;
- ;// CONCATENATED MODULE: ./src/common/iServer/SetLayersInfoParameters.js
- function SetLayersInfoParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SetLayersInfoParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayersInfoParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayersInfoParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.SetLayersInfoParameters
- * @category iServer Map TempLayersSet
- * @classdesc 设置图层信息参数类。
- * @param {Object} options - 参数。
- * @param {boolean} [options.isTempLayers=false] - 是否是临时图层。
- * @param {string} options.resourceID - 临时图层资源 ID。
- * @param {string} options.layersInfo - 要更新的图层信息。
- */
- var SetLayersInfoParameters = /*#__PURE__*/function () {
- function SetLayersInfoParameters(options) {
- SetLayersInfoParameters_classCallCheck(this, SetLayersInfoParameters);
- options = options || {};
- /**
- * @member {boolean} [SuperMap.SetLayersInfoParameters.prototype.isTempLayers=false]
- * @description 是否是临时图层。
- */
- this.isTempLayers = null;
- /**
- * @member {string} SuperMap.SetLayersInfoParameters.prototype.resourceID
- * @description 临时图层资源 ID,
- */
- this.resourceID = null;
- /**
- * @member {Object} SuperMap.SetLayersInfoParameters.prototype.layersInfo
- * @description 要更新的图层信息(包含修改和未修改的所有字段)。该参数可以通过图层信息服务获取,然后对返回值中 subLayers.layers[i] 图层信息属性进行修改。
- */
- this.layersInfo = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.SetLayersInfoParameters";
- }
- /**
- * @function SuperMap.SetLayersInfoParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- SetLayersInfoParameters_createClass(SetLayersInfoParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.isTempLayers = null;
- me.resourceID = null;
- me.layersInfo = null;
- }
- }]);
- return SetLayersInfoParameters;
- }();
- SuperMap.SetLayersInfoParameters = SetLayersInfoParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/SetLayersInfoService.js
- 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); }
- function SetLayersInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SetLayersInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayersInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayersInfoService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SetLayersInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayersInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SetLayersInfoService_setPrototypeOf(o, p) { SetLayersInfoService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SetLayersInfoService_setPrototypeOf(o, p); }
- 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); }; }
- function SetLayersInfoService_possibleConstructorReturn(self, call) { if (call && (SetLayersInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } return SetLayersInfoService_assertThisInitialized(self); }
- function SetLayersInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SetLayersInfoService_getPrototypeOf(o) { SetLayersInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayersInfoService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.SetLayersInfoService
- * @category iServer Map TempLayersSet
- * @classdesc 设置图层信息服务类。可以实现创建新的临时图层和对现有临时图层的修改,
- * 当 isTempLayers 为 false的时候执行创建临时图层。当 isTempLayers 为 ture 并且临时图层资源 resourceID 被设置有效时执行对临时图层的编辑。
- * 该类负责将图层设置参数传递到服务端,并获取服务端返回的结果信息。
- * @extends {SuperMap.CommonServiceBase}
- * @param url - {string} 与客户端交互的地图服务地址。请求地图服务,URL 应为:
- * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
- * @param {Object} options - 参数。
- * @param {string} options.resourceID - 图层资源ID,临时图层的资源ID标记。
- * @param {boolean} options.isTempLayers - 当前url对应的图层是否是临时图层。
- * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var SetLayersInfoService = /*#__PURE__*/function (_CommonServiceBase) {
- SetLayersInfoService_inherits(SetLayersInfoService, _CommonServiceBase);
- var _super = SetLayersInfoService_createSuper(SetLayersInfoService);
- function SetLayersInfoService(url, options) {
- var _this;
- SetLayersInfoService_classCallCheck(this, SetLayersInfoService);
- _this = _super.call(this, url, options);
- /**
- * @member {string} SuperMap.SetLayersInfoService.prototype.resourceID
- * @description 图层资源ID,临时图层的资源ID标记。
- */
- _this.resourceID = null;
- /**
- * @function {boolean} SuperMap.SetLayersInfoService.prototype.isTempLayers
- * @description 当前url对应的图层是否是临时图层。
- */
- _this.isTempLayers = false;
- if (options) {
- SuperMap.Util.extend(SetLayersInfoService_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.SetLayersInfoService";
- return _this;
- }
- /**
- * @override
- */
- SetLayersInfoService_createClass(SetLayersInfoService, [{
- key: "destroy",
- value: function destroy() {
- SetLayersInfoService_get(SetLayersInfoService_getPrototypeOf(SetLayersInfoService.prototype), "destroy", this).call(this);
- Util.reset(this);
- }
- /**
- * @function SuperMap.SetLayersInfoService.prototype.processAsync
- * @description 负责将客户端的更新参数传递到服务端。
- * @param {Object} params - 修改后的图层资源信息。该参数可以使用获取图层信息服务 <{@link SuperMap.GetLayersInfoService}>返回图层信息,然后对其属性进行修改来获取。
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!params) {
- return;
- }
- var jsonParams,
- subLayers = [],
- me = this,
- method = ""; //创建临时图层和设置修改临时图层信息对应不同的资源URL
- if (me.isTempLayers) {
- me.url = Util.urlPathAppend(me.url, "tempLayersSet/" + me.resourceID);
- method = "PUT";
- } else {
- me.url = Util.urlPathAppend(me.url, "tempLayersSet");
- method = "POST";
- }
- if (!params.subLayers) {
- params.subLayers = {
- layers: []
- };
- }
- if (!params.subLayers.layers) {
- params.subLayers.layers = [];
- }
- var layers = params.subLayers.layers,
- len = layers.length;
- for (var i in layers) {
- if (layers[i].ugcLayerType === "GRID") {
- var colorDictionary = {};
- var colorDics = layers[i].colorDictionarys;
- for (var j in colorDics) {
- var key = colorDics[j].elevation;
- colorDictionary[key] = colorDics[j].color;
- }
- }
- layers[i].colorDictionary = colorDictionary;
- delete layers[i].colorDictionarys;
- }
- for (var _i = 0; _i < len; _i++) {
- if (layers[_i].toJsonObject) {
- //将图层信息转换成服务端能识别的简单json对象
- subLayers.push(layers[_i].toJsonObject());
- } else {
- subLayers.push(layers[_i]);
- }
- }
- jsonParams = Util.extend(jsonParams, params);
- jsonParams.subLayers = {
- "layers": subLayers
- };
- jsonParams.object = null;
- var jsonParamsStr = Util.toJSON([jsonParams]);
- me.request({
- method: method,
- data: jsonParamsStr,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return SetLayersInfoService;
- }(CommonServiceBase);
- SuperMap.SetLayersInfoService = SetLayersInfoService;
- ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerStatusParameters.js
- function SetLayerStatusParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SetLayerStatusParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerStatusParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerStatusParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.SetLayerStatusParameters
- * @category iServer Map TempLayersSet
- * @classdesc 子图层显示控制参数类,该类存储了各子图层是否可见的状态。
- * 注意在 SuperMap iClient 系列产品中所说的图层与 SuperMap Deskpro 的地图对应,子图层与 SuperMap Deskpro 的图层对应。
- * @param {Object} options - 参数。
- * @param {Array.<SuperMap.LayerStatus>} options.layerStatusList - 获取或设置图层可见状态({@link SuperMap.LayerStatus})集合,
- * 集合中的每个 {@link SuperMap.LayerStatus} 对象代表一个子图层的可视状态。
- * @param {number} [options.holdTime=15] - 获取或设置资源在服务端保存的时间。
- * @param {string} [options.resourceID] - 获取或设置资源服务 ID。
- */
- var SetLayerStatusParameters = /*#__PURE__*/function () {
- function SetLayerStatusParameters(options) {
- SetLayerStatusParameters_classCallCheck(this, SetLayerStatusParameters);
- /**
- * @member {Array.<SuperMap.LayerStatus>} SuperMap.SetLayerStatusParameters.prototype.layerStatusList
- * @description 获取或设置图层可见状态({@link SuperMap.LayerStatus})集合,集合中的每个 {@link SuperMap.LayerStatus} 对象代表一个子图层的可视状态。
- */
- this.layerStatusList = [];
- /**
- * @member {number} [SuperMap.SetLayerStatusParameters.prototype.holdTime=15]
- * @description 获取或设置资源在服务端保存的时间。单位为分钟。
- */
- this.holdTime = 15;
- /**
- * @member {string} SuperMap.SetLayerStatusParameters.prototype.resourceID
- * @description 获取或设置资源服务ID。如果设置该参数则会在指定的 TempLayer 进行图层的显示控制;
- * 如果不设置该参数,则会首先创建一个 TempLayer ,然后在新创建的 TempLayer 进行图层的显示控制。
- */
- this.resourceID = null;
- if (options) {
- Util.extend(this, options);
- }
- }
- /**
- * @function SuperMap.SetLayerStatusParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- SetLayerStatusParameters_createClass(SetLayerStatusParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.layerStatusList = null;
- me.holdTime = null;
- me.resourceID = null;
- }
- /**
- * @function SuperMap.SetLayerStatusParameters.prototype.toJSON
- * @description 生成 JSON。
- * @returns {Object} 对应的 JSON 对象。
- */
- }, {
- key: "toJSON",
- value: function toJSON() {
- var json = '{';
- json += '"layers":[';
- var v = [];
- for (var i = 0, len = this.layerStatusList.length; i < len; i++) {
- v.push(this.layerStatusList[i].toJSON());
- }
- json += v;
- json += ']';
- json += '}';
- return json;
- }
- }]);
- return SetLayerStatusParameters;
- }();
- SuperMap.SetLayerStatusParameters = SetLayerStatusParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerStatusService.js
- 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); }
- function SetLayerStatusService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SetLayerStatusService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerStatusService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerStatusService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SetLayerStatusService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayerStatusService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SetLayerStatusService_setPrototypeOf(o, p) { SetLayerStatusService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SetLayerStatusService_setPrototypeOf(o, p); }
- 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); }; }
- function SetLayerStatusService_possibleConstructorReturn(self, call) { if (call && (SetLayerStatusService_typeof(call) === "object" || typeof call === "function")) { return call; } return SetLayerStatusService_assertThisInitialized(self); }
- function SetLayerStatusService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SetLayerStatusService_getPrototypeOf(o) { SetLayerStatusService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayerStatusService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.SetLayerStatusService
- * @category iServer Map TempLayersSet
- * @classdesc 子图层显示控制服务类。该类负责将子图层显示控制参数传递到服务端,并获取服务端返回的图层显示状态。
- * 用户获取服务端返回的各子图层显示状态有两种方式:
- * 一种是通过监听 SetLayerEvent.PROCESS_COMPLETE 事件;
- * 一种是使用 AsyncResponder 类实现异步处理。
- * @extends {SuperMap.CommonServiceBase}
- * @param {string} url - 地图服务访问地址。请求地图服务,URL 应为:
- * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var SetLayerStatusService = /*#__PURE__*/function (_CommonServiceBase) {
- SetLayerStatusService_inherits(SetLayerStatusService, _CommonServiceBase);
- var _super = SetLayerStatusService_createSuper(SetLayerStatusService);
- function SetLayerStatusService(url, options) {
- var _this;
- SetLayerStatusService_classCallCheck(this, SetLayerStatusService);
- _this = _super.call(this, url, options);
- _this.lastparams = null;
- _this.mapUrl = url;
- if (options) {
- Util.extend(SetLayerStatusService_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.SetLayerStatusService";
- return _this;
- }
- /**
- * @override
- */
- SetLayerStatusService_createClass(SetLayerStatusService, [{
- key: "destroy",
- value: function destroy() {
- SetLayerStatusService_get(SetLayerStatusService_getPrototypeOf(SetLayerStatusService.prototype), "destroy", this).call(this);
- Util.reset(this);
- }
- /**
- * @function SuperMap.SetLayerStatusService.prototype.processAsync
- * @description 负责将客户端的更新参数传递到服务端。
- * @param {Object} params - 修改后的图层资源信息。该参数可以使用获取图层信息服务{@link SuperMap.SetLayerStatusParameters}
- * 返回图层信息,然后对其属性进行修改来获取。
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof SetLayerStatusParameters)) {
- return;
- }
- var me = this,
- method = "POST";
- me.url = me.mapUrl;
- if (params.resourceID == null) {
- me.url = Util.urlPathAppend(me.url, 'tempLayersSet');
- me.lastparams = params;
- me.request({
- method: method,
- scope: me,
- success: me.createTempLayerComplete,
- failure: me.serviceProcessFailed
- });
- } else {
- me.url = Util.urlPathAppend(me.url, "tempLayersSet/" + params.resourceID);
- me.url = Util.urlAppend(me.url, "elementRemain=true&reference=" + params.resourceID + "&holdTime=" + params.holdTime.toString());
- var jsonParameters = '[{';
- jsonParameters += '"type":"UGC",';
- if (params.layerStatusList != null && params.layerStatusList.length > 0) {
- jsonParameters += '"subLayers":' + params.toJSON();
- }
- jsonParameters += ',"visible":' + true + ',';
- jsonParameters += '"name":"' + this.getMapName(this.mapUrl) + '"';
- jsonParameters += '}]';
- me.request({
- method: "PUT",
- data: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }
- /**
- * @function SuperMap.SetLayerStatusService.prototype.createTempLayerComplete
- * @description 设置完成,执行此方法。
- * @param {Object} result - 服务器返回的结果对象,记录设置操作是否成功。
- */
- }, {
- key: "createTempLayerComplete",
- value: function createTempLayerComplete(result) {
- var me = this;
- result = Util.transformResult(result);
- if (result.succeed) {
- me.lastparams.resourceID = result.newResourceID;
- }
- me.processAsync(me.lastparams);
- }
- /**
- * @function SuperMap.SetLayerStatusService.prototype.getMapName
- * @description 获取地图名称。
- * @param {Object} url - 服务地址。
- */
- }, {
- key: "getMapName",
- value: function getMapName(url) {
- var mapUrl = url;
- if (mapUrl.charAt(mapUrl.length - 1) === "/") {
- mapUrl = mapUrl.substr(0, mapUrl.length - 1);
- }
- var index = mapUrl.lastIndexOf("/");
- var mapName = mapUrl.substring(index + 1, mapUrl.length);
- return mapName;
- }
- /**
- * @function SuperMap.SetLayerStatusService.prototype.setLayerCompleted
- * @description 设置完成,执行此方法。
- * @param {Object} result - 服务器返回的结果对象,记录设置操作是否成功。
- */
- }, {
- key: "serviceProcessCompleted",
- value: function serviceProcessCompleted(result) {
- var me = this;
- result = Util.transformResult(result);
- if (result != null && me.lastparams != null) {
- result.newResourceID = me.lastparams.resourceID;
- }
- me.events.triggerEvent("processCompleted", {
- result: result
- });
- }
- }]);
- return SetLayerStatusService;
- }(CommonServiceBase);
- SuperMap.SetLayerStatusService = SetLayerStatusService;
- ;// CONCATENATED MODULE: ./src/common/iServer/SingleObjectQueryJobsParameter.js
- function SingleObjectQueryJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SingleObjectQueryJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SingleObjectQueryJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SingleObjectQueryJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.SingleObjectQueryJobsParameter
- * @category iServer ProcessingService Query
- * @classdesc 单对象空间查询分析任务参数类。
- * @param {Object} options - 参数。
- * @param {string} options.datasetName - 数据集名。
- * @param {string} options.datasetQuery - 查询对象所在的数据集名称。
- * @param {SuperMap.SpatialQueryMode} [options.mode=SuperMap.SpatialQueryMode.CONTAIN] - 空间查询模式。
- * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
- * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
- */
- var SingleObjectQueryJobsParameter = /*#__PURE__*/function () {
- function SingleObjectQueryJobsParameter(options) {
- SingleObjectQueryJobsParameter_classCallCheck(this, SingleObjectQueryJobsParameter);
- if (!options) {
- return;
- }
- /**
- * @member {string} SuperMap.SingleObjectQueryJobsParameter.prototype.datasetName
- * @description 数据集名。
- */
- this.datasetName = "";
- /**
- * @member {string} SuperMap.SingleObjectQueryJobsParameter.prototype.datasetQuery
- * @description 查询对象所在的数据集名称。
- */
- this.datasetQuery = "";
- /**
- * @member {string} SuperMap.SingleObjectQueryJobsParameter.prototype.geometryQuery
- * @description 查询对象所在的几何对象。
- */
- this.geometryQuery = "";
- /**
- * @member {SuperMap.SpatialQueryMode} [SuperMap.SingleObjectQueryJobsParameter.prototype.mode=SuperMap.SpatialQueryMode.CONTAIN]
- * @description 空间查询模式 。
- */
- this.mode = SpatialQueryMode.CONTAIN;
- /**
- * @member {SuperMap.OutputSetting} [SuperMap.SingleObjectQueryJobsParameter.prototype.output]
- * @description 输出参数设置类。
- */
- this.output = null;
- /**
- * @member {SuperMap.MappingParameters} [SuperMap.SingleObjectQueryJobsParameter.prototype.mappingParameters]
- * @description 分析后结果可视化的参数类。
- */
- this.mappingParameters = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.SingleObjectQueryJobsParameter";
- }
- /**
- * @function SuperMap.SingleObjectQueryJobsParameter.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- SingleObjectQueryJobsParameter_createClass(SingleObjectQueryJobsParameter, [{
- key: "destroy",
- value: function destroy() {
- this.datasetName = null;
- this.datasetQuery = null;
- this.geometryQuery = null;
- this.mode = null;
- if (this.output instanceof OutputSetting) {
- this.output.destroy();
- this.output = null;
- }
- if (this.mappingParameters instanceof MappingParameters) {
- this.mappingParameters.destroy();
- this.mappingParameters = null;
- }
- }
- /**
- * @function SuperMap.SingleObjectQueryJobsParameter.toObject
- * @param {Object} singleObjectQueryJobsParameter - 单对象空间查询分析任务参数。
- * @param {Object} tempObj - 目标对象。
- * @description 生成单对象空间查询分析任务对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(singleObjectQueryJobsParameter, tempObj) {
- for (var name in singleObjectQueryJobsParameter) {
- if (name === "datasetName") {
- tempObj['input'] = tempObj['input'] || {};
- tempObj['input'][name] = singleObjectQueryJobsParameter[name];
- continue;
- }
- if (name === "output") {
- tempObj['output'] = tempObj['output'] || {};
- tempObj['output'] = singleObjectQueryJobsParameter[name];
- continue;
- }
- tempObj['analyst'] = tempObj['analyst'] || {};
- tempObj['analyst'][name] = singleObjectQueryJobsParameter[name];
- if (name === 'mappingParameters') {
- tempObj['analyst'][name] = tempObj['analyst'][name] || {};
- tempObj['analyst']['mappingParameters'] = singleObjectQueryJobsParameter[name];
- }
- }
- }
- }]);
- return SingleObjectQueryJobsParameter;
- }();
- SuperMap.SingleObjectQueryJobsParameter = SingleObjectQueryJobsParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/SingleObjectQueryJobsService.js
- 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); }
- function SingleObjectQueryJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SingleObjectQueryJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SingleObjectQueryJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SingleObjectQueryJobsService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SingleObjectQueryJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SingleObjectQueryJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SingleObjectQueryJobsService_setPrototypeOf(o, p) { SingleObjectQueryJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SingleObjectQueryJobsService_setPrototypeOf(o, p); }
- 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); }; }
- function SingleObjectQueryJobsService_possibleConstructorReturn(self, call) { if (call && (SingleObjectQueryJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return SingleObjectQueryJobsService_assertThisInitialized(self); }
- function SingleObjectQueryJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SingleObjectQueryJobsService_getPrototypeOf(o) { SingleObjectQueryJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SingleObjectQueryJobsService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.SingleObjectQueryJobsService
- * @category iServer ProcessingService Query
- * @classdesc 单对象查询分析服务类
- * @extends {SuperMap.ProcessingServiceBase}
- * @param {string} url - 单对象空间查询分析服务地址。
- * @param {Object} options - 参数。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var SingleObjectQueryJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
- SingleObjectQueryJobsService_inherits(SingleObjectQueryJobsService, _ProcessingServiceBas);
- var _super = SingleObjectQueryJobsService_createSuper(SingleObjectQueryJobsService);
- function SingleObjectQueryJobsService(url, options) {
- var _this;
- SingleObjectQueryJobsService_classCallCheck(this, SingleObjectQueryJobsService);
- _this = _super.call(this, url, options);
- _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/query');
- _this.CLASS_NAME = 'SuperMap.SingleObjectQueryJobsService';
- return _this;
- }
- /**
- *@override
- */
- SingleObjectQueryJobsService_createClass(SingleObjectQueryJobsService, [{
- key: "destroy",
- value: function destroy() {
- SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.SingleObjectQueryJobsService.protitype.getQueryJobs
- * @description 获取单对象空间查询分析所有任务
- */
- }, {
- key: "getQueryJobs",
- value: function getQueryJobs() {
- SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "getJobs", this).call(this, this.url);
- }
- /**
- * @function SuperMap.KernelDensityJobsService.protitype.getQueryJob
- * @description 获取指定id的单对象空间查询分析服务
- * @param {string} id - 指定要获取数据的id
- */
- }, {
- key: "getQueryJob",
- value: function getQueryJob(id) {
- SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
- }
- /**
- * @function SuperMap.SingleObjectQueryJobsService.protitype.addQueryJob
- * @description 新建单对象空间查询分析服务
- * @param {SuperMap.SingleObjectQueryJobsParameter} params - 创建一个空间分析的请求参数。
- * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
- */
- }, {
- key: "addQueryJob",
- value: function addQueryJob(params, seconds) {
- SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "addJob", this).call(this, this.url, params, SingleObjectQueryJobsParameter, seconds);
- }
- }]);
- return SingleObjectQueryJobsService;
- }(ProcessingServiceBase);
- SuperMap.SingleObjectQueryJobsService = SingleObjectQueryJobsService;
- ;// CONCATENATED MODULE: ./src/common/iServer/StopQueryParameters.js
- function StopQueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function StopQueryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) StopQueryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) StopQueryParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.StopQueryParameters
- * @category iServer TrafficTransferAnalyst TransferStops
- * @classdesc 站点查询参数类。
- * @param {Object} options - 参数。
- * @param {string} options.keyWord - 站点名称关键字。
- * @param {boolean} [options.returnPosition=false] - 是否返回站点坐标信息。
- */
- var StopQueryParameters = /*#__PURE__*/function () {
- function StopQueryParameters(options) {
- StopQueryParameters_classCallCheck(this, StopQueryParameters);
- options = options || {};
- /**
- * @member {string} SuperMap.StopQueryParameters.prototype.keyWord
- * @description 站点名称关键字。
- */
- this.keyWord = null;
- /**
- * @member {boolean} [SuperMap.StopQueryParameters.prototype.returnPosition=false]
- * @description 是否返回站点坐标信息。
- */
- this.returnPosition = false;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.StopQueryParameters";
- }
- /**
- * @function SuperMap.StopQueryParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- StopQueryParameters_createClass(StopQueryParameters, [{
- key: "destroy",
- value: function destroy() {
- Util.reset(this);
- }
- }]);
- return StopQueryParameters;
- }();
- SuperMap.StopQueryParameters = StopQueryParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/StopQueryService.js
- 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); }
- function StopQueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function StopQueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) StopQueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) StopQueryService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function StopQueryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = StopQueryService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function StopQueryService_setPrototypeOf(o, p) { StopQueryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return StopQueryService_setPrototypeOf(o, p); }
- 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); }; }
- function StopQueryService_possibleConstructorReturn(self, call) { if (call && (StopQueryService_typeof(call) === "object" || typeof call === "function")) { return call; } return StopQueryService_assertThisInitialized(self); }
- function StopQueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function StopQueryService_getPrototypeOf(o) { StopQueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return StopQueryService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.StopQueryService
- * @category iServer TrafficTransferAnalyst TransferStops
- * @classdesc 站点查询服务类。
- * 返回结果通过该类支持的事件的监听函数参数获取
- * @extends {SuperMap.CommonServiceBase}
- * @param {string} url - 与客户端交互的站点查询服务地址。
- * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
- * @param {Object} options - 参数。</br>
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @example 例如:
- * (start code)
- * var myService = new SuperMap.StopQueryService(url, {eventListeners: {
- * "processCompleted": StopQueryCompleted,
- * "processFailed": StopQueryError
- * }
- * };
- * (end)
- *
- *
- */
- var StopQueryService = /*#__PURE__*/function (_CommonServiceBase) {
- StopQueryService_inherits(StopQueryService, _CommonServiceBase);
- var _super = StopQueryService_createSuper(StopQueryService);
- function StopQueryService(url, options) {
- var _this;
- StopQueryService_classCallCheck(this, StopQueryService);
- _this = _super.call(this, url, options);
- options = options || {};
- Util.extend(StopQueryService_assertThisInitialized(_this), options);
- _this.CLASS_NAME = "SuperMap.StopQueryService";
- return _this;
- }
- /**
- *@override
- */
- StopQueryService_createClass(StopQueryService, [{
- key: "destroy",
- value: function destroy() {
- StopQueryService_get(StopQueryService_getPrototypeOf(StopQueryService.prototype), "destroy", this).call(this);
- Util.reset(this);
- }
- /**
- * @function SuperMap.StopQueryService.prototype.processAsync
- * @description 负责将客户端的更新参数传递到服务端。
- * @param {SuperMap.StopQueryParameters} params - 交通换乘参数。
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof StopQueryParameters)) {
- return;
- }
- var me = this;
- me.url = Util.urlPathAppend(me.url, 'stops/keyword/' + params.keyWord);
- me.request({
- method: "GET",
- params: {
- returnPosition: params.returnPosition
- },
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return StopQueryService;
- }(CommonServiceBase);
- SuperMap.StopQueryService = StopQueryService;
- ;// CONCATENATED MODULE: ./src/common/iServer/SummaryAttributesJobsParameter.js
- function SummaryAttributesJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SummaryAttributesJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryAttributesJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryAttributesJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.SummaryAttributesJobsParameter
- * @category iServer ProcessingService SummaryAttributes
- * @classdesc 属性汇总分析任务参数类
- * @param {Object} options - 参数。
- * @param {string} options.datasetName - 数据集名。
- * @param {string} options.groupField - 分组字段。
- * @param {string} options.attributeField - 属性字段。
- * @param {string} options.statisticModes - 统计模式。
- * @param {SuperMap.OutputSetting} [options.output] -输出参数设置。
- * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
- */
- var SummaryAttributesJobsParameter = /*#__PURE__*/function () {
- function SummaryAttributesJobsParameter(options) {
- SummaryAttributesJobsParameter_classCallCheck(this, SummaryAttributesJobsParameter);
- if (!options) {
- return;
- }
- /**
- * @member {string} SuperMap.SummaryAttributesJobsParameter.prototype.datasetName
- * @description 汇总数据集名称。
- */
- this.datasetName = "";
- /**
- * @member {string} SuperMap.SummaryAttributesJobsParameter.prototype.groupField
- * @description 分组字段。
- */
- this.groupField = "";
- /**
- * @member {string} SuperMap.SummaryAttributesJobsParameter.prototype.attributeField
- * @description 属性字段。
- */
- this.attributeField = "";
- /**
- * @member {string} SuperMap.SummaryAttributesJobsParameter.prototype.statisticModes
- * @description 属性汇总统计模式。
- */
- this.statisticModes = "";
- /**
- * @member {SuperMap.OutputSetting} SuperMap.SummaryAttributesJobsParameter.prototype.output
- * @description 输出参数设置类。
- */
- this.output = null;
- /**
- * @member {SuperMap.MappingParameters} [SuperMap.SummaryAttributesJobsParameter.prototype.mappingParameters]
- * @description 分析后结果可视化的参数类。
- */
- this.mappingParameters = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.SummaryAttributesJobsParameter";
- }
- /**
- * @function SuperMap.SummaryAttributesJobsParameter.destroy
- * @override
- */
- SummaryAttributesJobsParameter_createClass(SummaryAttributesJobsParameter, [{
- key: "destroy",
- value: function destroy() {
- this.datasetName = null;
- this.groupField = null;
- this.attributeField = null;
- this.statisticModes = null;
- if (this.output instanceof OutputSetting) {
- this.output.destroy();
- this.output = null;
- }
- if (this.mappingParameters instanceof MappingParameters) {
- this.mappingParameters.destroy();
- this.mappingParameters = null;
- }
- }
- /**
- * @function SuperMap.SummaryAttributesJobsParameter.toObject
- * @param {Object} SummaryAttributesJobsParameter - 属性汇总任务参数。
- * @param {Object} tempObj - 目标对象。
- * @description 生成属性汇总分析任务对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(SummaryAttributesJobsParameter, tempObj) {
- for (var name in SummaryAttributesJobsParameter) {
- if (name === "datasetName") {
- tempObj['input'] = tempObj['input'] || {};
- tempObj['input'][name] = SummaryAttributesJobsParameter[name];
- continue;
- }
- if (name === "output") {
- tempObj['output'] = tempObj['output'] || {};
- tempObj['output'] = SummaryAttributesJobsParameter[name];
- continue;
- }
- tempObj['analyst'] = tempObj['analyst'] || {};
- tempObj['analyst'][name] = SummaryAttributesJobsParameter[name];
- if (name === 'mappingParameters') {
- tempObj['analyst'][name] = tempObj['analyst'][name] || {};
- tempObj['analyst']['mappingParameters'] = SummaryAttributesJobsParameter[name];
- }
- }
- }
- }]);
- return SummaryAttributesJobsParameter;
- }();
- SuperMap.SummaryAttributesJobsParameter = SummaryAttributesJobsParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/SummaryAttributesJobsService.js
- 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); }
- function SummaryAttributesJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SummaryAttributesJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryAttributesJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryAttributesJobsService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SummaryAttributesJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryAttributesJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SummaryAttributesJobsService_setPrototypeOf(o, p) { SummaryAttributesJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryAttributesJobsService_setPrototypeOf(o, p); }
- 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); }; }
- function SummaryAttributesJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryAttributesJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return SummaryAttributesJobsService_assertThisInitialized(self); }
- function SummaryAttributesJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SummaryAttributesJobsService_getPrototypeOf(o) { SummaryAttributesJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryAttributesJobsService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.SummaryAttributesJobsService
- * @category iServer ProcessingService SummaryAttributes
- * @classdesc 属性汇总分析服务类
- * @extends {SuperMap.ProcessingServiceBase}
- * @param {string} url - 汇总统计分析服务地址。
- * @param {Object} options - 参数。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var SummaryAttributesJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
- SummaryAttributesJobsService_inherits(SummaryAttributesJobsService, _ProcessingServiceBas);
- var _super = SummaryAttributesJobsService_createSuper(SummaryAttributesJobsService);
- function SummaryAttributesJobsService(url, options) {
- var _this;
- SummaryAttributesJobsService_classCallCheck(this, SummaryAttributesJobsService);
- _this = _super.call(this, url, options);
- _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/summaryattributes');
- _this.CLASS_NAME = "SuperMap.SummaryAttributesJobsService";
- return _this;
- }
- /**
- *@override
- */
- SummaryAttributesJobsService_createClass(SummaryAttributesJobsService, [{
- key: "destroy",
- value: function destroy() {
- SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.SummaryAttributesJobsService.protitype.getSummaryAttributesJobs
- * @description 获取属性汇总分析所有任务
- */
- }, {
- key: "getSummaryAttributesJobs",
- value: function getSummaryAttributesJobs() {
- SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "getJobs", this).call(this, this.url);
- }
- /**
- * @function SuperMap.SummaryAttributesJobsService.protitype.getSummaryAttributesJob
- * @description 获取指定id的属性汇总分析服务
- * @param {string} id - 指定要获取数据的id
- */
- }, {
- key: "getSummaryAttributesJob",
- value: function getSummaryAttributesJob(id) {
- SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
- }
- /**
- * @function SuperMap.SummaryAttributesJobsService.protitype.addSummaryAttributesJob
- * @description 新建属性汇总分析服务
- * @param {SuperMap.SummaryAttributesJobsParameter} params - 创建一个空间分析的请求参数。
- * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
- */
- }, {
- key: "addSummaryAttributesJob",
- value: function addSummaryAttributesJob(params, seconds) {
- SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryAttributesJobsParameter, seconds);
- }
- }]);
- return SummaryAttributesJobsService;
- }(ProcessingServiceBase);
- SuperMap.SummaryAttributesJobsService = SummaryAttributesJobsService;
- ;// CONCATENATED MODULE: ./src/common/iServer/SummaryMeshJobParameter.js
- function SummaryMeshJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SummaryMeshJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryMeshJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryMeshJobParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.SummaryMeshJobParameter
- * @category iServer ProcessingService AggregatePoints
- * @classdesc 点聚合分析任务参数类。
- * @param {Object} options - 参数。
- * @param {string} options.datasetName - 数据集名。
- * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.query] - 分析范围(默认为全图范围)。
- * @param {number} options.fields - 权重索引。
- * @param {number} [options.resolution=100] - 分辨率。
- * @param {SuperMap.StatisticAnalystMode} [options.statisticModes=SuperMap.StatisticAnalystMode.AVERAGE] - 分析模式。
- * @param {number} [options.meshType=0] - 分析类型。
- * @param {SuperMap.SummaryType} [options.type=SuperMap.SummaryType.SUMMARYMESH] - 聚合类型。
- * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
- * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
- */
- var SummaryMeshJobParameter = /*#__PURE__*/function () {
- function SummaryMeshJobParameter(options) {
- SummaryMeshJobParameter_classCallCheck(this, SummaryMeshJobParameter);
- if (!options) {
- return;
- }
- /**
- * @member {string} SuperMap.SummaryMeshJobParameter.prototype.datasetName
- * @description 数据集名。
- */
- this.datasetName = "";
- /**
- * @member {string} SuperMap.SummaryMeshJobParameter.prototype.regionDataset
- * @description 聚合面数据集(聚合类型为多边形聚合时使用的参数)。
- */
- this.regionDataset = "";
- /**
- * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.SummaryMeshJobParameter.prototype.query
- * @description 分析范围(聚合类型为网格面聚合时使用的参数)。
- */
- this.query = "";
- /**
- * @member {number} [SuperMap.SummaryMeshJobParameter.prototype.resolution=100]
- * @description 分辨率(聚合类型为网格面聚合时使用的参数)。
- */
- this.resolution = 100;
- /**
- * @member {number} [SuperMap.SummaryMeshJobParameter.prototype.meshType=0]
- * @description 网格面类型(聚合类型为网格面聚合时使用的参数),取值:0 或 1。
- */
- this.meshType = 0;
- /**
- * @member {SuperMap.StatisticAnalystMode} [SuperMap.SummaryMeshJobParameter.prototype.statisticModes=SuperMap.StatisticAnalystMode.AVERAGE]
- * @description 统计模式。
- */
- this.statisticModes = StatisticAnalystMode.AVERAGE;
- /**
- * @member {number} SuperMap.SummaryMeshJobParameter.prototype.fields
- * @description 权重字段。
- */
- this.fields = "";
- /**
- * @member {SuperMap.SummaryType} [SuperMap.SummaryMeshJobParameter.prototype.type=SuperMap.SummaryType.SUMMARYMESH]
- * @description 聚合类型。
- */
- this.type = SummaryType.SUMMARYMESH;
- /**
- * @member {SuperMap.OutputSetting} [SuperMap.SummaryMeshJobParameter.prototype.output]
- * @description 输出参数设置类。
- */
- this.output = null;
- /**
- * @member {SuperMap.MappingParameters} [SuperMap.SummaryMeshJobParameter.prototype.mappingParameters]
- * @description 分析后结果可视化的参数类。
- */
- this.mappingParameters = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.SummaryMeshJobParameter";
- }
- /**
- * @function SuperMap.SummaryMeshJobParameter.destroy
- * @override
- */
- SummaryMeshJobParameter_createClass(SummaryMeshJobParameter, [{
- key: "destroy",
- value: function destroy() {
- this.datasetName = null;
- this.query = null;
- this.resolution = null;
- this.statisticModes = null;
- this.meshType = null;
- this.fields = null;
- this.regionDataset = null;
- this.type = null;
- if (this.output instanceof OutputSetting) {
- this.output.destroy();
- this.output = null;
- }
- if (this.mappingParameters instanceof MappingParameters) {
- this.mappingParameters.destroy();
- this.mappingParameters = null;
- }
- }
- /**
- * @function SuperMap.SummaryMeshJobParameter.toObject
- * @param {Object} summaryMeshJobParameter - 点聚合分析任务参数。
- * @param {Object} tempObj - 目标对象。
- * @description 生成点聚合分析任务对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(summaryMeshJobParameter, tempObj) {
- for (var name in summaryMeshJobParameter) {
- if (name === "datasetName") {
- tempObj['input'] = tempObj['input'] || {};
- tempObj['input'][name] = summaryMeshJobParameter[name];
- continue;
- }
- if (name === "type") {
- tempObj['type'] = summaryMeshJobParameter[name];
- continue;
- }
- if (name === "output") {
- tempObj['output'] = tempObj['output'] || {};
- tempObj['output'] = summaryMeshJobParameter[name];
- continue;
- }
- if (summaryMeshJobParameter.type === 'SUMMARYMESH' && name !== 'regionDataset' || summaryMeshJobParameter.type === 'SUMMARYREGION' && !contains(['meshType', 'resolution', 'query'], name)) {
- tempObj['analyst'] = tempObj['analyst'] || {};
- if (name === 'query' && summaryMeshJobParameter[name]) {
- tempObj['analyst'][name] = summaryMeshJobParameter[name].toBBOX();
- } else {
- tempObj['analyst'][name] = summaryMeshJobParameter[name];
- }
- if (name === 'mappingParameters') {
- tempObj['analyst'][name] = tempObj['analyst'][name] || {};
- tempObj['analyst']['mappingParameters'] = summaryMeshJobParameter[name];
- }
- }
- }
- function contains(arr, obj) {
- var i = arr.length;
- while (i--) {
- if (arr[i] === obj) {
- return true;
- }
- }
- return false;
- }
- }
- }]);
- return SummaryMeshJobParameter;
- }();
- SuperMap.SummaryMeshJobParameter = SummaryMeshJobParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/SummaryMeshJobsService.js
- 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); }
- function SummaryMeshJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SummaryMeshJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryMeshJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryMeshJobsService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SummaryMeshJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryMeshJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SummaryMeshJobsService_setPrototypeOf(o, p) { SummaryMeshJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryMeshJobsService_setPrototypeOf(o, p); }
- 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); }; }
- function SummaryMeshJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryMeshJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return SummaryMeshJobsService_assertThisInitialized(self); }
- function SummaryMeshJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SummaryMeshJobsService_getPrototypeOf(o) { SummaryMeshJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryMeshJobsService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.SummaryMeshJobsService
- * @category iServer ProcessingService AggregatePoints
- * @classdesc 点聚合分析任务类。
- * @param {string} url -点聚合分析任务地址。
- * @param {Object} options - 参数。
- * @param {SuperMap.Events} options.events - 处理所有事件的对象。<br>
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
- * @param {number} options.index - 服务访问地址在数组中的位置。<br>
- * @param {number} options.length - 服务访问地址数组长度。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var SummaryMeshJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
- SummaryMeshJobsService_inherits(SummaryMeshJobsService, _ProcessingServiceBas);
- var _super = SummaryMeshJobsService_createSuper(SummaryMeshJobsService);
- function SummaryMeshJobsService(url, options) {
- var _this;
- SummaryMeshJobsService_classCallCheck(this, SummaryMeshJobsService);
- _this = _super.call(this, url, options);
- _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/aggregatepoints');
- _this.CLASS_NAME = 'SuperMap.SummaryMeshJobsService';
- return _this;
- }
- /**
- * @override
- */
- SummaryMeshJobsService_createClass(SummaryMeshJobsService, [{
- key: "destroy",
- value: function destroy() {
- SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.SummaryMeshJobsService.prototype.getSummaryMeshJobs
- * @description 获取点聚合分析任务
- */
- }, {
- key: "getSummaryMeshJobs",
- value: function getSummaryMeshJobs() {
- SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "getJobs", this).call(this, this.url);
- }
- /**
- * @function SuperMap.SummaryMeshJobsService.prototype.getSummaryMeshJob
- * @description 获取指定ip的点聚合分析任务
- * @param {string} id - 指定要获取数据的id
- */
- }, {
- key: "getSummaryMeshJob",
- value: function getSummaryMeshJob(id) {
- SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
- }
- /**
- * @function SuperMap.SummaryMeshJobsService.prototype.addSummaryMeshJob
- * @description 新建点聚合分析服务
- * @param {SuperMap.SummaryMeshJobParameter} params - 创建一个空间分析的请求参数。
- * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
- */
- }, {
- key: "addSummaryMeshJob",
- value: function addSummaryMeshJob(params, seconds) {
- SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryMeshJobParameter, seconds);
- }
- }]);
- return SummaryMeshJobsService;
- }(ProcessingServiceBase);
- SuperMap.SummaryMeshJobsService = SummaryMeshJobsService;
- ;// CONCATENATED MODULE: ./src/common/iServer/SummaryRegionJobParameter.js
- function SummaryRegionJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SummaryRegionJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryRegionJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryRegionJobParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.SummaryRegionJobParameter
- * @category iServer ProcessingService SummaryRegion
- * @classdesc 区域汇总分析任务参数类。
- * @param {Object} options - 参数。
- * @param {string} options.datasetName - 数据集名。
- * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.query] - 分析范围(默认为全图范围)。
- * @param {string} [options.standardFields] - 标准属性字段名称。
- * @param {string} [options.weightedFields] - 权重字段名称。
- * @param {SuperMap.StatisticAnalystMode} [options.standardStatisticModes] - 标准属性字段的统计模式。standardSummaryFields 为 true 时必填。
- * @param {SuperMap.StatisticAnalystMode} [options.weightedStatisticModes] - 权重字段的统计模式。weightedSummaryFields 为 true 时必填。
- * @param {boolean} [options.sumShape=true] - 是否统计长度或面积。
- * @param {boolean} [options.standardSummaryFields=false] - 是否以标准属字段统计。
- * @param {boolean} [options.weightedSummaryFields=false] - 是否以权重字段统计。
- * @param {number} [options.resolution=100] - 网格大小。
- * @param {number} [options.meshType=0] - 网格面汇总类型。
- * @param {SuperMap.AnalystSizeUnit} [options.meshSizeUnit=SuperMap.AnalystSizeUnit.METER] - 网格大小单位。
- * @param {SuperMap.SummaryType} [options.type=SuperMap.SummaryType.SUMMARYMESH] - 汇总类型。
- * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
- * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
- */
- var SummaryRegionJobParameter = /*#__PURE__*/function () {
- function SummaryRegionJobParameter(options) {
- SummaryRegionJobParameter_classCallCheck(this, SummaryRegionJobParameter);
- if (!options) {
- return;
- }
- /**
- * @member {string} SuperMap.SummaryRegionJobParameter.prototype.datasetName
- * @description 数据集名。
- */
- this.datasetName = "";
- /**
- * @member {string} SuperMap.SummaryRegionJobParameter.prototype.regionDataset
- * @description 汇总数据源(多边形汇总时用到的参数)。
- */
- this.regionDataset = "";
- /**
- * @member {boolean} [SuperMap.SummaryRegionJobParameter.prototype.sumShape=true]
- * @description 是否统计长度或面积。
- */
- this.sumShape = true;
- /**
- * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.SummaryRegionJobParameter.prototype.query
- * @description 分析范围。
- */
- this.query = "";
- /**
- * @member {boolean} [SuperMap.SummaryRegionJobParameter.prototype.standardSummaryFields=false]
- * @description 是否以标准属字段统计。
- */
- this.standardSummaryFields = false;
- /**
- * @member {string} SuperMap.SummaryRegionJobParameter.prototype.standardFields
- * @description 标准属性字段名称。仅支持系统字段以外的整形、长整形、浮点型的字段的名称。standardSummaryFields 为 true 时必填。
- */
- this.standardFields = "";
- /**
- * @member {SuperMap.StatisticAnalystMode} SuperMap.SummaryRegionJobParameter.prototype.standardStatisticModes
- * @description 标准属性字段的统计模式。standardSummaryFields 为 true 时必填。
- */
- this.standardStatisticModes = "";
- /**
- * @member {boolean} [SuperMap.SummaryRegionJobParameter.prototype.weightedSummaryFields=false]
- * @description 是否以权重字段统计。
- */
- this.weightedSummaryFields = false;
- /**
- * @member {string} SuperMap.SummaryRegionJobParameter.prototype.weightedFields
- * @description 权重字段名称。仅支持系统字段以外的整形、长整形、浮点型的字段的名称。weightedSummaryFields 为 true 时必填。
- */
- this.weightedFields = "";
- /**
- * @member {SuperMap.StatisticAnalystMode} SuperMap.SummaryRegionJobParameter.prototype.weightedStatisticModes
- * @description 以权重字段统计的统计模式。权重字段的统计模式。weightedSummaryFields 为 true 时必填。
- */
- this.weightedStatisticModes = "";
- /**
- * @member {number} [SuperMap.SummaryRegionJobParameter.prototype.meshType=0]
- * @description 网格面汇总类型。
- */
- this.meshType = 0;
- /**
- * @member {number} [SuperMap.SummaryRegionJobParameter.prototype.resolution=100]
- * @description 网格大小。
- */
- this.resolution = 100;
- /**
- * @member {SuperMap.AnalystSizeUnit} [SuperMap.SummaryRegionJobParameter.prototype.meshSizeUnit=SuperMap.AnalystSizeUnit.METER]
- * @description 网格大小单位。
- */
- this.meshSizeUnit = AnalystSizeUnit.METER;
- /**
- * @member {SuperMap.SummaryType} [SuperMap.SummaryRegionJobParameter.prototype.type=SuperMap.SummaryType.SUMMARYMESH]
- * @description 汇总类型。
- */
- this.type = SummaryType.SUMMARYMESH;
- /**
- * @member {SuperMap.OutputSetting} SuperMap.SummaryRegionJobParameter.prototype.output
- * @description 输出参数设置类
- */
- this.output = null;
- /**
- * @member {SuperMap.MappingParameters} [SuperMap.SummaryRegionJobParameter.prototype.mappingParameters]
- * @description 分析后结果可视化的参数类。
- */
- this.mappingParameters = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.SummaryRegionJobParameter";
- }
- /**
- * @function SuperMap.SummaryRegionJobParameter.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- SummaryRegionJobParameter_createClass(SummaryRegionJobParameter, [{
- key: "destroy",
- value: function destroy() {
- this.datasetName = null;
- this.sumShape = null;
- this.regionDataset = null;
- this.query = null;
- this.standardSummaryFields = null;
- this.standardFields = null;
- this.standardStatisticModes = null;
- this.weightedSummaryFields = null;
- this.weightedFields = null;
- this.weightedStatisticModes = null;
- this.meshType = null;
- this.resolution = null;
- this.meshSizeUnit = null;
- this.type = null;
- if (this.output instanceof OutputSetting) {
- this.output.destroy();
- this.output = null;
- }
- if (this.mappingParameters instanceof MappingParameters) {
- this.mappingParameters.destroy();
- this.mappingParameters = null;
- }
- }
- /**
- * @function SuperMap.SummaryRegionJobParameter.toObject
- * @param {Object} summaryRegionJobParameter - 矢量裁剪分析任务参数。
- * @param {Object} tempObj - 目标对象。
- * @description 生成区域汇总分析服务对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(summaryRegionJobParameter, tempObj) {
- for (var name in summaryRegionJobParameter) {
- if (name === "datasetName") {
- tempObj['input'] = tempObj['input'] || {};
- tempObj['input'][name] = summaryRegionJobParameter[name];
- continue;
- }
- if (name === "type") {
- tempObj['type'] = summaryRegionJobParameter[name];
- continue;
- }
- if (name === "type") {
- tempObj['type'] = summaryRegionJobParameter[name];
- continue;
- }
- if (name === "output") {
- tempObj['output'] = tempObj['output'] || {};
- tempObj['output'] = summaryRegionJobParameter[name];
- continue;
- }
- if (summaryRegionJobParameter.type === "SUMMARYREGION" || summaryRegionJobParameter.type === "SUMMARYMESH" && name !== "regionDataset") {
- tempObj['analyst'] = tempObj['analyst'] || {};
- if (name === 'query' && summaryRegionJobParameter[name]) {
- tempObj['analyst'][name] = summaryRegionJobParameter[name].toBBOX();
- } else {
- tempObj['analyst'][name] = summaryRegionJobParameter[name];
- }
- if (name === 'mappingParameters') {
- tempObj['analyst'][name] = tempObj['analyst'][name] || {};
- tempObj['analyst']['mappingParameters'] = summaryRegionJobParameter[name];
- }
- }
- }
- }
- }]);
- return SummaryRegionJobParameter;
- }();
- SuperMap.SummaryRegionJobParameter = SummaryRegionJobParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/SummaryRegionJobsService.js
- 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); }
- function SummaryRegionJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SummaryRegionJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryRegionJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryRegionJobsService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SummaryRegionJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryRegionJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SummaryRegionJobsService_setPrototypeOf(o, p) { SummaryRegionJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryRegionJobsService_setPrototypeOf(o, p); }
- 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); }; }
- function SummaryRegionJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryRegionJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return SummaryRegionJobsService_assertThisInitialized(self); }
- function SummaryRegionJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SummaryRegionJobsService_getPrototypeOf(o) { SummaryRegionJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryRegionJobsService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.SummaryRegionJobsService
- * @category iServer ProcessingService SummaryRegion
- * @classdesc 区域汇总分析服务类
- * @extends {SuperMap.ProcessingServiceBase}
- * @param {string} url - 区域汇总分析服务地址。
- * @param {Object} options - 参数。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var SummaryRegionJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
- SummaryRegionJobsService_inherits(SummaryRegionJobsService, _ProcessingServiceBas);
- var _super = SummaryRegionJobsService_createSuper(SummaryRegionJobsService);
- function SummaryRegionJobsService(url, options) {
- var _this;
- SummaryRegionJobsService_classCallCheck(this, SummaryRegionJobsService);
- _this = _super.call(this, url, options);
- _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/summaryregion');
- _this.CLASS_NAME = 'SuperMap.SummaryRegionJobsService';
- return _this;
- }
- /**
- *@override
- */
- SummaryRegionJobsService_createClass(SummaryRegionJobsService, [{
- key: "destroy",
- value: function destroy() {
- SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.SummaryRegionJobsService.prototype.getSummaryRegionJobs
- * @description 获取区域汇总分析任务集合。
- */
- }, {
- key: "getSummaryRegionJobs",
- value: function getSummaryRegionJobs() {
- SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "getJobs", this).call(this, this.url);
- }
- /**
- * @function SuperMap.SummaryRegionJobsService.prototype.getSummaryRegionJob
- * @description 获取指定id的区域汇总分析任务。
- * @param {string} id -要获取区域汇总分析任务的id
- */
- }, {
- key: "getSummaryRegionJob",
- value: function getSummaryRegionJob(id) {
- SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
- }
- /**
- * @function SuperMap.SummaryRegionJobsService.prototype.addSummaryRegionJob
- * @description 新建区域汇总任务。
- * @param {SuperMap.SummaryRegionJobParameter} params - 创建一个区域汇总任务的请求参数。
- * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
- */
- }, {
- key: "addSummaryRegionJob",
- value: function addSummaryRegionJob(params, seconds) {
- SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryRegionJobParameter, seconds);
- }
- }]);
- return SummaryRegionJobsService;
- }(ProcessingServiceBase);
- SuperMap.SummaryRegionJobsService = SummaryRegionJobsService;
- ;// CONCATENATED MODULE: ./src/common/iServer/SupplyCenter.js
- function SupplyCenter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SupplyCenter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SupplyCenter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SupplyCenter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.SupplyCenter
- * @category iServer NetworkAnalyst Location
- * @classdesc 资源供给中心类。在资源分配和选址分区分析两个功能中使用。
- * @param {Object} options - 参数。
- * @param {number} options.maxWeight - 资源供给中心的最大耗费值。
- * @param {number} options.nodeID - 资源供给中心点的结点 ID 号。资源供给中心必须是结点。
- * @param {number} options.resourceValue - 资源供给中心能提供的最大服务量或商品数量。
- * @param {SuperMap.SupplyCenterType} [options.type] - 资源供给中心点的类型常量。
- */
- var SupplyCenter = /*#__PURE__*/function () {
- function SupplyCenter(options) {
- SupplyCenter_classCallCheck(this, SupplyCenter);
- /**
- * @member {number} SuperMap.SupplyCenter.prototype.maxWeight
- * @description 资源供给中心的最大耗费值。中心点最大阻值设置越小,表示中心点所提供的资源可影响范围越大。
- * 最大阻力值是用来限制需求点到中心点的花费。
- * 如果需求点(弧段或结点)到此中心的花费大于最大阻力值,则该需求点不属于该资源供给中心提供资源的范围。
- */
- this.maxWeight = null;
- /**
- * @member {number} SuperMap.SupplyCenter.prototype.nodeID
- * @description 资源供给中心点的结点 ID 号,资源供给中心必须是结点。
- */
- this.nodeID = null;
- /**
- * @member {number} SuperMap.SupplyCenter.prototype.resourceValue
- * @description 资源供给中心能提供的最大服务量或商品数量。例如资源中心为学校,资源中心资源量表示该学校能够接纳多少学生。
- */
- this.resourceValue = null;
- /**
- * @member {SuperMap.SupplyCenterType} [SuperMap.SupplyCenter.prototype.type]
- * @description 资源供给中心点的类型常量。资源供给中心点的类型包括非中心,固定中心和可选中心。
- * 固定中心用于资源分配分析;固定中心和可选中心用于选址分析;非中心在两种网络分析时都不予考虑。
- */
- this.type = null;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.SupplyCenter";
- }
- /**
- * @function SuperMap.SupplyCenter.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- SupplyCenter_createClass(SupplyCenter, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.maxWeight = null;
- me.nodeID = null;
- me.resourceValue = null;
- me.type = null;
- }
- /**
- * @function SuperMap.SupplyCenter.fromJson
- * @description 将服务端 JSON 对象转换成当前客户端对象。
- * @param {Object} jsonObject - 要转换的 JSON 对象。
- * @returns {SuperMap.SupplyCenter} SupplyCenter 对象。
- */
- }], [{
- key: "fromJson",
- value: function fromJson(jsonObject) {
- if (!jsonObject) {
- return;
- }
- return new SupplyCenter({
- maxWeight: jsonObject.maxWeight,
- nodeID: jsonObject.nodeID,
- resourceValue: jsonObject.resourceValue,
- type: jsonObject.type
- });
- }
- }]);
- return SupplyCenter;
- }();
- SuperMap.SupplyCenter = SupplyCenter;
- ;// CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystService.js
- 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); }
- function SurfaceAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SurfaceAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SurfaceAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SurfaceAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SurfaceAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SurfaceAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SurfaceAnalystService_setPrototypeOf(o, p) { SurfaceAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SurfaceAnalystService_setPrototypeOf(o, p); }
- 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); }; }
- function SurfaceAnalystService_possibleConstructorReturn(self, call) { if (call && (SurfaceAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return SurfaceAnalystService_assertThisInitialized(self); }
- function SurfaceAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SurfaceAnalystService_getPrototypeOf(o) { SurfaceAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SurfaceAnalystService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.SurfaceAnalystService
- * @category iServer SpatialAnalyst SurfaceAnalyst
- * @classdesc 表面分析服务类。
- * 该类负责将客户设置的表面分析服务参数传递给服务端,并接收服务端返回的表面分析服务分析结果数据。
- * 表面分析结果通过该类支持的事件的监听函数参数获取
- * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
- * @param {Object} options - 参数。</br>
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {SuperMap.SpatialAnalystBase}
- * @example 例如:
- * (start code)
- * var mySurfaceAnalystService = new SuperMap.SurfaceAnalystService(url, {
- * eventListeners: {
- * "processCompleted": surfaceAnalysCompleted,
- * "processFailed": surfaceAnalysFailed
- * }
- * });
- * (end)
- *
- */
- var SurfaceAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
- SurfaceAnalystService_inherits(SurfaceAnalystService, _SpatialAnalystBase);
- var _super = SurfaceAnalystService_createSuper(SurfaceAnalystService);
- function SurfaceAnalystService(url, options) {
- var _this;
- SurfaceAnalystService_classCallCheck(this, SurfaceAnalystService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.SurfaceAnalystService";
- return _this;
- }
- /**
- * @function SuperMap.SurfaceAnalystService.prototype.destroy
- * @description 释放资源,将引用的资源属性置空。
- */
- SurfaceAnalystService_createClass(SurfaceAnalystService, [{
- key: "destroy",
- value: function destroy() {
- SurfaceAnalystService_get(SurfaceAnalystService_getPrototypeOf(SurfaceAnalystService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.SurfaceAnalystService.prototype.processAsync
- * @description 负责将客户端的表面分析服务参数传递到服务端。
- * @param {SuperMap.SurfaceAnalystParameters} params - 表面分析提取操作参数类。
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof SurfaceAnalystParameters)) {
- return;
- }
- var me = this,
- jsonParameters;
- jsonParameters = me.getJsonParameters(params);
- me.request({
- method: "POST",
- data: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.SurfaceAnalystService.prototype.getJsonParameters
- * @description 将参数转化为 JSON 字符串。
- * @param {SuperMap.SurfaceAnalystParameters} params - 表面分析提取操作参数类。
- * @returns {Object} 转化后的JSON字符串。
- */
- }, {
- key: "getJsonParameters",
- value: function getJsonParameters(params) {
- var jsonParameters = '';
- var parameterObject = {};
- var me = this;
- if (params instanceof DatasetSurfaceAnalystParameters) {
- me.url = Util.urlPathAppend(me.url, 'datasets/' + params.dataset + '/' + params.surfaceAnalystMethod.toLowerCase());
- DatasetSurfaceAnalystParameters.toObject(params, parameterObject);
- jsonParameters = Util.toJSON(parameterObject);
- } else if (params instanceof GeometrySurfaceAnalystParameters) {
- me.url = Util.urlPathAppend(me.url, 'geometry/' + params.surfaceAnalystMethod.toLowerCase());
- jsonParameters = Util.toJSON(params);
- } else {
- return;
- }
- me.url = Util.urlAppend(me.url, 'returnContent=true');
- return jsonParameters;
- }
- }]);
- return SurfaceAnalystService;
- }(SpatialAnalystBase);
- SuperMap.SurfaceAnalystService = SurfaceAnalystService;
- ;// CONCATENATED MODULE: ./src/common/iServer/TerrainCurvatureCalculationParameters.js
- function TerrainCurvatureCalculationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function TerrainCurvatureCalculationParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) TerrainCurvatureCalculationParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) TerrainCurvatureCalculationParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.TerrainCurvatureCalculationParameters
- * @category iServer SpatialAnalyst TerrainCalculation
- * @classdesc 地形曲率计算参数类。
- * @param {Object} options - 参数。
- * @param {string} options.dataset - 要用来做地形曲率计算数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
- * @param {string} options.averageCurvatureName - 结果数据集:平均曲率数据集的名称。
- * @param {string} options.profileCurvatureName - 结果数据集:剖面曲率数据集的名称。
- * @param {string} options.planCurvatureName - 结果数据集:平面曲率数据集的名称。
- * @param {number} [options.zFactor=1.0] - 指定的高程缩放系数。1.0 表示不缩放。
- * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
- */
- var TerrainCurvatureCalculationParameters = /*#__PURE__*/function () {
- function TerrainCurvatureCalculationParameters(options) {
- TerrainCurvatureCalculationParameters_classCallCheck(this, TerrainCurvatureCalculationParameters);
- if (!options) {
- return;
- }
- /**
- * @member {string} SuperMap.TerrainCurvatureCalculationParameters.prototype.dataset
- * @description 要用来做地形曲率计算数据源中数据集的名称。
- * 该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
- * 注:地形曲率计算必须为栅格数据集。
- */
- this.dataset = null;
- /**
- * @member {number} [SuperMap.TerrainCurvatureCalculationParameters.prototype.zFactor=1.0]
- * @description 指定的高程缩放系数。1.0 表示不缩放。
- * 该值是指在 DEM 栅格数据中,栅格值( Z 坐标,即高程值)相对于 X 和 Y 坐标的单位变换系数。
- * 通常有 X,Y,Z 都参加的计算中,需要将高程值乘以一个高程缩放系数,使得三者单位一致。
- * 例如,X、Y 方向上的单位是米,而 Z 方向的单位是英尺,由于 1 英尺等于 0.3048 米,则需要指定缩放系数为 0.3048。
- */
- this.zFactor = 1.0;
- /**
- * @member {string} SuperMap.TerrainCurvatureCalculationParameters.prototype.averageCurvatureName
- * @description 结果数据集:平均曲率数据集的名称。
- */
- this.averageCurvatureName = null;
- /**
- * @member {string} SuperMap.TerrainCurvatureCalculationParameters.prototype.profileCurvatureName
- * @description 结果数据集:剖面曲率数据集的名称。
- */
- this.profileCurvatureName = "";
- /**
- * @member {string} SuperMap.TerrainCurvatureCalculationParameters.prototype.planCurvatureName
- * @description 结果数据集:平面曲率数据集的名称。
- */
- this.planCurvatureName = "";
- /**
- * @member {boolean} [SuperMap.TerrainCurvatureCalculationParameters.prototype.deleteExistResultDataset=false]
- * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
- */
- this.deleteExistResultDataset = false;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.TerrainCurvatureCalculationParameters";
- }
- /**
- * @function SuperMap.TerrainCurvatureCalculationParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- TerrainCurvatureCalculationParameters_createClass(TerrainCurvatureCalculationParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.dataset = null;
- me.zFactor = 1.0;
- me.averageCurvatureName = null;
- me.profileCurvatureName = null;
- me.planCurvatureName = null;
- me.deleteExistResultDataset = true;
- }
- /**
- * @function SuperMap.TerrainCurvatureCalculationParameters.toObject
- * @param {Object} derrainCurvatureCalculationParameters - 地形曲率计算参数。
- * @param {Object} tempObj - 目标对象。
- * @description 生成地形曲率计算对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(derrainCurvatureCalculationParameters, tempObj) {
- for (var name in derrainCurvatureCalculationParameters) {
- if (name !== "dataset") {
- tempObj[name] = derrainCurvatureCalculationParameters[name];
- }
- }
- }
- }]);
- return TerrainCurvatureCalculationParameters;
- }();
- SuperMap.TerrainCurvatureCalculationParameters = TerrainCurvatureCalculationParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/TerrainCurvatureCalculationService.js
- 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); }
- function TerrainCurvatureCalculationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function TerrainCurvatureCalculationService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TerrainCurvatureCalculationService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TerrainCurvatureCalculationService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function TerrainCurvatureCalculationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TerrainCurvatureCalculationService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function TerrainCurvatureCalculationService_setPrototypeOf(o, p) { TerrainCurvatureCalculationService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TerrainCurvatureCalculationService_setPrototypeOf(o, p); }
- 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); }; }
- function TerrainCurvatureCalculationService_possibleConstructorReturn(self, call) { if (call && (TerrainCurvatureCalculationService_typeof(call) === "object" || typeof call === "function")) { return call; } return TerrainCurvatureCalculationService_assertThisInitialized(self); }
- function TerrainCurvatureCalculationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function TerrainCurvatureCalculationService_getPrototypeOf(o) { TerrainCurvatureCalculationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TerrainCurvatureCalculationService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.TerrainCurvatureCalculationService
- * @category iServer SpatialAnalyst TerrainCalculation
- * @classdesc 地形曲率计算服务类。
- * @extends {SuperMap.SpatialAnalystBase}
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {string} options.url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst 。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @example 例如:
- * (start code)
- * var myTerrainCurvatureCalculationService = new SuperMap.TerrainCurvatureCalculationService(url);
- * myTerrainCurvatureCalculationService.on({
- * "processCompleted": processCompleted,
- * "processFailed": processFailed
- * }
- * );
- * (end)
- *
- */
- var TerrainCurvatureCalculationService = /*#__PURE__*/function (_SpatialAnalystBase) {
- TerrainCurvatureCalculationService_inherits(TerrainCurvatureCalculationService, _SpatialAnalystBase);
- var _super = TerrainCurvatureCalculationService_createSuper(TerrainCurvatureCalculationService);
- function TerrainCurvatureCalculationService(url, options) {
- var _this;
- TerrainCurvatureCalculationService_classCallCheck(this, TerrainCurvatureCalculationService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.TerrainCurvatureCalculationService";
- return _this;
- }
- /**
- *@override
- */
- TerrainCurvatureCalculationService_createClass(TerrainCurvatureCalculationService, [{
- key: "destroy",
- value: function destroy() {
- TerrainCurvatureCalculationService_get(TerrainCurvatureCalculationService_getPrototypeOf(TerrainCurvatureCalculationService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.TerrainCurvatureCalculationService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.TerrainCurvatureCalculationParameters} parameter - 地形曲率计算参数类。
- */
- }, {
- key: "processAsync",
- value: function processAsync(parameter) {
- var me = this;
- var parameterObject = {};
- if (parameter instanceof TerrainCurvatureCalculationParameters) {
- me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/terraincalculation/curvature');
- }
- TerrainCurvatureCalculationParameters.toObject(parameter, parameterObject);
- var jsonParameters = SuperMap.Util.toJSON(parameterObject);
- me.url = Util.urlAppend(me.url, 'returnContent=true');
- me.request({
- method: "POST",
- data: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return TerrainCurvatureCalculationService;
- }(SpatialAnalystBase);
- SuperMap.TerrainCurvatureCalculationService = TerrainCurvatureCalculationService;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridRangeItem.js
- function ThemeGridRangeItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeGridRangeItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridRangeItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridRangeItem_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeGridRangeItem
- * @category iServer Map Theme
- * @classdesc 栅格分段专题图子项类。
- * @description 在栅格分段专题图中,将栅格值按照某种分段模式被分成多个范围段。
- * 本类用来设置每个范围段的分段起始值、终止值、名称和颜色等。每个分段所表示的范围为 [Start,End)。
- * @param {Object} options - 参数。
- * @param {SuperMap.ServerColor} options.color - 栅格分段专题图中每一个分段专题图子项的对应的颜色。
- * @param {string} [options.caption] - 栅格分段专题图子项的标题。
- * @param {number} [options.end=0] - 栅格分段专题图子项的终止值。
- * @param {number} [options.start=0] - 栅格分段专题图子项的起始值。
- * @param {boolean} [options.visible=true] - 栅格分段专题图子项是否可见。
- */
- var ThemeGridRangeItem = /*#__PURE__*/function () {
- function ThemeGridRangeItem(options) {
- ThemeGridRangeItem_classCallCheck(this, ThemeGridRangeItem);
- /**
- * @member {string} [SuperMap.ThemeGridRangeItem.prototype.caption]
- * @description 栅格分段专题图子项的标题。
- */
- this.caption = null;
- /**
- * @member {SuperMap.ServerColor} SuperMap.ThemeGridRangeItem.prototype.color
- * @description 栅格分段专题图中每一个分段专题图子项的对应的颜色。
- */
- this.color = new ServerColor();
- /**
- * @member {number} [SuperMap.ThemeGridRangeItem.prototype.end=0]
- * @description 栅格分段专题图子项的终止值,即该段专题值范围的最大值。
- */
- this.end = 0;
- /**
- * @member {number} [SuperMap.ThemeGridRangeItem.prototype.start=0]
- * @description 栅格分段专题图子项的起始值,即该段专题值范围的最小值。
- */
- this.start = 0;
- /**
- * @member {boolean} [SuperMap.ThemeGridRangeItem.prototype.visible=true]
- * @description 栅格分段专题图子项是否可见。
- */
- this.visible = true;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ThemeGridRangeItem";
- }
- /**
- * @function SuperMap.ThemeGridRangeItem.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThemeGridRangeItem_createClass(ThemeGridRangeItem, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.caption = null;
- me.end = null;
- me.start = null; //需要验证是够存在destroy方法
- if (me.color) {
- me.color.destroy();
- me.color = null;
- }
- me.visible = null;
- }
- /**
- * @function SuperMap.ThemeGridRangeItem.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- * @returns {Object} 对应的 JSON 格式对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- var obj = {};
- obj = Util.copyAttributes(obj, this);
- if (obj.color) {
- if (obj.color.toServerJSONObject) {
- obj.color = obj.color.toServerJSONObject();
- }
- }
- return obj;
- }
- /**
- * @function SuperMap.ThemeGridRangeItem.fromObj
- * @description 从传入对象获取栅格分段专题图子项类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeGridRangeItem} ThemeGridRangeItem 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- if (!obj) {
- return;
- }
- var res = new ThemeGridRangeItem();
- Util.copy(res, obj);
- res.color = ServerColor.fromJson(obj.color);
- return res;
- }
- }]);
- return ThemeGridRangeItem;
- }();
- SuperMap.ThemeGridRangeItem = ThemeGridRangeItem;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridRange.js
- 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); }
- function ThemeGridRange_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeGridRange_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridRange_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridRange_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function ThemeGridRange_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGridRange_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function ThemeGridRange_setPrototypeOf(o, p) { ThemeGridRange_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGridRange_setPrototypeOf(o, p); }
- 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); }; }
- function ThemeGridRange_possibleConstructorReturn(self, call) { if (call && (ThemeGridRange_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeGridRange_assertThisInitialized(self); }
- function ThemeGridRange_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function ThemeGridRange_getPrototypeOf(o) { ThemeGridRange_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGridRange_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeGridRange
- * @category iServer Map Theme
- * @classdesc 栅格分段专题图。
- * @description 栅格分段专题图,是将所有单元格的值按照某种分段方式分成多个范围段,值在同一个范围段中的单元格使用相同的颜色进行显示。
- * 栅格分段专题图一般用来反映连续分布现象的数量或程度特征。比如某年的全国降水量分布图,将各气象站点的观测值经过内插之后生成的栅格数据进行分段显示。
- * 该类类似于分段专题图类,不同点在于分段专题图的操作对象是矢量数据,而栅格分段专题图的操作对象是栅格数据。
- * @extends {SuperMap.Theme}
- * @param {Object} options - 参数。
- * @param {Array.<SuperMap.ThemeGridRangeItem>} options.items - 栅格分段专题图子项数组。
- * @param {boolean} [options.reverseColor=false] - 是否对栅格分段专题图中分段的颜色风格进行反序显示。
- * @param {SuperMap.RangeMode} [options.rangeMode=SuperMap.RangeMode.EQUALINTERVAL] - 分段专题图的分段模式。
- * @param {number} [options.rangeParameter=0] - 分段参数。
- * @param {SuperMap.ColorGradientType} [options.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
- */
- var ThemeGridRange = /*#__PURE__*/function (_Theme) {
- ThemeGridRange_inherits(ThemeGridRange, _Theme);
- var _super = ThemeGridRange_createSuper(ThemeGridRange);
- function ThemeGridRange(options) {
- var _this;
- ThemeGridRange_classCallCheck(this, ThemeGridRange);
- _this = _super.call(this, "GRIDRANGE", options);
- /**
- * @member {Array.<SuperMap.ThemeGridRangeItem>} SuperMap.ThemeGridRange.prototype.items
- * @description 栅格分段专题图子项数组。<br>
- * 在栅格分段专题图中,将栅格值按照某种分段模式被分成多个范围段。
- * 本类用来设置每个栅格范围段的分段起始值、终止值、名称和颜色等。每个分段所表示的范围为 [Start,End)。
- */
- _this.items = null;
- /**
- * @member {SuperMap.RangeMode} [SuperMap.ThemeGridRange.prototype.rangeMode=SuperMap.RangeMode.EQUALINTERVAL]
- * @description 分段专题图的分段模式。<br>
- * 在栅格分段专题图中,作为专题变量的字段或表达式的值按照某种分段方式被分成多个范围段。
- * 目前 SuperMap 提供的分段方式包括:等距离分段法、平方根分段法、标准差分段法、对数分段法、等计数分段法和自定义距离法,
- * 显然这些分段方法根据一定的距离进行分段,因而范围分段专题图所基于的专题变量必须为数值型。
- */
- _this.rangeMode = RangeMode.EQUALINTERVAL;
- /**
- * @member {number} [SuperMap.ThemeGridRange.prototype.rangeParameter=0]
- * @description 分段参数。<br>
- * 当分段模式为等距离分段法,平方根分段,对数分段法,计数分段法其中一种模式时,该参数用于设置分段个数,必设;当分段模式为标准差分段法时,
- * 该参数不起作用;当分段模式为自定义距离时,该参数用于设置自定义距离。
- */
- _this.rangeParameter = 0;
- /**
- * @member {SuperMap.ColorGradientType} [SuperMap.ThemeGridRange.prototype.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED]
- * @description 渐变颜色枚举类。
- *
- */
- _this.colorGradientType = ColorGradientType.YELLOW_RED;
- /**
- * @member {boolean} SuperMap.ThemeGridRange.prototype.reverseColor
- * @description 是否对栅格分段专题图中分段的颜色风格进行反序显示。
- */
- _this.reverseColor = false;
- if (options) {
- Util.extend(ThemeGridRange_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.ThemeGridRange";
- return _this;
- }
- /**
- * @function SuperMap.ThemeGridRange.prototype.destroy
- * @override
- */
- ThemeGridRange_createClass(ThemeGridRange, [{
- key: "destroy",
- value: function destroy() {
- ThemeGridRange_get(ThemeGridRange_getPrototypeOf(ThemeGridRange.prototype), "destroy", this).call(this);
- var me = this;
- if (me.items) {
- if (me.items.length > 0) {
- for (var item in me.items) {
- me.items[item].destroy();
- me.items[item] = null;
- }
- }
- me.items = null;
- }
- me.reverseColor = null;
- me.rangeMode = null;
- me.rangeParameter = null;
- me.colorGradientType = null;
- }
- /**
- * @function SuperMap.ThemeGridRange.fromObj
- * @description 从传入对象获取栅格分段专题图。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeGridRange} ThemeGridRange 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- if (!obj) {
- return;
- }
- var res = new ThemeGridRange();
- Util.copy(res, obj);
- var itemsR = obj.items;
- var len = itemsR ? itemsR.length : 0;
- res.items = [];
- for (var i = 0; i < len; i++) {
- res.items.push(ThemeGridRangeItem.fromObj(itemsR[i]));
- }
- return res;
- }
- }]);
- return ThemeGridRange;
- }(Theme);
- SuperMap.ThemeGridRange = ThemeGridRange;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridUniqueItem.js
- function ThemeGridUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeGridUniqueItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridUniqueItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridUniqueItem_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeGridUniqueItem
- * @category iServer Map Theme
- * @classdesc 栅格单值专题图子项类。
- * 栅格单值专题图是将值相同的单元格归为一类,每一类是一个专题图子项。
- * @param {Object} options - 参数。
- * @param {string} [options.caption] - 栅格单值专题图子项的名称。
- * @param {SuperMap.ServerColor} [options.color] - 栅格单值专题图子项的显示颜色。
- * @param {number} options.unique - 栅格单值专题图子项的专题值,即单元格的值,值相同的单元格位于一个子项内。
- * @param {boolean} [options.visible=true] - 栅格单值专题图子项是否可见。
- */
- var ThemeGridUniqueItem = /*#__PURE__*/function () {
- function ThemeGridUniqueItem(options) {
- ThemeGridUniqueItem_classCallCheck(this, ThemeGridUniqueItem);
- /**
- * @member {string} [SuperMap.ThemeGridUniqueItem.prototype.caption]
- * @description 栅格单值专题图子项的名称。
- */
- this.caption = null;
- /**
- * @member {SuperMap.ServerColor} [SuperMap.ThemeGridUniqueItem.prototype.color]
- * @description 栅格单值专题图子项的显示颜色。
- */
- this.color = new ServerColor();
- /**
- * @member {number} SuperMap.ThemeGridUniqueItem.prototype.unique
- * @description 栅格单值专题图子项的专题值,即单元格的值,值相同的单元格位于一个子项内。
- */
- this.unique = null;
- /**
- * @member {boolean} [SuperMap.ThemeGridUniqueItem.prototype.visible=true]
- * @description 栅格单值专题图子项是否可见。
- */
- this.visible = true;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ThemeGridUniqueItem";
- }
- /**
- * @function SuperMap.ThemeGridUniqueItem.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThemeGridUniqueItem_createClass(ThemeGridUniqueItem, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.caption = null;
- me.unique = null;
- if (me.color) {
- me.color.destroy();
- me.color = null;
- }
- me.visible = null;
- }
- /**
- * @function SuperMap.ThemeGridUniqueItem.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- * @returns {Object} 对应的 JSON 格式对象。
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- var obj = {};
- obj = Util.copyAttributes(obj, this);
- if (obj.color) {
- if (obj.color.toServerJSONObject) {
- obj.color = obj.color.toServerJSONObject();
- }
- }
- return obj;
- }
- /**
- * @function SuperMap.ThemeGridUniqueItem.fromObj
- * @description 从传入对象获取栅格单值专题图子项类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeGridUniqueItem} ThemeGridUniqueItem 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- var res = new ThemeGridUniqueItem();
- Util.copy(res, obj);
- res.color = ServerColor.fromJson(obj.color);
- return res;
- }
- }]);
- return ThemeGridUniqueItem;
- }();
- SuperMap.ThemeGridUniqueItem = ThemeGridUniqueItem;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridUnique.js
- 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); }
- function ThemeGridUnique_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeGridUnique_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridUnique_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridUnique_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function ThemeGridUnique_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGridUnique_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function ThemeGridUnique_setPrototypeOf(o, p) { ThemeGridUnique_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGridUnique_setPrototypeOf(o, p); }
- 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); }; }
- function ThemeGridUnique_possibleConstructorReturn(self, call) { if (call && (ThemeGridUnique_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeGridUnique_assertThisInitialized(self); }
- function ThemeGridUnique_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function ThemeGridUnique_getPrototypeOf(o) { ThemeGridUnique_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGridUnique_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeGridUnique
- * @category iServer Map Theme
- * @classdesc 栅格单值专题图类。
- * @description 栅格单值专题图,是将单元格值相同的归为一类,为每一类设定一种颜色,从而用来区分不同的类别。<br>
- * 栅格单值专题图适用于离散栅格数据和部分连续栅格数据,对于单元格值各不相同的那些连续栅格数据,使用栅格单值专题图不具有任何意义。
- * @extends {SuperMap.Theme}
- * @param {Object} options - 参数。
- * @param {Array.<SuperMap.ThemeGridUniqueItem>} options.items - 栅格单值专题图子项数组。
- * @param {SuperMap.ServerColor} [options.defaultcolor] - 栅格单值专题图的默认颜色。
- */
- var ThemeGridUnique = /*#__PURE__*/function (_Theme) {
- ThemeGridUnique_inherits(ThemeGridUnique, _Theme);
- var _super = ThemeGridUnique_createSuper(ThemeGridUnique);
- function ThemeGridUnique(options) {
- var _this;
- ThemeGridUnique_classCallCheck(this, ThemeGridUnique);
- _this = _super.call(this, "GRIDUNIQUE", options);
- /**
- * @member {SuperMap.ServerColor} SuperMap.ThemeGridUnique.prototype.defaultcolor
- * @description 栅格单值专题图的默认颜色。
- * 对于那些未在格网单值专题图子项之列的要素使用该颜色显示。
- */
- _this.defaultcolor = new ServerColor();
- /**
- * @member {Array.<SuperMap.ThemeGridUniqueItem>} SuperMap.ThemeGridUnique.prototype.items
- * @description 栅格单值专题图子项数组。
- * 栅格单值专题图将值相同的单元格归为一类,每一类是一个专题图子项。
- */
- _this.items = null;
- if (options) {
- Util.extend(ThemeGridUnique_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.ThemeGridUnique";
- return _this;
- }
- /**
- * @function SuperMap.ThemeGridUnique.prototype.destroy
- * @override
- */
- ThemeGridUnique_createClass(ThemeGridUnique, [{
- key: "destroy",
- value: function destroy() {
- ThemeGridUnique_get(ThemeGridUnique_getPrototypeOf(ThemeGridUnique.prototype), "destroy", this).call(this);
- var me = this;
- if (me.items) {
- if (me.items.length > 0) {
- for (var item in me.items) {
- me.items[item].destroy();
- me.items[item] = null;
- }
- }
- me.items = null;
- }
- if (me.defaultcolor) {
- me.defaultcolor.destroy();
- me.defaultcolor = null;
- }
- }
- /**
- * @function SuperMap.ThemeGridUnique.prototype.toServerJSONObject
- * @description 转换成对应的 JSON 格式对象。
- * @returns {Object} 对应的 JSON 格式对象
- */
- }, {
- key: "toServerJSONObject",
- value: function toServerJSONObject() {
- var obj = {};
- obj = Util.copyAttributes(obj, this);
- if (obj.defaultcolor) {
- if (obj.defaultcolor.toServerJSONObject) {
- obj.defaultcolor = obj.defaultcolor.toServerJSONObject();
- }
- }
- if (obj.items) {
- var items = [],
- len = obj.items.length;
- for (var i = 0; i < len; i++) {
- items.push(obj.items[i].toServerJSONObject());
- }
- obj.items = items;
- }
- return obj;
- }
- /**
- * @function SuperMap.ThemeGridUnique.fromObj
- * @description 从传入对象获取栅格单值专题图类。
- * @param {Object} obj - 传入对象
- * @returns {SuperMap.ThemeGridUnique} ThemeGridUnique 对象
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- var res = new ThemeGridUnique();
- var uItems = obj.items;
- var len = uItems ? uItems.length : 0;
- Util.extend(res, obj);
- res.items = [];
- res.defaultcolor = ServerColor.fromJson(obj.defaultcolor);
- for (var i = 0; i < len; i++) {
- res.items.push(ThemeGridUniqueItem.fromObj(uItems[i]));
- }
- return res;
- }
- }]);
- return ThemeGridUnique;
- }(Theme);
- SuperMap.ThemeGridUnique = ThemeGridUnique;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelUniqueItem.js
- function ThemeLabelUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeLabelUniqueItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelUniqueItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelUniqueItem_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeLabelUniqueItem
- * @category iServer Map Theme
- * @classdesc 单值标签专题图的子项。
- * @description 标签专题图用专题值对点、线、面等对象做标注,值得注意的是,单值标签专题图允许用户通过 uniqueExpression
- * 字段指定用于单值的字段,同一值的标签具有相同的显示风格,其中每一个值就是一个专题图子项,
- * 每一个子项都具有其名称、风格、指定的单值、X 方向偏移量和 Y 方向偏移量。
- * @param {Object} options - 参数。
- * @param {string} options.unique - 单值专题图子项的值,可以为数字、字符串等。
- * @param {string} [options.caption] - 专题图子项的名称。
- * @param {number} [options.offsetX=0] - 标签在 X 方向偏移量。
- * @param {number} [options.offsetY=0] - 标签在 Y 方向偏移量。
- * @param {boolean} [options.visible=true] - 标签专题图子项是否可见。
- * @param {SuperMap.ServerTextStyle} [options.style] - 标签专题图子项文本的显示风格。
- */
- var ThemeLabelUniqueItem = /*#__PURE__*/function () {
- function ThemeLabelUniqueItem(options) {
- ThemeLabelUniqueItem_classCallCheck(this, ThemeLabelUniqueItem);
- /**
- * @member {string} [SuperMap.ThemeLabelUniqueItem.prototype.caption]
- * @description 标签专题子项的标题。
- */
- this.caption = null;
- /**
- * @member {string} SuperMap.ThemeLabelUniqueItem.prototype.unique
- * @description 单值专题图子项的值,可以为数字、字符串等。
- */
- this.unique = null;
- /**
- * @member {number} [SuperMap.ThemeLabelUniqueItem.prototype.offsetX=0]
- * @description 标签在 X 方向偏移量。
- */
- this.offsetX = 0;
- /**
- * @member {number} [SuperMap.ThemeLabelUniqueItem.prototype.offsetY=0]
- * @description 标签在 Y 方向偏移量。
- */
- this.offsetY = 0;
- /**
- * @member {boolean} [SuperMap.ThemeLabelUniqueItem.prototype.visible=true]
- * @description 标签专题图子项是否可见。如果标签专题图子项可见,则为 true,否则为 false。
- */
- this.visible = true;
- /**
- * @member {SuperMap.ServerTextStyle} SuperMap.ThemeLabelUniqueItem.prototype.style
- * @description 标签专题图子项文本的显示风格。各种风格的优先级从高到低为:<br>
- * uniformMixedStyle(标签文本的复合风格),SuperMap.ThemeLabelUniqueItem.style(单值子项的文本风格),uniformStyle(统一文本风格)。
- */
- this.style = new ServerTextStyle();
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ThemeLabelUniqueItem";
- }
- /**
- * @function SuperMap.ThemeLabelUniqueItem.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThemeLabelUniqueItem_createClass(ThemeLabelUniqueItem, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.unique = null;
- me.caption = null;
- me.offsetX = null;
- me.offsetY = null;
- if (me.style) {
- me.style.destroy();
- me.style = null;
- }
- me.visible = null;
- }
- /**
- * @function SuperMap.ThemeLabelUniqueItem.fromObj
- * @description 从传入对象获取单值标签专题图的子项类。
- * @param {Object} obj - 传入对象。
- * @returns {SuperMap.ThemeLabelUniqueItem} ThemeLabelUniqueItem 对象。
- */
- }], [{
- key: "fromObj",
- value: function fromObj(obj) {
- if (!obj) {
- return;
- }
- var t = new ThemeLabelUniqueItem();
- Util.copy(t, obj);
- return t;
- }
- }]);
- return ThemeLabelUniqueItem;
- }();
- SuperMap.ThemeLabelUniqueItem = ThemeLabelUniqueItem;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeParameters.js
- function ThemeParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeParameters
- * @category iServer Map Theme
- * @classdesc 专题图参数类。
- * 该类存储了制作专题所需的参数,包括数据源、数据集名称和专题图对象。
- * @param {Object} options - 参数。
- * @param {Array.<string>} options.datasetNames - 要制作专题图的数据集数组。
- * @param {Array.<string>} options.dataSourceNames - 要制作专题图的数据集所在的数据源数组。
- * @param {Array.<SuperMap.JoinItem>} [options.joinItems] - 专题图外部表的连接信息 JoinItem 数组。
- * @param {Array.<SuperMap.Theme>} options.themes - 专题图对象列表。
- * @param {Array.<string>} [options.displayFilters] - 专题图属性过滤条件。
- * @param {Array.<string>} [options.displayOrderBys] - 专题图对象生成符号叠加次序排序字段。
- * @param {Object} [options.fieldValuesDisplayFilter] - 图层要素的显示和隐藏的过滤属性,其带有三个属性,分别是:values、fieldName、fieldValuesDisplayMode。
- */
- var ThemeParameters = /*#__PURE__*/function () {
- function ThemeParameters(options) {
- ThemeParameters_classCallCheck(this, ThemeParameters);
- /**
- * @member {Array.<string>} SuperMap.ThemeParameters.prototype.datasetNames
- * @description 要制作专题图的数据集数组。
- */
- this.datasetNames = null;
- /**
- * @member {Array.<string>} SuperMap.ThemeParameters.prototype.dataSourceNames
- * @description 要制作专题图的数据集所在的数据源数组。
- */
- this.dataSourceNames = null;
- /**
- * @member {Array.<SuperMap.JoinItem>} [SuperMap.ThemeParameters.prototype.joinItems]
- * @description 设置与外部表的连接信息 JoinItem 数组。
- * 使用此属性可以制作与外部表连接的专题图。
- */
- this.joinItems = null;
- /**
- * @member {Array.<SuperMap.Theme>} SuperMap.ThemeParameters.prototype.themes
- * @description 专题图对象列表。
- * 该参数为实例化的各类专题图对象的集合。
- */
- this.themes = null;
- /**
- * @member {Array.<string>} [SuperMap.ThemeParameters.prototype.displayFilters]
- * @description 专题图属性过滤条件。
- */
- this.displayFilters = null;
- /**
- * @member {Array.<string>} [SuperMap.ThemeParameters.prototype.displayOrderBys]
- * @description 专题图对象生成符号叠加次序排序字段。
- */
- this.displayOrderBys = null;
- /**
- * @member {Object} [SuperMap.ThemeParameters.prototype.fieldValuesDisplayFilter]
- * @property {Array.<number>} values - 需要过滤的值。
- * @property {string} fieldName - 要过滤的字段名称只支持数字类型的字段。
- * @property {string} fieldValuesDisplayMode - 目前为 DISPLAY/DISABLE。当为 DISPLAY 时,表示只显示以上设置的相应属性值的要素,否则表示不显示以上设置的相应属性值的要素。
- */
- this.fieldValuesDisplayFilter = null;
- if (options) {
- Util.extend(this, options);
- }
- this.CLASS_NAME = "SuperMap.ThemeParameters";
- }
- /**
- * @function SuperMap.ThemeParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- ThemeParameters_createClass(ThemeParameters, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.datasetNames = null;
- me.dataSourceNames = null;
- if (me.joinItems) {
- for (var i = 0, joinItems = me.joinItems, len = joinItems.length; i < len; i++) {
- joinItems[i].destroy();
- }
- me.joinItems = null;
- }
- if (me.themes) {
- for (var _i = 0, themes = me.themes, _len = themes.length; _i < _len; _i++) {
- themes[_i].destroy();
- }
- me.themes = null;
- }
- }
- }]);
- return ThemeParameters;
- }();
- SuperMap.ThemeParameters = ThemeParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThemeService.js
- 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); }
- function ThemeService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function ThemeService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function ThemeService_setPrototypeOf(o, p) { ThemeService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeService_setPrototypeOf(o, p); }
- 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); }; }
- function ThemeService_possibleConstructorReturn(self, call) { if (call && (ThemeService_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeService_assertThisInitialized(self); }
- function ThemeService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function ThemeService_getPrototypeOf(o) { ThemeService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeService
- * @category iServer Map Theme
- * @classdesc 专题图服务类。
- * @extends {SuperMap.CommonServiceBase}
- * @example
- * var myThemeService = new SuperMap.ThemeService(url, {
- * eventListeners: {
- * "processCompleted": themeCompleted,
- * "processFailed": themeFailed
- * }
- * });
- * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var ThemeService = /*#__PURE__*/function (_CommonServiceBase) {
- ThemeService_inherits(ThemeService, _CommonServiceBase);
- var _super = ThemeService_createSuper(ThemeService);
- function ThemeService(url, options) {
- var _this;
- ThemeService_classCallCheck(this, ThemeService);
- _this = _super.call(this, url, options);
- if (options) {
- SuperMap.Util.extend(ThemeService_assertThisInitialized(_this), options);
- }
- _this.url = Util.urlPathAppend(_this.url, 'tempLayersSet');
- _this.CLASS_NAME = 'SuperMap.ThemeService';
- return _this;
- }
- /**
- * @override
- */
- ThemeService_createClass(ThemeService, [{
- key: "destroy",
- value: function destroy() {
- ThemeService_get(ThemeService_getPrototypeOf(ThemeService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.ThemeService.prototype.processAsync
- * @description 负责将客户端的专题图参数传递到服务端。
- * @param {SuperMap.ThemeParameters} params - 专题图参数类。
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof ThemeParameters)) {
- return;
- }
- var me = this,
- jsonParameters = null;
- jsonParameters = me.getJsonParameters(params);
- me.request({
- method: "POST",
- data: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.ThemeService.prototype.getJsonParameters
- * @description 将专题图参数参数转化为 JSON 字符串。
- * @param {SuperMap.ThemeParameters} parameter - 专题图参数类。
- * @returns {Object} 转化后的JSON字符串。
- */
- }, {
- key: "getJsonParameters",
- value: function getJsonParameters(parameter) {
- var jsonParameters = "",
- themeObj = null,
- filters = null,
- orderBys = null,
- fieldValuesDisplayFilter;
- jsonParameters += "[{'type': 'UGC','subLayers': {'layers': [";
- for (var i = 0; i < parameter.themes.length; i++) {
- themeObj = parameter.themes[i];
- var jsonTheme = Util.toJSON(themeObj);
- jsonTheme = jsonTheme.slice(0, -1);
- jsonParameters += "{'theme': " + jsonTheme + "},'type': 'UGC','ugcLayerType': 'THEME',";
- filters = parameter.displayFilters;
- if (filters && filters.length > 0) {
- if (filters.length === 1) {
- jsonParameters += "'displayFilter':\"" + filters[0] + "\",";
- } else {
- jsonParameters += "'displayFilter':\"" + filters[i] + "\",";
- }
- }
- orderBys = parameter.displayOrderBy;
- if (orderBys && orderBys.length > 0) {
- if (orderBys.length === 1) {
- jsonParameters += "'displayOrderBy':'" + orderBys[0] + "',";
- } else {
- jsonParameters += "'displayOrderBy':'" + orderBys[i] + "',";
- }
- }
- fieldValuesDisplayFilter = parameter.fieldValuesDisplayFilter;
- if (fieldValuesDisplayFilter) {
- jsonParameters += "'fieldValuesDisplayFilter':" + Util.toJSON(fieldValuesDisplayFilter) + ",";
- }
- if (parameter.joinItems && parameter.joinItems.length > 0 && parameter.joinItems[i]) {
- jsonParameters += "'joinItems':[" + Util.toJSON(parameter.joinItems[i]) + "],";
- }
- if (parameter.datasetNames && parameter.dataSourceNames) {
- var datasetID = parameter.datasetNames[i] ? i : parameter.datasetNames.length - 1;
- var dataSourceID = parameter.dataSourceNames[i] ? i : parameter.dataSourceNames.length - 1;
- jsonParameters += "'datasetInfo': {'name': '" + parameter.datasetNames[datasetID] + "','dataSourceName': '" + parameter.dataSourceNames[dataSourceID] + "'}},";
- } else {
- jsonParameters += "},";
- }
- } //去除多余的逗号
- if (parameter.themes && parameter.themes.length > 0) {
- jsonParameters = jsonParameters.substring(0, jsonParameters.length - 1);
- }
- jsonParameters += "]},";
- var urlArray = this.url.split("/");
- var jsonMapName = urlArray[urlArray.length - 2];
- jsonParameters += "'name': '" + jsonMapName + "'}]";
- return jsonParameters;
- }
- }]);
- return ThemeService;
- }(CommonServiceBase);
- SuperMap.ThemeService = ThemeService;
- ;// CONCATENATED MODULE: ./src/common/iServer/ThiessenAnalystService.js
- 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); }
- function ThiessenAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThiessenAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThiessenAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThiessenAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function ThiessenAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThiessenAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function ThiessenAnalystService_setPrototypeOf(o, p) { ThiessenAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThiessenAnalystService_setPrototypeOf(o, p); }
- 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); }; }
- function ThiessenAnalystService_possibleConstructorReturn(self, call) { if (call && (ThiessenAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return ThiessenAnalystService_assertThisInitialized(self); }
- function ThiessenAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function ThiessenAnalystService_getPrototypeOf(o) { ThiessenAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThiessenAnalystService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThiessenAnalystService
- * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
- * @classdesc
- * 泰森多边形分析服务类
- * 该类负责将客户设置的泰森多边形分析参数传递给服务端,并接收服务端返回的分析结果数据。
- * 泰森多边形分析结果通过该类支持的事件的监听函数参数获取
- * 泰森多边形分析的参数支持两种,当参数为 {SuperMap.DatasetThiessenAnalystParameters} 类型
- * 时,执行数据集泰森多边形分析,当参数为 {SuperMap.GeometryThiessenAnalystParameters} 类型时,
- * 执行几何对象泰森多边形分析。
- * @param url - {string} 服务的访问地址。
- * 如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
- * @param {Object} options - 参数。</br>
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {SuperMap.SpatialAnalystBase}
- * @example 例如:
- * (start code)
- * var myThiessenAnalystService = new SuperMap.ThiessenAnalystService(url, {
- * eventListeners: {
- * "processCompleted": bufferCompleted,
- * "processFailed": bufferFailed
- * }
- * });
- * (end)
- *
- */
- var ThiessenAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
- ThiessenAnalystService_inherits(ThiessenAnalystService, _SpatialAnalystBase);
- var _super = ThiessenAnalystService_createSuper(ThiessenAnalystService);
- function ThiessenAnalystService(url, options) {
- var _this;
- ThiessenAnalystService_classCallCheck(this, ThiessenAnalystService);
- _this = _super.call(this, url, options);
- /**
- * @member {string} SuperMap.ThiessenAnalystService.prototype.mode
- * @description 缓冲区分析类型
- */
- _this.mode = null;
- if (options) {
- Util.extend(ThiessenAnalystService_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.ThiessenAnalystService";
- return _this;
- }
- /**
- * @override
- */
- ThiessenAnalystService_createClass(ThiessenAnalystService, [{
- key: "destroy",
- value: function destroy() {
- ThiessenAnalystService_get(ThiessenAnalystService_getPrototypeOf(ThiessenAnalystService.prototype), "destroy", this).call(this);
- this.mode = null;
- }
- /**
- * @function SuperMap.ThiessenAnalystService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {(SuperMap.DatasetThiessenAnalystParameters|GeometryThiessenAnalystParameters)} parameter - 泰森多边形分析参数基类。
- */
- }, {
- key: "processAsync",
- value: function processAsync(parameter) {
- var parameterObject = {};
- var me = this;
- if (parameter instanceof DatasetThiessenAnalystParameters) {
- me.mode = "datasets";
- me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/thiessenpolygon');
- DatasetThiessenAnalystParameters.toObject(parameter, parameterObject);
- } else if (parameter instanceof GeometryThiessenAnalystParameters) {
- me.mode = "geometry";
- me.url = Util.urlPathAppend(me.url, 'geometry/thiessenpolygon');
- GeometryThiessenAnalystParameters.toObject(parameter, parameterObject);
- }
- var jsonParameters = Util.toJSON(parameterObject);
- me.url = Util.urlAppend(me.url, 'returnContent=true');
- me.request({
- method: "POST",
- data: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return ThiessenAnalystService;
- }(SpatialAnalystBase);
- SuperMap.ThiessenAnalystService = ThiessenAnalystService;
- ;// CONCATENATED MODULE: ./src/common/iServer/GeometryBatchAnalystService.js
- 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); }
- function GeometryBatchAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function GeometryBatchAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryBatchAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryBatchAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function GeometryBatchAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryBatchAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function GeometryBatchAnalystService_setPrototypeOf(o, p) { GeometryBatchAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryBatchAnalystService_setPrototypeOf(o, p); }
- 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); }; }
- function GeometryBatchAnalystService_possibleConstructorReturn(self, call) { if (call && (GeometryBatchAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return GeometryBatchAnalystService_assertThisInitialized(self); }
- function GeometryBatchAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function GeometryBatchAnalystService_getPrototypeOf(o) { GeometryBatchAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryBatchAnalystService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.GeometryBatchAnalystService
- * @category iServer SpatialAnalyst BatchAnalyst
- * @classdesc 批量空间分析服务类
- * @description 该类负责将客户设置的叠加分析参数传递给服务端,并接收服务端返回的叠加分析结果数据。
- * 叠加分析结果通过该类支持的事件的监听函数参数获取,参数类型为 {<SuperMap.REST.OverlayAnalystEventArgs>}; 获取的结果数据包括 originResult 、result 两种,
- * 其中,originResult 为服务端返回的用 JSON 对象表示的量算结果数据,result 为服务端返回的量算结果数据。
- * @extends {SuperMap.SpatialAnalystBase}
- * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @example
- * var myOverlayAnalystService = new SuperMap.REST.GeometryBatchAnalystService(url, {
- * eventListeners: {
- * "processCompleted": OverlayCompleted,
- * "processFailed": OverlayFailed
- * }
- * });
- */
- var GeometryBatchAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
- GeometryBatchAnalystService_inherits(GeometryBatchAnalystService, _SpatialAnalystBase);
- var _super = GeometryBatchAnalystService_createSuper(GeometryBatchAnalystService);
- function GeometryBatchAnalystService(url, options) {
- var _this;
- GeometryBatchAnalystService_classCallCheck(this, GeometryBatchAnalystService);
- _this = _super.call(this, url, options);
- if (options) {
- Util.extend(GeometryBatchAnalystService_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = "SuperMap.GeometryBatchAnalystService";
- return _this;
- }
- /**
- * @function SuperMap.GeometryBatchAnalystService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- * @param {SuperMap.GeometryBatchOverlayAnalystParameters} parameter - 批量几何对象叠加分析参数类
- *
- */
- GeometryBatchAnalystService_createClass(GeometryBatchAnalystService, [{
- key: "processAsync",
- value: function processAsync(parameters) {
- var me = this;
- me.url = Util.urlPathAppend(me.url, 'geometry/batchanalyst');
- me.url = Util.urlAppend(me.url, 'returnContent=true&ignoreAnalystParam=true');
- var parameterObjects = me._processParams(parameters);
- var jsonParameters = Util.toJSON(parameterObjects);
- me.request({
- method: "POST",
- data: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }, {
- key: "_processParams",
- value: function _processParams(parameters) {
- var me = this;
- if (!Util.isArray(parameters)) {
- return;
- }
- var processParams = [];
- parameters.map(function (item) {
- processParams.push(me._toJSON(item));
- return item;
- });
- return processParams;
- }
- }, {
- key: "_toJSON",
- value: function _toJSON(parameter) {
- var tempObj = {};
- if (parameter.analystName === "buffer") {
- tempObj.analystName = "buffer";
- tempObj.param = {}; //几何对象的批量空间分析,
- GeometryBufferAnalystParameters.toObject(parameter.param, tempObj.param);
- } else if (parameter.analystName === "overlay") {
- tempObj.analystName = "overlay";
- tempObj.param = {};
- GeometryOverlayAnalystParameters.toObject(parameter.param, tempObj.param);
- } else if (parameter.analystName === "interpolationDensity") {
- tempObj.analystName = "interpolationDensity";
- tempObj.param = {};
- InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
- } else if (parameter.analystName === "interpolationidw") {
- tempObj.analystName = "interpolationidw";
- tempObj.param = {};
- InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
- } else if (parameter.analystName === "interpolationRBF") {
- tempObj.analystName = "interpolationRBF";
- tempObj.param = {};
- InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
- } else if (parameter.analystName === "interpolationKriging") {
- tempObj.analystName = "interpolationKriging";
- tempObj.param = {};
- InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
- } else if (parameter.analystName === "thiessenpolygon") {
- tempObj.analystName = "thiessenpolygon";
- tempObj.param = {};
- GeometryThiessenAnalystParameters.toObject(parameter.param, tempObj.param);
- } else {
- //isoline; isoregion; calculatemeasure; routelocator 四种分析不需要再处理参数
- return parameter;
- }
- return tempObj;
- }
- /**
- * @override
- */
- }, {
- key: "destroy",
- value: function destroy() {
- GeometryBatchAnalystService_get(GeometryBatchAnalystService_getPrototypeOf(GeometryBatchAnalystService.prototype), "destroy", this).call(this);
- }
- }]);
- return GeometryBatchAnalystService;
- }(SpatialAnalystBase);
- SuperMap.GeometryBatchAnalystService = GeometryBatchAnalystService;
- ;// CONCATENATED MODULE: ./src/common/iServer/TilesetsService.js
- 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); }
- function TilesetsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function TilesetsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TilesetsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TilesetsService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function TilesetsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TilesetsService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function TilesetsService_setPrototypeOf(o, p) { TilesetsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TilesetsService_setPrototypeOf(o, p); }
- 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); }; }
- function TilesetsService_possibleConstructorReturn(self, call) { if (call && (TilesetsService_typeof(call) === "object" || typeof call === "function")) { return call; } return TilesetsService_assertThisInitialized(self); }
- function TilesetsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function TilesetsService_getPrototypeOf(o) { TilesetsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TilesetsService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.TilesetsService
- * @category iServer Map Tilesets
- * @classdesc 切片列表信息查询服务类;即查询切片地图服务的切片列表,返回切片集名称、地图切片元数据信息、切片版本集信息。
- * @extends {SuperMap.CommonServiceBase}
- * @param {string} url - 地图服务地址。URL 应为:
- * http://{服务器地址}:{服务端口号}/iserver/services/{服务名}/rest/maps/map;
- * 例如: "http://localhost:8090/iserver/services/test/rest/maps/tianlocal"。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
- * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var TilesetsService = /*#__PURE__*/function (_CommonServiceBase) {
- TilesetsService_inherits(TilesetsService, _CommonServiceBase);
- var _super = TilesetsService_createSuper(TilesetsService);
- function TilesetsService(url, options) {
- var _this;
- TilesetsService_classCallCheck(this, TilesetsService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.TilesetsService";
- return _this;
- }
- /**
- * @override
- */
- TilesetsService_createClass(TilesetsService, [{
- key: "destroy",
- value: function destroy() {
- TilesetsService_get(TilesetsService_getPrototypeOf(TilesetsService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.TilesetsService.prototype.processAsync
- * @description 负责将客户端的查询参数传递到服务端。
- */
- }, {
- key: "processAsync",
- value: function processAsync() {
- if (!this.url) {
- return;
- }
- var me = this;
- me.url = Util.urlPathAppend(me.url, 'tilesets');
- me.request({
- method: "GET",
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return TilesetsService;
- }(CommonServiceBase);
- SuperMap.TilesetsService = TilesetsService;
- ;// CONCATENATED MODULE: ./src/common/iServer/TopologyValidatorJobsParameter.js
- function TopologyValidatorJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function TopologyValidatorJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) TopologyValidatorJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) TopologyValidatorJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.TopologyValidatorJobsParameter
- * @category iServer ProcessingService TopologyValidator
- * @classdesc 拓扑检查分析任务参数类。
- * @param {Object} options - 必填参数。
- * @param {string} options.datasetName - 数据集名。
- * @param {string} options.datasetTopology -检查对象所在的数据集名称。
- * @param {SuperMap.TopologyValidatorRule} [options.rule=SuperMap.TopologyValidatorRule.REGIONNOOVERLAP] - 拓扑检查规则。
- * @param {string} [options.tolerance] - 容限。
- * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
- * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
- */
- var TopologyValidatorJobsParameter = /*#__PURE__*/function () {
- function TopologyValidatorJobsParameter(options) {
- TopologyValidatorJobsParameter_classCallCheck(this, TopologyValidatorJobsParameter);
- if (!options) {
- return;
- }
- /**
- * @member {string} SuperMap.TopologyValidatorJobsParameter.prototype.datasetName
- * @description 数据集名。
- */
- this.datasetName = "";
- /**
- * @member {string} SuperMap.TopologyValidatorJobsParameter.prototype.datasetTopology
- * @description 拓扑检查对象所在的数据集名称。
- */
- this.datasetTopology = "";
- /**
- * @member {string} [SuperMap.TopologyValidatorJobsParameter.prototype.tolerance]
- * @description 容限,指定的拓扑错误检查时使用的容限。
- */
- this.tolerance = "";
- /**
- * @member {SuperMap.TopologyValidatorRule} [SuperMap.TopologyValidatorJobsParameter.prototype.rule=SuperMap.TopologyValidatorRule.REGIONNOOVERLAP]
- * @description 拓扑检查模式。
- */
- this.rule = TopologyValidatorRule.REGIONNOOVERLAP;
- /**
- * @member {SuperMap.OutputSetting} [SuperMap.TopologyValidatorJobsParameter.prototype.output]
- * @description 输出参数设置类。
- */
- this.output = null;
- /**
- * @member {SuperMap.MappingParameters} [SuperMap.TopologyValidatorJobsParameter.prototype.mappingParameters]
- * @description 分析后结果可视化的参数类。
- */
- this.mappingParameters = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.TopologyValidatorJobsParameter";
- }
- /**
- * @function SuperMap.TopologyValidatorJobsParameter.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- TopologyValidatorJobsParameter_createClass(TopologyValidatorJobsParameter, [{
- key: "destroy",
- value: function destroy() {
- this.datasetName = null;
- this.datasetTopology = null;
- this.tolerance = null;
- this.rule = null;
- if (this.output instanceof OutputSetting) {
- this.output.destroy();
- this.output = null;
- }
- if (this.mappingParameters instanceof MappingParameters) {
- this.mappingParameters.destroy();
- this.mappingParameters = null;
- }
- }
- /**
- * @function SuperMap.TopologyValidatorJobsParameter.toObject
- * @param {Object} TopologyValidatorJobsParameter -拓扑检查分析任务参数。
- * @param {Object} tempObj - 目标对象。
- * @description 生成拓扑检查分析任务对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(TopologyValidatorJobsParameter, tempObj) {
- for (var name in TopologyValidatorJobsParameter) {
- if (name === "datasetName") {
- tempObj['input'] = tempObj['input'] || {};
- tempObj['input'][name] = TopologyValidatorJobsParameter[name];
- continue;
- }
- if (name === "output") {
- tempObj['output'] = tempObj['output'] || {};
- tempObj['output'] = TopologyValidatorJobsParameter[name];
- continue;
- }
- tempObj['analyst'] = tempObj['analyst'] || {};
- tempObj['analyst'][name] = TopologyValidatorJobsParameter[name];
- if (name === 'mappingParameters') {
- tempObj['analyst'][name] = tempObj['analyst'][name] || {};
- tempObj['analyst']['mappingParameters'] = TopologyValidatorJobsParameter[name];
- }
- }
- }
- }]);
- return TopologyValidatorJobsParameter;
- }();
- SuperMap.TopologyValidatorJobsParameter = TopologyValidatorJobsParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/TopologyValidatorJobsService.js
- 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); }
- function TopologyValidatorJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function TopologyValidatorJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TopologyValidatorJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TopologyValidatorJobsService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function TopologyValidatorJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TopologyValidatorJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function TopologyValidatorJobsService_setPrototypeOf(o, p) { TopologyValidatorJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TopologyValidatorJobsService_setPrototypeOf(o, p); }
- 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); }; }
- function TopologyValidatorJobsService_possibleConstructorReturn(self, call) { if (call && (TopologyValidatorJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return TopologyValidatorJobsService_assertThisInitialized(self); }
- function TopologyValidatorJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function TopologyValidatorJobsService_getPrototypeOf(o) { TopologyValidatorJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TopologyValidatorJobsService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.TopologyValidatorJobsService
- * @category iServer ProcessingService TopologyValidator
- * @classdesc 拓扑检查分析服务类
- * @extends {SuperMap.ProcessingServiceBase}
- * @param {string} url - 拓扑检查分析服务地址。
- * @param {Object} options - 参数。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var TopologyValidatorJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
- TopologyValidatorJobsService_inherits(TopologyValidatorJobsService, _ProcessingServiceBas);
- var _super = TopologyValidatorJobsService_createSuper(TopologyValidatorJobsService);
- function TopologyValidatorJobsService(url, options) {
- var _this;
- TopologyValidatorJobsService_classCallCheck(this, TopologyValidatorJobsService);
- _this = _super.call(this, url, options);
- _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/topologyvalidator');
- _this.CLASS_NAME = "SuperMap.TopologyValidatorJobsService";
- return _this;
- }
- /**
- *@override
- */
- TopologyValidatorJobsService_createClass(TopologyValidatorJobsService, [{
- key: "destroy",
- value: function destroy() {
- TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.TopologyValidatorJobsService.protitype.getTopologyValidatorJobs
- * @description 获取拓扑检查分析所有任务
- */
- }, {
- key: "getTopologyValidatorJobs",
- value: function getTopologyValidatorJobs() {
- TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "getJobs", this).call(this, this.url);
- }
- /**
- * @function SuperMap.TopologyValidatorJobsService.protitype.getTopologyValidatorJob
- * @description 获取指定id的拓扑检查分析服务
- * @param {string} id - 指定要获取数据的id
- */
- }, {
- key: "getTopologyValidatorJob",
- value: function getTopologyValidatorJob(id) {
- TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
- }
- /**
- * @function SuperMap.TopologyValidatorJobsService.protitype.addTopologyValidatorJob
- * @description 新建拓扑检查分析服务
- * @param {SuperMap.TopologyValidatorJobsParameter} params - 创建一个空间分析的请求参数。
- * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
- */
- }, {
- key: "addTopologyValidatorJob",
- value: function addTopologyValidatorJob(params, seconds) {
- TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "addJob", this).call(this, this.url, params, TopologyValidatorJobsParameter, seconds);
- }
- }]);
- return TopologyValidatorJobsService;
- }(ProcessingServiceBase);
- SuperMap.TopologyValidatorJobsService = TopologyValidatorJobsService;
- ;// CONCATENATED MODULE: ./src/common/iServer/TransferLine.js
- function TransferLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function TransferLine_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferLine_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferLine_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.TransferLine
- * @category iServer TrafficTransferAnalyst TransferPath
- * @classdesc 换乘路线信息类。
- * @param {Object} options - 参数。
- * @param {number} options.lineID - 乘车路线 ID。
- * @param {string} options.lineName - 乘车路线名称。
- * @param {string} options.lineAliasName - 乘车路线别名。
- * @param {number} options.startStopIndex - 上车站点在本公交路线中的索引。
- * @param {string} options.startStopName - 上车站点名称。
- * @param {string} options.startStopAliasName - 上车站点别名。
- * @param {number} options.endStopIndex - 下车站点在本公交路线中的索引。
- * @param {string} options.endStopName - 下车站点名称。
- * @param {string} options.endStopAliasName - 下车站点别名。
- */
- var TransferLine = /*#__PURE__*/function () {
- function TransferLine(options) {
- TransferLine_classCallCheck(this, TransferLine);
- options = options || {};
- /**
- * @member {number} SuperMap.TransferLine.prototype.lineID
- * @description 乘车路线 ID。
- */
- this.lineID = null;
- /**
- * @member {string} SuperMap.TransferLine.prototype.lineName
- * @description 乘车路线名称。
- */
- this.lineName = null;
- /**
- * @member {string} SuperMap.TransferLine.prototype.lineAliasName
- * @description 乘车路线别名。
- */
- this.lineAliasName = null;
- /**
- * @member {number} SuperMap.TransferLine.prototype.startStopIndex
- * @description 上车站点在本公交路线中的索引。
- */
- this.startStopIndex = null;
- /**
- * @member {string} SuperMap.TransferLine.prototype.startStopName
- * @description 上车站点名称。
- */
- this.startStopName = null;
- /**
- * @member {string} SuperMap.TransferLine.prototype.startStopAliasName
- * @description 上车站点别名。
- */
- this.startStopAliasName = null;
- /**
- * @member {number} SuperMap.TransferLine.prototype.endStopIndex
- * @description 下车站点在本公交路线中的索引。
- */
- this.endStopIndex = null;
- /**
- * @member {string} SuperMap.TransferLine.prototype.endStopName
- * @description 下车站点名称。
- */
- this.endStopName = null;
- /**
- * @member {string} SuperMap.TransferLine.prototype.endStopAliasName
- * @description 下车站点别名。
- */
- this.endStopAliasName = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.TransferLine";
- }
- /**
- * @function SuperMap.TransferLine.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- TransferLine_createClass(TransferLine, [{
- key: "destroy",
- value: function destroy() {
- Util.reset(this);
- }
- /**
- * @function SuperMap.TransferLine.fromJson
- * @description 将返回结果转化为 {@link SuperMap.TransferLine} 对象。
- * @param {Object} jsonObject - 新的返回结果。
- * @returns {SuperMap.TransferLine} 转化后的 {@link SuperMap.TransferLine} 对象。
- */
- }], [{
- key: "fromJson",
- value: function fromJson(jsonObject) {
- if (!jsonObject) {
- return;
- }
- return new TransferLine({
- lineID: jsonObject['lineID'],
- lineName: jsonObject['lineName'],
- lineAliasName: jsonObject['lineAliasName'],
- startStopIndex: jsonObject['startStopIndex'],
- startStopName: jsonObject['startStopName'],
- startStopAliasName: jsonObject['startStopAliasName'],
- endStopIndex: jsonObject['endStopIndex'],
- endStopName: jsonObject['endStopName'],
- endStopAliasName: jsonObject['endStopAliasName']
- });
- }
- }]);
- return TransferLine;
- }();
- SuperMap.TransferLine = TransferLine;
- ;// CONCATENATED MODULE: ./src/common/iServer/TransferPathParameters.js
- function TransferPathParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function TransferPathParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferPathParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferPathParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.TransferPathParameters
- * @category iServer TrafficTransferAnalyst TransferPaths
- * @classdesc 交通换乘线路查询参数类。
- * @param {Object} options - 参数。
- * @param {Array.<SuperMap.TransferLine>} options.transferLines - 本换乘分段内可乘车的路线集合。
- * @param {Array.<(string|SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} options.points - 两种查询方式:按照公交站点的起止 ID 进行查询和按照起止点的坐标进行查询。
- *
- */
- var TransferPathParameters = /*#__PURE__*/function () {
- function TransferPathParameters(options) {
- TransferPathParameters_classCallCheck(this, TransferPathParameters);
- options = options || {};
- /**
- * @member {Array.<SuperMap.TransferLine>} SuperMap.TransferPathParameters.prototype.transferLines
- * @description 本换乘分段内可乘车的路线集合,通过交通换乘方案查询得到。
- */
- this.transferLines = null;
- /**
- * @member {Array.<(string|SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} SuperMap.TransferPathParameters.prototype.points
- * @description 两种查询方式:<br>
- * 1. 按照公交站点的起止ID进行查询,则 points 参数的类型为 int[],形如:[起点ID、终点ID],公交站点的 ID 对应服务提供者配置中的站点 ID 字段;
- * 2. 按照起止点的坐标进行查询,则 points 参数的类型为 Point2D[],形如:[{"x":44,"y":39},{"x":45,"y":40}]。
- */
- this.points = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.TransferPathParameters";
- }
- /**
- * @function SuperMap.TransferPathParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- TransferPathParameters_createClass(TransferPathParameters, [{
- key: "destroy",
- value: function destroy() {
- Util.reset(this);
- }
- /**
- * @function SuperMap.TransferPathParameters.toJson
- * @description 将 {@link SuperMap.TransferPathParameters} 对象参数转换为 JSON 字符串。
- * @param {SuperMap.TransferPathParameters} params - 交通换乘参数。
- * @returns {string} 转化后的 JSON 字符串。
- */
- }], [{
- key: "toJson",
- value: function toJson(params) {
- if (params) {
- return Util.toJSON(params);
- }
- }
- }]);
- return TransferPathParameters;
- }();
- SuperMap.TransferPathParameters = TransferPathParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/TransferPathService.js
- 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); }
- function TransferPathService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function TransferPathService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferPathService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferPathService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function TransferPathService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TransferPathService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function TransferPathService_setPrototypeOf(o, p) { TransferPathService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TransferPathService_setPrototypeOf(o, p); }
- 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); }; }
- function TransferPathService_possibleConstructorReturn(self, call) { if (call && (TransferPathService_typeof(call) === "object" || typeof call === "function")) { return call; } return TransferPathService_assertThisInitialized(self); }
- function TransferPathService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function TransferPathService_getPrototypeOf(o) { TransferPathService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TransferPathService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.TransferPathService
- * @category iServer TrafficTransferAnalyst TransferPath
- * @classdesc 交通换乘线路查询服务类,根据交通换乘分析结果(TransferSolutionResult),获取某一条乘车路线的详细信息。
- * 返回结果通过该类支持的事件的监听函数参数获取
- * @extends {SuperMap.CommonServiceBase}
- * @example 例如:
- * var myService = new SuperMap.TransferPathService(url, {eventListeners: {
- * "processCompleted": TrafficTransferCompleted,
- * "processFailed": TrafficTransferError
- * }
- * };
- * @param {string} url - 与客户端交互的交通换乘线路查询服务地址。
- * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
- * @param {Object} options - 参数。</br>
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var TransferPathService = /*#__PURE__*/function (_CommonServiceBase) {
- TransferPathService_inherits(TransferPathService, _CommonServiceBase);
- var _super = TransferPathService_createSuper(TransferPathService);
- function TransferPathService(url, options) {
- var _this;
- TransferPathService_classCallCheck(this, TransferPathService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.TransferPathService";
- return _this;
- }
- /**
- * @override
- */
- TransferPathService_createClass(TransferPathService, [{
- key: "destroy",
- value: function destroy() {
- TransferPathService_get(TransferPathService_getPrototypeOf(TransferPathService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.TransferPathService.prototype.processAsync
- * @description 负责将客户端的更新参数传递到服务端。
- * @param {SuperMap.TransferPathParameters} params - 交通换乘参数。
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof TransferPathParameters)) {
- return;
- }
- var me = this,
- method = "GET",
- jsonParameters;
- me.url = Util.urlPathAppend(me.url, 'path');
- jsonParameters = {
- points: Util.toJSON(params.points),
- transferLines: Util.toJSON(params['transferLines'])
- };
- me.request({
- method: method,
- params: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return TransferPathService;
- }(CommonServiceBase);
- SuperMap.TransferPathService = TransferPathService;
- ;// CONCATENATED MODULE: ./src/common/iServer/TransferSolutionParameters.js
- function TransferSolutionParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function TransferSolutionParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferSolutionParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferSolutionParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.TransferSolutionParameters
- * @category iServer TrafficTransferAnalyst TransferSolutions
- * @classdesc 交通换乘方案查询参数类。
- * @param {Object} options - 参数。
- * @param {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point|number)>} options.points - 两种查询方式:按照公交站点的起止ID进行查询和按照起止点的坐标进行查询。
- * @param {number} [options.solutionCount=6] - 乘车方案的数量。
- * @param {SuperMap.TransferTactic} [options.transferTactic=SuperMap.TransferTactic.LESS_TIME] - 交通换乘策略类型,包括时间最短、距离最短、最少换乘、最少步行四种选择。
- * @param {SuperMap.TransferPreference} [options.transferPreference=SuperMap.TransferPreference.NONE] - 乘车偏好枚举。
- * @param {number} [options.walkingRatio=10] - 步行与公交的消耗权重比。
- * @param {Array.<number>} [options.evadeLines] - 避让路线的 ID。
- * @param {Array.<number>} [options.evadeStops] - 避让站点的 ID。
- * @param {Array.<number>} [options.priorLines] - 优先路线的 ID。
- * @param {Array.<number>} [options.priorStops] - 优先站点的 ID。
- * @param {string} [options.travelTime] - 出行的时间。
- */
- var TransferSolutionParameters = /*#__PURE__*/function () {
- function TransferSolutionParameters(options) {
- TransferSolutionParameters_classCallCheck(this, TransferSolutionParameters);
- options = options || {};
- /**
- * @member {number} [SuperMap.TransferSolutionParameters.prototype.solutionCount=6]
- * @description 乘车方案的数量。
- */
- this.solutionCount = 6;
- /**
- * @member {SuperMap.TransferPreference} [SuperMap.TransferSolutionParameters.prototype.transferPreference=SuperMap.TransferPreference.NONE]
- * @description 乘车偏好枚举。
- */
- this.transferPreference = TransferPreference.NONE;
- /**
- * @member {SuperMap.TransferTactic} [SuperMap.TransferSolutionParameters.prototype.transferTactic=TransferTactic|SuperMap.TransferTactic.LESS_TIME]
- * @description 交通换乘策略类型,包括时间最短、距离最短、最少换乘、最少步行四种选择。
- */
- this.transferTactic = TransferTactic.LESS_TIME;
- /**
- * @member {number} [SuperMap.TransferSolutionParameters.prototype.walkingRatio=10]
- * @description 步行与公交的消耗权重比。此值越大,则步行因素对于方案选择的影响越大。例如:</br>
- * 例如现在有两种换乘方案(在仅考虑消耗因素的情况下):</br>
- * 方案1:坐车 10 公里,走路 1 公里;</br>
- * 方案2:坐车 15 公里,走路 0.5 公里;</br>
- * 1. 假设权重比为 15:</br>
- * •方案 1 的总消耗为:10 + 1*15 = 25</br>
- * •方案 2 的总消耗为:15 + 0.5*15 = 22.5</br>
- * 此时方案 2 消耗更低。</br>
- * 2. 假设权重比为2:</br>
- * •方案 1 的总消耗为:10+1*2 = 12</br>
- * •方案 2 的总消耗为:15+0.5*2 = 17</br>
- * 此时方案 1 消耗更低。</br>
- */
- this.walkingRatio = null;
- /**
- * @member {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point|string)>} SuperMap.TransferSolutionParameters.prototype.points
- * @description 两种查询方式:</br>
- * 1. 按照公交站点的起止 ID 进行查询,则 points 参数的类型为 int[],形如:[起点 ID、终点 ID],公交站点的 ID 对应服务提供者配置中的站点 ID 字段;
- * 2. 按照起止点的坐标进行查询,则 points 参数的类型为 Point2D[],形如:[{"x":44,"y":39},{"x":45,"y":40}]。
- */
- this.points = false;
- /**
- * @member {Array.<number>} [SuperMap.TransferSolutionParameters.prototype.evadeLinesnull]
- * @description 避让路线 ID。
- * */
- this.evadeLines = null;
- /**
- * @member {Array.<number>} [SuperMap.TransferSolutionParameters.prototype.evadeStops=TransferLine]
- * @description 避让站点 ID。
- * */
- this.evadeStops = null;
- /**
- * @member {Array.<number>} [SuperMap.TransferSolutionParameters.prototype.priorLines]
- * @description 优先路线 ID。
- * */
- this.priorLines = null;
- /**
- * @member {Array.<number>} [SuperMap.TransferSolutionParameters.prototype.priorStops]
- * @description 优先站点 ID。
- * */
- this.priorStops = null;
- /**
- * @member {string} SuperMap.TransferSolutionParameters.prototype.travelTime
- * @description 出行的时间; 格式是:"小时:分钟",如:"08:30"。如果设置了该参数,在分析时,则会考虑线路的首末班车时间的限制,即在返回的结果中会提示公交的首末班发车时间。
- */
- this.travelTime = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.TransferSolutionParameters";
- }
- /**
- * @function SuperMap.TransferSolutionParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- TransferSolutionParameters_createClass(TransferSolutionParameters, [{
- key: "destroy",
- value: function destroy() {
- Util.reset(this);
- }
- /**
- * @function SuperMap.TransferSolutionParameters.toJsonParameters
- * @description 将 {@link SuperMap.TransferSolutionParameters} 对象参数转换为 JSON 字符串。
- * @param {SuperMap.TransferSolutionParameters} params - 交通换乘参数。
- * @returns {string} 转化后的 JSON 字符串。
- */
- }], [{
- key: "toJson",
- value: function toJson(params) {
- if (params) {
- return Util.toJSON(params);
- }
- }
- }]);
- return TransferSolutionParameters;
- }();
- SuperMap.TransferSolutionParameters = TransferSolutionParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/TransferSolutionService.js
- 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); }
- function TransferSolutionService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function TransferSolutionService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferSolutionService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferSolutionService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function TransferSolutionService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TransferSolutionService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function TransferSolutionService_setPrototypeOf(o, p) { TransferSolutionService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TransferSolutionService_setPrototypeOf(o, p); }
- 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); }; }
- function TransferSolutionService_possibleConstructorReturn(self, call) { if (call && (TransferSolutionService_typeof(call) === "object" || typeof call === "function")) { return call; } return TransferSolutionService_assertThisInitialized(self); }
- function TransferSolutionService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function TransferSolutionService_getPrototypeOf(o) { TransferSolutionService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TransferSolutionService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.TransferSolutionService
- * @category iServer TrafficTransferAnalyst TransferSolutions
- * @classdesc 交通换乘方案查询服务类。
- * 返回结果通过该类支持的事件的监听函数参数获取。
- * @param {string} url - 与客户端交互的交通换乘方案查询服务地址。
- * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
- * @param {Object} options - 参数。</br>
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。</br>
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {SuperMap.CommonServiceBase}
- * @example 例如:
- * (start code)
- * var myService = new SuperMap.TransferSolutionService(url, {eventListeners: {
- * "processCompleted": trafficTransferCompleted,
- * "processFailed": trafficTransferError
- * }
- * };
- * (end)
- *
- */
- var TransferSolutionService = /*#__PURE__*/function (_CommonServiceBase) {
- TransferSolutionService_inherits(TransferSolutionService, _CommonServiceBase);
- var _super = TransferSolutionService_createSuper(TransferSolutionService);
- function TransferSolutionService(url, options) {
- var _this;
- TransferSolutionService_classCallCheck(this, TransferSolutionService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.TransferSolutionService";
- return _this;
- }
- /**
- * @override
- */
- TransferSolutionService_createClass(TransferSolutionService, [{
- key: "destroy",
- value: function destroy() {
- TransferSolutionService_get(TransferSolutionService_getPrototypeOf(TransferSolutionService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.TransferSolutionService.prototype.processAsync
- * @description 负责将客户端的更新参数传递到服务端。
- * @param {SuperMap.TransferSolutionParameters} params - 交通换乘参数。
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof TransferSolutionParameters)) {
- return;
- }
- var me = this,
- method = "GET",
- jsonParameters;
- me.url = Util.urlPathAppend(me.url, 'solutions');
- jsonParameters = {
- points: Util.toJSON(params.points),
- walkingRatio: params['walkingRatio'],
- transferTactic: params['transferTactic'],
- solutionCount: params['solutionCount'],
- transferPreference: params["transferPreference"]
- };
- if (params.evadeLines) {
- jsonParameters["evadeLines"] = Util.toJSON(params.evadeLines);
- }
- if (params.evadeStops) {
- jsonParameters["evadeStops"] = Util.toJSON(params.evadeStops);
- }
- if (params.priorLines) {
- jsonParameters["priorLines"] = Util.toJSON(params.priorLines);
- }
- if (params.priorStops) {
- jsonParameters["priorStops"] = Util.toJSON(params.priorStops);
- }
- if (params.travelTime) {
- jsonParameters["travelTime"] = params.travelTime;
- }
- me.request({
- method: method,
- params: jsonParameters,
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- }]);
- return TransferSolutionService;
- }(CommonServiceBase);
- SuperMap.TransferSolutionService = TransferSolutionService;
- ;// CONCATENATED MODULE: ./src/common/iServer/UpdateEdgeWeightParameters.js
- function UpdateEdgeWeightParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function UpdateEdgeWeightParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateEdgeWeightParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateEdgeWeightParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.UpdateEdgeWeightParameters
- * @category iServer NetworkAnalyst EdgeWeight
- * @classdesc 边的耗费权重更新服务参数类。
- * @param {Object} options - 参数。
- * @param {string} options.edgeId - 所在边的 ID。
- * @param {string} options.fromNodeId - 起始转向点的 ID。
- * @param {string} options.toNodeId - 终止转向点的 ID。
- * @param {string} options.weightField - 边的耗费字段。
- * @param {string} options.edgeWeight - 耗费权重。
- */
- var UpdateEdgeWeightParameters = /*#__PURE__*/function () {
- function UpdateEdgeWeightParameters(options) {
- UpdateEdgeWeightParameters_classCallCheck(this, UpdateEdgeWeightParameters);
- if (!options) {
- return;
- }
- /**
- * @member {string} SuperMap.UpdateEdgeWeightParameters.prototype.edgeId
- * @description 所在边的 ID。
- */
- this.edgeId = "";
- /**
- * @member {string} SuperMap.UpdateEdgeWeightParameters.prototype.fromNodeId
- * @description 起始转向点的 ID。
- */
- this.fromNodeId = "";
- /**
- * @member {string} SuperMap.UpdateEdgeWeightParameters.prototype.toNodeId
- * @description 终止转向点的 ID。
- */
- this.toNodeId = "";
- /**
- * @member {string} SuperMap.UpdateEdgeWeightParameters.prototype.weightField
- * @description 边的耗费字段。
- */
- this.weightField = "";
- /**
- * @member {string} SuperMap.UpdateEdgeWeightParameters.prototype.edgeWeight
- * @description 耗费权重。
- */
- this.edgeWeight = "";
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.UpdateEdgeWeightParameters";
- }
- /**
- * @function SuperMap.UpdateEdgeWeightParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- UpdateEdgeWeightParameters_createClass(UpdateEdgeWeightParameters, [{
- key: "destroy",
- value: function destroy() {
- this.edgeId = null;
- this.fromNodeId = null;
- this.toNodeId = null;
- this.weightField = null;
- this.edgeWeight = null;
- }
- }]);
- return UpdateEdgeWeightParameters;
- }();
- SuperMap.UpdateEdgeWeightParameters = UpdateEdgeWeightParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/UpdateEdgeWeightService.js
- 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); }
- function UpdateEdgeWeightService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function UpdateEdgeWeightService_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateEdgeWeightService_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateEdgeWeightService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function UpdateEdgeWeightService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UpdateEdgeWeightService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function UpdateEdgeWeightService_setPrototypeOf(o, p) { UpdateEdgeWeightService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UpdateEdgeWeightService_setPrototypeOf(o, p); }
- 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); }; }
- function UpdateEdgeWeightService_possibleConstructorReturn(self, call) { if (call && (UpdateEdgeWeightService_typeof(call) === "object" || typeof call === "function")) { return call; } return UpdateEdgeWeightService_assertThisInitialized(self); }
- function UpdateEdgeWeightService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function UpdateEdgeWeightService_getPrototypeOf(o) { UpdateEdgeWeightService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UpdateEdgeWeightService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.UpdateEdgeWeightService
- * @category iServer NetworkAnalyst EdgeWeight
- * @classdesc 更新边的边的耗费权重服务
- * @extends {SuperMap.NetworkAnalystServiceBase}
- * @example
- *(start code)
- * var updateEdgeWeightService = new SuperMap.UpdateEdgeWeightService(url, {
- * eventListeners: {
- * "processCompleted": UpdateEdgeWeightCompleted, //参数为SuperMap.UpdateEdgeWeightEventArgs
- * "processFailed": UpdateEdgeWeightError //参数为SuperMap.ServiceFailedEventArgs
- * }
- * });
- * (end)
- * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var UpdateEdgeWeightService = /*#__PURE__*/function (_NetworkAnalystServic) {
- UpdateEdgeWeightService_inherits(UpdateEdgeWeightService, _NetworkAnalystServic);
- var _super = UpdateEdgeWeightService_createSuper(UpdateEdgeWeightService);
- function UpdateEdgeWeightService(url, options) {
- var _this;
- UpdateEdgeWeightService_classCallCheck(this, UpdateEdgeWeightService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.UpdateEdgeWeightService";
- return _this;
- }
- /**
- * @override
- */
- UpdateEdgeWeightService_createClass(UpdateEdgeWeightService, [{
- key: "destroy",
- value: function destroy() {
- UpdateEdgeWeightService_get(UpdateEdgeWeightService_getPrototypeOf(UpdateEdgeWeightService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.UpdateEdgeWeightService.prototype.processAsync
- * @description 开始异步执行边的边的耗费权重的更新
- * @param {SuperMap.UpdateEdgeWeightParameters} params - 边的耗费权重更新服务参数类
- * @example
- * (code)
- * var updateEdgeWeightParam=new SuperMapUpdateEdgeWeightParameters({
- * edgeId:"20",
- * fromNodeId:"26",
- * toNodeId:"109",
- * weightField:"time",
- * edgeWeight:"25"
- * });
- * updateEdgeWeightService.processAsync(updateEdgeWeightParam);
- * (end)
- */
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof UpdateEdgeWeightParameters)) {
- return;
- }
- var me = this;
- var paramStr = me.parse(params);
- me.url = Util.urlPathAppend(me.url, paramStr);
- var data = params.edgeWeight ? params.edgeWeight : null;
- me.request({
- method: "PUT",
- scope: me,
- data: data,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.UpdateEdgeWeightService.prototype.parse
- * @description 将更新服务参数解析为用‘/’做分隔的字符串
- */
- }, {
- key: "parse",
- value: function parse(params) {
- if (!params) {
- return;
- }
- var paramStr = "";
- for (var attr in params) {
- if (params[attr] === "" || params[attr] === "edgeWeight") {
- continue;
- }
- switch (attr) {
- case "edgeId":
- paramStr += "/edgeweight/" + params[attr];
- break;
- case "fromNodeId":
- paramStr += "/fromnode/" + params[attr];
- break;
- case "toNodeId":
- paramStr += "/tonode/" + params[attr];
- break;
- case "weightField":
- paramStr += "/weightfield/" + params[attr];
- break;
- default:
- break;
- }
- }
- return paramStr;
- }
- }]);
- return UpdateEdgeWeightService;
- }(NetworkAnalystServiceBase);
- SuperMap.UpdateEdgeWeightService = UpdateEdgeWeightService;
- ;// CONCATENATED MODULE: ./src/common/iServer/UpdateTurnNodeWeightParameters.js
- function UpdateTurnNodeWeightParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function UpdateTurnNodeWeightParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateTurnNodeWeightParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateTurnNodeWeightParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.UpdateTurnNodeWeightParameters
- * @category iServer NetworkAnalyst TurnNodeWeight
- * @classdesc 转向耗费权重更新服务参数类。
- * @param {Object} options - 参数。
- * @param {string} options.nodeId - 转向结点的 ID。
- * @param {string} options.fromEdgeId - 起始边的 ID。
- * @param {string} options.toEdgeId - 终止边的 ID。
- * @param {string} options.weightField - 转向结点的耗费字段。
- * @param {string} options.turnNodeWeight - 耗费权重。
- */
- var UpdateTurnNodeWeightParameters = /*#__PURE__*/function () {
- function UpdateTurnNodeWeightParameters(options) {
- UpdateTurnNodeWeightParameters_classCallCheck(this, UpdateTurnNodeWeightParameters);
- if (!options) {
- return;
- }
- /**
- * @member {string} SuperMap.UpdateTurnNodeWeightParameters.prototype.nodeId
- * @description 转向结点的 ID。
- */
- this.nodeId = "";
- /**
- * @member {string} SuperMap.UpdateTurnNodeWeightParameters.prototype.fromEdgeId
- * @description 起始边的 ID。
- */
- this.fromEdgeId = "";
- /**
- * @member {string} SuperMap.UpdateTurnNodeWeightParameters.prototype.toEdgeId
- * @description 终止边的 ID。
- */
- this.toEdgeId = "";
- /**
- * @member {string} SuperMap.UpdateTurnNodeWeightParameters.prototype.weightField
- * @description 转向结点的耗费字段。
- */
- this.weightField = "";
- /**
- * @member {string} SuperMap.UpdateTurnNodeWeightParameters.prototype.turnNodeWeight
- * @description 耗费权重。
- */
- this.turnNodeWeight = "";
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.UpdateTurnNodeWeightParameters";
- }
- /**
- * @function SuperMap.UpdateTurnNodeWeightParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- UpdateTurnNodeWeightParameters_createClass(UpdateTurnNodeWeightParameters, [{
- key: "destroy",
- value: function destroy() {
- this.nodeId = null;
- this.fromEdgeId = null;
- this.toEdgeId = null;
- this.weightField = null;
- this.turnNodeWeight = null;
- }
- }]);
- return UpdateTurnNodeWeightParameters;
- }();
- SuperMap.UpdateTurnNodeWeightParameters = UpdateTurnNodeWeightParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/UpdateTurnNodeWeightService.js
- 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); }
- function UpdateTurnNodeWeightService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function UpdateTurnNodeWeightService_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateTurnNodeWeightService_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateTurnNodeWeightService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function UpdateTurnNodeWeightService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UpdateTurnNodeWeightService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function UpdateTurnNodeWeightService_setPrototypeOf(o, p) { UpdateTurnNodeWeightService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UpdateTurnNodeWeightService_setPrototypeOf(o, p); }
- 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); }; }
- function UpdateTurnNodeWeightService_possibleConstructorReturn(self, call) { if (call && (UpdateTurnNodeWeightService_typeof(call) === "object" || typeof call === "function")) { return call; } return UpdateTurnNodeWeightService_assertThisInitialized(self); }
- function UpdateTurnNodeWeightService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function UpdateTurnNodeWeightService_getPrototypeOf(o) { UpdateTurnNodeWeightService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UpdateTurnNodeWeightService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.UpdateTurnNodeWeightService
- * @category iServer NetworkAnalyst TurnNodeWeight
- * @classdesc 转向耗费权重更新服务类
- * @extends {SuperMap.NetworkAnalystServiceBase}
- * @example
- * var UpdateTurnNodeWeightService = new SuperMap.UpdateTurnNodeWeightService(url, {
- * eventListeners: {
- * "processCompleted": UpdateTurnNodeWeightCompleted, //参数为SuperMap.UpdateTurnNodeWeightEventArgs
- * "processFailed": UpdateTurnNodeWeightError //参数为SuperMap.ServiceFailedEventArgs
- * }
- * });
- * @param {string} url - 服务的访问地址。如:
- * http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var UpdateTurnNodeWeightService = /*#__PURE__*/function (_NetworkAnalystServic) {
- UpdateTurnNodeWeightService_inherits(UpdateTurnNodeWeightService, _NetworkAnalystServic);
- var _super = UpdateTurnNodeWeightService_createSuper(UpdateTurnNodeWeightService);
- function UpdateTurnNodeWeightService(url, options) {
- var _this;
- UpdateTurnNodeWeightService_classCallCheck(this, UpdateTurnNodeWeightService);
- _this = _super.call(this, url, options);
- _this.CLASS_NAME = "SuperMap.UpdateTurnNodeWeightService";
- return _this;
- }
- /**
- * @override
- */
- UpdateTurnNodeWeightService_createClass(UpdateTurnNodeWeightService, [{
- key: "destroy",
- value: function destroy() {
- UpdateTurnNodeWeightService_get(UpdateTurnNodeWeightService_getPrototypeOf(UpdateTurnNodeWeightService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.UpdateTurnNodeWeightService.prototype.processAsync
- * @description 开始异步执行转向耗费权重的更新
- * @param {SuperMap.UpdateTurnNodeWeightParameters} params - 转向耗费权重更新服务参数类
- * @example
- * (code)
- * var updateTurnNodeWeightParam=new SuperMap.UpdateTurnNodeWeightParameters({
- * nodeId:"106",
- * fromEdgeId:"6508",
- * toEdgeId:"6504",
- * weightField:"TurnCost",
- * turnNodeWeight:"50"
- * });
- * updateTurnNodeWeightService.processAsync(updateTurnNodeWeightParam);
- * (end)
- **/
- }, {
- key: "processAsync",
- value: function processAsync(params) {
- if (!(params instanceof UpdateTurnNodeWeightParameters)) {
- return;
- }
- var me = this;
- var paramStr = me.parse(params);
- me.url = Util.urlPathAppend(me.url, paramStr);
- var data = params.turnNodeWeight ? params.turnNodeWeight : null;
- me.request({
- method: "PUT",
- scope: me,
- data: data,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.UpdateTurnNodeWeightService.prototype.parse
- * @description 将更新服务参数解析为用‘/’做分隔的字符串
- */
- }, {
- key: "parse",
- value: function parse(params) {
- if (!params) {
- return;
- }
- var paramStr = "";
- for (var attr in params) {
- if (params[attr] === "" || params[attr] === "turnNodeWeight") {
- continue;
- }
- switch (attr) {
- case "nodeId":
- paramStr += "/turnnodeweight/" + params[attr];
- break;
- case "fromEdgeId":
- paramStr += "/fromedge/" + params[attr];
- break;
- case "toEdgeId":
- paramStr += "/toedge/" + params[attr];
- break;
- case "weightField":
- paramStr += "/weightfield/" + params[attr];
- break;
- default:
- break;
- }
- }
- return paramStr;
- }
- }]);
- return UpdateTurnNodeWeightService;
- }(NetworkAnalystServiceBase);
- SuperMap.UpdateTurnNodeWeightService = UpdateTurnNodeWeightService;
- ;// CONCATENATED MODULE: ./src/common/iServer/VectorClipJobsParameter.js
- function VectorClipJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function VectorClipJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) VectorClipJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) VectorClipJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.VectorClipJobsParameter
- * @category iServer ProcessingService VectorClip
- * @classdesc 矢量裁剪分析任务参数类。
- * @param {Object} options - 参数。
- * @param {string} options.datasetName - 数据集名。
- * @param {string} options.datasetOverlay - 裁剪对象数据集。
- * @param {SuperMap.ClipAnalystMode} [options.mode=SuperMap.ClipAnalystMode.CLIP] - 裁剪分析模式。
- * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
- * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
- */
- var VectorClipJobsParameter = /*#__PURE__*/function () {
- function VectorClipJobsParameter(options) {
- VectorClipJobsParameter_classCallCheck(this, VectorClipJobsParameter);
- options = options || {};
- /**
- * @member {string} SuperMap.VectorClipJobsParameter.prototype.datasetName
- * @description 数据集名。
- */
- this.datasetName = "";
- /**
- * @member {string} SuperMap.VectorClipJobsParameter.prototype.datasetOverlay
- * @description 裁剪对象数据集。
- */
- this.datasetVectorClip = "";
- /**
- * @member {string} SuperMap.VectorClipJobsParameter.prototype.geometryClip
- * @description 裁剪几何对象。
- */
- this.geometryClip = "";
- /**
- * @member {SuperMap.ClipAnalystMode} [SuperMap.VectorClipJobsParameter.prototype.mode=ClipAnalystMode.CLIP]
- * @description 裁剪分析模式 。
- */
- this.mode = ClipAnalystMode.CLIP;
- /**
- * @member {SuperMap.OutputSetting} SuperMap.VectorClipJobsParameter.prototype.output
- * @description 输出参数设置类。
- */
- this.output = null;
- /**
- * @member {SuperMap.MappingParameters} [SuperMap.VectorClipJobsParameter.prototype.mappingParameters]
- * @description 分析后结果可视化的参数类。
- */
- this.mappingParameters = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.VectorClipJobsParameter";
- }
- /**
- * @function SuperMap.VectorClipJobsParameter.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- VectorClipJobsParameter_createClass(VectorClipJobsParameter, [{
- key: "destroy",
- value: function destroy() {
- this.datasetName = null;
- this.datasetVectorClip = null;
- this.geometryClip = null;
- this.mode = null;
- if (this.output instanceof OutputSetting) {
- this.output.destroy();
- this.output = null;
- }
- if (this.mappingParameters instanceof MappingParameters) {
- this.mappingParameters.destroy();
- this.mappingParameters = null;
- }
- }
- /**
- * @function SuperMap.VectorClipJobsParameter.toObject
- * @param {Object} vectorClipJobsParameter - 区域汇总分析服务参数。
- * @param {Object} tempObj - 目标对象。
- * @description 矢量裁剪分析任务对象。
- */
- }], [{
- key: "toObject",
- value: function toObject(vectorClipJobsParameter, tempObj) {
- for (var name in vectorClipJobsParameter) {
- if (name === "datasetName") {
- tempObj['input'] = tempObj['input'] || {};
- tempObj['input'][name] = vectorClipJobsParameter[name];
- continue;
- }
- if (name === "output") {
- tempObj['output'] = tempObj['output'] || {};
- tempObj['output'] = vectorClipJobsParameter[name];
- continue;
- }
- tempObj['analyst'] = tempObj['analyst'] || {};
- tempObj['analyst'][name] = vectorClipJobsParameter[name];
- if (name === 'mappingParameters') {
- tempObj['analyst'][name] = tempObj['analyst'][name] || {};
- tempObj['analyst']['mappingParameters'] = vectorClipJobsParameter[name];
- }
- }
- }
- }]);
- return VectorClipJobsParameter;
- }();
- SuperMap.VectorClipJobsParameter = VectorClipJobsParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/VectorClipJobsService.js
- 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); }
- function VectorClipJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function VectorClipJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) VectorClipJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) VectorClipJobsService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function VectorClipJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = VectorClipJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function VectorClipJobsService_setPrototypeOf(o, p) { VectorClipJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return VectorClipJobsService_setPrototypeOf(o, p); }
- 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); }; }
- function VectorClipJobsService_possibleConstructorReturn(self, call) { if (call && (VectorClipJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return VectorClipJobsService_assertThisInitialized(self); }
- function VectorClipJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function VectorClipJobsService_getPrototypeOf(o) { VectorClipJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return VectorClipJobsService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.VectorClipJobsService
- * @category iServer ProcessingService VectorClip
- * @classdesc 矢量裁剪分析服务类
- * @extends {SuperMap.ProcessingServiceBase}
- * @param {string} url -矢量裁剪分析服务地址。
- * @param {Object} options - 交互服务时所需可选参数。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var VectorClipJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
- VectorClipJobsService_inherits(VectorClipJobsService, _ProcessingServiceBas);
- var _super = VectorClipJobsService_createSuper(VectorClipJobsService);
- function VectorClipJobsService(url, options) {
- var _this;
- VectorClipJobsService_classCallCheck(this, VectorClipJobsService);
- _this = _super.call(this, url, options);
- _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/vectorclip');
- _this.CLASS_NAME = 'SuperMap.VectorClipJobsService';
- return _this;
- }
- /**
- *@override
- */
- VectorClipJobsService_createClass(VectorClipJobsService, [{
- key: "destroy",
- value: function destroy() {
- VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.VectorClipJobsService.protitype.getVectorClipJobs
- * @description 获取矢量裁剪分析所有任务
- */
- }, {
- key: "getVectorClipJobs",
- value: function getVectorClipJobs() {
- VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "getJobs", this).call(this, this.url);
- }
- /**
- * @function SuperMap.KernelDensityJobsService.protitype.getVectorClipJob
- * @description 获取指定id的矢量裁剪分析服务
- * @param {string} id - 指定要获取数据的id
- */
- }, {
- key: "getVectorClipJob",
- value: function getVectorClipJob(id) {
- VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
- }
- /**
- * @function SuperMap.VectorClipJobsService.protitype.addVectorClipJob
- * @description 新建矢量裁剪分析服务
- * @param {SuperMap.VectorClipJobsParameter} params - 创建一个空间分析的请求参数。
- * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
- */
- }, {
- key: "addVectorClipJob",
- value: function addVectorClipJob(params, seconds) {
- VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "addJob", this).call(this, this.url, params, VectorClipJobsParameter, seconds);
- }
- }]);
- return VectorClipJobsService;
- }(ProcessingServiceBase);
- SuperMap.VectorClipJobsService = VectorClipJobsService;
- ;// CONCATENATED MODULE: ./src/common/iServer/RasterFunctionParameter.js
- function RasterFunctionParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function RasterFunctionParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) RasterFunctionParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) RasterFunctionParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.RasterFunctionParameter
- * @category iServer Map
- * @classdesc iServer 地图服务栅格分析参数基类
- * @param {Object} options - 参数。
- * @param {SuperMap.RasterFunctionType} options.type - 栅格分析方法。
- */
- var RasterFunctionParameter = /*#__PURE__*/function () {
- function RasterFunctionParameter(options) {
- RasterFunctionParameter_classCallCheck(this, RasterFunctionParameter);
- options = options || {};
- /**
- * @member {SuperMap.RasterFunctionType} [SuperMap.RasterFunctionParameter.prototype.type]
- * @description 栅格分析方法。
- */
- this.type = null;
- Util.extend(this, options);
- this.CLASS_NAME = 'SuperMap.RasterFunctionParameter';
- }
- /**
- * @function SuperMap.RasterFunctionParameter.prototype.destroy
- * @description 释放资源,将资源的属性置空。
- */
- RasterFunctionParameter_createClass(RasterFunctionParameter, [{
- key: "destroy",
- value: function destroy() {
- this.type = null;
- }
- }]);
- return RasterFunctionParameter;
- }();
- SuperMap.RasterFunctionParameter = RasterFunctionParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/NDVIParameter.js
- 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); }
- function NDVIParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function NDVIParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) NDVIParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) NDVIParameter_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function NDVIParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = NDVIParameter_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function NDVIParameter_setPrototypeOf(o, p) { NDVIParameter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NDVIParameter_setPrototypeOf(o, p); }
- 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); }; }
- function NDVIParameter_possibleConstructorReturn(self, call) { if (call && (NDVIParameter_typeof(call) === "object" || typeof call === "function")) { return call; } return NDVIParameter_assertThisInitialized(self); }
- function NDVIParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function NDVIParameter_getPrototypeOf(o) { NDVIParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NDVIParameter_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.NDVIParameter
- * @category iServer Map
- * @classdesc 归一化植被指数参数类
- * @param {Object} options - 参数。
- * @param {number} [options.redIndex=0] - 红光谱波段索引。
- * @param {number} [options.nirIndex=1] - 近红外光谱波段索引。
- * @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。仅单波段数据时设定。
- * @extends {SuperMap.RasterFunctionParameter}
- */
- var NDVIParameter = /*#__PURE__*/function (_RasterFunctionParame) {
- NDVIParameter_inherits(NDVIParameter, _RasterFunctionParame);
- var _super = NDVIParameter_createSuper(NDVIParameter);
- function NDVIParameter(options) {
- var _this;
- NDVIParameter_classCallCheck(this, NDVIParameter);
- _this = _super.call(this, options);
- /**
- * @member {number} [SuperMap.NDVIParameter.prototype.redIndex=0]
- * @description 红光谱波段索引。
- */
- _this.redIndex = 0;
- /**
- * @member {number} [SuperMap.NDVIParameter.prototype.nirIndex=1]
- * @description 近红外光谱波段索引。
- */
- _this.nirIndex = 1;
- /**
- * @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"]
- * @description 颜色表。由栅格的中断值和颜色停止之间的映射组成的,如0.3->d9f0a3ff 指的是[0,0.3)显示d9f0a3ff。仅单波段数据时设定。
- */
- _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';
- /**
- * @member {SuperMap.RasterFunctionType} [SuperMap.RasterFunctionParameter.prototype.type]
- * @description 栅格分析方法。
- */
- _this.type = RasterFunctionType.NDVI;
- Util.extend(NDVIParameter_assertThisInitialized(_this), options);
- _this.CLASS_NAME = 'SuperMap.NDVIParameter';
- return _this;
- }
- /**
- * @function SuperMap.NDVIParameter.prototype.destroy
- * @override
- */
- NDVIParameter_createClass(NDVIParameter, [{
- key: "destroy",
- value: function destroy() {
- NDVIParameter_get(NDVIParameter_getPrototypeOf(NDVIParameter.prototype), "destroy", this).call(this);
- this.redIndex = null;
- this.nirIndex = null;
- this.colorMap = null;
- }
- /**
- * @function SuperMap.NDVIParameter.prototype.toJSON
- * @description 将 NDVIParameter 对象转化为 JSON 字符串。
- * @returns {string} 返回转换后的 JSON 字符串。
- */
- }, {
- key: "toJSON",
- value: function toJSON() {
- return {
- redIndex: this.redIndex,
- nirIndex: this.nirIndex,
- colorMap: this.colorMap,
- type: this.type
- };
- }
- }]);
- return NDVIParameter;
- }(RasterFunctionParameter);
- SuperMap.NDVIParameter = NDVIParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/HillshadeParameter.js
- 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); }
- function HillshadeParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function HillshadeParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) HillshadeParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) HillshadeParameter_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function HillshadeParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = HillshadeParameter_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function HillshadeParameter_setPrototypeOf(o, p) { HillshadeParameter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return HillshadeParameter_setPrototypeOf(o, p); }
- 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); }; }
- function HillshadeParameter_possibleConstructorReturn(self, call) { if (call && (HillshadeParameter_typeof(call) === "object" || typeof call === "function")) { return call; } return HillshadeParameter_assertThisInitialized(self); }
- function HillshadeParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function HillshadeParameter_getPrototypeOf(o) { HillshadeParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return HillshadeParameter_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.HillshadeParameter
- * @category iServer Map
- * @classdesc 阴影面分析参数类
- * @param {Object} options - 参数。
- * @param {number} [options.altitude=45] - 高于地平线的光源高度角。高度角由正度数表示,0 度代表地平线,而 90 度代表头顶正上方。
- * @param {number} [options.azimuth=315] - 光源的方位角。方位角由0到360度之间的正度数表示,以北为基准方向按顺时针进行测量。
- * @param {number} [options.zFactor=1] - 一个表面 z 单位中地面 x,y 单位的数量。z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
- * z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
- * 如果 x,y 单位和 z 单位采用相同的测量单位,则 z 因子为 1。这是默认设置。
- * 如果 x,y 单位和 z 单位采用不同的测量单位,则必须将 z 因子设置为适当的因子,否则会得到错误的结果。例如,如果 z 单位是英尺而 x,y 单位是米,则应使用 z 因子 0.3048 将 z 单位从英尺转换为米(1 英尺 = 0.3048 米)。
- * 如果输入栅格位于球面坐标系中(如十进制度球面坐标系),则生成的山体阴影可能看起来很独特。这是因为水平地面单位与高程 z 单位之间的测量值存在差异。由于经度的长度随着纬度而变化,因此需要为该纬度指定一个适当的 z 因子。如果 x,y 单位是十进制度而 Z 单位是米,特定纬度的一些合适的 Z 因子为:
- * Latitude Z-factor
- * 0 0.00000898
- * 10 0.00000912
- * 20 0.00000956
- * 30 0.00001036
- * 40 0.00001171
- * 50 0.00001395
- * 60 0.00001792
- * 70 0.00002619
- * 80 0.00005156
- * @extends {SuperMap.RasterFunctionParameter}
- */
- var HillshadeParameter = /*#__PURE__*/function (_RasterFunctionParame) {
- HillshadeParameter_inherits(HillshadeParameter, _RasterFunctionParame);
- var _super = HillshadeParameter_createSuper(HillshadeParameter);
- function HillshadeParameter(options) {
- var _this;
- HillshadeParameter_classCallCheck(this, HillshadeParameter);
- _this = _super.call(this, options);
- /**
- * @member {number} [SuperMap.HillshadeParameter.prototype.altitude = 45]
- * @description 高于地平线的光源高度角。高度角由正度数表示,0 度代表地平线,而 90 度代表头顶正上方。
- */
- _this.altitude = 45;
- /**
- * @member {number} [SuperMap.HillshadeParameter.prototype.azimuth = 315]
- * @description 光源的方位角。方位角由0到360度之间的正度数表示,以北为基准方向按顺时针进行测量。
- */
- _this.azimuth = 315;
- /**
- * @member {number} [SuperMap.HillshadeParameter.prototype.zFactor = 1]
- * @description 一个表面 z 单位中地面 x,y 单位的数量。z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
- */
- _this.zFactor = 1;
- /**
- * @member {SuperMap.RasterFunctionType} SuperMap.RasterFunctionParameter.prototype.type
- * @description 栅格分析方法。
- */
- _this.type = RasterFunctionType.HILLSHADE;
- Util.extend(HillshadeParameter_assertThisInitialized(_this), options);
- _this.CLASS_NAME = 'SuperMap.HillshadeParameter';
- return _this;
- }
- /**
- * @function SuperMap.HillshadeParameter.prototype.destroy
- * @override
- */
- HillshadeParameter_createClass(HillshadeParameter, [{
- key: "destroy",
- value: function destroy() {
- HillshadeParameter_get(HillshadeParameter_getPrototypeOf(HillshadeParameter.prototype), "destroy", this).call(this);
- this.altitude = null;
- this.azimuth = null;
- this.zFactor = null;
- }
- /**
- * @function SuperMap.HillshadeParameter.prototype.toJSON
- * @description 将 HillshadeParameter 对象转化为 JSON 字符串。
- * @returns {string} 返回转换后的 JSON 字符串。
- */
- }, {
- key: "toJSON",
- value: function toJSON() {
- return {
- altitude: this.altitude,
- azimuth: this.azimuth,
- zFactor: this.zFactor,
- type: this.type
- };
- }
- }]);
- return HillshadeParameter;
- }(RasterFunctionParameter);
- SuperMap.HillshadeParameter = HillshadeParameter;
- ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobCustomItems.js
- function WebPrintingJobCustomItems_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function WebPrintingJobCustomItems_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobCustomItems_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobCustomItems_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.WebPrintingJobCustomItems
- * @classdesc Web 打印图例元素参数类。
- * @version 10.1.0
- * @category iServer WebPrintingJob
- * @param {Object} option - 初始化参数。
- * @param {string} option.name - 图例元素的名称。
- * @param {string} [option.picAsUrl] - 图例元素 Base64 格式图片。
- * @param {string} [option.picAsBase64] - 图例元素图片的获取地址。
- */
- var WebPrintingJobCustomItems = /*#__PURE__*/function () {
- function WebPrintingJobCustomItems(option) {
- WebPrintingJobCustomItems_classCallCheck(this, WebPrintingJobCustomItems);
- /**
- * @member {string} SuperMap.WebPrintingJobCustomItems.prototype.name
- * @description 图例元素的名称。
- */
- this.name = null;
- /**
- * @member {string} [SuperMap.WebPrintingJobCustomItems.prototype.picAsUrl]
- * @description 图例元素 Base64 格式图片。
- */
- this.picAsUrl = null;
- /**
- * @member {string} [SuperMap.WebPrintingJobCustomItems.prototype.picAsBase64]
- * @description 图例元素图片的获取地址。
- */
- this.picAsBase64 = null;
- this.CLASS_NAME = 'SuperMap.WebPrintingJobCustomItems';
- Util.extend(this, option);
- }
- /**
- * @function SuperMap.WebPrintingJobCustomItems.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- WebPrintingJobCustomItems_createClass(WebPrintingJobCustomItems, [{
- key: "destroy",
- value: function destroy() {
- var me = this;
- me.name = null;
- me.picAsUrl = null;
- me.picAsBase64 = null;
- }
- /**
- * @function SuperMap.WebPrintingJobCustomItems.prototype.toJSON
- * @description 将 SuperMap.WebPrintingJobCustomItems 对象转化为 JSON 字符串。
- * @returns {string} 返回转换后的 JSON 字符串。
- */
- }, {
- key: "toJSON",
- value: function toJSON() {
- var params = {
- name: this.name
- };
- if (this.title) {
- params.title = this.title;
- }
- if (this.picAsUrl) {
- params.picAsUrl = this.picAsUrl;
- } else if (this.picAsBase64) {
- params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
- }
- return Util.toJSON(params);
- }
- }]);
- return WebPrintingJobCustomItems;
- }();
- SuperMap.WebPrintingJobCustomItems = WebPrintingJobCustomItems;
- ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobImage.js
- function WebPrintingJobImage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function WebPrintingJobImage_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobImage_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobImage_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.WebPrintingJobImage
- * @classdesc 表达小地图的静态图片参数类。
- * @version 10.1.0
- * @category iServer WebPrintingJob
- * @param {Object} option - 初始化参数。
- * @param {string} [option.picAsUrl] - 小地图的图片 url 地址。
- * @param {string} [option.picAsBase64] - 小地图的base64位图片信息。
- */
- var WebPrintingJobImage = /*#__PURE__*/function () {
- function WebPrintingJobImage(option) {
- WebPrintingJobImage_classCallCheck(this, WebPrintingJobImage);
- /**
- * @member {string} [SuperMap.WebPrintingJobImage.prototype.picAsUrl]
- * @description 小地图的图片 url 地址。
- */
- this.picAsUrl = null;
- /**
- * @member {string} [SuperMap.WebPrintingJobImage.prototype.picAsBase64]
- * @description 小地图的base64位图片信息。
- */
- this.picAsBase64 = null;
- this.CLASS_NAME = 'SuperMap.WebPrintingJobImage';
- Util.extend(this, option);
- }
- /**
- * @function SuperMap.WebPrintingJobImage.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- WebPrintingJobImage_createClass(WebPrintingJobImage, [{
- key: "destroy",
- value: function destroy() {
- this.picAsUrl = null;
- this.picAsBase64 = null;
- }
- /**
- * @function SuperMap.WebPrintingJobImage.prototype.toJSON
- * @description 将 SuperMap.WebPrintingJobImage 对象转化为 JSON 字符串。
- * @returns {string} 返回转换后的 JSON 字符串。
- */
- }, {
- key: "toJSON",
- value: function toJSON() {
- var params = {};
- if (this.picAsUrl) {
- params.picAsUrl = this.picAsUrl;
- }
- if (this.picAsBase64) {
- params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
- }
- return Util.toJSON(params);
- }
- }]);
- return WebPrintingJobImage;
- }();
- SuperMap.WebPrintingJobImage = WebPrintingJobImage;
- ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLayers.js
- function WebPrintingJobLayers_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function WebPrintingJobLayers_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLayers_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLayers_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.WebPrintingJobLayers
- * @classdesc 将图例添加到布局的业务图层参数类。
- * @version 10.1.0
- * @category iServer WebPrintingJob
- * @param {Object} option - 初始化参数。
- * @param {string} [option.name] - 表示图层 name 的字符串。此 name 必须唯一,并且必须与定义业务图层的 LegendOptions_layers 元素中的图层 name 匹配。
- */
- var WebPrintingJobLayers = /*#__PURE__*/function () {
- function WebPrintingJobLayers(option) {
- WebPrintingJobLayers_classCallCheck(this, WebPrintingJobLayers);
- /**
- * @member {string} SuperMap.WebPrintingJobLayers.prototype.name
- * @description 图层 name。
- */
- this.name = null;
- /**
- * @member {string} SuperMap.WebPrintingJobLayers.prototype.layerType
- * @description 图层 type。
- */
- this.layerType = null;
- /**
- * @member {string} SuperMap.WebPrintingJobLayers.prototype.url
- * @description 图层 url。
- */
- this.url = null;
- this.CLASS_NAME = 'SuperMap.WebPrintingJobLayers';
- Util.extend(this, option);
- }
- /**
- * @function SuperMap.WebPrintingJobLayers.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- WebPrintingJobLayers_createClass(WebPrintingJobLayers, [{
- key: "destroy",
- value: function destroy() {
- this.name = null;
- this.layerType = null;
- this.url = null;
- }
- }]);
- return WebPrintingJobLayers;
- }();
- SuperMap.WebPrintingJobLayers = WebPrintingJobLayers;
- ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLegendOptions.js
- function WebPrintingJobLegendOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function WebPrintingJobLegendOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLegendOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLegendOptions_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.WebPrintingJobLegendOptions
- * @classdesc Web 打印图例参数类。
- * @version 10.1.0
- * @category iServer WebPrintingJob
- * @param {Object} option - 初始化参数。
- * @param {string} [option.title] - 图例名称。
- * @param {string} [option.picAsUrl] - 图例的图片 url 地址。
- * @param {string} [option.picAsBase64] - 图例的 base64 位图片信息。
- * @param {SuperMap.WebPrintingJobLayers} [option.layers] - 图例的布局业务图层参数类。
- * @param {SuperMap.WebPrintingJobCustomItems} [option.customItems] - 自定义图例元素参数类。
- */
- var WebPrintingJobLegendOptions = /*#__PURE__*/function () {
- function WebPrintingJobLegendOptions(option) {
- WebPrintingJobLegendOptions_classCallCheck(this, WebPrintingJobLegendOptions);
- /**
- * @member {string} SuperMap.WebPrintingJobLegendOptions.prototype.title
- * @description 图例名称。
- */
- this.title = null;
- /**
- * @member {string} [SuperMap.WebPrintingJobLegendOptions.prototype.picAsUrl]
- * @description 图例的图片 url 地址。
- */
- this.picAsUrl = null;
- /**
- * @member {string} [SuperMap.WebPrintingJobLegendOptions.prototype.picAsBase64]
- * @description 图例的 base64 位图片信息。
- */
- this.picAsBase64 = null;
- /**
- * @member {SuperMap.WebPrintingJobLayers} [SuperMap.WebPrintingJobLegendOptions.prototype.layers]
- * @description 图例的布局业务图层参数类。
- */
- this.layers = null;
- /**
- * @member {SuperMap.WebPrintingJobCustomItems} [SuperMap.WebPrintingJobLegendOptions.prototype.customItems]
- * @description 自定义图例元素参数类。
- */
- this.customItems = null;
- this.CLASS_NAME = 'SuperMap.WebPrintingJobLegendOptions';
- Util.extend(this, option);
- }
- /**
- * @function SuperMap.WebPrintingJobLegendOptions.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- WebPrintingJobLegendOptions_createClass(WebPrintingJobLegendOptions, [{
- key: "destroy",
- value: function destroy() {
- this.title = null;
- this.picAsUrl = null;
- this.picAsBase64 = null;
- if (this.layers instanceof WebPrintingJobLayers) {
- this.layers.destroy();
- this.layers = null;
- }
- if (this.customItems instanceof WebPrintingJobCustomItems) {
- this.customItems.destroy();
- this.customItems = null;
- }
- }
- /**
- * @function SuperMap.WebPrintingJobLegendOptions.prototype.toJSON
- * @description 将 SuperMap.WebPrintingJobLegendOptions 对象转化为 JSON 字符串。
- * @returns {string} 返回转换后的 JSON 字符串。
- */
- }, {
- key: "toJSON",
- value: function toJSON() {
- var params = {
- title: this.title || ""
- };
- if (this.picAsUrl) {
- params.picAsUrl = this.picAsUrl;
- } else if (this.picAsBase64) {
- params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
- } else if (this.customItems) {
- params.customItems = this.customItems;
- }
- return Util.toJSON(params);
- }
- }]);
- return WebPrintingJobLegendOptions;
- }();
- SuperMap.WebPrintingJobLegendOptions = WebPrintingJobLegendOptions;
- ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLittleMapOptions.js
- function WebPrintingJobLittleMapOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function WebPrintingJobLittleMapOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLittleMapOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLittleMapOptions_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.WebPrintingJobLittleMapOptions
- * @classdesc Web 打印小地图参数类。
- * @version 10.1.0
- * @category iServer WebPrintingJob
- * @param {Object} option - 初始化参数。
- * @param {SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} option.center - 小地图的中心点。
- * @param {number} [option.scale] - 小地图的比例尺。
- * @param {Array.<string>} [option.layerNames] - 指定 WebMap中图层名称的列表,用于渲染小地图。
- * @param {SuperMap.WebPrintingJobImage} [option.image] - 表达小地图的静态图类。
- * @param {SuperMap.WebPrintingJobLayers} [option.layers] - 指定 WebMap 中的 layers 图层类。
- */
- var WebPrintingJobLittleMapOptions = /*#__PURE__*/function () {
- function WebPrintingJobLittleMapOptions(option) {
- WebPrintingJobLittleMapOptions_classCallCheck(this, WebPrintingJobLittleMapOptions);
- /**
- * @member {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} SuperMap.WebPrintingJobLittleMapOptions.prototype.center
- * @description 小地图的中心点。
- */
- this.center = null;
- /**
- * @member {number} [SuperMap.WebPrintingJobLittleMapOptions.prototype.scale]
- * @description 小地图的比例尺。
- */
- this.scale = null;
- /**
- * @member {Array.<string>} SuperMap.WebPrintingJobLittleMapOptions.prototype.layerNames
- * @description 指定 WebMap中图层名称的列表,用于渲染小地图。
- */
- this.layerNames = null;
- /**
- * @member {SuperMap.WebPrintingJobImage} [SuperMap.WebPrintingJobLittleMapOptions.prototype.image]
- * @description 表达小地图的静态图类。暂不支持
- */
- this.image = null;
- /**
- * @member {SuperMap.WebPrintingJobLayers} [SuperMap.WebPrintingJobLittleMapOptions.prototype.layers]
- * @description 指定 WebMap 中的 layers 图层类。
- */
- this.layers = null;
- this.CLASS_NAME = 'SuperMap.WebPrintingJobLittleMapOptions';
- Util.extend(this, option);
- }
- /**
- * @function SuperMap.WebPrintingJobLittleMapOptions.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- WebPrintingJobLittleMapOptions_createClass(WebPrintingJobLittleMapOptions, [{
- key: "destroy",
- value: function destroy() {
- this.center = null;
- this.scale = null;
- this.layerNames = null;
- if (this.image instanceof WebPrintingJobImage) {
- this.image.destroy();
- this.image = null;
- }
- if (this.layers instanceof WebPrintingJobLayers) {
- this.layers.destroy();
- this.layers = null;
- }
- }
- /**
- * @function SuperMap.WebPrintingJobLittleMapOptions.prototype.toJSON
- * @description 将 SuperMap.WebPrintingJobLittleMapOptions 对象转化为 JSON 字符串。
- * @returns {string} 返回转换后的 JSON 字符串。
- */
- }, {
- key: "toJSON",
- value: function toJSON() {
- var params = {
- scale: this.scale,
- center: this.center
- };
- if (this.layerNames) {
- params.layerNames = this.layerNames;
- } else if (this.layers) {
- params.layers = this.layers;
- }
- if (this.image) {
- params.image = this.image;
- }
- return Util.toJSON(params);
- }
- }]);
- return WebPrintingJobLittleMapOptions;
- }();
- SuperMap.WebPrintingJobLittleMapOptions = WebPrintingJobLittleMapOptions;
- ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobNorthArrowOptions.js
- function WebPrintingJobNorthArrowOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function WebPrintingJobNorthArrowOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobNorthArrowOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobNorthArrowOptions_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.WebPrintingJobNorthArrowOptions
- * @classdesc Web 打印地图指北针参数类。
- * @version 10.1.0
- * @category iServer WebPrintingJob
- * @param {Object} option - 初始化参数。
- * @param {string} option.picAsUrl - 指北针的图片 url 地址。
- * @param {string} [option.picAsBase64] - 指北针的base64位图片信息。
- */
- var WebPrintingJobNorthArrowOptions = /*#__PURE__*/function () {
- function WebPrintingJobNorthArrowOptions(option) {
- WebPrintingJobNorthArrowOptions_classCallCheck(this, WebPrintingJobNorthArrowOptions);
- /**
- * @member {string} SuperMap.WebPrintingJobNorthArrowOptions.prototype.picAsUrl
- * @description 指北针的图片 url 地址。
- */
- this.picAsUrl = null;
- /**
- * @member {string} [SuperMap.WebPrintingJobNorthArrowOptions.prototype.picAsBase64]
- * @description 指北针的base64位图片信息。
- */
- this.picAsBase64 = null;
- this.CLASS_NAME = 'SuperMap.WebPrintingJobNorthArrowOptions';
- Util.extend(this, option);
- }
- /**
- * @function SuperMap.WebPrintingJobNorthArrowOptions.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- WebPrintingJobNorthArrowOptions_createClass(WebPrintingJobNorthArrowOptions, [{
- key: "destroy",
- value: function destroy() {
- this.picAsUrl = null;
- this.picAsBase64 = null;
- }
- /**
- * @function SuperMap.WebPrintingJobNorthArrowOptions.prototype.toJSON
- * @description 将 SuperMap.WebPrintingJobNorthArrowOptions 对象转化为 JSON 字符串。
- * @returns {string} 返回转换后的 JSON 字符串。
- */
- }, {
- key: "toJSON",
- value: function toJSON() {
- var params = {};
- if (this.picAsUrl) {
- params.picAsUrl = this.picAsUrl;
- } else if (this.picAsBase64) {
- params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
- }
- return Util.toJSON(params);
- }
- }]);
- return WebPrintingJobNorthArrowOptions;
- }();
- SuperMap.WebPrintingJobNorthArrowOptions = WebPrintingJobNorthArrowOptions;
- ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobScaleBarOptions.js
- function WebPrintingJobScaleBarOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function WebPrintingJobScaleBarOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobScaleBarOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobScaleBarOptions_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.WebPrintingJobScaleBarOptions
- * @classdesc Web 打印比例尺参数类。
- * @category iServer WebPrintingJob
- * @version 10.1.0
- * @param {Object} option - 初始化参数。
- * @param {string} [option.scaleText] - 比例尺文本信息。例如:1:1000000
- * @param {SuperMap.WebScaleOrientationType} [option.orientation] - 比例尺的方位样式。
- * @param {SuperMap.WebScaleType} [option.type] - 比例尺的样式。
- * @param {number} [option.intervals] - 比例尺条的段数。
- * @param {SuperMap.WebScaleUnit} [option.unit] - 比例尺的单位制。
- */
- var WebPrintingJobScaleBarOptions = /*#__PURE__*/function () {
- function WebPrintingJobScaleBarOptions(option) {
- WebPrintingJobScaleBarOptions_classCallCheck(this, WebPrintingJobScaleBarOptions);
- /**
- * @member {string} SuperMap.WebPrintingJobScaleBarOptions.prototype.scaleText
- * @description 比例尺文本信息。
- */
- this.scaleText = null;
- /**
- * @member {SuperMap.WebScaleOrientationType} [SuperMap.WebPrintingJobScaleBarOptions.prototype.orientation]
- * @description 比例尺的方位样式。
- */
- this.orientation = null;
- /**
- * @member {SuperMap.WebScaleType} [SuperMap.WebPrintingJobScaleBarOptions.prototype.type]
- * @description 比例尺的样式。
- */
- this.type = null;
- /**
- * @member {object} [SuperMap.WebPrintingJobScaleBarOptions.prototype.intervals]
- * @description 比例尺条的段数。
- */
- this.intervals = null;
- /**
- * @member {SuperMap.WebScaleUnit} [SuperMap.WebPrintingJobScaleBarOptions.prototype.unit]
- * @description 比例尺的单位制。
- */
- this.unit = null;
- this.CLASS_NAME = 'SuperMap.WebPrintingJobScaleBarOptions';
- Util.extend(this, option);
- }
- /**
- * @function SuperMap.WebPrintingJobScaleBarOptions.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- WebPrintingJobScaleBarOptions_createClass(WebPrintingJobScaleBarOptions, [{
- key: "destroy",
- value: function destroy() {
- this.scaleText = null;
- this.orientation = null;
- this.type = null;
- this.intervals = null;
- this.unit = null;
- }
- /**
- * @function SuperMap.WebPrintingJobScaleBarOptions.prototype.toJSON
- * @description 将 SuperMap.WebPrintingJobScaleBarOptions 对象转化为 JSON 字符串。
- * @returns {string} 返回转换后的 JSON 字符串。
- */
- }, {
- key: "toJSON",
- value: function toJSON() {
- var params = {
- scaleText: this.scaleText || "",
- type: this.type || "BAR",
- intervals: this.intervals || "",
- unit: this.unit || "METER"
- };
- if (this.orientation) {
- params.orientation = this.orientation;
- }
- return Util.toJSON(params);
- }
- }]);
- return WebPrintingJobScaleBarOptions;
- }();
- SuperMap.WebPrintingJobScaleBarOptions = WebPrintingJobScaleBarOptions;
- ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobContent.js
- function WebPrintingJobContent_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function WebPrintingJobContent_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobContent_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobContent_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.WebPrintingJobContent
- * @classdesc Web 打印内容参数类。
- * @version 10.1.0
- * @category iServer WebPrintingJob
- * @param {Object} option - 初始化参数。
- * @param {string} option.type - Web 打印内容支持的类型。目前支持的类型:WEBMAP
- * @param {string} [option.url] - 待打印的 SuperMap iPortal WebMap 的 url 地址。例如:http://supermapiportal:8190/iportal/web/maps/{mapid}/map.rjson
- * @param {string} [option.token] - 如果待打印的是 SuperMap iPortal 用户私有的 WebMap,需要提供 SuperMap iPortal 用户的 token。
- * @param {WebMapSummaryObject} [option.value] - 传递的是一个符合 SuperMap WebMap 规范的 WebMap 的 JSON 表达,也可以是一个完整的 SuperMap iPortal 数据上图制作的 WebMap 的 json 表达。如果已填了 url 参数,此参数可不传
- */
- var WebPrintingJobContent = /*#__PURE__*/function () {
- function WebPrintingJobContent(option) {
- WebPrintingJobContent_classCallCheck(this, WebPrintingJobContent);
- /**
- * @member {string} SuperMap.WebPrintingJobContent.prototype.type
- * @description Web 打印内容支持的类型。
- */
- this.type = null;
- /**
- * @member {string} [SuperMap.WebPrintingJobContent.prototype.url]
- * @description 待打印的 SuperMap iPortal WebMap 的 url 地址。
- */
- this.url = null;
- /**
- * @member {string} [SuperMap.WebPrintingJobContent.prototype.token]
- * @description 如果待打印的是 SuperMap iPortal 用户私有的 WebMap,需要提供 SuperMap iPortal 用户的 token。
- */
- this.token = null;
- /**
- * @member {WebMapSummaryObject} [SuperMap.WebPrintingJobContent.prototype.value]
- * @description 传递的是一个符合 SuperMap WebMap 规范的 WebMap 的 JSON 表达,也可以是一个完整的 SuperMap iPortal 数据上图制作的 WebMap 的 json 表达。
- */
- this.value = null;
- this.CLASS_NAME = 'SuperMap.WebPrintingJobContent';
- Util.extend(this, option);
- }
- /**
- * @function SuperMap.WebPrintingJobContent.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- WebPrintingJobContent_createClass(WebPrintingJobContent, [{
- key: "destroy",
- value: function destroy() {
- this.type = false || "WEBMAP";
- this.url = null;
- this.token = null;
- this.value = null;
- }
- /**
- * @function SuperMap.WebPrintingJobContent.prototype.toJSON
- * @description 将 SuperMap.WebPrintingJobContent 对象转化为 JSON 字符串。
- * @returns {string} 返回转换后的 JSON 字符串。
- */
- }, {
- key: "toJSON",
- value: function toJSON() {
- var params = {
- type: this.type
- };
- if (this.token) {
- params.token = this.token;
- }
- if (this.url) {
- params.url = this.url;
- } else if (this.value) {
- params.value = this.value;
- }
- return Util.toJSON(params);
- }
- }]);
- return WebPrintingJobContent;
- }();
- SuperMap.WebPrintingJobContent = WebPrintingJobContent;
- ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLayoutOptions.js
- function WebPrintingJobLayoutOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function WebPrintingJobLayoutOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLayoutOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLayoutOptions_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.WebPrintingJobLayoutOptions
- * @classdesc Web 打印的布局参数类。
- * @version 10.1.0
- * @category iServer WebPrintingJob
- * @param {Object} option - 初始化参数。
- * @param {string} option.templateName - 布局模板的名称。
- * @param {string} option.title - 地图主标题名称。
- * @param {string} option.subTitle - 地图副标题名称。
- * @param {string} option.author - 地图作者名称。
- * @param {string} option.copyright - 地图版权信息。
- * @param {SuperMap.WebPrintingJobLittleMapOptions} option.littleMapOptions - 小地图参数类。
- * @param {SuperMap.WebPrintingJobLegendOptions} option.legendOptions - 图例参数类。
- * @param {SuperMap.WebPrintingJobScaleBarOptions} [option.scaleBarOptions] - 地图比例尺参数类。
- * @param {SuperMap.WebPrintingJobNorthArrowOptions} [option.northArrowOptions] - 地图指北针参数类。
- */
- var WebPrintingJobLayoutOptions = /*#__PURE__*/function () {
- function WebPrintingJobLayoutOptions(option) {
- WebPrintingJobLayoutOptions_classCallCheck(this, WebPrintingJobLayoutOptions);
- /**
- * @member {string} SuperMap.WebPrintingJobLayoutOptions.prototype.templateName
- * @description 布局模板的名称。
- */
- this.templateName = null;
- /**
- * @member {string} SuperMap.WebPrintingJobLayoutOptions.prototype.title
- * @description 地图主标题名称。
- */
- this.title = null;
- /**
- * @member {string} SuperMap.WebPrintingJobLayoutOptions.prototype.subTitle
- * @description 地图副标题名称。
- */
- this.subTitle = null;
- /**
- * @member {string} SuperMap.WebPrintingJobLayoutOptions.prototype.author
- * @description 地图作者名称。
- */
- this.author = null;
- /**
- * @member {string} SuperMap.WebPrintingJobLayoutOptions.prototype.copyright
- * @description 地图版权信息。
- */
- this.copyright = null;
- /**
- * @member {SuperMap.WebPrintingJobScaleBarOptions} [SuperMap.WebPrintingJobLayoutOptions.prototype.scaleBarOptions]
- * @description 地图比例尺参数类。
- */
- this.scaleBarOptions = null;
- /**
- * @member {SuperMap.WebPrintingJobNorthArrowOptions} [SuperMap.WebPrintingJobLayoutOptions.prototype.northArrowOptions]
- * @description 地图指北针参数类。
- */
- this.northArrowOptions = null;
- /**
- * @member {SuperMap.WebPrintingJobLittleMapOptions} SuperMap.WebPrintingJobLayoutOptions.prototype.littleMapOptions
- * @description 小地图参数类。
- */
- this.littleMapOptions = null;
- /**
- * @member {SuperMap.WebPrintingJobLegendOptions} SuperMap.WebPrintingJobLayoutOptions.prototype.legendOptions
- * @description 图例参数类。
- */
- this.legendOptions = null;
- this.CLASS_NAME = 'SuperMap.WebPrintingJobLayoutOptions';
- Util.extend(this, option);
- }
- /**
- * @function SuperMap.WebPrintingJobLayoutOptions.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- WebPrintingJobLayoutOptions_createClass(WebPrintingJobLayoutOptions, [{
- key: "destroy",
- value: function destroy() {
- this.templateName = null;
- this.title = null;
- this.subTitle = null;
- this.author = null;
- this.copyright = null;
- if (this.scaleBarOptions instanceof WebPrintingJobScaleBarOptions) {
- this.scaleBarOptions.destroy();
- this.scaleBarOptions = null;
- }
- if (this.northArrowOptions instanceof WebPrintingJobNorthArrowOptions) {
- this.northArrowOptions.destroy();
- this.northArrowOptions = null;
- }
- if (this.littleMapOptions instanceof WebPrintingJobLittleMapOptions) {
- this.littleMapOptions.destroy();
- this.littleMapOptions = null;
- }
- if (this.legendOptions instanceof WebPrintingJobLegendOptions) {
- this.legendOptions.destroy();
- this.legendOptions = null;
- }
- }
- /**
- * @function SuperMap.WebPrintingJobLayoutOptions.prototype.toJSON
- * @description 将 SuperMap.WebPrintingJobLayoutOptions 对象转化为 JSON 字符串。
- * @returns {string} 返回转换后的 JSON 字符串。
- */
- }, {
- key: "toJSON",
- value: function toJSON() {
- var params = {
- templateName: this.templateName,
- title: this.title,
- subTitle: this.subTitle,
- author: this.author,
- copyright: this.copyright
- };
- if (this.scaleBarOptions) {
- params.scaleBarOptions = this.scaleBarOptions;
- }
- if (this.northArrowOptions) {
- params.northArrowOptions = this.northArrowOptions;
- }
- if (this.littleMapOptions) {
- params.littleMapOptions = this.littleMapOptions;
- }
- if (this.legendOptions) {
- params.legendOptions = this.legendOptions;
- }
- return Util.toJSON(params);
- }
- }]);
- return WebPrintingJobLayoutOptions;
- }();
- SuperMap.WebPrintingJobLayoutOptions = WebPrintingJobLayoutOptions;
- ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobExportOptions.js
- function WebPrintingJobExportOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function WebPrintingJobExportOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobExportOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobExportOptions_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.WebPrintingJobExportOptions
- * @classdesc Web 打印的输出参数类。
- * @version 10.1.0
- * @category iServer WebPrintingJob
- * @param {Object} option - 初始化参数。
- * @param {SuperMap.WebExportFormatType} option.format - Web 打印输出的格式,目前支持:PNG、PDF。
- * @param {number} [option.dpi=96] - Web 打印输出的分辨率,单位为每英寸点数。默认值为 96 dpi。
- * @param {number} [option.scale] - Web 打印输出的地图比例尺。
- * @param {number} [option.rotation] - Web 打印输出的地图角度。
- * @param {SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} [option.center] - Web 打印输出的地图中心点。
- */
- var WebPrintingJobExportOptions = /*#__PURE__*/function () {
- function WebPrintingJobExportOptions(option) {
- WebPrintingJobExportOptions_classCallCheck(this, WebPrintingJobExportOptions);
- /**
- * @member {SuperMap.WebExportFormatType} SuperMap.WebPrintingJobExportOptions.prototype.format
- * @description Web 打印输出的格式。
- */
- this.format = null;
- /**
- * @member {number} [SuperMap.WebPrintingJobExportOptions.prototype.dpi=96]
- * @description Web 打印输出的分辨率,单位为每英寸点数。
- */
- this.dpi = 96;
- /**
- * @member {number} [SuperMap.WebPrintingJobExportOptions.prototype.scale]
- * @description Web 打印输出的地图比例尺。
- */
- this.scale = null;
- /**
- * @member {number} [SuperMap.WebPrintingJobExportOptions.prototype.rotation]
- * @description Web 打印输出的地图角度。
- */
- this.rotation = null;
- /**
- * @member {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} [SuperMap.WebPrintingJobExportOptions.prototype.center]
- * @description Web 打印输出的地图中心点。
- */
- this.center = null;
- this.CLASS_NAME = 'SuperMap.WebPrintingJobExportOptions';
- Util.extend(this, option);
- }
- /**
- * @function SuperMap.WebPrintingJobExportOptions.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- WebPrintingJobExportOptions_createClass(WebPrintingJobExportOptions, [{
- key: "destroy",
- value: function destroy() {
- this.format = null;
- this.dpi = null;
- this.scale = null;
- this.rotation = null;
- this.center = null;
- this.outputSize = null;
- }
- /**
- * @function SuperMap.WebPrintingJobExportOptions.prototype.toJSON
- * @description 将 SuperMap.WebPrintingJobExportOptions 对象转化为 JSON 字符串。
- * @returns {string} 返回转换后的 JSON 字符串。
- */
- }, {
- key: "toJSON",
- value: function toJSON() {
- var params = {
- format: this.format || "PDF",
- dpi: this.dpi,
- scale: this.scale,
- center: this.center
- };
- if (this.rotation) {
- params.rotation = this.rotation;
- }
- if (this.outputSize) {
- params.outputSize = this.outputSize;
- }
- return Util.toJSON(params);
- }
- }]);
- return WebPrintingJobExportOptions;
- }();
- SuperMap.WebPrintingJobExportOptions = WebPrintingJobExportOptions;
- ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobParameters.js
- function WebPrintingJobParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function WebPrintingJobParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.WebPrintingJobParameters
- * @category iServer WebPrintingJob
- * @version 10.1.0
- * @classdesc Web 打印参数类
- * @param {Object} options - 初始化参数。
- * @param {SuperMap.WebPrintingJobContent} options.content - Web 打印的内容类。
- * @param {SuperMap.WebPrintingJobLayoutOptions} options.layoutOptions - Web 打印的布局类,包含各种布局元素的设置。
- * @param {SuperMap.WebPrintingJobExportOptions} options.exportOptions - Web 打印的输出类,包含 DPI、页面大小等。
- */
- var WebPrintingJobParameters = /*#__PURE__*/function () {
- function WebPrintingJobParameters(options) {
- WebPrintingJobParameters_classCallCheck(this, WebPrintingJobParameters);
- if (!options) {
- return;
- }
- /**
- * @member {SuperMap.WebPrintingJobContent} SuperMap.WebPrintingJobParameters.prototype.content
- * @description Web 打印的内容类。
- */
- this.content = null;
- /**
- * @member {SuperMap.WebPrintingJobLayoutOptions} SuperMap.WebPrintingJobParameters.prototype.layoutOptions
- * @description Web 打印的布局类,包含各种布局元素的设置。
- */
- this.layoutOptions = null;
- /**
- * @member {SuperMap.WebPrintingJobExportOptions} SuperMap.WebPrintingJobParameters.prototype.exportOptions
- * @description Web 打印的输出类,包含 DPI、页面大小等。
- */
- this.exportOptions = null;
- Util.extend(this, options);
- this.CLASS_NAME = 'SuperMap.WebPrintingJobParameters';
- }
- /**
- * @function SuperMap.WebPrintingJobParameters.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- WebPrintingJobParameters_createClass(WebPrintingJobParameters, [{
- key: "destroy",
- value: function destroy() {
- if (this.content instanceof WebPrintingJobContent) {
- this.content.destroy();
- this.content = null;
- }
- if (this.layoutOptions instanceof WebPrintingJobLayoutOptions) {
- this.layoutOptions.destroy();
- this.layoutOptions = null;
- }
- if (this.exportOptions instanceof WebPrintingJobExportOptions) {
- this.exportOptions.destroy();
- this.exportOptions = null;
- }
- }
- }]);
- return WebPrintingJobParameters;
- }();
- SuperMap.WebPrintingJobParameters = WebPrintingJobParameters;
- ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingService.js
- 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); }
- function WebPrintingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function WebPrintingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingService_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function WebPrintingService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = WebPrintingService_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function WebPrintingService_setPrototypeOf(o, p) { WebPrintingService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WebPrintingService_setPrototypeOf(o, p); }
- 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); }; }
- function WebPrintingService_possibleConstructorReturn(self, call) { if (call && (WebPrintingService_typeof(call) === "object" || typeof call === "function")) { return call; } return WebPrintingService_assertThisInitialized(self); }
- function WebPrintingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function WebPrintingService_getPrototypeOf(o) { WebPrintingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WebPrintingService_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.WebPrintingService
- * @category iServer WebPrintingJob
- * @version 10.1.0
- * @classdesc 打印地图服务基类。
- * @extends {SuperMap.CommonServiceBase}
- * @param {string} url - 资源根地址。请求打印地图服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/webprinting/rest/webprinting/v1。
- * @param {Object} options - 参数。
- * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var WebPrintingService = /*#__PURE__*/function (_CommonServiceBase) {
- WebPrintingService_inherits(WebPrintingService, _CommonServiceBase);
- var _super = WebPrintingService_createSuper(WebPrintingService);
- /**
- * @function SuperMap.WebPrintingService.prototype.constructor
- * @description 打印地图服务基类。
- * @param {string} url - 资源根地址。请求打印地图服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/webprinting/rest/webprinting/v1。
- * @param {Object} options -参数。
- * @param {Object} options.eventListeners - 需要被注册的监听器对象。
- */
- function WebPrintingService(url, options) {
- var _this;
- WebPrintingService_classCallCheck(this, WebPrintingService);
- _this = _super.call(this, url, options);
- if (options) {
- Util.extend(WebPrintingService_assertThisInitialized(_this), options);
- }
- _this.CLASS_NAME = 'SuperMap.WebPrintingService';
- if (!_this.url) {
- return WebPrintingService_possibleConstructorReturn(_this);
- }
- return _this;
- }
- /**
- * @function SuperMap.WebPrintingService.prototype.destroy
- * @description 释放资源,将引用资源的属性置空。
- */
- WebPrintingService_createClass(WebPrintingService, [{
- key: "destroy",
- value: function destroy() {
- WebPrintingService_get(WebPrintingService_getPrototypeOf(WebPrintingService.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.WebPrintingService.prototype.createWebPrintingJob
- * @description 创建 Web 打印任务。
- * @param {SuperMap.WebPrintingJobParameters} params - Web 打印的请求参数。
- */
- }, {
- key: "createWebPrintingJob",
- value: function createWebPrintingJob(params) {
- if (!params) {
- return;
- }
- if (params.layoutOptions) {
- if (params.layoutOptions.legendOptions) {
- !params.layoutOptions.legendOptions.title && (params.layoutOptions.legendOptions.title = '');
- params.layoutOptions.legendOptions.picAsBase64 = params.layoutOptions.legendOptions.picAsBase64 && params.layoutOptions.legendOptions.picAsBase64.replace(/^data:.+;base64,/, '');
- if (params.layoutOptions.legendOptions.customItems && params.layoutOptions.legendOptions.customItems.hasOwnProperty('picAsBase64')) {
- params.layoutOptions.legendOptions.customItems.picAsBase64 = params.layoutOptions.legendOptions.customItems.picAsBase64.replace(/^data:.+;base64,/, '');
- }
- }
- }
- var me = this;
- me.request({
- url: me._processUrl('jobs'),
- method: 'POST',
- data: Util.toJSON(params),
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.WebPrintingService.prototype.getPrintingJob
- * @description 获取 Web 打印输出文档任务。
- * @param {String} jobId - Web 打印任务 ID
- */
- }, {
- key: "getPrintingJob",
- value: function getPrintingJob(jobId) {
- var me = this;
- var url = me._processUrl("jobs/".concat(jobId));
- me.request({
- url: url,
- method: 'GET',
- scope: me,
- success: function success(result) {
- me.rollingProcess(result, url);
- },
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.WebPrintingService.prototype.getPrintingJobResult
- * @description 获取 Web 打印任务的输出文档。
- * @param {String} jobId - Web 打印输入文档任务 ID。
- */
- }, {
- key: "getPrintingJobResult",
- value: function getPrintingJobResult(jobId) {
- var me = this;
- me.request({
- url: me._processUrl("jobs/".concat(jobId, "/result")),
- method: 'GET',
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.WebPrintingService.prototype.getLayoutTemplates
- * @description 查询 Web 打印服务所有可用的模板信息。
- */
- }, {
- key: "getLayoutTemplates",
- value: function getLayoutTemplates() {
- var me = this;
- me.request({
- url: me._processUrl('layouts'),
- method: 'GET',
- scope: me,
- success: me.serviceProcessCompleted,
- failure: me.serviceProcessFailed
- });
- }
- /**
- * @function SuperMap.WebPrintingService.prototype.rollingProcess
- * @description 轮询查询 Web 打印任务。
- * @param {Object} result - 服务器返回的结果对象。
- */
- }, {
- key: "rollingProcess",
- value: function rollingProcess(result, url) {
- var me = this;
- if (!result) {
- return;
- }
- var id = setInterval(function () {
- me.request({
- url: url,
- method: 'GET',
- scope: me,
- success: function success(result) {
- switch (result.status) {
- case 'FINISHED':
- clearInterval(id);
- me.serviceProcessCompleted(result);
- break;
- case 'ERROR':
- clearInterval(id);
- me.serviceProcessFailed(result);
- break;
- case 'RUNNING':
- me.events.triggerEvent('processRunning', result);
- break;
- }
- },
- failure: me.serviceProcessFailed
- });
- }, 1000);
- }
- }, {
- key: "_processUrl",
- value: function _processUrl(appendContent) {
- if (appendContent) {
- return Util.urlPathAppend(this.url, appendContent);
- }
- return this.url;
- }
- }]);
- return WebPrintingService;
- }(CommonServiceBase);
- SuperMap.WebPrintingService = WebPrintingService;
- ;// CONCATENATED MODULE: ./src/common/iServer/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/common/online/OnlineResources.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @enum ServiceStatus
- * @memberOf SuperMap
- * @category iPortal/Online
- * @description 服务发布状态。
- */
- var ServiceStatus = SuperMap.ServiceStatus = {
- /** 不涉及,不可发布。 */
- DOES_NOT_INVOLVE: "DOES_NOT_INVOLVE",
- /** 发布失败。 */
- PUBLISH_FAILED: "PUBLISH_FAILED",
- /** 已发布。 */
- PUBLISHED: "PUBLISHED",
- /** 正在发布。 */
- PUBLISHING: "PUBLISHING",
- /** 未发布。 */
- UNPUBLISHED: "UNPUBLISHED",
- /** 取消服务失败。 */
- UNPUBLISHED_FAILED: "UNPUBLISHED_FAILED"
- };
- /**
- *
- * @enum DataItemType
- * @memberOf SuperMap
- * @category iPortal/Online
- * @description 数据项类型。
- */
- var OnlineResources_DataItemType = SuperMap.DataItemType = {
- /** AUDIO */
- AUDIO: "AUDIO",
- /** COLOR */
- COLOR: "COLOR",
- /** COLORSCHEME */
- COLORSCHEME: "COLORSCHEME",
- /** CSV */
- CSV: "CSV",
- /** EXCEL */
- EXCEL: "EXCEL",
- /** FILLSYMBOL */
- FILLSYMBOL: "FILLSYMBOL",
- /** IMAGE */
- IMAGE: "IMAGE",
- /** LAYERTEMPLATE */
- LAYERTEMPLATE: "LAYERTEMPLATE",
- /** LAYOUTTEMPLATE */
- LAYOUTTEMPLATE: "LAYOUTTEMPLATE",
- /** LINESYMBOL */
- LINESYMBOL: "LINESYMBOL",
- /** MAPTEMPLATE */
- MAPTEMPLATE: "MAPTEMPLATE",
- /** MARKERSYMBOL */
- MARKERSYMBOL: "MARKERSYMBOL",
- /** MBTILES */
- MBTILES: "MBTILES",
- /** PHOTOS */
- PHOTOS: "PHOTOS",
- /** SHP */
- SHP: "SHP",
- /** SMTILES */
- SMTILES: "SMTILES",
- /** SVTILES */
- SVTILES: "SVTILES",
- /** THEMETEMPLATE */
- THEMETEMPLATE: "THEMETEMPLATE",
- /** TPK */
- TPK: "TPK",
- /** UDB */
- UDB: "UDB",
- /** UGCV5 */
- UGCV5: "UGCV5",
- /** UNKNOWN */
- UNKNOWN: "UNKNOWN",
- /** VIDEO */
- VIDEO: "VIDEO",
- /** WORKENVIRONMENT */
- WORKENVIRONMENT: "WORKENVIRONMENT",
- /** WORKSPACE */
- WORKSPACE: "WORKSPACE"
- };
- /**
- * @enum DataItemOrderBy
- * @memberOf SuperMap
- * @category iPortal/Online
- * @description 数据排序字段。
- */
- var DataItemOrderBy = SuperMap.DataItemOrderBy = {
- /** FILENAME */
- FILENAME: "FILENAME",
- /** ID */
- ID: "ID",
- /** LASTMODIFIEDTIME */
- LASTMODIFIEDTIME: "LASTMODIFIEDTIME",
- /** NICKNAME */
- NICKNAME: "NICKNAME",
- /** SERVICESTATUS */
- SERVICESTATUS: "SERVICESTATUS",
- /** SIZE */
- SIZE: "SIZE",
- /** STATUS */
- STATUS: "STATUS",
- /** TYPE */
- TYPE: "TYPE",
- /** UPDATETIME */
- UPDATETIME: "UPDATETIME",
- /** USERNAME */
- USERNAME: "USERNAME"
- };
- /**
- * @enum FilterField
- * @memberOf SuperMap
- * @category iPortal/Online
- * @description 关键字查询时的过滤字段。
- */
- var FilterField = SuperMap.FilterField = {
- /** LINKPAGE */
- LINKPAGE: "LINKPAGE",
- /** LINKPAGE */
- MAPTITLE: "MAPTITLE",
- /** LINKPAGE */
- NICKNAME: "NICKNAME",
- /** LINKPAGE */
- RESTITLE: "RESTITLE",
- /** LINKPAGE */
- USERNAME: "USERNAME"
- };
- ;// CONCATENATED MODULE: ./src/common/online/OnlineServiceBase.js
- function OnlineServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function OnlineServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) OnlineServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) OnlineServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- // import {SecurityManager} from '../security/SecurityManager';
- /**
- * @class SuperMap.OnlineServiceBase
- * @classdesc Online 服务基类(使用 key 作为权限限制的类需要实现此类)。
- * @category iPortal/Online
- * @param {Object} options - 服务参数。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var OnlineServiceBase = /*#__PURE__*/function () {
- function OnlineServiceBase(options) {
- OnlineServiceBase_classCallCheck(this, OnlineServiceBase);
- options = options || {};
- Util.extend(this, options);
- this.serverType = ServerType.ONLINE;
- this.CLASS_NAME = "SuperMap.OnlineServiceBase";
- }
- /**
- * @function SuperMap.OnlineServiceBase.prototype.request
- * @description 请求 online 服务
- * @param {string} [method='GET'] - 请求方式, 'GET', 'PUT', 'POST', 'DELETE'。
- * @param {string} url - 服务地址。
- * @param {Object} param - URL 查询参数。
- * @param {Object} [requestOptions] - http 请求参数, 比如请求头,超时时间等。
- * @returns {Promise} 返回包含请求结果的 Promise 对象。
- */
- OnlineServiceBase_createClass(OnlineServiceBase, [{
- key: "request",
- value: function request(method, url, param) {
- var requestOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
- url = this.createCredentialUrl(url);
- requestOptions['crossOrigin'] = this.options.crossOrigin;
- requestOptions['headers'] = this.options.headers;
- return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
- return response.json();
- });
- }
- /**
- * @function SuperMap.OnlineServiceBase.prototype.createCredentialUrl
- * @description 追加授权信息。
- * @param {string} url - 对接的 online 服务地址。
- */
- }, {
- key: "createCredentialUrl",
- value: function createCredentialUrl(url) {
- var newUrl = url,
- key = this.getCredential();
- if (key) {
- var paramStr = "key=" + key;
- var endStr = newUrl.substring(newUrl.length - 1, newUrl.length);
- if (newUrl.indexOf("?") > -1 && endStr === "?") {
- newUrl += paramStr;
- } else if (newUrl.indexOf("?") > -1 && endStr !== "?") {
- newUrl += "&" + paramStr;
- } else {
- newUrl += "?" + paramStr;
- }
- }
- return newUrl;
- } //其子类需要重写该方法,修改其中获取key的字段
- //存储key可能是服务id字段,可能是url,或者是WebAPI类型
- }, {
- key: "getCredential",
- value: function getCredential() {//return SecurityManager.getKey(this.id);
- //或
- //return SecurityManager.getKey(this.serviceUrl);
- }
- }]);
- return OnlineServiceBase;
- }();
- SuperMap.OnlineServiceBase = OnlineServiceBase;
- ;// CONCATENATED MODULE: ./src/common/online/OnlineData.js
- 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); }
- function OnlineData_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function OnlineData_createClass(Constructor, protoProps, staticProps) { if (protoProps) OnlineData_defineProperties(Constructor.prototype, protoProps); if (staticProps) OnlineData_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function OnlineData_setPrototypeOf(o, p) { OnlineData_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return OnlineData_setPrototypeOf(o, p); }
- 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); }; }
- function OnlineData_possibleConstructorReturn(self, call) { if (call && (OnlineData_typeof(call) === "object" || typeof call === "function")) { return call; } return OnlineData_assertThisInitialized(self); }
- function OnlineData_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function OnlineData_getPrototypeOf(o) { OnlineData_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OnlineData_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.OnlineData
- * @classdesc Online myData 服务。
- * @category iPortal/Online
- * @param {string} serviceRootUrl - 服务根地址。
- * @param {Object} options - 服务相关参数。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var OnlineData = /*#__PURE__*/function (_OnlineServiceBase) {
- OnlineData_inherits(OnlineData, _OnlineServiceBase);
- var _super = OnlineData_createSuper(OnlineData);
- //TODO 目前并没有对接服务支持的所有操作,日后需要补充完整
- function OnlineData(serviceRootUrl, options) {
- var _this;
- OnlineData_classCallCheck(this, OnlineData);
- _this = _super.call(this, serviceRootUrl);
- options = options || {}; //MD5
- _this.MD5 = null; //文件类型。
- _this.type = null; //数据上传者名称。
- _this.userName = null; //文件名称。
- _this.fileName = null; //文件大小,单位为 B 。
- _this.size = null; //服务发布状态。
- _this.serviceStatus = null; //服务 id 。
- _this.serviceId = null; //数据项 id 。
- _this.id = null; //最后修改时间。
- _this.lastModfiedTime = null; //文件状态。
- _this.status = null; //数据文件存储 id 。
- _this.storageId = null; //数据的发布信息。
- _this.publishInfo = null; //数据的权限信息。
- _this.authorizeSetting = null; //用户的昵称。
- _this.nickname = null; //数据的标签。
- _this.tags = []; //数据的描述信息。
- _this.description = null; //数据发布的服务信息集合。
- _this.dataItemServices = null; //数据坐标类型。
- _this.coordType = null; //数据审核信息
- _this.dataCheckResult = null; //数据元数据信息
- _this.dataMetaInfo = null; //数据的缩略图路径。
- _this.thumbnail = null;
- Util.extend(OnlineData_assertThisInitialized(_this), options);
- if (_this.id) {
- _this.serviceUrl = serviceRootUrl + "/" + _this.id;
- }
- _this.CLASS_NAME = "SuperMap.OnlineData";
- return _this;
- }
- /**
- * @function SuperMap.OnlineData.prototype.load
- * @description 通过 URL 请求获取该服务完整信息。
- * @returns {Promise} 返回不包含请求结果的 Promise 对象,请求返回结果自动填充到该类属性中。
- */
- OnlineData_createClass(OnlineData, [{
- key: "load",
- value: function load() {
- if (!this.serviceUrl) {
- return;
- }
- var me = this;
- return me.request("GET", this.serviceUrl).then(function (result) {
- Util.extend(me, result);
- });
- }
- /**
- * @function SuperMap.OnlineData.prototype.getPublishedServices
- * @description 获取数据发布的所有服务。
- * @returns {Object} 数据发布的所有服务。
- */
- }, {
- key: "getPublishedServices",
- value: function getPublishedServices() {
- return this.dataItemServices;
- }
- /**
- * @function SuperMap.OnlineData.prototype.getAuthorizeSetting
- * @description 获取数据的权限信息。
- * @returns {Object} 权限信息。
- */
- }, {
- key: "getAuthorizeSetting",
- value: function getAuthorizeSetting() {
- return this.authorizeSetting;
- }
- }]);
- return OnlineData;
- }(OnlineServiceBase);
- SuperMap.OnlineData = OnlineData;
- ;// CONCATENATED MODULE: ./src/common/online/Online.js
- function Online_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Online_createClass(Constructor, protoProps, staticProps) { if (protoProps) Online_defineProperties(Constructor.prototype, protoProps); if (staticProps) Online_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Online
- * @classdesc 对接 SuperMap Online 所有基础服务。
- * @category iPortal/Online
- * @example
- * var online=new SuperMap.Online();
- * var services = online.queryDatas(param);
- * service.then(function(services){
- * var service= services[0];
- * service.updateDataInfo();
- * })
- */
- var Online = /*#__PURE__*/function () {
- //TODO 目前并没有对接Online的所有操作,需要补充完整
- //所有查询返回的是一个Promise,在外部使用的时候通过Promise的then方法获取异步结果
- function Online() {
- Online_classCallCheck(this, Online);
- this.rootUrl = "https://www.supermapol.com";
- this.webUrl = this.rootUrl + "/web";
- var mContentUrl = this.webUrl + "/mycontent";
- this.mDatasUrl = mContentUrl + "/datas";
- this.CLASS_NAME = "SuperMap.Online";
- }
- /**
- * @function SuperMap.Online.prototype.load
- * @description 加载 online,验证 online 是否可用。
- * @returns {Promise} 返回包含网络请求结果的 Promise 对象。
- */
- Online_createClass(Online, [{
- key: "load",
- value: function load() {
- return FetchRequest.get(this.rootUrl).then(function (response) {
- return response;
- });
- }
- /**
- * @function SuperMap.Online.prototype.login
- * @description 登录Online
- */
- }, {
- key: "login",
- value: function login() {
- SecurityManager.loginOnline(this.rootUrl, true);
- }
- /**
- * @function SuperMap.Online.prototype.queryDatas
- * @description 查询 Online “我的内容” 下 “我的数据” 服务(需要登录状态获取),并返回可操作的服务对象。
- * @param {SuperMap.OnlineQueryDatasParameter} parameter - myDatas 服务资源查询参数。
- * @returns {Promise} 返回包含所有数据服务信息的 Promise 对象。
- */
- }, {
- key: "queryDatas",
- value: function queryDatas(parameter) {
- var me = this,
- url = me.mDatasUrl;
- if (parameter) {
- parameter = parameter.toJSON();
- }
- return FetchRequest.get(url, parameter).then(function (json) {
- if (!json || !json.content || json.content.length < 1) {
- return;
- }
- var services = [],
- contents = json.content,
- len = contents.length;
- for (var i = 0; i < len; i++) {
- var content = contents[i];
- var service = new OnlineData(me.mDatasUrl, content);
- services.push(service);
- }
- return services;
- });
- }
- }]);
- return Online;
- }();
- SuperMap.Online = Online;
- ;// CONCATENATED MODULE: ./src/common/online/OnlineQueryDatasParameter.js
- function OnlineQueryDatasParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function OnlineQueryDatasParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) OnlineQueryDatasParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) OnlineQueryDatasParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.OnlineQueryDatasParameter
- * @classdesc myDatas 服务资源查询参数。
- * @category iPortal/Online
- * @param {Object} options - 查询参数。
- */
- var OnlineQueryDatasParameter = /*#__PURE__*/function () {
- function OnlineQueryDatasParameter(options) {
- OnlineQueryDatasParameter_classCallCheck(this, OnlineQueryDatasParameter);
- options = options || {};
- /**
- * @member {Array.<string>} SuperMap.OnlineQueryDatasParameter.prototype.userNames
- * @description 数据作者名。可以根据数据作者名查询,默认查询全部。
- */
- this.userNames = null;
- /**
- * @member {Array.<Object>} SuperMap.OnlineQueryDatasParameter.prototype.types
- * @description 数据类型。
- */
- this.types = null;
- /**
- * @member {string} SuperMap.OnlineQueryDatasParameter.prototype.fileName
- * @description 文件名称。
- */
- this.fileName = null;
- /**
- * @member {string} SuperMap.OnlineQueryDatasParameter.prototype.serviceStatuses
- * @description 服务发布状态。
- */
- this.serviceStatuses = null;
- /**
- * @member {string} SuperMap.OnlineQueryDatasParameter.prototype.serviceId
- * @description 服务 ID。
- */
- this.serviceId = null;
- /**
- * @member {Array.<integer>} SuperMap.OnlineQueryDatasParameter.prototype.ids
- * @description 由数据项 ID 组成的整型数组。
- */
- this.ids = null;
- /**
- * @member {Array.<string>} SuperMap.OnlineQueryDatasParameter.prototype.keywords
- * @description 关键字。
- */
- this.keywords = null;
- /**
- * @member {string} SuperMap.OnlineQueryDatasParameter.prototype.orderBy
- * @description 排序字段。
- */
- this.orderBy = null;
- /**
- * @member {Array.<string>} SuperMap.OnlineQueryDatasParameter.prototype.tags
- * @description 数据的标签。
- */
- this.tags = null;
- /**
- * @member {Array.<string>} SuperMap.OnlineQueryDatasParameter.prototype.filterFields
- * @description 用于关键字查询时的过滤字段。
- */
- this.filterFields = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.OnlineQueryDatasParameter";
- }
- /**
- * @function SuperMap.OnlineQueryDatasParameter.prototype.toJSON
- * @description 返回对应的 JSON 对象。
- * @returns {Object} 对应的 JSON 对象。
- */
- OnlineQueryDatasParameter_createClass(OnlineQueryDatasParameter, [{
- key: "toJSON",
- value: function toJSON() {
- var me = this;
- var jsonObj = {
- "types": me.types,
- "fileName": me.fileName,
- "serviceStatuses": me.serviceStatuses,
- "serviceId": me.serviceId,
- "ids": me.ids,
- "keywords": me.keywords,
- "orderBy": me.orderBy,
- "tags": me.tags,
- "filterFields": me.filterFields
- };
- for (var key in jsonObj) {
- if (jsonObj[key] == null) {
- delete jsonObj[key];
- }
- }
- return jsonObj;
- }
- }]);
- return OnlineQueryDatasParameter;
- }();
- SuperMap.OnlineQueryDatasParameter = OnlineQueryDatasParameter;
- ;// CONCATENATED MODULE: ./src/common/online/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/common/security/KeyServiceParameter.js
- function KeyServiceParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function KeyServiceParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) KeyServiceParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) KeyServiceParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.KeyServiceParameter
- * @classdesc key申请参数
- * @category Security
- * @param {Object} options - 参数。
- * @param {string} options.name - 申请服务名称。
- * @param {number} options.serviceIds - 服务 ID。
- * @param {SuperMap.ClientType} [options.clientType=SuperMap.ClientType.SERVER] - 服务端类型。
- * @param {number} options.limitation - 有效期
- */
- var KeyServiceParameter = /*#__PURE__*/function () {
- function KeyServiceParameter(options) {
- KeyServiceParameter_classCallCheck(this, KeyServiceParameter);
- this.name = null;
- this.serviceIds = null;
- this.clientType = ClientType.SERVER;
- this.limitation = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.KeyServiceParameter";
- }
- /**
- * @function SuperMap.KeyServiceParameter.prototype.toJSON
- * @description 转换成 JSON 对象
- * @returns {Object} 参数的 JSON 对象
- */
- KeyServiceParameter_createClass(KeyServiceParameter, [{
- key: "toJSON",
- value: function toJSON() {
- return {
- name: this.name,
- serviceIds: this.serviceIds,
- clientType: this.clientType,
- limitation: this.limitation
- };
- }
- }]);
- return KeyServiceParameter;
- }();
- SuperMap.KeyServiceParameter = KeyServiceParameter;
- ;// CONCATENATED MODULE: ./src/common/security/ServerInfo.js
- function ServerInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ServerInfo
- * @classdesc 服务器信息(安全相关),包含服务器类型,服务地址,token服务地址等
- * @category Security
- * @param {string} type - 服务器类型
- * @param {Object} options - 服务器信息相关可选参数。
- * @param {string} options.server - 服务器地址,如:http://supermapiserver:8090/iserver
- * @param {string} [options.tokenServiceUrl] - 如:http://supermapiserver:8090/iserver/services/security/tokens.json
- * @param {string} [options.keyServiceUrl] - 如:http://supermapiserver:8092/web/mycontent/keys/register.json
- */
- var ServerInfo = function ServerInfo(type, options) {
- ServerInfo_classCallCheck(this, ServerInfo);
- /**
- * @member {SuperMap.ServerType} SuperMap.ServerInfo.prototype.type
- * @description 服务器类型
- */
- this.type = type;
- /**
- * @member {string} SuperMap.ServerInfo.prototype.server
- * @description 服务器地址
- */
- this.server = null;
- /**
- * @member {string} [SuperMap.ServerInfo.prototype.tokenServiceUrl]
- * @description 如:http://supermapiserver:8090/iserver/services/security/tokens.json
- */
- this.tokenServiceUrl = null;
- /**
- * @member {string} [SuperMap.ServerInfo.prototype.keyServiceUrl]
- * @description 如:http://supermapiserver:8092/web/mycontent/keys/register.json
- */
- this.keyServiceUrl = null;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.ServerInfo";
- this.type = this.type || ServerType.ISERVER;
- if (!this.server) {
- console.error('server url require is not undefined');
- } // var patten = /http:\/\/([^\/]+)/i;
- //this.server = this.server.match(patten)[0];
- var tokenServiceSuffix = "/services/security/tokens";
- if (this.type === ServerType.ISERVER && this.server.indexOf("iserver") < 0) {
- tokenServiceSuffix = "/iserver" + tokenServiceSuffix;
- }
- if (!this.tokenServiceUrl) {
- this.tokenServiceUrl = Util.urlPathAppend(this.server, tokenServiceSuffix);
- }
- if (!this.keyServiceUrl) {
- if (this.type === ServerType.IPORTAL) {
- this.keyServiceUrl = Util.urlPathAppend(this.server, "/web/mycontent/keys/register");
- } else if (this.type === ServerType.ONLINE) {
- this.keyServiceUrl = Util.urlPathAppend(this.server, "/web/mycontent/keys");
- }
- }
- };
- SuperMap.ServerInfo = ServerInfo;
- ;// CONCATENATED MODULE: ./src/common/security/TokenServiceParameter.js
- function TokenServiceParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function TokenServiceParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) TokenServiceParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) TokenServiceParameter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.TokenServiceParameter
- * @classdesc token 申请参数。
- * @category Security
- * @param {Object} options - token 申请参数。
- * @param {string} options.username - 用户名。
- * @param {string} options.password - 密码。
- * @param {SuperMap.ClientType} [options.clientType='SuperMap.ClientType.NONE'] - token 申请的客户端标识类型。
- * @param {string} [options.ip] - clientType=IP 时,必选。
- * @param {string} [options.referer] -clientType=Referer 时,必选。如果按照指定 URL 的方式申请令牌,则设置相应的 URL。
- * @param {number} [options.expiration=60] - 申请令牌的有效期,从发布令牌的时间开始计算,单位为分钟。
- *
- *
- */
- var TokenServiceParameter = /*#__PURE__*/function () {
- function TokenServiceParameter(options) {
- TokenServiceParameter_classCallCheck(this, TokenServiceParameter);
- /**
- * @member {string} SuperMap.TokenServiceParameter.prototype.userName
- * @description 用户名。
- */
- this.userName = null;
- /**
- * @member {string} SuperMap.TokenServiceParameter.prototype.password
- * @description 密码。
- */
- this.password = null;
- /**
- * @member {SuperMap.ClientType} SuperMap.TokenServiceParameter.prototype.clientType
- * @description token 申请的客户端标识类型。
- */
- this.clientType = ClientType.NONE;
- /**
- * @member {string} [SuperMap.TokenServiceParameter.prototype.ip]
- * @description clientType=IP 时,必选。
- */
- this.ip = null;
- /**
- * @member {string} [SuperMap.TokenServiceParameter.prototype.referer]
- * @description clientType=Referer 时,必选。如果按照指定 URL 的方式申请令牌,则设置相应的 URL。
- */
- this.referer = null;
- /**
- * @member {number} SuperMap.TokenServiceParameter.prototype.expiration
- * @description 申请令牌的有效期,从发布令牌的时间开始计算,单位为分钟。
- */
- this.expiration = 60;
- Util.extend(this, options);
- this.CLASS_NAME = "SuperMap.TokenServiceParameter";
- }
- /**
- * @function SuperMap.TokenServiceParameter.prototype.toJSON
- * @description 将所有信息转成 JSON 字符串
- * @returns {string} 参数的 JSON 字符串
- */
- TokenServiceParameter_createClass(TokenServiceParameter, [{
- key: "toJSON",
- value: function toJSON() {
- return {
- userName: this.userName,
- password: this.password,
- clientType: this.clientType,
- ip: this.ip,
- referer: this.referer,
- expiration: this.expiration
- };
- }
- }]);
- return TokenServiceParameter;
- }();
- SuperMap.TokenServiceParameter = TokenServiceParameter;
- ;// CONCATENATED MODULE: ./src/common/security/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: external "function(){try{return elasticsearch}catch(e){return {}}}()"
- var external_function_try_return_elasticsearch_catch_e_return_namespaceObject = function(){try{return elasticsearch}catch(e){return {}}}();
- var external_function_try_return_elasticsearch_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_elasticsearch_catch_e_return_namespaceObject);
- ;// CONCATENATED MODULE: ./src/common/thirdparty/elasticsearch/ElasticSearch.js
- function ElasticSearch_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ElasticSearch_createClass(Constructor, protoProps, staticProps) { if (protoProps) ElasticSearch_defineProperties(Constructor.prototype, protoProps); if (staticProps) ElasticSearch_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ElasticSearch
- * @classdesc ElasticSearch服务类。
- * @category ElasticSearch
- * @param {string} url - ElasticSearch服务地址。
- * @param {Object} options - 参数。
- * @param {function} [options.change] - 服务器返回数据后执行的函数。废弃,不建议使用。使用search或msearch方法。
- * @param {boolean} [options.openGeoFence=false] - 是否开启地理围栏验证,默认为不开启。
- * @param {function} [options.outOfGeoFence] - 数据超出地理围栏后执行的函数。
- * @param {Object} [options.geoFence] - 地理围栏。
- */
- var ElasticSearch = /*#__PURE__*/function () {
- function ElasticSearch(url, options) {
- ElasticSearch_classCallCheck(this, ElasticSearch);
- options = options || {};
- /**
- * @member {string} SuperMap.ElasticSearch.prototype.url
- * @description ElasticSearch服务地址
- */
- this.url = url;
- /**
- * @member {Object} SuperMap.ElasticSearch.prototype.client
- * @description client ES客户端
- */
- this.client = new (external_function_try_return_elasticsearch_catch_e_return_default()).Client({
- host: this.url
- });
- /**
- * @deprecated
- * @member {function} [SuperMap.ElasticSearch.prototype.change]
- * @description 服务器返回数据后执行的函数。废弃,不建议使用。使用search或msearch方法。
- */
- this.change = null;
- /**
- * @member {boolean} [SuperMap.ElasticSearch.prototype.openGeoFence=false]
- * @description 是否开启地理围栏验证,默认为不开启。
- */
- this.openGeoFence = false;
- /**
- * @member {function} [SuperMap.ElasticSearch.prototype.outOfGeoFence]
- * @description 数据超出地理围栏后执行的函数
- */
- this.outOfGeoFence = null;
- /**
- * @member {Object} [SuperMap.ElasticSearch.prototype.geoFence]
- * @description 地理围栏
- * @example {
- * radius: 1000,//单位是m
- * center: [104.40, 30.43],
- * unit: 'meter|degree'
- * }
- */
- this.geoFence = null;
- /*
- * Constant: EVENT_TYPES
- * {Array.<String>}
- * 此类支持的事件类型。
- *
- */
- this.EVENT_TYPES = ['change', 'error', 'outOfGeoFence'];
- /**
- * @member {SuperMap.Events} SuperMap.ElasticSearch.prototype.events
- * @description 事件
- */
- this.events = new Events(this, null, this.EVENT_TYPES);
- /**
- * @member {Object} SuperMap.ElasticSearch.prototype.eventListeners
- * @description 听器对象,在构造函数中设置此参数(可选),对 MapService 支持的两个事件 processCompleted 、processFailed 进行监听,
- * 相当于调用 SuperMap.Events.on(eventListeners)。
- */
- this.eventListeners = null;
- Util.extend(this, options);
- if (this.eventListeners instanceof Object) {
- this.events.on(this.eventListeners);
- }
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.setGeoFence
- * @description 设置地理围栏,openGeoFence参数为true的时候,设置的地理围栏才生效。
- * @param {SuperMap.Geometry} geoFence - 地理围栏。
- */
- ElasticSearch_createClass(ElasticSearch, [{
- key: "setGeoFence",
- value: function setGeoFence(geoFence) {
- this.geoFence = geoFence;
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.bulk
- * @description 批量操作API,允许执行多个索引/删除操作。
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-bulk}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "bulk",
- value: function bulk(params, callback) {
- return this.client.bulk(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.clearScroll
- * @description 通过指定scroll参数进行查询来清除已经创建的scroll请求。
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-clearscroll}</br>
- *更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "clearScroll",
- value: function clearScroll(params, callback) {
- return this.client.clearScroll(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.count
- * @description 获取集群、索引、类型或查询的文档个数。
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-count}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-count.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "count",
- value: function count(params, callback) {
- return this.client.count(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.count
- * @description 在特定索引中添加一个类型化的JSON文档,使其可搜索。如果具有相同index,type且id已经存在的文档将发生错误。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-create}
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html}
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "create",
- value: function create(params, callback) {
- return this.client.create(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.delete
- * @description 根据其ID从特定索引中删除键入的JSON文档。
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-delete}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "delete",
- value: function _delete(params, callback) {
- return this.client["delete"](params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.delete
- * @description 根据其ID从特定索引中删除键入的JSON文档。
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletebyquery}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "deleteByQuery",
- value: function deleteByQuery(params, callback) {
- return this.client.deleteByQuery(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.delete
- * @description 根据其ID删除脚本。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletescript}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "deleteScript",
- value: function deleteScript(params, callback) {
- return this.client.deleteScript(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.deleteTemplate
- * @description 根据其ID删除模板。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletetemplate}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "deleteTemplate",
- value: function deleteTemplate(params, callback) {
- return this.client.deleteTemplate(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.exists
- * @description 检查给定文档是否存在。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-exists}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "exists",
- value: function exists(params, callback) {
- return this.client.exists(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.existsSource
- * @description 检查资源是否存在。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-existssource}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "existsSource",
- value: function existsSource(params, callback) {
- return this.client.existsSource(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.explain
- * @description 提供与特定查询相关的特定文档分数的详细信息。它还会告诉您文档是否与指定的查询匹配。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-explain}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "explain",
- value: function explain(params, callback) {
- return this.client.explain(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.fieldCaps
- * @description 允许检索多个索引之间的字段的功能。(实验性API,可能会在未来版本中删除)</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-fieldcaps}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-field-caps.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "fieldCaps",
- value: function fieldCaps(params, callback) {
- return this.client.fieldCaps(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.get
- * @description 从索引获取一个基于其id的类型的JSON文档。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-get}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "get",
- value: function get(params, callback) {
- return this.client.get(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.getScript
- * @description 获取脚本。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-getscript}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "getScript",
- value: function getScript(params, callback) {
- return this.client.getScript(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.getSource
- * @description 通过索引,类型和ID获取文档的源。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-getsource}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "getSource",
- value: function getSource(params, callback) {
- return this.client.getSource(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.getTemplate
- * @description 获取模板。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-gettemplate}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "getTemplate",
- value: function getTemplate(params, callback) {
- return this.client.getTemplate(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.index
- * @description 在索引中存储一个键入的JSON文档,使其可搜索。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-index}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "index",
- value: function index(params, callback) {
- return this.client.index(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.info
- * @description 从当前集群获取基本信息。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-info}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/index.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "info",
- value: function info(params, callback) {
- return this.client.info(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.mget
- * @description 根据索引,类型(可选)和ids来获取多个文档。mget所需的主体可以采用两种形式:文档位置数组或文档ID数组。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-mget}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "mget",
- value: function mget(params, callback) {
- return this.client.mget(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.msearch
- * @description 在同一请求中执行多个搜索请求。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearch}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 请求返回的回调函数。也可以使用then表达式获取返回结果。
- * 回调参数:error,response。结果存储在response.responses中
- */
- }, {
- key: "msearch",
- value: function msearch(params, callback) {
- var me = this;
- return me.client.msearch(params).then(function (resp) {
- me._update(resp.responses, callback);
- return resp;
- }, function (err) {
- callback(err);
- me.events.triggerEvent('error', {
- error: err
- });
- return err;
- });
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.msearchTemplate
- * @description 在同一请求中执行多个搜索模板请求。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearchtemplate}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "msearchTemplate",
- value: function msearchTemplate(params, callback) {
- return this.client.msearchTemplate(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.mtermvectors
- * @description 多termvectors API允许一次获得多个termvectors。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-mtermvectors}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-termvectors.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "mtermvectors",
- value: function mtermvectors(params, callback) {
- return this.client.mtermvectors(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.ping
- * @description 测试连接。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-ping}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/index.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "ping",
- value: function ping(params, callback) {
- return this.client.ping(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.putScript
- * @description 添加脚本。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-putscript}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "putScript",
- value: function putScript(params, callback) {
- return this.client.putScript(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.putTemplate
- * @description 添加模板。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-puttemplate}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "putTemplate",
- value: function putTemplate(params, callback) {
- return this.client.putTemplate(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.reindex
- * @description 重新索引。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-reindex}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "reindex",
- value: function reindex(params, callback) {
- return this.client.reindex(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.reindexRessrottle
- * @description 重新索引。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-reindexrethrottle}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "reindexRessrottle",
- value: function reindexRessrottle(params, callback) {
- return this.client.reindexRessrottle(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.renderSearchTemplate
- * @description 搜索模板。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-rendersearchtemplate}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "renderSearchTemplate",
- value: function renderSearchTemplate(params, callback) {
- return this.client.renderSearchTemplate(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.scroll
- * @description 在search()调用中指定滚动参数之后,滚动搜索请求(检索下一组结果)。</br>
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-scroll}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "scroll",
- value: function scroll(params, callback) {
- return this.client.scroll(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.search
- * @description 在search()调用中指定滚动参数之后,滚动搜索请求(检索下一组结果)。
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-search}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 请求返回的回调函数。也可以使用then表达式获取返回结果。
- * 回调参数:error,response,结果存储在response.responses中
- */
- }, {
- key: "search",
- value: function search(params, callback) {
- var me = this;
- return me.client.search(params).then(function (resp) {
- me._update(resp.responses, callback);
- return resp;
- }, function (err) {
- callback(err);
- me.events.triggerEvent('error', {
- error: err
- });
- return err;
- });
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.searchShards
- * @description 返回要执行搜索请求的索引和分片。
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-searchshards}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-shards.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "searchShards",
- value: function searchShards(params, callback) {
- return this.client.searchShards(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.searchTemplate
- * @description 搜索模板。
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-searchtemplate}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "searchTemplate",
- value: function searchTemplate(params, callback) {
- return this.client.searchTemplate(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.suggest
- * @description 该建议功能通过使用特定的建议者,基于所提供的文本来建议类似的术语。
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-suggest}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "suggest",
- value: function suggest(params, callback) {
- return this.client.suggest(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.termvectors
- * @description 返回有关特定文档字段中的术语的信息和统计信息。
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-termvectors}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-termvectors.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "termvectors",
- value: function termvectors(params, callback) {
- return this.client.termvectors(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.update
- * @description 更新文档的部分。
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-update}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "update",
- value: function update(params, callback) {
- return this.client.update(params, callback);
- }
- /**
- * @function SuperMap.ElasticSearch.prototype.update
- * @description 通过查询API来更新文档。
- * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-updatebyquery}</br>
- * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html}</br>
- * @param {Object} params - 参数。
- * @param {function} callback - 回调函数。
- */
- }, {
- key: "updateByQuery",
- value: function updateByQuery(params, callback) {
- return this.client.updateByQuery(params, callback);
- }
- }, {
- key: "_update",
- value: function _update(data, callback) {
- var me = this;
- if (!data) {
- return;
- }
- me.data = data;
- if (me.openGeoFence && me.geoFence) {
- me._validateDatas(data);
- }
- me.events.triggerEvent('change', {
- data: me.data
- }); //change方法已废弃,不建议使用。建议使用search方法的第二个参数传入请求成功的回调
- if (me.change) {
- me.change && me.change(data);
- } else {
- //加responses是为了保持跟原来es自身的数据结构一致
- callback && callback(undefined, {
- responses: data
- });
- }
- }
- }, {
- key: "_validateDatas",
- value: function _validateDatas(datas) {
- if (!datas) {
- return;
- }
- if (!(datas instanceof Array)) {
- datas = [datas];
- }
- var i,
- len = datas.length;
- for (i = 0; i < len; i++) {
- this._validateData(datas[i]);
- }
- }
- }, {
- key: "_validateData",
- value: function _validateData(data) {
- var me = this;
- data.hits.hits.map(function (source) {
- var content = source._source;
- var meterUnit = me._getMeterPerMapUnit(me.geoFence.unit);
- var geoFenceCX = me.geoFence.center[0] * meterUnit;
- var geoFenceCY = me.geoFence.center[1] * meterUnit;
- var contentX = content.x * meterUnit;
- var contentY = content.y * meterUnit;
- var distance = me._distance(contentX, contentY, geoFenceCX, geoFenceCY);
- var radius = me.geoFence.radius;
- if (distance > radius) {
- me.outOfGeoFence && me.outOfGeoFence(data);
- me.events.triggerEvent('outOfGeoFence', {
- data: data
- });
- }
- return source;
- });
- }
- }, {
- key: "_distance",
- value: function _distance(x1, y1, x2, y2) {
- return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
- }
- }, {
- key: "_getMeterPerMapUnit",
- value: function _getMeterPerMapUnit(mapUnit) {
- var earchRadiusInMeters = 6378137;
- var meterPerMapUnit;
- if (mapUnit === 'meter') {
- meterPerMapUnit = 1;
- } else if (mapUnit === 'degree') {
- // 每度表示多少米。
- meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
- }
- return meterPerMapUnit;
- }
- }]);
- return ElasticSearch;
- }();
- SuperMap.ElasticSearch = ElasticSearch;
- ;// CONCATENATED MODULE: ./src/common/thirdparty/elasticsearch/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/common/thirdparty/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Util.js
- 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); }
- function Util_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Util_createClass(Constructor, protoProps, staticProps) { if (protoProps) Util_defineProperties(Constructor.prototype, protoProps); if (staticProps) Util_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Tool.Util
- * @category Visualization Theme
- * LevelRenderer 基础工具类
- *
- */
- var Util_Util = /*#__PURE__*/function () {
- /**
- * @function SuperMap.LevelRenderer.Tool.Util.constructor
- * @description 构造函数。
- *
- */
- function Util() {
- Util_classCallCheck(this, Util);
- /**
- * @member {Object} SuperMap.LevelRenderer.Tool.Util.prototype.BUILTIN_OBJECT
- * @description 用于处理merge时无法遍历Date等对象的问题
- */
- this.BUILTIN_OBJECT = {
- '[object Function]': 1,
- '[object RegExp]': 1,
- '[object Date]': 1,
- '[object Error]': 1,
- '[object CanvasGradient]': 1
- };
- /**
- * @member {Object} SuperMap.LevelRenderer.Tool.Util.prototype._ctx
- */
- this._ctx = null;
- /**
- * Property: _canvas
- * {Object}
- */
- this._canvas = null;
- /**
- * Property: _pixelCtx
- * {Object}
- */
- this._pixelCtx = null;
- /**
- * Property: _width
- * {Object}
- */
- this._width = null;
- /**
- * Property: _height
- * {Object}
- */
- this._height = null;
- /**
- * Property: _offsetX
- * {Object}
- */
- this._offsetX = 0;
- /**
- * Property: _offsetY
- * {Object}
- */
- this._offsetY = 0;
- this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Util";
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Util.prototype.clone
- * @description 对一个object进行深度拷贝。
- *
- * @param {Object} source - 需要进行拷贝的对象。
- * @return {Object} 拷贝后的新对象。
- */
- Util_createClass(Util, [{
- key: "clone",
- value: function clone(source) {
- var BUILTIN_OBJECT = this.BUILTIN_OBJECT;
- if (Util_typeof(source) == 'object' && source !== null) {
- var result = source;
- if (source instanceof Array) {
- result = [];
- for (var i = 0, len = source.length; i < len; i++) {
- result[i] = this.clone(source[i]);
- }
- } else if (!BUILTIN_OBJECT[Object.prototype.toString.call(source)]) {
- result = {};
- for (var key in source) {
- if (source.hasOwnProperty(key)) {
- result[key] = this.clone(source[key]);
- }
- }
- }
- return result;
- }
- return source;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Util.prototype.mergeItem
- * @description 合并源对象的单个属性到目标对象。
- *
- * @param {Object} target - 目标对象。
- * @param {Object} source - 源对象。
- * @param {string} key - 键。
- * @param {boolean} overwrite - 是否覆盖。
- * @return {Object} 目标对象
- */
- }, {
- key: "mergeItem",
- value: function mergeItem(target, source, key, overwrite) {
- var BUILTIN_OBJECT = this.BUILTIN_OBJECT;
- if (source.hasOwnProperty(key)) {
- if (Util_typeof(target[key]) == 'object' && !BUILTIN_OBJECT[Object.prototype.toString.call(target[key])]) {
- // 如果需要递归覆盖,就递归调用merge
- this.merge(target[key], source[key], overwrite);
- } else if (overwrite || !(key in target)) {
- // 否则只处理overwrite为true,或者在目标对象中没有此属性的情况
- target[key] = source[key];
- }
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Util.prototype.merge
- * @description 合并源对象的属性到目标对象。
- *
- * @param {Object} target - 目标对象。
- * @param {Object} source - 源对象。
- * @param {boolean} overwrite - 是否覆盖。
- * @return {Object} 目标对象。
- */
- }, {
- key: "merge",
- value: function merge(target, source, overwrite) {
- for (var i in source) {
- this.mergeItem(target, source, i, overwrite);
- }
- return target;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Util.prototype.getContext
- * @description 获取 Canvas 上下文。
- * @return {Object} 上下文。
- */
- }, {
- key: "getContext",
- value: function getContext() {
- if (!this._ctx) {
- this._ctx = document.createElement('canvas').getContext('2d');
- }
- return this._ctx;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Util.prototype.getPixelContext
- * @description 获取像素拾取专用的上下文。
- * @return {Object} 像素拾取专用的上下文。
- */
- }, {
- key: "getPixelContext",
- value: function getPixelContext() {
- if (!this._pixelCtx) {
- this._canvas = document.createElement('canvas');
- this._width = this._canvas.width;
- this._height = this._canvas.height;
- this._pixelCtx = this._canvas.getContext('2d');
- }
- return this._pixelCtx;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Util.prototype.adjustCanvasSize
- * @description 如果坐标处在_canvas外部,改变_canvas的大小,修改canvas的大小 需要重新设置translate
- *
- * @param {number} x - 横坐标。
- * @param {number} y - 纵坐标。
- *
- */
- }, {
- key: "adjustCanvasSize",
- value: function adjustCanvasSize(x, y) {
- var _canvas = this._canvas;
- var _pixelCtx = this._pixelCtx;
- var _width = this._width;
- var _height = this._height;
- var _offsetX = this._offsetX;
- var _offsetY = this._offsetY; // 每次加的长度
- var _v = 100;
- var _flag;
- if (x + _offsetX > _width) {
- _width = x + _offsetX + _v;
- _canvas.width = _width;
- _flag = true;
- }
- if (y + _offsetY > _height) {
- _height = y + _offsetY + _v;
- _canvas.height = _height;
- _flag = true;
- }
- if (x < -_offsetX) {
- _offsetX = Math.ceil(-x / _v) * _v;
- _width += _offsetX;
- _canvas.width = _width;
- _flag = true;
- }
- if (y < -_offsetY) {
- _offsetY = Math.ceil(-y / _v) * _v;
- _height += _offsetY;
- _canvas.height = _height;
- _flag = true;
- }
- if (_flag) {
- _pixelCtx.translate(_offsetX, _offsetY);
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Util.prototype.getPixelOffset
- * @description 获取像素canvas的偏移量。
- * @return {Object} 偏移量。
- */
- }, {
- key: "getPixelOffset",
- value: function getPixelOffset() {
- return {
- x: this._offsetX,
- y: this._offsetY
- };
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Util.prototype.indexOf
- * @description 查询数组中元素的index
- * @return {Object} 偏移量。
- */
- }, {
- key: "indexOf",
- value: function indexOf(array, value) {
- if (array.indexOf) {
- return array.indexOf(value);
- }
- for (var i = 0, len = array.length; i < len; i++) {
- if (array[i] === value) {
- return i;
- }
- }
- return -1;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Util.prototype.inherits
- * @description 构造类继承关系
- *
- * @param {Function} clazz - 源类。
- * @param {Function} baseClazz - 基类。
- * @return {Object} 偏移量。
- */
- }, {
- key: "inherits",
- value: function inherits(clazz, baseClazz) {
- var clazzPrototype = clazz.prototype;
- function F() {}
- F.prototype = baseClazz.prototype;
- clazz.prototype = new F();
- for (var prop in clazzPrototype) {
- clazz.prototype[prop] = clazzPrototype[prop];
- }
- clazz.constructor = clazz;
- }
- }]);
- return Util;
- }();
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Color.js
- function Color_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Color_createClass(Constructor, protoProps, staticProps) { if (protoProps) Color_defineProperties(Constructor.prototype, protoProps); if (staticProps) Color_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.LevelRenderer.Tool.Color
- * @category Visualization Theme
- * @classdesc LevelRenderer 工具-颜色辅助类
- * @private
- */
- var Color = /*#__PURE__*/function () {
- function Color() {
- Color_classCallCheck(this, Color);
- /**
- * @member {SuperMap.LevelRenderer.Tool.Util} SuperMap.LevelRenderer.Tool.Color.prototype.util
- * @description LevelRenderer 基础工具对象。
- */
- this.util = new Util_Util();
- /**
- * @member {Object} SuperMap.LevelRenderer.Tool.Color.prototype._ctx
- * @description _ctx。
- */
- this._ctx = null;
- /**
- * @member {Array} SuperMap.LevelRenderer.Tool.Color.prototype.palette
- * @description 默认色板。色板是一个包含图表默认颜色系列的数组,当色板中所有颜色被使用过后,又将从新回到色板中的第一个颜色。
- */
- 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'];
- /**
- * @member {Array} SuperMap.LevelRenderer.Tool.Color.prototype._palette
- * @description 复位色板,用于复位 palette
- */
- this._palette = this.palette;
- /**
- * @member {string} SuperMap.LevelRenderer.Tool.Color.prototype.highlightColor
- * @description 高亮色
- */
- this.highlightColor = 'rgba(0,0,255,1)';
- /**
- * @member {string} SuperMap.LevelRenderer.Tool.Color.prototype._highlightColor
- * @description 复位高亮色
- */
- this._highlightColor = this.highlightColor;
- /**
- * @member {string} SuperMap.LevelRenderer.Tool.Color.prototype.colorRegExp
- * @description 颜色格式,正则表达式。
- */
- 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;
- /**
- * @member {string} SuperMap.LevelRenderer.Tool.Color.prototype._nameColors
- * @description 颜色名。
- */
- this._nameColors = {
- aliceblue: '#f0f8ff',
- antiquewhite: '#faebd7',
- aqua: '#0ff',
- aquamarine: '#7fffd4',
- azure: '#f0ffff',
- beige: '#f5f5dc',
- bisque: '#ffe4c4',
- black: '#000',
- blanchedalmond: '#ffebcd',
- blue: '#00f',
- blueviolet: '#8a2be2',
- brown: '#a52a2a',
- burlywood: '#deb887',
- cadetblue: '#5f9ea0',
- chartreuse: '#7fff00',
- chocolate: '#d2691e',
- coral: '#ff7f50',
- cornflowerblue: '#6495ed',
- cornsilk: '#fff8dc',
- crimson: '#dc143c',
- cyan: '#0ff',
- darkblue: '#00008b',
- darkcyan: '#008b8b',
- darkgoldenrod: '#b8860b',
- darkgray: '#a9a9a9',
- darkgrey: '#a9a9a9',
- darkgreen: '#006400',
- darkkhaki: '#bdb76b',
- darkmagenta: '#8b008b',
- darkolivegreen: '#556b2f',
- darkorange: '#ff8c00',
- darkorchid: '#9932cc',
- darkred: '#8b0000',
- darksalmon: '#e9967a',
- darkseagreen: '#8fbc8f',
- darkslateblue: '#483d8b',
- darkslategray: '#2f4f4f',
- darkslategrey: '#2f4f4f',
- darkturquoise: '#00ced1',
- darkviolet: '#9400d3',
- deeppink: '#ff1493',
- deepskyblue: '#00bfff',
- dimgray: '#696969',
- dimgrey: '#696969',
- dodgerblue: '#1e90ff',
- firebrick: '#b22222',
- floralwhite: '#fffaf0',
- forestgreen: '#228b22',
- fuchsia: '#f0f',
- gainsboro: '#dcdcdc',
- ghostwhite: '#f8f8ff',
- gold: '#ffd700',
- goldenrod: '#daa520',
- gray: '#808080',
- grey: '#808080',
- green: '#008000',
- greenyellow: '#adff2f',
- honeydew: '#f0fff0',
- hotpink: '#ff69b4',
- indianred: '#cd5c5c',
- indigo: '#4b0082',
- ivory: '#fffff0',
- khaki: '#f0e68c',
- lavender: '#e6e6fa',
- lavenderblush: '#fff0f5',
- lawngreen: '#7cfc00',
- lemonchiffon: '#fffacd',
- lightblue: '#add8e6',
- lightcoral: '#f08080',
- lightcyan: '#e0ffff',
- lightgoldenrodyellow: '#fafad2',
- lightgray: '#d3d3d3',
- lightgrey: '#d3d3d3',
- lightgreen: '#90ee90',
- lightpink: '#ffb6c1',
- lightsalmon: '#ffa07a',
- lightseagreen: '#20b2aa',
- lightskyblue: '#87cefa',
- lightslategray: '#789',
- lightslategrey: '#789',
- lightsteelblue: '#b0c4de',
- lightyellow: '#ffffe0',
- lime: '#0f0',
- limegreen: '#32cd32',
- linen: '#faf0e6',
- magenta: '#f0f',
- maroon: '#800000',
- mediumaquamarine: '#66cdaa',
- mediumblue: '#0000cd',
- mediumorchid: '#ba55d3',
- mediumpurple: '#9370d8',
- mediumseagreen: '#3cb371',
- mediumslateblue: '#7b68ee',
- mediumspringgreen: '#00fa9a',
- mediumturquoise: '#48d1cc',
- mediumvioletred: '#c71585',
- midnightblue: '#191970',
- mintcream: '#f5fffa',
- mistyrose: '#ffe4e1',
- moccasin: '#ffe4b5',
- navajowhite: '#ffdead',
- navy: '#000080',
- oldlace: '#fdf5e6',
- olive: '#808000',
- olivedrab: '#6b8e23',
- orange: '#ffa500',
- orangered: '#ff4500',
- orchid: '#da70d6',
- palegoldenrod: '#eee8aa',
- palegreen: '#98fb98',
- paleturquoise: '#afeeee',
- palevioletred: '#d87093',
- papayawhip: '#ffefd5',
- peachpuff: '#ffdab9',
- peru: '#cd853f',
- pink: '#ffc0cb',
- plum: '#dda0dd',
- powderblue: '#b0e0e6',
- purple: '#800080',
- red: '#f00',
- rosybrown: '#bc8f8f',
- royalblue: '#4169e1',
- saddlebrown: '#8b4513',
- salmon: '#fa8072',
- sandybrown: '#f4a460',
- seagreen: '#2e8b57',
- seashell: '#fff5ee',
- sienna: '#a0522d',
- silver: '#c0c0c0',
- skyblue: '#87ceeb',
- slateblue: '#6a5acd',
- slategray: '#708090',
- slategrey: '#708090',
- snow: '#fffafa',
- springgreen: '#00ff7f',
- steelblue: '#4682b4',
- tan: '#d2b48c',
- teal: '#008080',
- thistle: '#d8bfd8',
- tomato: '#ff6347',
- turquoise: '#40e0d0',
- violet: '#ee82ee',
- wheat: '#f5deb3',
- white: '#fff',
- whitesmoke: '#f5f5f5',
- yellow: '#ff0',
- yellowgreen: '#9acd32'
- };
- this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Color";
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.customPalette
- * @description 自定义调色板。
- * @param {Array} userPalete - 颜色板。
- */
- Color_createClass(Color, [{
- key: "customPalette",
- value: function customPalette(userPalete) {
- this.palette = userPalete;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.resetPalette
- * @description 复位默认色板。
- */
- }, {
- key: "resetPalette",
- value: function resetPalette() {
- this.palette = this._palette;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.getColor
- * @description 获取色板颜色。
- * @param {number} idx - 色板位置。
- * @param {Array} userPalete - 色板。
- * @returns {string} 颜色值。
- */
- }, {
- key: "getColor",
- value: function getColor(idx, userPalete) {
- idx = idx | 0;
- userPalete = userPalete || this.palette;
- return userPalete[idx % userPalete.length];
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.customHighlight
- * @description 自定义默认高亮颜色。
- * @param {string} userHighlightColor - 自定义高亮色。
- */
- }, {
- key: "customHighlight",
- value: function customHighlight(userHighlightColor) {
- this.highlightColor = userHighlightColor;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.resetHighlight
- * @description 重置默认高亮颜色。将当前的高亮色作为默认高亮颜色
- */
- }, {
- key: "resetHighlight",
- value: function resetHighlight() {
- this.highlightColor = this._highlightColor;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.getHighlightColor
- * @description 获取默认高亮颜色
- * @returns {string} 颜色值。
- */
- }, {
- key: "getHighlightColor",
- value: function getHighlightColor() {
- return this.highlightColor;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.getRadialGradient
- * @description 径向渐变。
- * @param {number} x0 - 渐变起点横坐标。
- * @param {number} y0 - 渐变起点纵坐标。
- * @param {number} r0 - 半径
- * @param {number} x1 - 渐变终点横坐标。
- * @param {number} y1 - 渐变终点纵坐标。
- * @param {number} r1 - 半径
- * @param {Array} colorList - 颜色列表。
- * @returns {CanvasGradient} Cavans 渐变颜色。
- */
- }, {
- key: "getRadialGradient",
- value: function getRadialGradient(x0, y0, r0, x1, y1, r1, colorList) {
- var util = this.util;
- if (!this._ctx) {
- this._ctx = util.getContext();
- }
- var gradient = this._ctx.createRadialGradient(x0, y0, r0, x1, y1, r1);
- for (var i = 0, l = colorList.length; i < l; i++) {
- gradient.addColorStop(colorList[i][0], colorList[i][1]);
- }
- gradient.__nonRecursion = true;
- return gradient;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.getLinearGradient
- * @description 线性渐变。
- * @param {number} x0 - 渐变起点横坐标。
- * @param {number} y0 - 渐变起点纵坐标。
- * @param {number} x1 - 渐变终点横坐标。
- * @param {number} y1 - 渐变终点纵坐标。
- * @param {Array} colorList - 颜色列表。
- * @returns {CanvasGradient} Cavans 渐变颜色。
- */
- }, {
- key: "getLinearGradient",
- value: function getLinearGradient(x0, y0, x1, y1, colorList) {
- var util = this.util;
- if (!this._ctx) {
- this._ctx = util.getContext();
- }
- var gradient = this._ctx.createLinearGradient(x0, y0, x1, y1);
- for (var i = 0, l = colorList.length; i < l; i++) {
- gradient.addColorStop(colorList[i][0], colorList[i][1]);
- }
- gradient.__nonRecursion = true;
- return gradient;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.getStepColors
- * @description 获取两种颜色之间渐变颜色数组。
- * @param {Object} start - 起始颜色对象。
- * @param {Object} end - 结束颜色对象。
- * @param {number} step - 渐变级数。
- * @returns {Array} 颜色数组。
- */
- }, {
- key: "getStepColors",
- value: function getStepColors(start, end, step) {
- start = this.toRGBA(start);
- end = this.toRGBA(end);
- start = this.getData(start);
- end = this.getData(end);
- var colors = [];
- var stepR = (end[0] - start[0]) / step;
- var stepG = (end[1] - start[1]) / step;
- var stepB = (end[2] - start[2]) / step;
- var stepA = (end[3] - start[3]) / step; // 生成颜色集合
- // fix by linfeng 颜色堆积
- for (var i = 0, r = start[0], g = start[1], b = start[2], a = start[3]; i < step; i++) {
- 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');
- r += stepR;
- g += stepG;
- b += stepB;
- a += stepA;
- }
- r = end[0];
- g = end[1];
- b = end[2];
- a = end[3];
- colors[i] = this.toColor([r, g, b, a], 'rgba');
- return colors;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.getGradientColors
- * @description 获取指定级数的渐变颜色数组。
- * @param {Array.<string>} colors - 颜色数组。
- * @param {number} [step=20] - 渐变级数。
- * @returns {Array.<string>} 颜色数组。
- */
- }, {
- key: "getGradientColors",
- value: function getGradientColors(colors, step) {
- var ret = [];
- var len = colors.length;
- if (step === undefined) {
- step = 20;
- }
- if (len === 1) {
- ret = this.getStepColors(colors[0], colors[0], step);
- } else if (len > 1) {
- for (var i = 0, n = len - 1; i < n; i++) {
- var steps = this.getStepColors(colors[i], colors[i + 1], step);
- if (i < n - 1) {
- steps.pop();
- }
- ret = ret.concat(steps);
- }
- }
- return ret;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.toColor
- * @description 颜色值数组转为指定格式颜色。
- * @param {Array} data - 颜色值数组。
- * @param {string} format - 格式,默认'rgb'
- * @returns {string} 颜色。
- */
- }, {
- key: "toColor",
- value: function toColor(data, format) {
- format = format || 'rgb';
- if (data && (data.length === 3 || data.length === 4)) {
- data = this.map(data, function (c) {
- return c > 1 ? Math.ceil(c) : c;
- });
- if (format.indexOf('hex') > -1) {
- return '#' + ((1 << 24) + (data[0] << 16) + (data[1] << 8) + +data[2]).toString(16).slice(1);
- } else if (format.indexOf('hs') > -1) {
- var sx = this.map(data.slice(1, 3), function (c) {
- return c + '%';
- });
- data[1] = sx[0];
- data[2] = sx[1];
- }
- if (format.indexOf('a') > -1) {
- if (data.length === 3) {
- data.push(1);
- }
- data[3] = this.adjust(data[3], [0, 1]);
- return format + '(' + data.slice(0, 4).join(',') + ')';
- }
- return format + '(' + data.slice(0, 3).join(',') + ')';
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.toArray
- * @description 颜色字符串转换为rgba数组。
- * @param {string} color - 颜色。
- * @returns {Array.<number>} 颜色值数组。
- */
- }, {
- key: "toArray",
- value: function toArray(color) {
- color = this.trim(color);
- if (color.indexOf('rgba') < 0) {
- color = this.toRGBA(color);
- }
- var data = [];
- var i = 0;
- color.replace(/[\d.]+/g, function (n) {
- if (i < 3) {
- n = n | 0;
- } else {
- // Alpha
- n = +n;
- }
- data[i++] = n;
- });
- return data;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.convert
- * @description 颜色格式转化。
- * @param {Array} data - 颜色值数组。
- * @param {string} format - 格式,默认'rgb'
- * @returns {string} 颜色。
- */
- }, {
- key: "convert",
- value: function convert(color, format) {
- if (!this.isCalculableColor(color)) {
- return color;
- }
- var data = this.getData(color);
- var alpha = data[3];
- if (typeof alpha === 'undefined') {
- alpha = 1;
- }
- if (color.indexOf('hsb') > -1) {
- data = this._HSV_2_RGB(data);
- } else if (color.indexOf('hsl') > -1) {
- data = this._HSL_2_RGB(data);
- }
- if (format.indexOf('hsb') > -1 || format.indexOf('hsv') > -1) {
- data = this._RGB_2_HSB(data);
- } else if (format.indexOf('hsl') > -1) {
- data = this._RGB_2_HSL(data);
- }
- data[3] = alpha;
- return this.toColor(data, format);
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.toRGBA
- * @description 转换为rgba格式的颜色。
- * @param {string} color - 颜色。
- * @returns {string} 颜色。
- */
- }, {
- key: "toRGBA",
- value: function toRGBA(color) {
- return this.convert(color, 'rgba');
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.toRGB
- * @description 转换为rgb数字格式的颜色。
- * @param {string} color - 颜色。
- * @returns {string} 颜色。
- */
- }, {
- key: "toRGB",
- value: function toRGB(color) {
- return this.convert(color, 'rgb');
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHex
- * @description 转换为16进制颜色。
- * @param {string} color - 颜色。
- * @returns {string} 16进制颜色,#rrggbb格式
- */
- }, {
- key: "toHex",
- value: function toHex(color) {
- return this.convert(color, 'hex');
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSVA
- * @description 转换为HSV颜色。
- * @param {string} color - 颜色。
- * @returns {string} HSVA颜色,hsva(h,s,v,a)
- */
- }, {
- key: "toHSVA",
- value: function toHSVA(color) {
- return this.convert(color, 'hsva');
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSV
- * @description 转换为HSV颜色。
- * @param {string} color - 颜色。
- * @returns {string} HSV颜色,hsv(h,s,v)
- */
- }, {
- key: "toHSV",
- value: function toHSV(color) {
- return this.convert(color, 'hsv');
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSBA
- * @description 转换为HSBA颜色。
- * @param {string} color - 颜色。
- * @returns {string} HSBA颜色,hsba(h,s,b,a)
- */
- }, {
- key: "toHSBA",
- value: function toHSBA(color) {
- return this.convert(color, 'hsba');
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSB
- * @description 转换为HSB颜色。
- * @param {string} color - 颜色。
- * @returns {string} HSB颜色,hsb(h,s,b)
- */
- }, {
- key: "toHSB",
- value: function toHSB(color) {
- return this.convert(color, 'hsb');
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSLA
- * @description 转换为HSLA颜色。
- * @param {string} color - 颜色。
- * @returns {string} HSLA颜色,hsla(h,s,l,a)
- */
- }, {
- key: "toHSLA",
- value: function toHSLA(color) {
- return this.convert(color, 'hsla');
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSL
- * @description 转换为HSL颜色。
- * @param {string} color - 颜色。
- * @returns {string} HSL颜色,hsl(h,s,l)
- */
- }, {
- key: "toHSL",
- value: function toHSL(color) {
- return this.convert(color, 'hsl');
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.toName
- * @description 转换颜色名。
- * @param {string} color - 颜色。
- * @returns {string} 颜色名
- */
- }, {
- key: "toName",
- value: function toName(color) {
- for (var key in this._nameColors) {
- if (this.toHex(this._nameColors[key]) === this.toHex(color)) {
- return key;
- }
- }
- return null;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.trim
- * @description 移除颜色中多余空格。
- * @param {string} color - 颜色。
- * @returns {string} 无空格颜色
- */
- }, {
- key: "trim",
- value: function trim(color) {
- return String(color).replace(/\s+/g, '');
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.normalize
- * @description 颜色规范化。
- * @param {string} color - 颜色。
- * @returns {string} 规范化后的颜色
- */
- }, {
- key: "normalize",
- value: function normalize(color) {
- // 颜色名
- if (this._nameColors[color]) {
- color = this._nameColors[color];
- } // 去掉空格
- color = this.trim(color); // hsv与hsb等价
- color = color.replace(/hsv/i, 'hsb'); // rgb转为rrggbb
- if (/^#[\da-f]{3}$/i.test(color)) {
- color = parseInt(color.slice(1), 16);
- var r = (color & 0xf00) << 8;
- var g = (color & 0xf0) << 4;
- var b = color & 0xf;
- color = '#' + ((1 << 24) + (r << 4) + r + (g << 4) + g + (b << 4) + b).toString(16).slice(1);
- } // 或者使用以下正则替换,不过 chrome 下性能相对差点
- // color = color.replace(/^#([\da-f])([\da-f])([\da-f])$/i, '#$1$1$2$2$3$3');
- return color;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.lift
- * @description 颜色加深或减淡,当level>0加深,当level<0减淡。
- * @param {string} color - 颜色。
- * @param {number} level - 升降程度,取值区间[-1,1]。
- * @returns {string} 加深或减淡后颜色值
- */
- }, {
- key: "lift",
- value: function lift(color, level) {
- if (!this.isCalculableColor(color)) {
- return color;
- }
- var direct = level > 0 ? 1 : -1;
- if (typeof level === 'undefined') {
- level = 0;
- }
- level = Math.abs(level) > 1 ? 1 : Math.abs(level);
- color = this.toRGB(color);
- var data = this.getData(color);
- for (var i = 0; i < 3; i++) {
- if (direct === 1) {
- data[i] = data[i] * (1 - level) | 0;
- } else {
- data[i] = (255 - data[i]) * level + data[i] | 0;
- }
- }
- return 'rgb(' + data.join(',') + ')';
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.reverse
- * @description 颜色翻转。[255-r,255-g,255-b,1-a]
- * @param {string} color - 颜色。
- * @returns {string} 翻转颜色
- */
- }, {
- key: "reverse",
- value: function reverse(color) {
- if (!this.isCalculableColor(color)) {
- return color;
- }
- var data = this.getData(this.toRGBA(color));
- data = this.map(data, function (c) {
- return 255 - c;
- });
- return this.toColor(data, 'rgb');
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.mix
- * @description 简单两种颜色混合
- * @param {string} color1 - 第一种颜色。
- * @param {string} color2 - 第二种颜色。
- * @param {number} weight - 混合权重[0-1]。
- * @returns {string} 结果色。rgb(r,g,b)或rgba(r,g,b,a)
- */
- }, {
- key: "mix",
- value: function mix(color1, color2, weight) {
- if (!this.isCalculableColor(color1) || !this.isCalculableColor(color2)) {
- return color1;
- }
- if (typeof weight === 'undefined') {
- weight = 0.5;
- }
- weight = 1 - this.adjust(weight, [0, 1]);
- var w = weight * 2 - 1;
- var data1 = this.getData(this.toRGBA(color1));
- var data2 = this.getData(this.toRGBA(color2));
- var d = data1[3] - data2[3];
- var weight1 = ((w * d === -1 ? w : (w + d) / (1 + w * d)) + 1) / 2;
- var weight2 = 1 - weight1;
- var data = [];
- for (var i = 0; i < 3; i++) {
- data[i] = data1[i] * weight1 + data2[i] * weight2;
- }
- var alpha = data1[3] * weight + data2[3] * (1 - weight);
- alpha = Math.max(0, Math.min(1, alpha));
- if (data1[3] === 1 && data2[3] === 1) {
- // 不考虑透明度
- return this.toColor(data, 'rgb');
- }
- data[3] = alpha;
- return this.toColor(data, 'rgba');
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.random
- * @description 随机颜色
- * @returns {string} 颜色值,#rrggbb格式
- */
- }, {
- key: "random",
- value: function random() {
- return '#' + Math.random().toString(16).slice(2, 8);
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.getData
- * @description 获取颜色值数组,返回值范围。
- * RGB 范围[0-255]
- * HSL/HSV/HSB 范围[0-1]
- * A透明度范围[0-1]
- * 支持格式:
- * #rgb
- * #rrggbb
- * rgb(r,g,b)
- * rgb(r%,g%,b%)
- * rgba(r,g,b,a)
- * hsb(h,s,b) // hsv与hsb等价
- * hsb(h%,s%,b%)
- * hsba(h,s,b,a)
- * hsl(h,s,l)
- * hsl(h%,s%,l%)
- * hsla(h,s,l,a)
- * @param {string} color - 颜色。
- * @returns {Array.<number>} 颜色值数组或null
- */
- }, {
- key: "getData",
- value: function getData(color) {
- color = this.normalize(color);
- var r = color.match(this.colorRegExp);
- if (r === null) {
- throw new Error('The color format error'); // 颜色格式错误
- }
- var d;
- var a;
- var data = [];
- var rgb;
- if (r[2]) {
- // #rrggbb
- d = r[2].replace('#', '').split('');
- rgb = [d[0] + d[1], d[2] + d[3], d[4] + d[5]];
- data = this.map(rgb, function (c) {
- return Color.prototype.adjust.call(this, parseInt(c, 16), [0, 255]);
- });
- } else if (r[4]) {
- // rgb rgba
- var rgba = r[4].split(',');
- a = rgba[3];
- rgb = rgba.slice(0, 3);
- data = this.map(rgb, function (c) {
- c = Math.floor(c.indexOf('%') > 0 ? parseInt(c, 0) * 2.55 : c);
- return Color.prototype.adjust.call(this, c, [0, 255]);
- });
- if (typeof a !== 'undefined') {
- data.push(this.adjust(parseFloat(a), [0, 1]));
- }
- } else if (r[5] || r[6]) {
- // hsb hsba hsl hsla
- var hsxa = (r[5] || r[6]).split(',');
- var h = parseInt(hsxa[0], 0) / 360;
- var s = hsxa[1];
- var x = hsxa[2];
- a = hsxa[3];
- data = this.map([s, x], function (c) {
- return Color.prototype.adjust.call(this, parseFloat(c) / 100, [0, 1]);
- });
- data.unshift(h);
- if (typeof a !== 'undefined') {
- data.push(this.adjust(parseFloat(a), [0, 1]));
- }
- }
- return data;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.alpha
- * @description 设置颜色透明度
- * @param {string} color - 颜色。
- * @param {number} a - 透明度,区间[0,1]。
- * @returns {string} rgba颜色值
- */
- }, {
- key: "alpha",
- value: function alpha(color, a) {
- if (!this.isCalculableColor(color)) {
- return color;
- }
- if (a === null) {
- a = 1;
- }
- var data = this.getData(this.toRGBA(color));
- data[3] = this.adjust(Number(a).toFixed(4), [0, 1]);
- return this.toColor(data, 'rgba');
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.map
- * @description 数组映射
- * @param {Array} array - 数组。
- * @param {function} fun - 函数。
- * @returns {string} 数组映射结果
- */
- }, {
- key: "map",
- value: function map(array, fun) {
- if (typeof fun !== 'function') {
- throw new TypeError();
- }
- var len = array ? array.length : 0;
- for (var i = 0; i < len; i++) {
- array[i] = fun(array[i]);
- }
- return array;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.adjust
- * @description 调整值区间
- * @param {Array.<number>} value - 数组。
- * @param {Array.<number>} region - 区间。
- * @returns {number} 调整后的值
- */
- }, {
- key: "adjust",
- value: function adjust(value, region) {
- // < to <= & > to >=
- // modify by linzhifeng 2014-05-25 because -0 == 0
- if (value <= region[0]) {
- value = region[0];
- } else if (value >= region[1]) {
- value = region[1];
- }
- return value;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype.isCalculableColor
- * @description 判断是否是可计算的颜色
- * @param {string} color - 颜色。
- * @returns {boolean} 是否是可计算的颜色
- */
- }, {
- key: "isCalculableColor",
- value: function isCalculableColor(color) {
- return color instanceof Array || typeof color === 'string';
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype._HSV_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
- */
- }, {
- key: "_HSV_2_RGB",
- value: function _HSV_2_RGB(data) {
- var H = data[0];
- var S = data[1];
- var V = data[2]; // HSV from 0 to 1
- var R;
- var G;
- var B;
- if (S === 0) {
- R = V * 255;
- G = V * 255;
- B = V * 255;
- } else {
- var h = H * 6;
- if (h === 6) {
- h = 0;
- }
- var i = h | 0;
- var v1 = V * (1 - S);
- var v2 = V * (1 - S * (h - i));
- var v3 = V * (1 - S * (1 - (h - i)));
- var r = 0;
- var g = 0;
- var b = 0;
- if (i === 0) {
- r = V;
- g = v3;
- b = v1;
- } else if (i === 1) {
- r = v2;
- g = V;
- b = v1;
- } else if (i === 2) {
- r = v1;
- g = V;
- b = v3;
- } else if (i === 3) {
- r = v1;
- g = v2;
- b = V;
- } else if (i === 4) {
- r = v3;
- g = v1;
- b = V;
- } else {
- r = V;
- g = v1;
- b = v2;
- } // RGB results from 0 to 255
- R = r * 255;
- G = g * 255;
- B = b * 255;
- }
- return [R, G, B];
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype._HSL_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
- */
- }, {
- key: "_HSL_2_RGB",
- value: function _HSL_2_RGB(data) {
- var H = data[0];
- var S = data[1];
- var L = data[2]; // HSL from 0 to 1
- var R;
- var G;
- var B;
- if (S === 0) {
- R = L * 255;
- G = L * 255;
- B = L * 255;
- } else {
- var v2;
- if (L < 0.5) {
- v2 = L * (1 + S);
- } else {
- v2 = L + S - S * L;
- }
- var v1 = 2 * L - v2;
- R = 255 * this._HUE_2_RGB(v1, v2, H + 1 / 3);
- G = 255 * this._HUE_2_RGB(v1, v2, H);
- B = 255 * this._HUE_2_RGB(v1, v2, H - 1 / 3);
- }
- return [R, G, B];
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype._HUE_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
- */
- }, {
- key: "_HUE_2_RGB",
- value: function _HUE_2_RGB(v1, v2, vH) {
- if (vH < 0) {
- vH += 1;
- }
- if (vH > 1) {
- vH -= 1;
- }
- if (6 * vH < 1) {
- return v1 + (v2 - v1) * 6 * vH;
- }
- if (2 * vH < 1) {
- return v2;
- }
- if (3 * vH < 2) {
- return v1 + (v2 - v1) * (2 / 3 - vH) * 6;
- }
- return v1;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype._RGB_2_HSB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
- */
- }, {
- key: "_RGB_2_HSB",
- value: function _RGB_2_HSB(data) {
- // RGB from 0 to 255
- var R = data[0] / 255;
- var G = data[1] / 255;
- var B = data[2] / 255;
- var vMin = Math.min(R, G, B); // Min. value of RGB
- var vMax = Math.max(R, G, B); // Max. value of RGB
- var delta = vMax - vMin; // Delta RGB value
- var V = vMax;
- var H;
- var S; // HSV results from 0 to 1
- if (delta === 0) {
- H = 0;
- S = 0;
- } else {
- S = delta / vMax;
- var deltaR = ((vMax - R) / 6 + delta / 2) / delta;
- var deltaG = ((vMax - G) / 6 + delta / 2) / delta;
- var deltaB = ((vMax - B) / 6 + delta / 2) / delta;
- if (R === vMax) {
- H = deltaB - deltaG;
- } else if (G === vMax) {
- H = 1 / 3 + deltaR - deltaB;
- } else if (B === vMax) {
- H = 2 / 3 + deltaG - deltaR;
- }
- if (H < 0) {
- H += 1;
- }
- if (H > 1) {
- H -= 1;
- }
- }
- H = H * 360;
- S = S * 100;
- V = V * 100;
- return [H, S, V];
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Color.prototype._RGB_2_HSL。参见{@link http://www.easyrgb.com/index.php?X=MATH}
- */
- }, {
- key: "_RGB_2_HSL",
- value: function _RGB_2_HSL(data) {
- // RGB from 0 to 255
- var R = data[0] / 255;
- var G = data[1] / 255;
- var B = data[2] / 255;
- var vMin = Math.min(R, G, B); // Min. value of RGB
- var vMax = Math.max(R, G, B); // Max. value of RGB
- var delta = vMax - vMin; // Delta RGB value
- var L = (vMax + vMin) / 2;
- var H;
- var S; // HSL results from 0 to 1
- if (delta === 0) {
- H = 0;
- S = 0;
- } else {
- if (L < 0.5) {
- S = delta / (vMax + vMin);
- } else {
- S = delta / (2 - vMax - vMin);
- }
- var deltaR = ((vMax - R) / 6 + delta / 2) / delta;
- var deltaG = ((vMax - G) / 6 + delta / 2) / delta;
- var deltaB = ((vMax - B) / 6 + delta / 2) / delta;
- if (R === vMax) {
- H = deltaB - deltaG;
- } else if (G === vMax) {
- H = 1 / 3 + deltaR - deltaB;
- } else if (B === vMax) {
- H = 2 / 3 + deltaG - deltaR;
- }
- if (H < 0) {
- H += 1;
- }
- if (H > 1) {
- H -= 1;
- }
- }
- H = H * 360;
- S = S * 100;
- L = L * 100;
- return [H, S, L];
- }
- }]);
- return Color;
- }();
- ;// CONCATENATED MODULE: ./src/common/util/ColorsPickerUtil.js
- function ColorsPickerUtil_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ColorsPickerUtil_createClass(Constructor, protoProps, staticProps) { if (protoProps) ColorsPickerUtil_defineProperties(Constructor.prototype, protoProps); if (staticProps) ColorsPickerUtil_defineProperties(Constructor, staticProps); return Constructor; }
- var ColorRender = new Color(); // let "http://www.qzu.zj.cn": "#bd10e0"
- // "www.qzct.net": "#7ed321" = new SuperMap.LevelRenderer.Tool.Color();
- /**
- * Created by yzy on 2016/11/9.
- * 色带选择器工具类 用于1、创建canvas对象,2、从几种颜色中获取一定数量的渐变色
- *
- */
- var ColorsPickerUtil = /*#__PURE__*/function () {
- function ColorsPickerUtil() {
- ColorsPickerUtil_classCallCheck(this, ColorsPickerUtil);
- }
- ColorsPickerUtil_createClass(ColorsPickerUtil, null, [{
- key: "createCanvas",
- /**
- * 创建DOM canvas
- * @param height canvas 高度
- * @param width canvas 宽度
- *
- */
- value: function createCanvas(height, width) {
- var canvas = document.createElement("canvas");
- canvas.height = height;
- canvas.width = width;
- return canvas.getContext("2d");
- }
- /**
- * 线性渐变。
- * Parameters:
- * x0 - {Number} 渐变起点。
- * y0 - {Number}
- * x1 - {Number} 渐变终点。
- * y1 - {Number}
- * colorList - {Array} 颜色列表。
- *
- * Returns:
- * {CanvasGradient} Cavans 渐变颜色。
- */
- }, {
- key: "getLinearGradient",
- value: function getLinearGradient(x0, y0, x1, y1, colorList) {
- if (!this._ctx) {
- this._ctx = this.getContext();
- }
- var gradient = this._ctx.createLinearGradient(x0, y0, x1, y1);
- var leng = colorList.length;
- var add = 1 / (leng - 1);
- var offset = 0;
- for (var i = 0; i < leng; i++) {
- gradient.addColorStop(offset, colorList[i]);
- offset += add;
- }
- gradient.__nonRecursion = true;
- return gradient;
- }
- /**
- * 获取 Cavans 上下文
- *
- * Returns:
- * {Object} Cavans 上下文。
- */
- }, {
- key: "getContext",
- value: function getContext() {
- if (!this._ctx) {
- this._ctx = document.createElement('canvas').getContext('2d');
- }
- return this._ctx;
- }
- /**
- * 获取两种颜色之间渐变颜色数组。
- *
- * Parameters:
- * start - {color} 起始颜色。
- * end - {color} 结束颜色。
- * step - {Number} 渐变级数。
- * colorList - {Array} 颜色列表。
- *
- * Returns:
- * {Array} 颜色数组。
- */
- }, {
- key: "getStepColors",
- value: function getStepColors(start, end, step) {
- start = ColorRender.toRGBA(start);
- end = ColorRender.toRGBA(end);
- start = ColorRender.getData(start);
- end = ColorRender.getData(end);
- var colors = [];
- var stepR = (end[0] - start[0]) / step;
- var stepG = (end[1] - start[1]) / step;
- var stepB = (end[2] - start[2]) / step;
- var stepA = (end[3] - start[3]) / step; // 生成颜色集合
- // fix by linfeng 颜色堆积
- for (var i = 0, r = start[0], g = start[1], b = start[2], a = start[3]; i < step; i++) {
- 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');
- r += stepR;
- g += stepG;
- b += stepB;
- a += stepA;
- }
- r = end[0];
- g = end[1];
- b = end[2];
- a = end[3];
- colors[i] = ColorRender.toColor([r, g, b, a], 'hex');
- return colors;
- }
- /**
- * APIMethod: getGradientColors
- * 获取指定级数的渐变颜色数组。
- *
- * Parameters:
- * colors - {Array{String}} 颜色组。
- * total - {Number} 颜色总数。
- * total - {String} 专题类型
- *
- * Returns:
- * {Array{String}} 颜色数组。
- */
- }, {
- key: "getGradientColors",
- value: function getGradientColors(colors, total, themeType) {
- var ret = [],
- step;
- var i,
- n,
- len = colors.length;
- if (total === undefined) {
- return;
- }
- if (len >= total) {
- if (themeType === 'RANGE') {
- for (i = 0; i < total; i++) {
- ret.push(colors[i]);
- }
- } else {
- //1/2前后取色
- for (i = 0; i < total; i++) {
- var ii = Math.floor(i / 2);
- if (i % 2 === 0) {
- ret.push(colors[ii]);
- } else {
- var _index = colors.length - 1 - ii;
- ret.push(colors[_index]);
- }
- }
- }
- } else {
- step = Math.ceil(total / (len - 1));
- for (i = 0, n = len - 1; i < n; i++) {
- var steps = this.getStepColors(colors[i], colors[i + 1], step);
- if (i < n - 1) {
- steps.pop();
- }
- ret = ret.concat(steps);
- } //删除多余元素
- var nouse = ret.length - total;
- for (var j = 0, index = 0; j < nouse; j++) {
- ret.splice(index + 2, 1);
- }
- }
- return ret;
- }
- }]);
- return ColorsPickerUtil;
- }();
- SuperMap.ColorsPickerUtil = ColorsPickerUtil;
- ;// CONCATENATED MODULE: ./src/common/util/ArrayStatistic.js
- function ArrayStatistic_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ArrayStatistic_createClass(Constructor, protoProps, staticProps) { if (protoProps) ArrayStatistic_defineProperties(Constructor.prototype, protoProps); if (staticProps) ArrayStatistic_defineProperties(Constructor, staticProps); return Constructor; }
- var ArrayStatistic = /*#__PURE__*/function () {
- function ArrayStatistic() {
- ArrayStatistic_classCallCheck(this, ArrayStatistic);
- }
- ArrayStatistic_createClass(ArrayStatistic, null, [{
- key: "newInstance",
- // geostatsInstance: null,
- /**
- * 初始化插件实例
- */
- value: function newInstance() {
- // if(!this.geostatsInstance) {
- // // this.geostatsInstance = new geostats();
- // // }
- // window.dataList = [];
- if (!this.geostatsInstance) {
- this.geostatsInstance = new window.geostats();
- }
- return this.geostatsInstance;
- }
- /**
- * 设置需要被处理的数组
- *
- * @param array
- */
- }, {
- key: "getInstance",
- value: function getInstance(array) {
- var instance = this.newInstance();
- instance.setSerie(array);
- return instance;
- }
- /**
- * 获取数组统计的值
- *
- * @param array 需要统计的数组
- * @param type 统计方法
- */
- }, {
- key: "getArrayStatistic",
- value: function getArrayStatistic(array, type) {
- if (!array.length) {
- return 0;
- }
- if (type === "Sum" || type === "求和") {
- return this.getSum(array);
- } else if (type === "Maximum" || type === "最大值") {
- return this.getMax(array);
- } else if (type === "Minimum" || type === "最小值") {
- return this.getMin(array);
- } else if (type === "Average" || type === "平均值") {
- return this.getMean(array);
- } else if (type === "Median" || type === "中位数") {
- return this.getMedian(array);
- } else if (type === "times" || type === "计数") {
- return this.getTimes(array);
- }
- }
- /**
- * 获取数组分段后的数值
- *
- * @param array 需要分段的数组
- * @param type 分段方法
- * @param segNum 分段个数
- */
- }, {
- key: "getArraySegments",
- value: function getArraySegments(array, type, segNum) {
- if (type === "offset") {
- return this.getEqInterval(array, segNum);
- } else if (type === "jenks") {
- return this.getJenks(array, segNum);
- } else if (type === "square") {
- // 数据都必须 >= 0
- var minValue = this.getMin(array);
- if (minValue >= 0) {
- return this.getSqrtInterval(array, segNum);
- } else {
- //console.log('数据都必须 >= 0');
- // Util.showMessage(Language.hasNegValue + Language.noSupportRange, 'ERROR');
- return false;
- }
- } else if (type === "logarithm") {
- // 数据都必须 > 0
- var _minValue = this.getMin(array);
- if (_minValue > 0) {
- return this.getGeometricProgression(array, segNum);
- } else {
- //console.log('数据都必须 > 0');
- // Util.showMessage(Language.hasZeroNegValue + Language.noSupportRange, 'ERROR');
- return false;
- }
- }
- }
- /**
- * 求和
- * @param array
- * @returns {number}
- */
- }, {
- key: "getSum",
- value: function getSum(array) {
- return this.getInstance(array).sum();
- }
- /**
- * 最小值
- * @param array
- * @returns {*}
- */
- }, {
- key: "getMax",
- value: function getMax(array) {
- return this.getInstance(array).max();
- }
- /**
- * 最大值
- * @param array
- * @returns {*}
- */
- }, {
- key: "getMin",
- value: function getMin(array) {
- return this.getInstance(array).min();
- }
- /**
- * 求平均
- * @param array
- * @returns {number}
- */
- }, {
- key: "getMean",
- value: function getMean(array) {
- return this.getInstance(array).mean();
- }
- /**
- * 求中位数
- *
- * @param array
- * @returns {number}
- */
- }, {
- key: "getMedian",
- value: function getMedian(array) {
- return this.getInstance(array).median();
- }
- /**
- * 计数
- *
- * @param array
- * @returns {number}
- */
- }, {
- key: "getTimes",
- value: function getTimes(array) {
- return array.length;
- }
- /**
- * 等距分段法
- *
- * @param array
- * @param segNum
- */
- }, {
- key: "getEqInterval",
- value: function getEqInterval(array, segNum) {
- return this.getInstance(array).getClassEqInterval(segNum);
- }
- /**
- * 自然断裂法
- *
- * @param array
- * @param segNum
- */
- }, {
- key: "getJenks",
- value: function getJenks(array, segNum) {
- return this.getInstance(array).getClassJenks(segNum);
- }
- /**
- * 平方根分段法
- *
- * @param array
- * @param segNum
- */
- }, {
- key: "getSqrtInterval",
- value: function getSqrtInterval(array, segNum) {
- array = array.map(function (value) {
- return Math.sqrt(value);
- });
- var breaks = this.getInstance(array).getClassEqInterval(segNum);
- return breaks.map(function (value) {
- return value * value;
- });
- }
- /**
- * 对数分段法
- *
- * @param array
- * @param segNum
- */
- }, {
- key: "getGeometricProgression",
- value: function getGeometricProgression(array, segNum) {
- return this.getInstance(array).getClassGeometricProgression(segNum);
- }
- }]);
- return ArrayStatistic;
- }();
- SuperMap.ArrayStatistic = ArrayStatistic;
- ;// CONCATENATED MODULE: ./src/common/util/MapCalculateUtil.js
- var getMeterPerMapUnit = function getMeterPerMapUnit(mapUnit) {
- var earchRadiusInMeters = 6378137;
- var meterPerMapUnit;
- if (mapUnit === Unit.METER) {
- meterPerMapUnit = 1;
- } else if (mapUnit === Unit.DEGREE) {
- // 每度表示多少米。
- meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
- } else if (mapUnit === Unit.KILOMETER) {
- meterPerMapUnit = 1.0e-3;
- } else if (mapUnit === Unit.INCH) {
- meterPerMapUnit = 1 / 2.5399999918e-2;
- } else if (mapUnit === Unit.FOOT) {
- meterPerMapUnit = 0.3048;
- } else {
- return meterPerMapUnit;
- }
- return meterPerMapUnit;
- };
- function getWrapNum(x) {
- var includeMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
- var includeMin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
- var range = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [-180, 180];
- var max = range[1],
- min = range[0],
- d = max - min;
- if (x === max && includeMax) {
- return x;
- }
- if (x === min && includeMin) {
- return x;
- }
- var tmp = ((x - min) % d + d) % d;
- if (tmp === 0 && includeMax) {
- return max;
- }
- return ((x - min) % d + d) % d + min;
- }
- function conversionDegree(degrees) {
- var degree = parseInt(degrees);
- var fraction = parseInt((degrees - degree) * 60);
- var second = parseInt(((degrees - degree) * 60 - fraction) * 60);
- fraction = parseInt(fraction / 10) === 0 ? "0".concat(fraction) : fraction;
- second = parseInt(second / 10) === 0 ? "0".concat(second) : second;
- return "".concat(degree, "\xB0").concat(fraction, "'").concat(second);
- }
- ;// CONCATENATED MODULE: ./src/common/util/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- // EXTERNAL MODULE: ./node_modules/lodash.topairs/index.js
- var lodash_topairs = __webpack_require__(820);
- var lodash_topairs_default = /*#__PURE__*/__webpack_require__.n(lodash_topairs);
- ;// CONCATENATED MODULE: ./src/common/style/CartoCSS.js
- 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); }
- function CartoCSS_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function CartoCSS_createClass(Constructor, protoProps, staticProps) { if (protoProps) CartoCSS_defineProperties(Constructor.prototype, protoProps); if (staticProps) CartoCSS_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.CartoCSS
- * @classdesc CartoCSS 解析类,其主要功能为将 CartoCSS 字符串解析为 CartoCSS 的 shader 属性风格对象。
- * @category BaseTypes Style
- * @param {string} cartoStr - CartoCSS 样式表字符串
- * @example
- * var cartocss = "@provinceLineColor:#ddd;
- * #China_Provinces_L___China400{
- * line-dasharray:10,10;
- * line-color:@provinceLineColor;
- * line-width:1;
- * }";
- * new SuperMap.CartoCSS(cartocss);
- */
- /*eslint no-useless-escape: "off"*/
- var CartoCSS = /*#__PURE__*/function () {
- function CartoCSS(cartoStr) {
- CartoCSS_classCallCheck(this, CartoCSS);
- this.env = null;
- /**
- * @member SuperMap.CartoCSS.prototype.parser
- * @description 解析器
- */
- this.parser = null;
- /**
- * @member SuperMap.CartoCSS.prototype.ruleSet
- * @description CartoCSS 规则对象
- */
- this.ruleSet = null;
- /**
- * @member SuperMap.CartoCSS.prototype.cartoStr
- * @description CartoCSS 样式表字符串
- */
- this.cartoStr = "";
- /**
- * @member SuperMap.CartoCSS.prototype.shaders
- * @description Carto 着色器集
- */
- this.shaders = null;
- if (typeof cartoStr === "string") {
- this.cartoStr = cartoStr;
- this.env = {
- frames: [],
- errors: [],
- error: function error(obj) {
- this.errors.push(obj);
- }
- };
- this.parser = this.getParser(this.env);
- this.parse(cartoStr);
- this.shaders = this.toShaders();
- }
- }
- /**
- * @function SuperMap.CartoCSS.prototype.getParser
- * @description 获取 CartoCSS 解析器
- */
- CartoCSS_createClass(CartoCSS, [{
- key: "getParser",
- value: function getParser(env) {
- var input, // LeSS input string
- i, // current index in `input`
- j, // current chunk
- temp, // temporarily holds a chunk's state, for backtracking
- memo, // temporarily holds `i`, when backtracking
- furthest, // furthest index the parser has gone to
- chunks, // chunkified input
- current, // index of current chunk, in `input`
- parser;
- var that = this; // This function is called after all files
- // have been imported through `@import`.
- var finish = function finish() {//NOSONAR
- //所有文件导入完成之后调用
- };
- function save() {
- temp = chunks[j];
- memo = i;
- current = i;
- }
- function restore() {
- chunks[j] = temp;
- i = memo;
- current = i;
- }
- function sync() {
- if (i > current) {
- chunks[j] = chunks[j].slice(i - current);
- current = i;
- }
- } //
- // Parse from a token, regexp or string, and move forward if match
- //
- function _match(tok) {
- var match, length, c, endIndex; // Non-terminal
- if (tok instanceof Function) {
- return tok.call(parser.parsers); // Terminal
- // Either match a single character in the input,
- // or match a regexp in the current chunk (chunk[j]).
- } else if (typeof tok === 'string') {
- match = input.charAt(i) === tok ? tok : null;
- length = 1;
- sync();
- } else {
- sync();
- match = tok.exec(chunks[j]);
- if (match) {
- length = match[0].length;
- } else {
- return null;
- }
- } // The match is confirmed, add the match length to `i`,
- // and consume any extra white-space characters (' ' || '\n')
- // which come after that. The reason for this is that LeSS's
- // grammar is mostly white-space insensitive.
- if (match) {
- var mem = i += length;
- endIndex = i + chunks[j].length - length;
- while (i < endIndex) {
- c = input.charCodeAt(i);
- if (!(c === 32 || c === 10 || c === 9)) {
- break;
- }
- i++;
- }
- chunks[j] = chunks[j].slice(length + (i - mem));
- current = i;
- if (chunks[j].length === 0 && j < chunks.length - 1) {
- j++;
- }
- if (typeof match === 'string') {
- return match;
- } else {
- return match.length === 1 ? match[0] : match;
- }
- }
- } // Same as _match(), but don't change the state of the parser,
- // just return the match.
- function peek(tok) {
- if (typeof tok === 'string') {
- return input.charAt(i) === tok;
- } else {
- return !!tok.test(chunks[j]);
- }
- } // Make an error object from a passed set of properties.
- // Accepted properties:
- // - `message`: Text of the error message.
- // - `filename`: Filename where the error occurred.
- // - `index`: Char. index where the error occurred.
- function makeError(err) {
- var einput;
- var defautls = {
- index: furthest,
- filename: env.filename,
- message: 'Parse error.',
- line: 0,
- column: -1
- };
- for (var prop in defautls) {
- if (err[prop] === 0) {
- err[prop] = defautls[prop];
- }
- }
- if (err.filename && that.env.inputs && that.env.inputs[err.filename]) {
- einput = that.env.inputs[err.filename];
- } else {
- einput = input;
- }
- err.line = (einput.slice(0, err.index).match(/\n/g) || '').length + 1;
- for (var n = err.index; n >= 0 && einput.charAt(n) !== '\n'; n--) {
- err.column++;
- }
- return new Error([err.filename, err.line, err.column, err.message].join(";"));
- }
- this.env = env = env || {};
- this.env.filename = this.env.filename || null;
- this.env.inputs = this.env.inputs || {}; // The Parser
- parser = {
- // Parse an input string into an abstract syntax tree.
- // Throws an error on parse errors.
- parse: function parse(str) {
- var root,
- error = null;
- i = j = current = furthest = 0;
- chunks = [];
- input = str.replace(/\r\n/g, '\n');
- if (env.filename) {
- that.env.inputs[env.filename] = input;
- } // Split the input into chunks.
- chunks = function (chunks) {
- var j = 0,
- skip = /(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,
- comment = /\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,
- string = /"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,
- level = 0,
- match,
- chunk = chunks[0],
- inParam;
- for (var i = 0, c, cc; i < input.length;) {
- skip.lastIndex = i;
- if (match = skip.exec(input)) {
- if (match.index === i) {
- i += match[0].length;
- chunk.push(match[0]);
- }
- }
- c = input.charAt(i);
- comment.lastIndex = string.lastIndex = i;
- if (match = string.exec(input)) {
- if (match.index === i) {
- i += match[0].length;
- chunk.push(match[0]);
- continue;
- }
- }
- if (!inParam && c === '/') {
- cc = input.charAt(i + 1);
- if (cc === '/' || cc === '*') {
- if (match = comment.exec(input)) {
- if (match.index === i) {
- i += match[0].length;
- chunk.push(match[0]);
- continue;
- }
- }
- }
- }
- switch (c) {
- case '{':
- //NOSONAR
- if (!inParam) {
- level++;
- chunk.push(c);
- break;
- }
- case '}':
- //NOSONAR
- if (!inParam) {
- level--;
- chunk.push(c);
- chunks[++j] = chunk = [];
- break;
- }
- case '(':
- //NOSONAR
- if (!inParam) {
- inParam = true;
- chunk.push(c);
- break;
- }
- case ')':
- //NOSONAR
- if (inParam) {
- inParam = false;
- chunk.push(c);
- break;
- }
- default:
- chunk.push(c);
- break;
- }
- i++;
- }
- if (level !== 0) {
- error = {
- index: i - 1,
- type: 'Parse',
- message: level > 0 ? "missing closing `}`" : "missing opening `{`"
- };
- }
- return chunks.map(function (c) {
- return c.join('');
- });
- }([[]]);
- if (error) {
- throw makeError(error);
- } // Sort rules by specificity: this function expects selectors to be
- // split already.
- //
- // Written to be used as a .sort(Function);
- // argument.
- //
- // [1, 0, 0, 467] > [0, 0, 1, 520]
- var specificitySort = function specificitySort(a, b) {
- var as = a.specificity;
- var bs = b.specificity;
- if (as[0] != bs[0]) {
- return bs[0] - as[0];
- }
- if (as[1] != bs[1]) {
- return bs[1] - as[1];
- }
- if (as[2] != bs[2]) {
- return bs[2] - as[2];
- }
- return bs[3] - as[3];
- }; // Start with the primary rule.
- // The whole syntax tree is held under a Ruleset node,
- // with the `root` property set to true, so no `{}` are
- // output.
- root = new SuperMap.CartoCSS.Tree.Ruleset([], _match(this.parsers.primary));
- root.root = true; // Get an array of Ruleset objects, flattened
- // and sorted according to specificitySort
- root.toList = function () {
- return function (env) {
- env.error = function (e) {
- if (!env.errors) {
- env.errors = new Error('');
- }
- if (env.errors.message) {
- env.errors.message += '\n' + makeError(e).message;
- } else {
- env.errors.message = makeError(e).message;
- }
- };
- env.frames = env.frames || []; // call populates Invalid-caused errors
- var definitions = this.flatten([], [], env);
- definitions.sort(specificitySort);
- return definitions;
- };
- }();
- return root;
- },
- // Here in, the parsing rules/functions
- //
- // The basic structure of the syntax tree generated is as follows:
- //
- // Ruleset -> Rule -> Value -> Expression -> Entity
- //
- // In general, most rules will try to parse a token with the `_match()` function, and if the return
- // value is truly, will return a new node, of the relevant type. Sometimes, we need to check
- // first, before parsing, that's when we use `peek()`.
- parsers: {
- // The `primary` rule is the *entry* and *exit* point of the parser.
- // The rules here can appear at any level of the parse tree.
- //
- // The recursive nature of the grammar is an interplay between the `block`
- // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,
- // as represented by this simplified grammar:
- //
- // primary → (ruleset | rule)+
- // ruleset → selector+ block
- // block → '{' primary '}'
- //
- // Only at one point is the primary rule not called from the
- // block rule: at the root level.
- primary: function primary() {
- var node,
- root = [];
- while ((node = _match(this.rule) || _match(this.ruleset) || _match(this.comment)) || _match(/^[\s\n]+/) || (node = _match(this.invalid))) {
- if (node) {
- root.push(node);
- }
- }
- return root;
- },
- invalid: function invalid() {
- var chunk = _match(/^[^;\n]*[;\n]/); // To fail gracefully, match everything until a semicolon or linebreak.
- if (chunk) {
- return new SuperMap.CartoCSS.Tree.Invalid(chunk, memo);
- }
- },
- // We create a Comment node for CSS comments `/* */`,
- // but keep the LeSS comments `//` silent, by just skipping
- // over them.
- comment: function comment() {
- var comment;
- if (input.charAt(i) !== '/') {
- return;
- }
- if (input.charAt(i + 1) === '/') {
- return new SuperMap.CartoCSS.Tree.Comment(_match(/^\/\/.*/), true);
- } else if (comment = _match(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/)) {
- return new SuperMap.CartoCSS.Tree.Comment(comment);
- }
- },
- // Entities are tokens which can be found inside an Expression
- entities: {
- // A string, which supports escaping " and ' "milky way" 'he\'s the one!'
- quoted: function quoted() {
- if (input.charAt(i) !== '"' && input.charAt(i) !== "'") {
- return;
- }
- var str = _match(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/);
- if (str) {
- return new SuperMap.CartoCSS.Tree.Quoted(str[1] || str[2]);
- }
- },
- // A reference to a Mapnik field, like [NAME]
- // Behind the scenes, this has the same representation, but Carto
- // needs to be careful to warn when unsupported operations are used.
- field: function field() {
- var l = '[',
- r = ']';
- if (!_match(l)) {
- return;
- }
- var field_name = _match(/(^[^\]]+)/);
- if (!_match(r)) {
- return;
- }
- if (field_name) {
- return new SuperMap.CartoCSS.Tree.Field(field_name[1]);
- }
- },
- // This is a comparison operator
- comparison: function comparison() {
- var str = _match(/^=~|=|!=|<=|>=|<|>/);
- if (str) {
- return str;
- }
- },
- // A catch-all word, such as: hard-light
- // These can start with either a letter or a dash (-),
- // and then contain numbers, underscores, and letters.
- keyword: function keyword() {
- var k = _match(/^[A-Za-z\u4e00-\u9fa5-]+[A-Za-z-0-9\u4e00-\u9fa5_]*/);
- if (k) {
- return new SuperMap.CartoCSS.Tree.Keyword(k);
- }
- },
- // A function call like rgb(255, 0, 255)
- // The arguments are parsed with the `entities.arguments` parser.
- call: function call() {
- var name, args;
- if (!(name = /^([\w\-]+|%)\(/.exec(chunks[j]))) {
- return;
- }
- name = name[1];
- if (name === 'url') {
- // url() is handled by the url parser instead
- return null;
- } else {
- i += name.length;
- }
- var l = '(',
- r = ')';
- _match(l); // Parse the '(' and consume whitespace.
- args = _match(this.entities['arguments']);
- if (!_match(r)) {
- return;
- }
- if (name) {
- return new SuperMap.CartoCSS.Tree.Call(name, args, i);
- }
- },
- // Arguments are comma-separated expressions
- 'arguments': function _arguments() {
- var args = [],
- arg;
- while (arg = _match(this.expression)) {
- args.push(arg);
- var q = ',';
- if (!_match(q)) {
- break;
- }
- }
- return args;
- },
- literal: function literal() {
- return _match(this.entities.dimension) || _match(this.entities.keywordcolor) || _match(this.entities.hexcolor) || _match(this.entities.quoted);
- },
- // Parse url() tokens
- //
- // We use a specific rule for urls, because they don't really behave like
- // standard function calls. The difference is that the argument doesn't have
- // to be enclosed within a string, so it can't be parsed as an Expression.
- url: function url() {
- var value;
- if (input.charAt(i) !== 'u' || !_match(/^url\(/)) {
- return;
- }
- value = _match(this.entities.quoted) || _match(this.entities.variable) || _match(/^[\-\w%@_match\/.&=:;#+?~]+/) || '';
- var r = ')';
- if (!_match(r)) {
- return new SuperMap.CartoCSS.Tree.Invalid(value, memo, 'Missing closing ) in URL.');
- } else {
- return new SuperMap.CartoCSS.Tree.URL(typeof value.value !== 'undefined' || value instanceof SuperMap.CartoCSS.Tree.Variable ? value : new SuperMap.CartoCSS.Tree.Quoted(value));
- }
- },
- // A Variable entity, such as `@fink`, in
- //
- // width: @fink + 2px
- //
- // We use a different parser for variable definitions,
- // see `parsers.variable`.
- variable: function variable() {
- var name,
- index = i;
- if (input.charAt(i) === '@' && (name = _match(/^@[\w-]+/))) {
- return new SuperMap.CartoCSS.Tree.Variable(name, index, env.filename);
- }
- },
- hexcolor: function hexcolor() {
- var rgb;
- if (input.charAt(i) === '#' && (rgb = _match(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/))) {
- return new SuperMap.CartoCSS.Tree.Color(rgb[1]);
- }
- },
- keywordcolor: function keywordcolor() {
- var rgb = chunks[j].match(/^[a-z]+/);
- if (rgb && rgb[0] in SuperMap.CartoCSS.Tree.Reference.data.colors) {
- return new SuperMap.CartoCSS.Tree.Color(SuperMap.CartoCSS.Tree.Reference.data.colors[_match(/^[a-z]+/)]);
- }
- },
- // A Dimension, that is, a number and a unit. The only
- // unit that has an effect is %
- dimension: function dimension() {
- var c = input.charCodeAt(i);
- if (c > 57 || c < 45 || c === 47) {
- return;
- }
- var value = _match(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/);
- if (value) {
- return new SuperMap.CartoCSS.Tree.Dimension(value[1], value[2], memo);
- }
- }
- },
- // The variable part of a variable definition.
- // Used in the `rule` parser. Like @fink:
- variable: function variable() {
- var name;
- if (input.charAt(i) === '@' && (name = _match(/^(@[\w-]+)\s*:/))) {
- return name[1];
- }
- },
- // Entities are the smallest recognized token,
- // and can be found inside a rule's value.
- entity: function entity() {
- var property1 = _match(this.entities.call) || _match(this.entities.literal);
- var property2 = _match(this.entities.field) || _match(this.entities.variable);
- var property3 = _match(this.entities.url) || _match(this.entities.keyword);
- return property1 || property2 || property3;
- },
- // A Rule terminator. Note that we use `peek()` to check for '}',
- // because the `block` rule will be expecting it, but we still need to make sure
- // it's there, if ';' was ommitted.
- end: function end() {
- var q = ';';
- return _match(q) || peek('}');
- },
- // Elements are the building blocks for Selectors. They consist of
- // an element name, such as a tag a class, or `*`.
- //增加对中文的支持,[\u4e00-\u9fa5]
- element: function element() {
- var e = _match(/^(?:[.#][\w\u4e00-\u9fa5\-]+|\*|Map)/);
- if (e) {
- return new SuperMap.CartoCSS.Tree.Element(e);
- }
- },
- // Attachments allow adding multiple lines, polygons etc. to an
- // object. There can only be one attachment per selector.
- attachment: function attachment() {
- var s = _match(/^::([\w\-]+(?:\/[\w\-]+)*)/);
- if (s) {
- return s[1];
- }
- },
- // Selectors are made out of one or more Elements, see above.
- selector: function selector() {
- var a,
- attachment,
- e,
- elements = [],
- f,
- filters = new SuperMap.CartoCSS.Tree.Filterset(),
- z,
- zooms = [],
- segments = 0,
- conditions = 0;
- while ((e = _match(this.element)) || (z = _match(this.zoom)) || (f = _match(this.filter)) || (a = _match(this.attachment))) {
- segments++;
- if (e) {
- elements.push(e);
- } else if (z) {
- zooms.push(z);
- conditions++;
- } else if (f) {
- var err = filters.add(f);
- if (err) {
- throw makeError({
- message: err,
- index: i - 1
- });
- }
- conditions++;
- } else if (attachment) {
- throw makeError({
- message: 'Encountered second attachment name.',
- index: i - 1
- });
- } else {
- attachment = a;
- }
- var c = input.charAt(i);
- if (c === '{' || c === '}' || c === ';' || c === ',') {
- break;
- }
- }
- if (segments) {
- return new SuperMap.CartoCSS.Tree.Selector(filters, zooms, elements, attachment, conditions, memo);
- }
- },
- filter: function filter() {
- save();
- var key,
- op,
- val,
- l = '[',
- r = ']';
- if (!_match(l)) {
- return;
- }
- if (key = _match(/^[a-zA-Z0-9\-_]+/) || _match(this.entities.quoted) || _match(this.entities.variable) || _match(this.entities.keyword) || _match(this.entities.field)) {
- if (key instanceof SuperMap.CartoCSS.Tree.Quoted) {
- key = new SuperMap.CartoCSS.Tree.Field(key.toString());
- }
- 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))) {
- if (!_match(r)) {
- throw makeError({
- message: 'Missing closing ] of filter.',
- index: memo - 1
- });
- }
- if (!key.is) {
- key = new SuperMap.CartoCSS.Tree.Field(key);
- }
- return new SuperMap.CartoCSS.Tree.Filter(key, op, val, memo, env.filename);
- }
- }
- },
- zoom: function zoom() {
- save();
- var op,
- val,
- r = ']';
- if (_match(/^\[\s*zoom/g) && (op = _match(this.entities.comparison)) && (val = _match(this.entities.variable) || _match(this.entities.dimension)) && _match(r)) {
- return new SuperMap.CartoCSS.Tree.Zoom(op, val, memo);
- } else {
- // backtrack
- restore();
- }
- },
- // The `block` rule is used by `ruleset`
- // It's a wrapper around the `primary` rule, with added `{}`.
- block: function block() {
- var content,
- l = '{',
- r = '}';
- if (_match(l) && (content = _match(this.primary)) && _match(r)) {
- return content;
- }
- },
- // div, .class, body > p {...}
- ruleset: function ruleset() {
- var selectors = [],
- s,
- rules,
- q = ',';
- save();
- while (s = _match(this.selector)) {
- selectors.push(s);
- while (_match(this.comment)) {//NOSONAR
- }
- if (!_match(q)) {
- break;
- }
- while (_match(this.comment)) {//NOSONAR
- }
- }
- if (s) {
- while (_match(this.comment)) {//NOSONAR
- }
- }
- if (selectors.length > 0 && (rules = _match(this.block))) {
- if (selectors.length === 1 && selectors[0].elements.length && selectors[0].elements[0].value === 'Map') {
- var rs = new SuperMap.CartoCSS.Tree.Ruleset(selectors, rules);
- rs.isMap = true;
- return rs;
- }
- return new SuperMap.CartoCSS.Tree.Ruleset(selectors, rules);
- } else {
- // Backtrack
- restore();
- }
- },
- rule: function rule() {
- var name,
- value,
- c = input.charAt(i);
- save();
- if (c === '.' || c === '#') {
- return;
- }
- if (name = _match(this.variable) || _match(this.property)) {
- value = _match(this.value);
- if (value && _match(this.end)) {
- return new SuperMap.CartoCSS.Tree.Rule(name, value, memo, env.filename);
- } else {
- furthest = i;
- restore();
- }
- }
- },
- font: function font() {
- var value = [],
- expression = [],
- e,
- q = ',';
- while (e = _match(this.entity)) {
- expression.push(e);
- }
- value.push(new SuperMap.CartoCSS.Tree.Expression(expression));
- if (_match(q)) {
- while (e = _match(this.expression)) {
- value.push(e);
- if (!_match(q)) {
- break;
- }
- }
- }
- return new SuperMap.CartoCSS.Tree.Value(value);
- },
- // A Value is a comma-delimited list of Expressions
- // In a Rule, a Value represents everything after the `:`,
- // and before the `;`.
- value: function value() {
- var e,
- expressions = [],
- q = ',';
- while (e = _match(this.expression)) {
- expressions.push(e);
- if (!_match(q)) {
- break;
- }
- }
- if (expressions.length > 1) {
- return new SuperMap.CartoCSS.Tree.Value(expressions.map(function (e) {
- return e.value[0];
- }));
- } else if (expressions.length === 1) {
- return new SuperMap.CartoCSS.Tree.Value(expressions);
- }
- },
- // A sub-expression, contained by parenthensis
- sub: function sub() {
- var e,
- l = '(',
- r = ")";
- if (_match(l) && (e = _match(this.expression)) && _match(r)) {
- return e;
- }
- },
- // This is a misnomer because it actually handles multiplication
- // and division.
- multiplication: function multiplication() {
- var m,
- a,
- op,
- operation,
- q = '/';
- if (m = _match(this.operand)) {
- while ((op = _match(q) || _match('*') || _match('%')) && (a = _match(this.operand))) {
- operation = new SuperMap.CartoCSS.Tree.Operation(op, [operation || m, a], memo);
- }
- return operation || m;
- }
- },
- addition: function addition() {
- var m,
- a,
- op,
- operation,
- plus = '+';
- if (m = _match(this.multiplication)) {
- while ((op = _match(/^[-+]\s+/) || input.charAt(i - 1) != ' ' && (_match(plus) || _match('-'))) && (a = _match(this.multiplication))) {
- operation = new SuperMap.CartoCSS.Tree.Operation(op, [operation || m, a], memo);
- }
- return operation || m;
- }
- },
- // An operand is anything that can be part of an operation,
- // such as a Color, or a Variable
- operand: function operand() {
- return _match(this.sub) || _match(this.entity);
- },
- // Expressions either represent mathematical operations,
- // or white-space delimited Entities. @var * 2
- expression: function expression() {
- var e,
- entities = [];
- while (e = _match(this.addition) || _match(this.entity)) {
- entities.push(e);
- }
- if (entities.length > 0) {
- return new SuperMap.CartoCSS.Tree.Expression(entities);
- }
- },
- property: function property() {
- var name = _match(/^(([a-z][-a-z_0-9]*\/)?\*?-?[-a-z_0-9]+)\s*:/);
- if (name) {
- return name[1];
- }
- }
- }
- };
- return parser;
- }
- /**
- * @function SuperMap.CartoCSS.prototype.parse
- * @description 利用CartoCSS解析器里面的parse方法,将CartoCSS样式表字符串转化为CartoCSS规则集
- * @returns {Object} CartoCSS规则集
- */
- }, {
- key: "parse",
- value: function parse(str) {
- var parser = this.parser;
- var ruleSet = this.ruleSet = parser.parse(str);
- return ruleSet;
- }
- /**
- * @function SuperMap.CartoCSS.prototype.toShaders
- * @description 将CartoCSS规则集转化为着色器
- * @returns {Array} CartoCSS着色器集
- */
- }, {
- key: "toShaders",
- value: function toShaders() {
- if (this.ruleSet) {
- var ruleset = this.ruleSet;
- if (ruleset) {
- var defs = ruleset.toList(this.env);
- defs.reverse();
- var shaders = {};
- var keys = [];
- this._toShaders(shaders, keys, defs);
- var ordered_shaders = [];
- var done = {};
- for (var i = 0, len0 = defs.length; i < len0; ++i) {
- var def = defs[i];
- var k = def.attachment;
- var shader = shaders[keys[i]];
- var shaderArray = [];
- if (!done[k]) {
- var j = 0;
- for (var prop in shader) {
- if (prop !== 'zoom' && prop !== 'frames' && prop !== "attachment" && prop != "elements") {
- //对layer-index作特殊处理以实现图层的控制
- if (prop === "layer-index") {
- /*var getLayerIndex = Function("attributes", "zoom", "var _value = null;" + shader[prop].join('\n') + "; return _value; ");*/
- var getLayerIndex = function getLayerIndex(attributes, zoom) {
- //NOSONAR
- var _value = null;
- shader[prop].join('\n');
- return _value;
- };
- var layerIndex = getLayerIndex();
- Object.defineProperty(shaderArray, "layerIndex", {
- configurable: true,
- enumerable: false,
- value: layerIndex
- });
- } else {
- shaderArray[j++] = function (ops, shaderArray) {
- //NOSONAR
- if (!Array.isArray(ops)) {
- return ops;
- }
- var body = ops.join('\n');
- var myKeyword = 'attributes["FEATUREID"]&&attributes["FEATUREID"]';
- var index = body.indexOf(myKeyword);
- if (index >= 0) {
- //对featureID作一些特殊处理,以将featureID提取出来
- if (!shaderArray.featureFilter) {
- var featureFilterStart = index + myKeyword.length;
- var featureFilterEnd = body.indexOf(")", featureFilterStart + 1);
- var featureFilterStr = "featureId&&(featureId" + body.substring(featureFilterStart, featureFilterEnd) + ")";
- /*var featureFilter = Function("featureId", "if(" + featureFilterStr + "){return true;}return false;");*/
- var featureFilter = function featureFilter(featureId) {
- if (featureFilterStr) {
- return true;
- }
- return false;
- };
- Object.defineProperty(shaderArray, "featureFilter", {
- configurable: true,
- enumerable: false,
- value: featureFilter
- });
- }
- return {
- "property": prop,
- "getValue": Function("attributes", "zoom", "seftFilter", "var _value = null; var isExcute=typeof seftFilter=='function'?sefgFilter():seftFilter;if(isExcute){" + body + ";} return _value; ") //NOSONAR
- };
- } else {
- return {
- "property": prop,
- "getValue": Function("attributes", "zoom", "var _value = null;" + body + "; return _value; ") //NOSONAR
- };
- }
- }(shader[prop], shaderArray);
- }
- }
- }
- Object.defineProperty(shaderArray, "attachment", {
- configurable: true,
- enumerable: false,
- value: k
- });
- Object.defineProperty(shaderArray, "elements", {
- configurable: true,
- enumerable: false,
- value: def.elements
- });
- ordered_shaders.push(shaderArray);
- done[keys[i]] = true;
- }
- Object.defineProperty(shaderArray, "zoom", {
- configurable: true,
- enumerable: false,
- value: def.zoom
- }); //shader.frames.push(def.frame_offset);
- }
- return ordered_shaders;
- }
- }
- return null;
- }
- }, {
- key: "_toShaders",
- value: function _toShaders(shaders, keys, defs) {
- for (var i = 0, len0 = defs.length; i < len0; ++i) {
- var def = defs[i];
- var element_str = [];
- for (var j = 0, len1 = def.elements.length; j < len1; j++) {
- element_str.push(def.elements[j]);
- }
- var filters = def.filters.filters;
- var filterStr = [];
- for (var attr in filters) {
- filterStr.push(filters[attr].id);
- }
- var key = element_str.join("/") + "::" + def.attachment + "_" + filterStr.join("_");
- keys.push(key);
- var shader = shaders[key] = shaders[key] || {}; //shader.frames = [];
- shader.zoom = SuperMap.CartoCSS.Tree.Zoom.all;
- var props = def.toJS(this.env);
- for (var v in props) {
- (shader[v] = shader[v] || []).push(props[v].join('\n'));
- }
- }
- }
- /**
- * @function SuperMap.CartoCSS.prototype.getShaders
- * @description 获取CartoCSS着色器
- * @returns {Array} 着色器集
- * @example
- * //shaders的结构大概如下:
- * var shaders=[
- * {
- * attachment:"one",
- * elements:[],
- * zoom:23,
- * length:2,
- * 0:{property:"line-color",value:function(attribute,zoom){var _value=null;if(zoom){_value="#123456"}return _vlaue;}},
- * 1:{preoperty:"line-width",value:function(attribute,zoom){var _value=null;if(zoom){_value=3}return _vlaue;}}
- * },
- * {
- * attachment:"two",
- * elements:[],
- * zoom:23,
- * length:2,
- * 0:{property:"polygon-color",value:function(attribute,zoom){var _value=null;if(zoom){_value="#123456"}return _vlaue;}},
- * 1:{property:"line-width",value:function(attribute,zoom){var _value=null;if(zoom){_value=3}return _vlaue;}}
- * }
- * ];
- */
- }, {
- key: "getShaders",
- value: function getShaders() {
- return this.shaders;
- }
- /**
- * @function SuperMap.CartoCSS.prototype.destroy
- * @description CartoCSS解析对象的析构函数,用于销毁CartoCSS解析对象
- */
- }, {
- key: "destroy",
- value: function destroy() {
- this.cartoStr = null;
- this.env = null;
- this.ruleSet = null;
- this.parser = null;
- this.shaders = null;
- }
- }]);
- return CartoCSS;
- }();
- SuperMap._mapnik_reference_latest = {
- "version": "2.1.1",
- "style": {
- "filter-mode": {
- "type": ["all", "first"],
- "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)",
- "default-value": "all",
- "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."
- },
- "image-filters": {
- "css": "image-filters",
- "default-value": "none",
- "default-meaning": "no filters",
- "type": "functions",
- "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]],
- "doc": "A list of image filters."
- },
- "comp-op": {
- "css": "comp-op",
- "default-value": "src-over",
- "default-meaning": "add the current layer on top of other layers",
- "doc": "Composite operation. This defines how this layer should behave relative to layers atop or below it.",
- "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"]
- },
- "opacity": {
- "css": "opacity",
- "type": "float",
- "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)",
- "default-value": 1,
- "default-meaning": "no separate buffer will be used and no alpha will be applied to the style after rendering"
- }
- },
- "layer": {
- "name": {
- "default-value": "",
- "type": "string",
- "required": true,
- "default-meaning": "No layer name has been provided",
- "doc": "The name of a layer. Can be anything you wish and is not strictly validated, but ideally unique in the map"
- },
- "srs": {
- "default-value": "",
- "type": "string",
- "default-meaning": "No srs value is provided and the value will be inherited from the Map's srs",
- "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'"
- },
- "status": {
- "default-value": true,
- "type": "boolean",
- "default-meaning": "This layer will be marked as active and available for processing",
- "doc": "A property that can be set to false to disable this layer from being processed"
- },
- "minzoom": {
- "default-value": "0",
- "type": "float",
- "default-meaning": "The layer will be visible at the minimum possible scale",
- "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"
- },
- "maxzoom": {
- "default-value": "1.79769e+308",
- "type": "float",
- "default-meaning": "The layer will be visible at the maximum possible scale",
- "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"
- },
- "queryable": {
- "default-value": false,
- "type": "boolean",
- "default-meaning": "The layer will not be available for the direct querying of data values",
- "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"
- },
- "clear-label-cache": {
- "default-value": false,
- "type": "boolean",
- "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",
- "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"
- },
- "group-by": {
- "default-value": "",
- "type": "string",
- "default-meaning": "No special layer grouping will be used during rendering",
- "doc": "https://github.com/mapnik/mapnik/wiki/Grouped-rendering"
- },
- "buffer-size": {
- "default-value": "0",
- "type": "float",
- "default-meaning": "No buffer will be used",
- "doc": "Extra tolerance around the Layer extent (in pixels) used to when querying and (potentially) clipping the layer data during rendering"
- },
- "maximum-extent": {
- "default-value": "none",
- "type": "bbox",
- "default-meaning": "No clipping extent will be used",
- "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."
- }
- },
- "symbolizers": {
- "*": {
- "image-filters": {
- "css": "image-filters",
- "default-value": "none",
- "default-meaning": "no filters",
- "type": "functions",
- "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]],
- "doc": "A list of image filters."
- },
- "comp-op": {
- "css": "comp-op",
- "default-value": "src-over",
- "default-meaning": "add the current layer on top of other layers",
- "doc": "Composite operation. This defines how this layer should behave relative to layers atop or below it.",
- "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"]
- },
- "opacity": {
- "css": "opacity",
- "type": "float",
- "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)",
- "default-value": 1,
- "default-meaning": "no separate buffer will be used and no alpha will be applied to the style after rendering"
- }
- },
- "map": {
- "background-color": {
- "css": "background-color",
- "default-value": "none",
- "default-meaning": "transparent",
- "type": "color",
- "doc": "Map Background color"
- },
- "background-image": {
- "css": "background-image",
- "type": "uri",
- "default-value": "",
- "default-meaning": "transparent",
- "doc": "An image that is repeated below all features on a map as a background.",
- "description": "Map Background image"
- },
- "srs": {
- "css": "srs",
- "type": "string",
- "default-value": "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs",
- "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",
- "doc": "Map spatial reference (proj4 string)"
- },
- "buffer-size": {
- "css": "buffer-size",
- "default-value": "0",
- "type": "float",
- "default-meaning": "No buffer will be used",
- "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\"."
- },
- "maximum-extent": {
- "css": "",
- "default-value": "none",
- "type": "bbox",
- "default-meaning": "No clipping extent will be used",
- "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."
- },
- "base": {
- "css": "base",
- "default-value": "",
- "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.",
- "type": "string",
- "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."
- },
- "paths-from-xml": {
- "css": "",
- "default-value": true,
- "default-meaning": "Paths read from XML will be interpreted from the location of the XML",
- "type": "boolean",
- "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()"
- },
- "minimum-version": {
- "css": "",
- "default-value": "none",
- "default-meaning": "Mapnik version will not be detected and no error will be thrown about compatibility",
- "type": "string",
- "doc": "The minumum Mapnik version (e.g. 0.7.2) needed to use certain functionality in the stylesheet"
- },
- "font-directory": {
- "css": "font-directory",
- "type": "uri",
- "default-value": "none",
- "default-meaning": "No map-specific fonts will be registered",
- "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)."
- }
- },
- "polygon": {
- "fill": {
- "css": "polygon-fill",
- "type": "color",
- "default-value": "rgba(128,128,128,1)",
- "default-meaning": "gray and fully opaque (alpha = 1), same as rgb(128,128,128)",
- "doc": "Fill color to assign to a polygon"
- },
- "fill-opacity": {
- "css": "polygon-opacity",
- "type": "float",
- "doc": "The opacity of the polygon",
- "default-value": 1,
- "default-meaning": "opaque"
- },
- "gamma": {
- "css": "polygon-gamma",
- "type": "float",
- "default-value": 1,
- "default-meaning": "fully antialiased",
- "range": "0-1",
- "doc": "Level of antialiasing of polygon edges"
- },
- "gamma-method": {
- "css": "polygon-gamma-method",
- "type": ["power", "linear", "none", "threshold", "multiply"],
- "default-value": "power",
- "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",
- "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"
- },
- "clip": {
- "css": "polygon-clip",
- "type": "boolean",
- "default-value": true,
- "default-meaning": "geometry will be clipped to map bounds before rendering",
- "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."
- },
- "smooth": {
- "css": "polygon-smooth",
- "type": "float",
- "default-value": 0,
- "default-meaning": "no smoothing",
- "range": "0-1",
- "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
- },
- "geometry-transform": {
- "css": "polygon-geometry-transform",
- "type": "functions",
- "default-value": "none",
- "default-meaning": "geometry will not be transformed",
- "doc": "Allows transformation functions to be applied to the geometry.",
- "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
- },
- "comp-op": {
- "css": "polygon-comp-op",
- "default-value": "src-over",
- "default-meaning": "add the current symbolizer on top of other symbolizer",
- "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
- "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"]
- }
- },
- "line": {
- "stroke": {
- "css": "line-color",
- "default-value": "rgba(0,0,0,1)",
- "type": "color",
- "default-meaning": "black and fully opaque (alpha = 1), same as rgb(0,0,0)",
- "doc": "The color of a drawn line"
- },
- "stroke-width": {
- "css": "line-width",
- "default-value": 1,
- "type": "float",
- "doc": "The width of a line in pixels"
- },
- "stroke-opacity": {
- "css": "line-opacity",
- "default-value": 1,
- "type": "float",
- "default-meaning": "opaque",
- "doc": "The opacity of a line"
- },
- "stroke-linejoin": {
- "css": "line-join",
- "default-value": "miter",
- "type": ["miter", "round", "bevel"],
- "doc": "The behavior of lines when joining"
- },
- "stroke-linecap": {
- "css": "line-cap",
- "default-value": "butt",
- "type": ["butt", "round", "square"],
- "doc": "The display of line endings"
- },
- "stroke-gamma": {
- "css": "line-gamma",
- "type": "float",
- "default-value": 1,
- "default-meaning": "fully antialiased",
- "range": "0-1",
- "doc": "Level of antialiasing of stroke line"
- },
- "stroke-gamma-method": {
- "css": "line-gamma-method",
- "type": ["power", "linear", "none", "threshold", "multiply"],
- "default-value": "power",
- "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",
- "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"
- },
- "stroke-dasharray": {
- "css": "line-dasharray",
- "type": "numbers",
- "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.",
- "default-value": "none",
- "default-meaning": "solid line"
- },
- "stroke-dashoffset": {
- "css": "line-dash-offset",
- "type": "numbers",
- "doc": "valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled)",
- "default-value": "none",
- "default-meaning": "solid line"
- },
- "stroke-miterlimit": {
- "css": "line-miterlimit",
- "type": "float",
- "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.",
- "default-value": 4.0,
- "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 )'"
- },
- "clip": {
- "css": "line-clip",
- "type": "boolean",
- "default-value": true,
- "default-meaning": "geometry will be clipped to map bounds before rendering",
- "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."
- },
- "smooth": {
- "css": "line-smooth",
- "type": "float",
- "default-value": 0,
- "default-meaning": "no smoothing",
- "range": "0-1",
- "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
- },
- "offset": {
- "css": "line-offset",
- "type": "float",
- "default-value": 0,
- "default-meaning": "no offset",
- "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)."
- },
- "rasterizer": {
- "css": "line-rasterizer",
- "type": ["full", "fast"],
- "default-value": "full",
- "doc": "Exposes an alternate AGG rendering method that sacrifices some accuracy for speed."
- },
- "geometry-transform": {
- "css": "line-geometry-transform",
- "type": "functions",
- "default-value": "none",
- "default-meaning": "geometry will not be transformed",
- "doc": "Allows transformation functions to be applied to the geometry.",
- "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
- },
- "comp-op": {
- "css": "line-comp-op",
- "default-value": "src-over",
- "default-meaning": "add the current symbolizer on top of other symbolizer",
- "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
- "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"]
- }
- },
- "markers": {
- "file": {
- "css": "marker-file",
- "doc": "An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse.",
- "default-value": "",
- "default-meaning": "An ellipse or circle, if width equals height",
- "type": "uri"
- },
- "opacity": {
- "css": "marker-opacity",
- "doc": "The overall opacity of the marker, if set, overrides both the opacity of both the fill and stroke",
- "default-value": 1,
- "default-meaning": "The stroke-opacity and fill-opacity will be used",
- "type": "float"
- },
- "fill-opacity": {
- "css": "marker-fill-opacity",
- "doc": "The fill opacity of the marker",
- "default-value": 1,
- "default-meaning": "opaque",
- "type": "float"
- },
- "stroke": {
- "css": "marker-line-color",
- "doc": "The color of the stroke around a marker shape.",
- "default-value": "black",
- "type": "color"
- },
- "stroke-width": {
- "css": "marker-line-width",
- "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.",
- "type": "float"
- },
- "stroke-opacity": {
- "css": "marker-line-opacity",
- "default-value": 1,
- "default-meaning": "opaque",
- "doc": "The opacity of a line",
- "type": "float"
- },
- "placement": {
- "css": "marker-placement",
- "type": ["point", "line", "interior"],
- "default-value": "point",
- "default-meaning": "Place markers at the center point (centroid) of the geometry",
- "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"
- },
- "multi-policy": {
- "css": "marker-multi-policy",
- "type": ["each", "whole", "largest"],
- "default-value": "each",
- "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",
- "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)."
- },
- "marker-type": {
- "css": "marker-type",
- "type": ["arrow", "ellipse"],
- "default-value": "ellipse",
- "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)"
- },
- "width": {
- "css": "marker-width",
- "default-value": 10,
- "doc": "The width of the marker, if using one of the default types.",
- "type": "expression"
- },
- "height": {
- "css": "marker-height",
- "default-value": 10,
- "doc": "The height of the marker, if using one of the default types.",
- "type": "expression"
- },
- "fill": {
- "css": "marker-fill",
- "default-value": "blue",
- "doc": "The color of the area of the marker.",
- "type": "color"
- },
- "allow-overlap": {
- "css": "marker-allow-overlap",
- "type": "boolean",
- "default-value": false,
- "doc": "Control whether overlapping markers are shown or hidden.",
- "default-meaning": "Do not allow makers to overlap with each other - overlapping markers will not be shown."
- },
- "ignore-placement": {
- "css": "marker-ignore-placement",
- "type": "boolean",
- "default-value": false,
- "default-meaning": "do not store the bbox of this geometry in the collision detector cache",
- "doc": "value to control whether the placement of the feature will prevent the placement of other features"
- },
- "spacing": {
- "css": "marker-spacing",
- "doc": "Space between repeated labels",
- "default-value": 100,
- "type": "float"
- },
- "max-error": {
- "css": "marker-max-error",
- "type": "float",
- "default-value": 0.2,
- "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."
- },
- "transform": {
- "css": "marker-transform",
- "type": "functions",
- "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]],
- "default-value": "",
- "default-meaning": "No transformation",
- "doc": "SVG transformation definition"
- },
- "clip": {
- "css": "marker-clip",
- "type": "boolean",
- "default-value": true,
- "default-meaning": "geometry will be clipped to map bounds before rendering",
- "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."
- },
- "smooth": {
- "css": "marker-smooth",
- "type": "float",
- "default-value": 0,
- "default-meaning": "no smoothing",
- "range": "0-1",
- "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
- },
- "geometry-transform": {
- "css": "marker-geometry-transform",
- "type": "functions",
- "default-value": "none",
- "default-meaning": "geometry will not be transformed",
- "doc": "Allows transformation functions to be applied to the geometry.",
- "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
- },
- "comp-op": {
- "css": "marker-comp-op",
- "default-value": "src-over",
- "default-meaning": "add the current symbolizer on top of other symbolizer",
- "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
- "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"]
- }
- },
- "shield": {
- "name": {
- "css": "shield-name",
- "type": "expression",
- "serialization": "content",
- "doc": "Value to use for a shield\"s text label. Data columns are specified using brackets like [column_name]"
- },
- "file": {
- "css": "shield-file",
- "required": true,
- "type": "uri",
- "default-value": "none",
- "doc": "Image file to render behind the shield text"
- },
- "face-name": {
- "css": "shield-face-name",
- "type": "string",
- "validate": "font",
- "doc": "Font name and style to use for the shield text",
- "default-value": "",
- "required": true
- },
- "unlock-image": {
- "css": "shield-unlock-image",
- "type": "boolean",
- "doc": "This parameter should be set to true if you are trying to position text beside rather than on top of the shield image",
- "default-value": false,
- "default-meaning": "text alignment relative to the shield image uses the center of the image as the anchor for text positioning."
- },
- "size": {
- "css": "shield-size",
- "type": "float",
- "doc": "The size of the shield text in pixels"
- },
- "fill": {
- "css": "shield-fill",
- "type": "color",
- "doc": "The color of the shield text"
- },
- "placement": {
- "css": "shield-placement",
- "type": ["point", "line", "vertex", "interior"],
- "default-value": "point",
- "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."
- },
- "avoid-edges": {
- "css": "shield-avoid-edges",
- "doc": "Tell positioning algorithm to avoid labeling near intersection edges.",
- "type": "boolean",
- "default-value": false
- },
- "allow-overlap": {
- "css": "shield-allow-overlap",
- "type": "boolean",
- "default-value": false,
- "doc": "Control whether overlapping shields are shown or hidden.",
- "default-meaning": "Do not allow shields to overlap with other map elements already placed."
- },
- "minimum-distance": {
- "css": "shield-min-distance",
- "type": "float",
- "default-value": 0,
- "doc": "Minimum distance to the next shield symbol, not necessarily the same shield."
- },
- "spacing": {
- "css": "shield-spacing",
- "type": "float",
- "default-value": 0,
- "doc": "The spacing between repeated occurrences of the same shield on a line"
- },
- "minimum-padding": {
- "css": "shield-min-padding",
- "default-value": 0,
- "doc": "Determines the minimum amount of padding that a shield gets relative to other shields",
- "type": "float"
- },
- "wrap-width": {
- "css": "shield-wrap-width",
- "type": "unsigned",
- "default-value": 0,
- "doc": "Length of a chunk of text in characters before wrapping text"
- },
- "wrap-before": {
- "css": "shield-wrap-before",
- "type": "boolean",
- "default-value": false,
- "doc": "Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."
- },
- "wrap-character": {
- "css": "shield-wrap-character",
- "type": "string",
- "default-value": " ",
- "doc": "Use this character instead of a space to wrap long names."
- },
- "halo-fill": {
- "css": "shield-halo-fill",
- "type": "color",
- "default-value": "#FFFFFF",
- "default-meaning": "white",
- "doc": "Specifies the color of the halo around the text."
- },
- "halo-radius": {
- "css": "shield-halo-radius",
- "doc": "Specify the radius of the halo in pixels",
- "default-value": 0,
- "default-meaning": "no halo",
- "type": "float"
- },
- "character-spacing": {
- "css": "shield-character-spacing",
- "type": "unsigned",
- "default-value": 0,
- "doc": "Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."
- },
- "line-spacing": {
- "css": "shield-line-spacing",
- "doc": "Vertical spacing between lines of multiline labels (in pixels)",
- "type": "unsigned"
- },
- "dx": {
- "css": "shield-text-dx",
- "type": "float",
- "doc": "Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
- "default-value": 0
- },
- "dy": {
- "css": "shield-text-dy",
- "type": "float",
- "doc": "Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
- "default-value": 0
- },
- "shield-dx": {
- "css": "shield-dx",
- "type": "float",
- "doc": "Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
- "default-value": 0
- },
- "shield-dy": {
- "css": "shield-dy",
- "type": "float",
- "doc": "Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
- "default-value": 0
- },
- "opacity": {
- "css": "shield-opacity",
- "type": "float",
- "doc": "(Default 1.0) - opacity of the image used for the shield",
- "default-value": 1
- },
- "text-opacity": {
- "css": "shield-text-opacity",
- "type": "float",
- "doc": "(Default 1.0) - opacity of the text placed on top of the shield",
- "default-value": 1
- },
- "horizontal-alignment": {
- "css": "shield-horizontal-alignment",
- "type": ["left", "middle", "right", "auto"],
- "doc": "The shield's horizontal alignment from its centerpoint",
- "default-value": "auto"
- },
- "vertical-alignment": {
- "css": "shield-vertical-alignment",
- "type": ["top", "middle", "bottom", "auto"],
- "doc": "The shield's vertical alignment from its centerpoint",
- "default-value": "middle"
- },
- "text-transform": {
- "css": "shield-text-transform",
- "type": ["none", "uppercase", "lowercase", "capitalize"],
- "doc": "Transform the case of the characters",
- "default-value": "none"
- },
- "justify-alignment": {
- "css": "shield-justify-alignment",
- "type": ["left", "center", "right", "auto"],
- "doc": "Define how text in a shield's label is justified",
- "default-value": "auto"
- },
- "clip": {
- "css": "shield-clip",
- "type": "boolean",
- "default-value": true,
- "default-meaning": "geometry will be clipped to map bounds before rendering",
- "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."
- },
- "comp-op": {
- "css": "shield-comp-op",
- "default-value": "src-over",
- "default-meaning": "add the current symbolizer on top of other symbolizer",
- "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
- "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"]
- }
- },
- "line-pattern": {
- "file": {
- "css": "line-pattern-file",
- "type": "uri",
- "default-value": "none",
- "required": true,
- "doc": "An image file to be repeated and warped along a line"
- },
- "clip": {
- "css": "line-pattern-clip",
- "type": "boolean",
- "default-value": true,
- "default-meaning": "geometry will be clipped to map bounds before rendering",
- "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."
- },
- "smooth": {
- "css": "line-pattern-smooth",
- "type": "float",
- "default-value": 0,
- "default-meaning": "no smoothing",
- "range": "0-1",
- "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
- },
- "geometry-transform": {
- "css": "line-pattern-geometry-transform",
- "type": "functions",
- "default-value": "none",
- "default-meaning": "geometry will not be transformed",
- "doc": "Allows transformation functions to be applied to the geometry.",
- "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
- },
- "comp-op": {
- "css": "line-pattern-comp-op",
- "default-value": "src-over",
- "default-meaning": "add the current symbolizer on top of other symbolizer",
- "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
- "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"]
- }
- },
- "polygon-pattern": {
- "file": {
- "css": "polygon-pattern-file",
- "type": "uri",
- "default-value": "none",
- "required": true,
- "doc": "Image to use as a repeated pattern fill within a polygon"
- },
- "alignment": {
- "css": "polygon-pattern-alignment",
- "type": ["local", "global"],
- "default-value": "local",
- "doc": "Specify whether to align pattern fills to the layer or to the map."
- },
- "gamma": {
- "css": "polygon-pattern-gamma",
- "type": "float",
- "default-value": 1,
- "default-meaning": "fully antialiased",
- "range": "0-1",
- "doc": "Level of antialiasing of polygon pattern edges"
- },
- "opacity": {
- "css": "polygon-pattern-opacity",
- "type": "float",
- "doc": "(Default 1.0) - Apply an opacity level to the image used for the pattern",
- "default-value": 1,
- "default-meaning": "The image is rendered without modifications"
- },
- "clip": {
- "css": "polygon-pattern-clip",
- "type": "boolean",
- "default-value": true,
- "default-meaning": "geometry will be clipped to map bounds before rendering",
- "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."
- },
- "smooth": {
- "css": "polygon-pattern-smooth",
- "type": "float",
- "default-value": 0,
- "default-meaning": "no smoothing",
- "range": "0-1",
- "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
- },
- "geometry-transform": {
- "css": "polygon-pattern-geometry-transform",
- "type": "functions",
- "default-value": "none",
- "default-meaning": "geometry will not be transformed",
- "doc": "Allows transformation functions to be applied to the geometry.",
- "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
- },
- "comp-op": {
- "css": "polygon-pattern-comp-op",
- "default-value": "src-over",
- "default-meaning": "add the current symbolizer on top of other symbolizer",
- "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
- "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"]
- }
- },
- "raster": {
- "opacity": {
- "css": "raster-opacity",
- "default-value": 1,
- "default-meaning": "opaque",
- "type": "float",
- "doc": "The opacity of the raster symbolizer on top of other symbolizers."
- },
- "filter-factor": {
- "css": "raster-filter-factor",
- "default-value": -1,
- "default-meaning": "Allow the datasource to choose appropriate downscaling.",
- "type": "float",
- "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."
- },
- "scaling": {
- "css": "raster-scaling",
- "type": ["near", "fast", "bilinear", "bilinear8", "bicubic", "spline16", "spline36", "hanning", "hamming", "hermite", "kaiser", "quadric", "catrom", "gaussian", "bessel", "mitchell", "sinc", "lanczos", "blackman"],
- "default-value": "near",
- "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."
- },
- "mesh-size": {
- "css": "raster-mesh-size",
- "default-value": 16,
- "default-meaning": "Reprojection mesh will be 1/16 of the resolution of the source image",
- "type": "unsigned",
- "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."
- },
- "comp-op": {
- "css": "raster-comp-op",
- "default-value": "src-over",
- "default-meaning": "add the current symbolizer on top of other symbolizer",
- "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
- "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"]
- }
- },
- "point": {
- "file": {
- "css": "point-file",
- "type": "uri",
- "required": false,
- "default-value": "none",
- "doc": "Image file to represent a point"
- },
- "allow-overlap": {
- "css": "point-allow-overlap",
- "type": "boolean",
- "default-value": false,
- "doc": "Control whether overlapping points are shown or hidden.",
- "default-meaning": "Do not allow points to overlap with each other - overlapping markers will not be shown."
- },
- "ignore-placement": {
- "css": "point-ignore-placement",
- "type": "boolean",
- "default-value": false,
- "default-meaning": "do not store the bbox of this geometry in the collision detector cache",
- "doc": "value to control whether the placement of the feature will prevent the placement of other features"
- },
- "opacity": {
- "css": "point-opacity",
- "type": "float",
- "default-value": 1.0,
- "default-meaning": "Fully opaque",
- "doc": "A value from 0 to 1 to control the opacity of the point"
- },
- "placement": {
- "css": "point-placement",
- "type": ["centroid", "interior"],
- "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.",
- "default-value": "centroid"
- },
- "transform": {
- "css": "point-transform",
- "type": "functions",
- "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]],
- "default-value": "",
- "default-meaning": "No transformation",
- "doc": "SVG transformation definition"
- },
- "comp-op": {
- "css": "point-comp-op",
- "default-value": "src-over",
- "default-meaning": "add the current symbolizer on top of other symbolizer",
- "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
- "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"]
- }
- },
- "text": {
- "name": {
- "css": "text-name",
- "type": "expression",
- "required": true,
- "default-value": "",
- "serialization": "content",
- "doc": "Value to use for a text label. Data columns are specified using brackets like [column_name]"
- },
- "face-name": {
- "css": "text-face-name",
- "type": "string",
- "validate": "font",
- "doc": "Font name and style to render a label in",
- "required": true
- },
- "size": {
- "css": "text-size",
- "type": "float",
- "default-value": 10,
- "doc": "Text size in pixels"
- },
- "text-ratio": {
- "css": "text-ratio",
- "doc": "Define the amount of text (of the total) present on successive lines when wrapping occurs",
- "default-value": 0,
- "type": "unsigned"
- },
- "wrap-width": {
- "css": "text-wrap-width",
- "doc": "Length of a chunk of text in characters before wrapping text",
- "default-value": 0,
- "type": "unsigned"
- },
- "wrap-before": {
- "css": "text-wrap-before",
- "type": "boolean",
- "default-value": false,
- "doc": "Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."
- },
- "wrap-character": {
- "css": "text-wrap-character",
- "type": "string",
- "default-value": " ",
- "doc": "Use this character instead of a space to wrap long text."
- },
- "spacing": {
- "css": "text-spacing",
- "type": "unsigned",
- "doc": "Distance between repeated text labels on a line (aka. label-spacing)"
- },
- "character-spacing": {
- "css": "text-character-spacing",
- "type": "float",
- "default-value": 0,
- "doc": "Horizontal spacing adjustment between characters in pixels"
- },
- "line-spacing": {
- "css": "text-line-spacing",
- "default-value": 0,
- "type": "unsigned",
- "doc": "Vertical spacing adjustment between lines in pixels"
- },
- "label-position-tolerance": {
- "css": "text-label-position-tolerance",
- "default-value": 0,
- "type": "unsigned",
- "doc": "Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line)"
- },
- "max-char-angle-delta": {
- "css": "text-max-char-angle-delta",
- "type": "float",
- "default-value": "22.5",
- "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."
- },
- "fill": {
- "css": "text-fill",
- "doc": "Specifies the color for the text",
- "default-value": "#000000",
- "type": "color"
- },
- "opacity": {
- "css": "text-opacity",
- "doc": "A number from 0 to 1 specifying the opacity for the text",
- "default-value": 1.0,
- "default-meaning": "Fully opaque",
- "type": "float"
- },
- "halo-fill": {
- "css": "text-halo-fill",
- "type": "color",
- "default-value": "#FFFFFF",
- "default-meaning": "white",
- "doc": "Specifies the color of the halo around the text."
- },
- "halo-radius": {
- "css": "text-halo-radius",
- "doc": "Specify the radius of the halo in pixels",
- "default-value": 0,
- "default-meaning": "no halo",
- "type": "float"
- },
- "dx": {
- "css": "text-dx",
- "type": "float",
- "doc": "Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
- "default-value": 0
- },
- "dy": {
- "css": "text-dy",
- "type": "float",
- "doc": "Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
- "default-value": 0
- },
- "vertical-alignment": {
- "css": "text-vertical-alignment",
- "type": ["top", "middle", "bottom", "auto"],
- "doc": "Position of label relative to point position.",
- "default-value": "auto",
- "default-meaning": "Default affected by value of dy; \"bottom\" for dy>0, \"top\" for dy<0."
- },
- "avoid-edges": {
- "css": "text-avoid-edges",
- "doc": "Tell positioning algorithm to avoid labeling near intersection edges.",
- "default-value": false,
- "type": "boolean"
- },
- "minimum-distance": {
- "css": "text-min-distance",
- "doc": "Minimum permitted distance to the next text symbolizer.",
- "type": "float"
- },
- "minimum-padding": {
- "css": "text-min-padding",
- "doc": "Determines the minimum amount of padding that a text symbolizer gets relative to other text",
- "type": "float"
- },
- "minimum-path-length": {
- "css": "text-min-path-length",
- "type": "float",
- "default-value": 0,
- "default-meaning": "place labels on all paths",
- "doc": "Place labels only on paths longer than this value."
- },
- "allow-overlap": {
- "css": "text-allow-overlap",
- "type": "boolean",
- "default-value": false,
- "doc": "Control whether overlapping text is shown or hidden.",
- "default-meaning": "Do not allow text to overlap with other text - overlapping markers will not be shown."
- },
- "orientation": {
- "css": "text-orientation",
- "type": "expression",
- "doc": "Rotate the text."
- },
- "placement": {
- "css": "text-placement",
- "type": ["point", "line", "vertex", "interior"],
- "default-value": "point",
- "doc": "Control the style of placement of a point versus the geometry it is attached to."
- },
- "placement-type": {
- "css": "text-placement-type",
- "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.",
- "type": ["dummy", "simple"],
- "default-value": "dummy"
- },
- "placements": {
- "css": "text-placements",
- "type": "string",
- "default-value": "",
- "doc": "If \"placement-type\" is set to \"simple\", use this \"POSITIONS,[SIZES]\" string. An example is `text-placements: \"E,NE,SE,W,NW,SW\";` "
- },
- "text-transform": {
- "css": "text-transform",
- "type": ["none", "uppercase", "lowercase", "capitalize"],
- "doc": "Transform the case of the characters",
- "default-value": "none"
- },
- "horizontal-alignment": {
- "css": "text-horizontal-alignment",
- "type": ["left", "middle", "right", "auto"],
- "doc": "The text's horizontal alignment from its centerpoint",
- "default-value": "auto"
- },
- "justify-alignment": {
- "css": "text-align",
- "type": ["left", "right", "center", "auto"],
- "doc": "Define how text is justified",
- "default-value": "auto",
- "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"
- },
- "clip": {
- "css": "text-clip",
- "type": "boolean",
- "default-value": true,
- "default-meaning": "geometry will be clipped to map bounds before rendering",
- "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."
- },
- "comp-op": {
- "css": "text-comp-op",
- "default-value": "src-over",
- "default-meaning": "add the current symbolizer on top of other symbolizer",
- "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
- "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"]
- }
- },
- "building": {
- "fill": {
- "css": "building-fill",
- "default-value": "#FFFFFF",
- "doc": "The color of the buildings walls.",
- "type": "color"
- },
- "fill-opacity": {
- "css": "building-fill-opacity",
- "type": "float",
- "doc": "The opacity of the building as a whole, including all walls.",
- "default-value": 1
- },
- "height": {
- "css": "building-height",
- "doc": "The height of the building in pixels.",
- "type": "expression",
- "default-value": "0"
- }
- }
- },
- "colors": {
- "aliceblue": [240, 248, 255],
- "antiquewhite": [250, 235, 215],
- "aqua": [0, 255, 255],
- "aquamarine": [127, 255, 212],
- "azure": [240, 255, 255],
- "beige": [245, 245, 220],
- "bisque": [255, 228, 196],
- "black": [0, 0, 0],
- "blanchedalmond": [255, 235, 205],
- "blue": [0, 0, 255],
- "blueviolet": [138, 43, 226],
- "brown": [165, 42, 42],
- "burlywood": [222, 184, 135],
- "cadetblue": [95, 158, 160],
- "chartreuse": [127, 255, 0],
- "chocolate": [210, 105, 30],
- "coral": [255, 127, 80],
- "cornflowerblue": [100, 149, 237],
- "cornsilk": [255, 248, 220],
- "crimson": [220, 20, 60],
- "cyan": [0, 255, 255],
- "darkblue": [0, 0, 139],
- "darkcyan": [0, 139, 139],
- "darkgoldenrod": [184, 134, 11],
- "darkgray": [169, 169, 169],
- "darkgreen": [0, 100, 0],
- "darkgrey": [169, 169, 169],
- "darkkhaki": [189, 183, 107],
- "darkmagenta": [139, 0, 139],
- "darkolivegreen": [85, 107, 47],
- "darkorange": [255, 140, 0],
- "darkorchid": [153, 50, 204],
- "darkred": [139, 0, 0],
- "darksalmon": [233, 150, 122],
- "darkseagreen": [143, 188, 143],
- "darkslateblue": [72, 61, 139],
- "darkslategrey": [47, 79, 79],
- "darkturquoise": [0, 206, 209],
- "darkviolet": [148, 0, 211],
- "deeppink": [255, 20, 147],
- "deepskyblue": [0, 191, 255],
- "dimgray": [105, 105, 105],
- "dimgrey": [105, 105, 105],
- "dodgerblue": [30, 144, 255],
- "firebrick": [178, 34, 34],
- "floralwhite": [255, 250, 240],
- "forestgreen": [34, 139, 34],
- "fuchsia": [255, 0, 255],
- "gainsboro": [220, 220, 220],
- "ghostwhite": [248, 248, 255],
- "gold": [255, 215, 0],
- "goldenrod": [218, 165, 32],
- "gray": [128, 128, 128],
- "grey": [128, 128, 128],
- "green": [0, 128, 0],
- "greenyellow": [173, 255, 47],
- "honeydew": [240, 255, 240],
- "hotpink": [255, 105, 180],
- "indianred": [205, 92, 92],
- "indigo": [75, 0, 130],
- "ivory": [255, 255, 240],
- "khaki": [240, 230, 140],
- "lavender": [230, 230, 250],
- "lavenderblush": [255, 240, 245],
- "lawngreen": [124, 252, 0],
- "lemonchiffon": [255, 250, 205],
- "lightblue": [173, 216, 230],
- "lightcoral": [240, 128, 128],
- "lightcyan": [224, 255, 255],
- "lightgoldenrodyellow": [250, 250, 210],
- "lightgray": [211, 211, 211],
- "lightgreen": [144, 238, 144],
- "lightgrey": [211, 211, 211],
- "lightpink": [255, 182, 193],
- "lightsalmon": [255, 160, 122],
- "lightseagreen": [32, 178, 170],
- "lightskyblue": [135, 206, 250],
- "lightslategray": [119, 136, 153],
- "lightslategrey": [119, 136, 153],
- "lightsteelblue": [176, 196, 222],
- "lightyellow": [255, 255, 224],
- "lime": [0, 255, 0],
- "limegreen": [50, 205, 50],
- "linen": [250, 240, 230],
- "magenta": [255, 0, 255],
- "maroon": [128, 0, 0],
- "mediumaquamarine": [102, 205, 170],
- "mediumblue": [0, 0, 205],
- "mediumorchid": [186, 85, 211],
- "mediumpurple": [147, 112, 219],
- "mediumseagreen": [60, 179, 113],
- "mediumslateblue": [123, 104, 238],
- "mediumspringgreen": [0, 250, 154],
- "mediumturquoise": [72, 209, 204],
- "mediumvioletred": [199, 21, 133],
- "midnightblue": [25, 25, 112],
- "mintcream": [245, 255, 250],
- "mistyrose": [255, 228, 225],
- "moccasin": [255, 228, 181],
- "navajowhite": [255, 222, 173],
- "navy": [0, 0, 128],
- "oldlace": [253, 245, 230],
- "olive": [128, 128, 0],
- "olivedrab": [107, 142, 35],
- "orange": [255, 165, 0],
- "orangered": [255, 69, 0],
- "orchid": [218, 112, 214],
- "palegoldenrod": [238, 232, 170],
- "palegreen": [152, 251, 152],
- "paleturquoise": [175, 238, 238],
- "palevioletred": [219, 112, 147],
- "papayawhip": [255, 239, 213],
- "peachpuff": [255, 218, 185],
- "peru": [205, 133, 63],
- "pink": [255, 192, 203],
- "plum": [221, 160, 221],
- "powderblue": [176, 224, 230],
- "purple": [128, 0, 128],
- "red": [255, 0, 0],
- "rosybrown": [188, 143, 143],
- "royalblue": [65, 105, 225],
- "saddlebrown": [139, 69, 19],
- "salmon": [250, 128, 114],
- "sandybrown": [244, 164, 96],
- "seagreen": [46, 139, 87],
- "seashell": [255, 245, 238],
- "sienna": [160, 82, 45],
- "silver": [192, 192, 192],
- "skyblue": [135, 206, 235],
- "slateblue": [106, 90, 205],
- "slategray": [112, 128, 144],
- "slategrey": [112, 128, 144],
- "snow": [255, 250, 250],
- "springgreen": [0, 255, 127],
- "steelblue": [70, 130, 180],
- "tan": [210, 180, 140],
- "teal": [0, 128, 128],
- "thistle": [216, 191, 216],
- "tomato": [255, 99, 71],
- "turquoise": [64, 224, 208],
- "violet": [238, 130, 238],
- "wheat": [245, 222, 179],
- "white": [255, 255, 255],
- "whitesmoke": [245, 245, 245],
- "yellow": [255, 255, 0],
- "yellowgreen": [154, 205, 50],
- "transparent": [0, 0, 0, 0]
- },
- "filter": {
- "value": ["true", "false", "null", "point", "linestring", "polygon", "collection"]
- }
- };
- CartoCSS['mapnik_reference'] = {
- version: {
- latest: SuperMap._mapnik_reference_latest,
- '2.1.1': SuperMap._mapnik_reference_latest
- }
- };
- SuperMap.CartoCSS = CartoCSS;
- SuperMap.CartoCSS.Tree = {};
- SuperMap.CartoCSS.Tree.operate = function (op, a, b) {
- switch (op) {
- case '+':
- return a + b;
- case '-':
- return a - b;
- case '*':
- return a * b;
- case '%':
- return a % b;
- case '/':
- return a / b;
- }
- };
- SuperMap.CartoCSS.Tree.functions = {
- rgb: function rgb(r, g, b) {
- return this.rgba(r, g, b, 1.0);
- },
- rgba: function rgba(r, g, b, a) {
- var me = this;
- var rgb = [r, g, b].map(function (c) {
- return me.number(c);
- });
- a = me.number(a);
- if (rgb.some(isNaN) || isNaN(a)) {
- return null;
- }
- return new SuperMap.CartoCSS.Tree.Color(rgb, a);
- },
- // Only require val
- stop: function stop(val) {
- var color, mode;
- if (arguments.length > 1) {
- color = arguments[1];
- }
- if (arguments.length > 2) {
- mode = arguments[2];
- }
- return {
- is: 'tag',
- val: val,
- color: color,
- mode: mode,
- toString: function toString(env) {
- return '\n\t<stop value="' + val.ev(env) + '"' + (color ? ' color="' + color.ev(env) + '" ' : '') + (mode ? ' mode="' + mode.ev(env) + '" ' : '') + '/>';
- }
- };
- },
- hsl: function hsl(h, s, l) {
- return this.hsla(h, s, l, 1.0);
- },
- hsla: function hsla(h, s, l, a) {
- h = this.number(h) % 360 / 360;
- s = this.number(s);
- l = this.number(l);
- a = this.number(a);
- if ([h, s, l, a].some(isNaN)) {
- return null;
- }
- var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s,
- m1 = l * 2 - m2;
- return this.rgba(hue(h + 1 / 3) * 255, hue(h) * 255, hue(h - 1 / 3) * 255, a);
- function hue(h) {
- h = h < 0 ? h + 1 : h > 1 ? h - 1 : h;
- if (h * 6 < 1) {
- return m1 + (m2 - m1) * h * 6;
- } else if (h * 2 < 1) {
- return m2;
- } else if (h * 3 < 2) {
- return m1 + (m2 - m1) * (2 / 3 - h) * 6;
- } else {
- return m1;
- }
- }
- },
- hue: function hue(color) {
- if (!('toHSL' in color)) {
- return null;
- }
- return new SuperMap.CartoCSS.Tree.Dimension(Math.round(color.toHSL().h));
- },
- saturation: function saturation(color) {
- if (!('toHSL' in color)) {
- return null;
- }
- return new SuperMap.CartoCSS.Tree.Dimension(Math.round(color.toHSL().s * 100), '%');
- },
- lightness: function lightness(color) {
- if (!('toHSL' in color)) {
- return null;
- }
- return new SuperMap.CartoCSS.Tree.Dimension(Math.round(color.toHSL().l * 100), '%');
- },
- alpha: function alpha(color) {
- if (!('toHSL' in color)) {
- return null;
- }
- return new SuperMap.CartoCSS.Tree.Dimension(color.toHSL().a);
- },
- saturate: function saturate(color, amount) {
- if (!('toHSL' in color)) {
- return null;
- }
- var hsl = color.toHSL();
- hsl.s += amount.value / 100;
- hsl.s = this.clamp(hsl.s);
- return this.hsla_simple(hsl);
- },
- desaturate: function desaturate(color, amount) {
- if (!('toHSL' in color)) {
- return null;
- }
- var hsl = color.toHSL();
- hsl.s -= amount.value / 100;
- hsl.s = this.clamp(hsl.s);
- return this.hsla_simple(hsl);
- },
- lighten: function lighten(color, amount) {
- if (!('toHSL' in color)) {
- return null;
- }
- var hsl = color.toHSL();
- hsl.l += amount.value / 100;
- hsl.l = this.clamp(hsl.l);
- return this.hsla_simple(hsl);
- },
- darken: function darken(color, amount) {
- if (!('toHSL' in color)) {
- return null;
- }
- var hsl = color.toHSL();
- hsl.l -= amount.value / 100;
- hsl.l = this.clamp(hsl.l);
- return this.hsla_simple(hsl);
- },
- fadein: function fadein(color, amount) {
- if (!('toHSL' in color)) {
- return null;
- }
- var hsl = color.toHSL();
- hsl.a += amount.value / 100;
- hsl.a = this.clamp(hsl.a);
- return this.hsla_simple(hsl);
- },
- fadeout: function fadeout(color, amount) {
- if (!('toHSL' in color)) {
- return null;
- }
- var hsl = color.toHSL();
- hsl.a -= amount.value / 100;
- hsl.a = this.clamp(hsl.a);
- return this.hsla_simple(hsl);
- },
- spin: function spin(color, amount) {
- if (!('toHSL' in color)) {
- return null;
- }
- var hsl = color.toHSL();
- var hue = (hsl.h + amount.value) % 360;
- hsl.h = hue < 0 ? 360 + hue : hue;
- return this.hsla_simple(hsl);
- },
- replace: function replace(entity, a, b) {
- if (entity.is === 'field') {
- return entity.toString + '.replace(' + a.toString() + ', ' + b.toString() + ')';
- } else {
- return entity.replace(a, b);
- }
- },
- //
- // Copyright (c) 2006-2009 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein
- // http://sass-lang.com
- //
- mix: function mix(color1, color2, weight) {
- var p = weight.value / 100.0;
- var w = p * 2 - 1;
- var a = color1.toHSL().a - color2.toHSL().a;
- var w1 = ((w * a == -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
- var w2 = 1 - w1;
- 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];
- var alpha = color1.alpha * p + color2.alpha * (1 - p);
- return new SuperMap.CartoCSS.Tree.Color(rgb, alpha);
- },
- greyscale: function greyscale(color) {
- return this.desaturate(color, new SuperMap.CartoCSS.Tree.Dimension(100));
- },
- '%': function _(quoted
- /* arg, arg, ...*/
- ) {
- var args = Array.prototype.slice.call(arguments, 1),
- str = quoted.value;
- for (var i = 0; i < args.length; i++) {
- str = str.replace(/%s/, args[i].value).replace(/%[da]/, args[i].toString());
- }
- str = str.replace(/%%/g, '%');
- return new SuperMap.CartoCSS.Tree.Quoted(str);
- },
- hsla_simple: function hsla_simple(h) {
- return this.hsla(h.h, h.s, h.l, h.a);
- },
- number: function number(n) {
- if (n instanceof SuperMap.CartoCSS.Tree.Dimension) {
- return parseFloat(n.unit === '%' ? n.value / 100 : n.value);
- } else if (typeof n === 'number') {
- return n;
- } else {
- return NaN;
- }
- },
- clamp: function clamp(val) {
- return Math.min(1, Math.max(0, val));
- }
- };
- SuperMap.CartoCSS.Tree.Call = /*#__PURE__*/function () {
- function Call(name, args, index) {
- CartoCSS_classCallCheck(this, Call);
- this.is = 'call';
- this.name = name;
- this.args = args;
- this.index = index;
- } // When evuating a function call,
- // we either find the function in `tree.functions` [1],
- // in which case we call it, passing the evaluated arguments,
- // or we simply print it out as it appeared originally [2].
- // The *functions.js* file contains the built-in functions.
- // The reason why we evaluate the arguments, is in the case where
- // we try to pass a variable to a function, like: `saturate(@color)`.
- // The function should receive the value, not the variable.
- CartoCSS_createClass(Call, [{
- key: 'ev',
- value: function ev(env) {
- var args = this.args.map(function (a) {
- return a.ev(env);
- });
- for (var i = 0; i < args.length; i++) {
- if (args[i].is === 'undefined') {
- return {
- is: 'undefined',
- value: 'undefined'
- };
- }
- }
- if (this.name in SuperMap.CartoCSS.Tree.functions) {
- if (SuperMap.CartoCSS.Tree.functions[this.name].length <= args.length) {
- var val = SuperMap.CartoCSS.Tree.functions[this.name].apply(SuperMap.CartoCSS.Tree.functions, args);
- if (val === null) {
- env.error({
- message: 'incorrect arguments given to ' + this.name + '()',
- index: this.index,
- type: 'runtime',
- filename: this.filename
- });
- return {
- is: 'undefined',
- value: 'undefined'
- };
- }
- return val;
- } else {
- env.error({
- message: 'incorrect number of arguments for ' + this.name + '(). ' + SuperMap.CartoCSS.Tree.functions[this.name].length + ' expected.',
- index: this.index,
- type: 'runtime',
- filename: this.filename
- });
- return {
- is: 'undefined',
- value: 'undefined'
- };
- }
- } else {
- var fn = SuperMap.CartoCSS.Tree.Reference.mapnikFunctions[this.name];
- if (fn === undefined) {
- var functions = lodash_topairs_default()(SuperMap.CartoCSS.Tree.Reference.mapnikFunctions); // cheap closest, needs improvement.
- var name = this.name;
- var mean = functions.map(function (f) {
- return [f[0], SuperMap.CartoCSS.Tree.Reference.editDistance(name, f[0]), f[1]];
- }).sort(function (a, b) {
- return a[1] - b[1];
- });
- env.error({
- message: 'unknown function ' + this.name + '(), did you mean ' + mean[0][0] + '(' + mean[0][2] + ')',
- index: this.index,
- type: 'runtime',
- filename: this.filename
- });
- return {
- is: 'undefined',
- value: 'undefined'
- };
- }
- if (fn !== args.length && // support variable-arg functions like `colorize-alpha`
- fn !== -1) {
- env.error({
- message: 'function ' + this.name + '() takes ' + fn + ' arguments and was given ' + args.length,
- index: this.index,
- type: 'runtime',
- filename: this.filename
- });
- return {
- is: 'undefined',
- value: 'undefined'
- };
- } else {
- // Save the evaluated versions of arguments
- this.args = args;
- return this;
- }
- }
- }
- }, {
- key: "toString",
- value: function toString(env, format) {
- if (this.args.length) {
- return this.name + '(' + this.args.join(',') + ')';
- } else {
- return this.name;
- }
- }
- }]);
- return Call;
- }();
- SuperMap.CartoCSS.Tree.Color = /*#__PURE__*/function () {
- function Color(rgb, a) {
- CartoCSS_classCallCheck(this, Color);
- this.is = 'color'; // The end goal here, is to parse the arguments
- // into an integer triplet, such as `128, 255, 0`
- //
- // This facilitates operations and conversions.
- if (Array.isArray(rgb)) {
- this.rgb = rgb.slice(0, 3);
- } else if (rgb.length == 6) {
- this.rgb = rgb.match(/.{2}/g).map(function (c) {
- return parseInt(c, 16);
- });
- } else {
- this.rgb = rgb.split('').map(function (c) {
- return parseInt(c + c, 16);
- });
- }
- if (typeof a === 'number') {
- this.alpha = a;
- } else if (rgb.length === 4) {
- this.alpha = rgb[3];
- } else {
- this.alpha = 1;
- }
- }
- CartoCSS_createClass(Color, [{
- key: 'ev',
- value: function ev() {
- return this;
- } // If we have some transparency, the only way to represent it
- // is via `rgba`. Otherwise, we use the hex representation,
- // which has better compatibility with older browsers.
- // Values are capped between `0` and `255`, rounded and zero-padded.
- }, {
- key: "toString",
- value: function toString() {
- /* if (this.alpha < 1.0) {*/
- return 'rgba(' + this.rgb.map(function (c) {
- return Math.round(c);
- }).concat(this.alpha).join(', ') + ')';
- /*} else {
- return '#' + this.rgb.map(function(i) {
- i = Math.round(i);
- i = (i > 255 ? 255 : (i < 0 ? 0 : i)).toString(16);
- return i.length === 1 ? '0' + i : i;
- }).join('');
- }*/
- } // Operations have to be done per-channel, if not,
- // channels will spill onto each other. Once we have
- // our result, in the form of an integer triplet,
- // we create a new Color node to hold the result.
- }, {
- key: "operate",
- value: function operate(env, op, other) {
- var result = [];
- if (!(other instanceof SuperMap.CartoCSS.Tree.Color)) {
- other = other.toColor();
- }
- for (var c = 0; c < 3; c++) {
- result[c] = SuperMap.CartoCSS.Tree.operate(op, this.rgb[c], other.rgb[c]);
- }
- return new SuperMap.CartoCSS.Tree.Color(result);
- }
- }, {
- key: "toHSL",
- value: function toHSL() {
- var r = this.rgb[0] / 255,
- g = this.rgb[1] / 255,
- b = this.rgb[2] / 255,
- a = this.alpha;
- var max = Math.max(r, g, b),
- min = Math.min(r, g, b);
- var h,
- s,
- l = (max + min) / 2,
- d = max - min;
- if (max === min) {
- h = s = 0;
- } else {
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
- switch (max) {
- case r:
- h = (g - b) / d + (g < b ? 6 : 0);
- break;
- case g:
- h = (b - r) / d + 2;
- break;
- case b:
- h = (r - g) / d + 4;
- break;
- default:
- break;
- }
- h /= 6;
- }
- return {
- h: h * 360,
- s: s,
- l: l,
- a: a
- };
- }
- }]);
- return Color;
- }();
- SuperMap.CartoCSS.Tree.Comment = /*#__PURE__*/function () {
- function Comment(value, silent) {
- CartoCSS_classCallCheck(this, Comment);
- this.value = value;
- this.silent = !!silent;
- }
- CartoCSS_createClass(Comment, [{
- key: "toString",
- value: function toString(env) {
- return '<!--' + this.value + '-->';
- }
- }, {
- key: 'ev',
- value: function ev() {
- return this;
- }
- }]);
- return Comment;
- }();
- SuperMap.CartoCSS.Tree.Definition = /*#__PURE__*/function () {
- function Definition(selector, rules) {
- CartoCSS_classCallCheck(this, Definition);
- this.elements = selector.elements; //assert.ok(selector.filters instanceof SuperMap.CartoCSS.Tree.Filterset);
- this.rules = rules;
- this.ruleIndex = {};
- for (var i = 0; i < this.rules.length; i++) {
- if ('zoom' in this.rules[i]) {
- this.rules[i] = this.rules[i].clone();
- }
- this.rules[i].zoom = selector.zoom;
- this.ruleIndex[this.rules[i].updateID()] = true;
- }
- this.filters = selector.filters;
- this.zoom = selector.zoom;
- this.attachment = selector.attachment || '__default__';
- this.specificity = selector.specificity();
- }
- CartoCSS_createClass(Definition, [{
- key: "toString",
- value: function toString() {
- var str = this.filters.toString();
- for (var i = 0; i < this.rules.length; i++) {
- str += '\n ' + this.rules[i];
- }
- return str;
- }
- }, {
- key: "toJS",
- value: function toJS(env) {
- var shaderAttrs = {}; // merge conditions from filters with zoom condition of the
- // definition
- var zoom = this.zoom; //var frame_offset = this.frame_offset;
- var _if = this.filters.toJS(env);
- var filters = [zoom];
- if (_if) {
- filters.push(_if);
- } //if(frame_offset) filters.push('ctx["frame-offset"] === ' + frame_offset);
- _if = filters.join(" && ");
- function eachRule(rule) {
- if (rule instanceof SuperMap.CartoCSS.Tree.Rule) {
- shaderAttrs[rule.name] = shaderAttrs[rule.name] || [];
- if (_if) {
- shaderAttrs[rule.name].push("if(" + _if + "){" + rule.value.toJS(env) + "}");
- } else {
- shaderAttrs[rule.name].push(rule.value.toJS(env));
- }
- } else {
- if (rule instanceof SuperMap.CartoCSS.Tree.Ruleset) {
- var sh = rule.toJS(env);
- for (var v in sh) {
- shaderAttrs[v] = shaderAttrs[v] || [];
- for (var attr in sh[v]) {
- shaderAttrs[v].push(sh[v][attr]);
- }
- }
- }
- }
- }
- for (var id in this.rules) {
- eachRule(this.rules[id]);
- }
- return shaderAttrs;
- }
- }]);
- return Definition;
- }();
- SuperMap.CartoCSS.Tree.Dimension = /*#__PURE__*/function () {
- function Dimension(value, unit, index) {
- CartoCSS_classCallCheck(this, Dimension);
- this.is = 'float';
- this.physical_units = ['m', 'cm', 'in', 'mm', 'pt', 'pc'];
- this.screen_units = ['px', '%'];
- this.all_units = ['m', 'cm', 'in', 'mm', 'pt', 'pc', 'px', '%'];
- this.densities = {
- m: 0.0254,
- mm: 25.4,
- cm: 2.54,
- pt: 72,
- pc: 6
- };
- this.value = parseFloat(value);
- this.unit = unit || null;
- this.index = index;
- }
- CartoCSS_createClass(Dimension, [{
- key: "ev",
- value: function ev(env) {
- if (this.unit && this.all_units.indexOf(this.unit) < 0) {
- env.error({
- message: "Invalid unit: '" + this.unit + "'",
- index: this.index
- });
- return {
- is: 'undefined',
- value: 'undefined'
- };
- } // normalize units which are not px or %
- if (this.unit && this.physical_units.indexOf(this.unit) >= 0) {
- if (!env.ppi) {
- env.error({
- message: "ppi is not set, so metric units can't be used",
- index: this.index
- });
- return {
- is: 'undefined',
- value: 'undefined'
- };
- } // convert all units to inch
- // convert inch to px using ppi
- this.value = this.value / this.densities[this.unit] * env.ppi;
- this.unit = 'px';
- }
- return this;
- }
- }, {
- key: "toColor",
- value: function toColor() {
- return new SuperMap.CartoCSS.Tree.Color([this.value, this.value, this.value]);
- }
- }, {
- key: "round",
- value: function round() {
- this.value = Math.round(this.value);
- return this;
- }
- }, {
- key: "toString",
- value: function toString() {
- return this.value.toString();
- }
- }, {
- key: "operate",
- value: function operate(env, op, other) {
- if (this.unit === '%' && other.unit !== '%') {
- env.error({
- message: 'If two operands differ, the first must not be %',
- index: this.index
- });
- return {
- is: 'undefined',
- value: 'undefined'
- };
- }
- if (this.unit !== '%' && other.unit === '%') {
- if (op === '*' || op === '/' || op === '%') {
- env.error({
- message: 'Percent values can only be added or subtracted from other values',
- index: this.index
- });
- return {
- is: 'undefined',
- value: 'undefined'
- };
- }
- return new SuperMap.CartoCSS.Tree.Dimension(SuperMap.CartoCSS.Tree.operate(op, this.value, this.value * other.value * 0.01), this.unit);
- } //here the operands are either the same (% or undefined or px), or one is undefined and the other is px
- return new SuperMap.CartoCSS.Tree.Dimension(SuperMap.CartoCSS.Tree.operate(op, this.value, other.value), this.unit || other.unit);
- }
- }]);
- return Dimension;
- }();
- SuperMap.CartoCSS.Tree.Element = /*#__PURE__*/function () {
- function Element(value) {
- CartoCSS_classCallCheck(this, Element);
- this.value = value.trim();
- if (this.value[0] === '#') {
- this.type = 'id';
- this.clean = this.value.replace(/^#/, '');
- }
- if (this.value[0] === '.') {
- this.type = 'class';
- this.clean = this.value.replace(/^\./, '');
- }
- if (this.value.indexOf('*') !== -1) {
- this.type = 'wildcard';
- }
- }
- CartoCSS_createClass(Element, [{
- key: "specificity",
- value: function specificity() {
- return [this.type === 'id' ? 1 : 0, // a
- this.type === 'class' ? 1 : 0 // b
- ];
- }
- }, {
- key: "toString",
- value: function toString() {
- return this.value;
- }
- }]);
- return Element;
- }();
- SuperMap.CartoCSS.Tree.Expression = /*#__PURE__*/function () {
- function Expression(value) {
- CartoCSS_classCallCheck(this, Expression);
- this.is = 'expression';
- this.value = value;
- }
- CartoCSS_createClass(Expression, [{
- key: "ev",
- value: function ev(env) {
- if (this.value.length > 1) {
- return new SuperMap.CartoCSS.Tree.Expression(this.value.map(function (e) {
- return e.ev(env);
- }));
- } else {
- return this.value[0].ev(env);
- }
- }
- }, {
- key: "toString",
- value: function toString(env) {
- return this.value.map(function (e) {
- return e.toString(env);
- }).join(' ');
- }
- }]);
- return Expression;
- }();
- SuperMap.CartoCSS.Tree.Field = /*#__PURE__*/function () {
- function Field(content) {
- CartoCSS_classCallCheck(this, Field);
- this.is = 'field';
- this.value = content || '';
- }
- CartoCSS_createClass(Field, [{
- key: "toString",
- value: function toString() {
- return '["' + this.value.toUpperCase() + '"]';
- }
- }, {
- key: 'ev',
- value: function ev() {
- return this;
- }
- }]);
- return Field;
- }();
- SuperMap.CartoCSS.Tree.Filter = /*#__PURE__*/function () {
- function Filter(key, op, val, index, filename) {
- CartoCSS_classCallCheck(this, Filter);
- this.ops = {
- '<': [' < ', 'numeric'],
- '>': [' > ', 'numeric'],
- '=': [' = ', 'both'],
- '!=': [' != ', 'both'],
- '<=': [' <= ', 'numeric'],
- '>=': [' >= ', 'numeric'],
- '=~': ['.match(', 'string', ')']
- };
- this.key = key;
- this.op = op;
- this.val = val;
- this.index = index;
- this.filename = filename;
- this.id = this.key + this.op + this.val;
- }
- CartoCSS_createClass(Filter, [{
- key: "ev",
- value: function ev(env) {
- this.key = this.key.ev(env);
- this.val = this.val.ev(env);
- return this;
- }
- }, {
- key: "toString",
- value: function toString() {
- return '[' + this.id + ']';
- }
- }]);
- return Filter;
- }();
- SuperMap.CartoCSS.Tree.Filterset = /*#__PURE__*/function () {
- function Filterset() {
- CartoCSS_classCallCheck(this, Filterset);
- this.filters = {};
- }
- CartoCSS_createClass(Filterset, [{
- key: "toJS",
- value: function toJS(env) {
- function eachFilter(filter) {
- var op = filter.op;
- if (op === "=") {
- op = "==";
- }
- var val = filter.val;
- if (filter._val !== undefined) {
- val = filter._val.toString(true);
- } //对scale进行特殊处理,将值转换成数值
- if (filter.key && filter.key.value === 'scale') {
- val = +val;
- } else if (typeof val === 'string' || CartoCSS_typeof(val) === 'object') {
- val = "'" + val + "'";
- }
- var attrs = "attributes";
- return attrs + "&&" + attrs + filter.key + "&&" + attrs + filter.key + " " + op + val;
- }
- var results = [];
- for (var id in this.filters) {
- results.push(eachFilter(this.filters[id]));
- }
- return results.join(' && ');
- }
- }, {
- key: "toString",
- value: function toString() {
- var arr = [];
- for (var id in this.filters) {
- arr.push(this.filters[id].id);
- }
- return arr.sort().join('\t');
- }
- }, {
- key: "ev",
- value: function ev(env) {
- for (var i in this.filters) {
- this.filters[i].ev(env);
- }
- return this;
- }
- }, {
- key: "clone",
- value: function clone() {
- var clone = new SuperMap.CartoCSS.Tree.Filterset();
- for (var id in this.filters) {
- clone.filters[id] = this.filters[id];
- }
- return clone;
- }
- }, {
- key: "cloneWith",
- value: function cloneWith(other) {
- var additions = [];
- for (var id in other.filters) {
- var status = this.addable(other.filters[id]); // status is true, false or null. if it's null we don't fail this
- // clone nor do we add the filter.
- if (status === false) {
- return false;
- }
- if (status === true) {
- // Adding the filter will override another value.
- additions.push(other.filters[id]);
- }
- } // Adding the other filters doesn't make this filterset invalid, but it
- // doesn't add anything to it either.
- if (!additions.length) {
- return null;
- } // We can successfully add all filters. Now clone the filterset and add the
- // new rules.
- var clone = new SuperMap.CartoCSS.Tree.Filterset(); // We can add the rules that are already present without going through the
- // add function as a Filterset is always in it's simplest canonical form.
- for (id in this.filters) {
- clone.filters[id] = this.filters[id];
- } // Only add new filters that actually change the filter.
- while (id = additions.shift()) {
- clone.add(id);
- }
- return clone;
- }
- }, {
- key: "addable",
- value: function addable(filter) {
- var key = filter.key.toString(),
- value = filter.val.toString();
- if (value.match(/^[0-9]+(\.[0-9]*)?_match/)) {
- value = parseFloat(value);
- }
- switch (filter.op) {
- case '=':
- // if there is already foo= and we're adding foo=
- if (this.filters[key + '='] !== undefined) {
- if (this.filters[key + '='].val.toString() != value) {
- return false;
- } else {
- return null;
- }
- }
- if (this.filters[key + '!=' + value] !== undefined) {
- return false;
- }
- if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
- return false;
- }
- if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
- return false;
- }
- if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
- return false;
- }
- if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
- return false;
- }
- return true;
- case '=~':
- return true;
- case '!=':
- if (this.filters[key + '='] !== undefined) {
- return this.filters[key + '='].val === value ? false : null;
- }
- if (this.filters[key + '!=' + value] !== undefined) {
- return null;
- }
- if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
- return null;
- }
- if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
- return null;
- }
- if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
- return null;
- }
- if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
- return null;
- }
- return true;
- case '>':
- if (key + '=' in this.filters) {
- if (this.filters[key + '='].val <= value) {
- return false;
- } else {
- return null;
- }
- }
- if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
- return false;
- }
- if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val <= value) {
- return false;
- }
- if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
- return null;
- }
- if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
- return null;
- }
- return true;
- case '>=':
- if (this.filters[key + '='] !== undefined) {
- return this.filters[key + '='].val < value ? false : null;
- }
- if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
- return false;
- }
- if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
- return false;
- }
- if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
- return null;
- }
- if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val >= value) {
- return null;
- }
- return true;
- case '<':
- if (this.filters[key + '='] !== undefined) {
- return this.filters[key + '='].val >= value ? false : null;
- }
- if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
- return false;
- }
- if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val >= value) {
- return false;
- }
- if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
- return null;
- }
- if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
- return null;
- }
- return true;
- case '<=':
- if (this.filters[key + '='] !== undefined) {
- return this.filters[key + '='].val > value ? false : null;
- }
- if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
- return false;
- }
- if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
- return false;
- }
- if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
- return null;
- }
- if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val <= value) {
- return null;
- }
- return true;
- default:
- break;
- }
- }
- }, {
- key: "conflict",
- value: function conflict(filter) {
- var key = filter.key.toString(),
- value = filter.val.toString();
- if (!isNaN(parseFloat(value))) {
- value = parseFloat(value);
- } // if (a=b) && (a=c)
- // if (a=b) && (a!=b)
- // or (a!=b) && (a=b)
- 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()) {
- return filter.toString() + ' added to ' + this.toString() + ' produces an invalid filter';
- }
- return false;
- }
- }, {
- key: "add",
- value: function add(filter, env) {
- var key = filter.key.toString(),
- op = filter.op,
- conflict = this.conflict(filter),
- numval;
- if (conflict) {
- return conflict;
- }
- if (op === '=') {
- for (var i in this.filters) {
- if (this.filters[i].key === key) {
- delete this.filters[i];
- }
- }
- this.filters[key + '='] = filter;
- } else if (op === '!=') {
- this.filters[key + '!=' + filter.val] = filter;
- } else if (op === '=~') {
- this.filters[key + '=~' + filter.val] = filter;
- } else if (op === '>') {
- // If there are other filters that are also >
- // but are less than this one, they don't matter, so
- // remove them.
- for (var j in this.filters) {
- if (this.filters[j].key === key && this.filters[j].val <= filter.val) {
- delete this.filters[j];
- }
- }
- this.filters[key + '>'] = filter;
- } else if (op === '>=') {
- for (var k in this.filters) {
- numval = +this.filters[k].val.toString();
- if (this.filters[k].key === key && numval < filter.val) {
- delete this.filters[k];
- }
- }
- if (this.filters[key + '!=' + filter.val] !== undefined) {
- delete this.filters[key + '!=' + filter.val];
- filter.op = '>';
- this.filters[key + '>'] = filter;
- } else {
- this.filters[key + '>='] = filter;
- }
- } else if (op === '<') {
- for (var l in this.filters) {
- numval = +this.filters[l].val.toString();
- if (this.filters[l].key === key && numval >= filter.val) {
- delete this.filters[l];
- }
- }
- this.filters[key + '<'] = filter;
- } else if (op === '<=') {
- for (var m in this.filters) {
- numval = +this.filters[m].val.toString();
- if (this.filters[m].key === key && numval > filter.val) {
- delete this.filters[m];
- }
- }
- if (this.filters[key + '!=' + filter.val] !== undefined) {
- delete this.filters[key + '!=' + filter.val];
- filter.op = '<';
- this.filters[key + '<'] = filter;
- } else {
- this.filters[key + '<='] = filter;
- }
- }
- }
- }]);
- return Filterset;
- }();
- SuperMap.CartoCSS.Tree.Fontset = function Fontset(env, fonts) {
- CartoCSS_classCallCheck(this, Fontset);
- this.fonts = fonts;
- this.name = 'fontset-' + env.effects.length;
- };
- SuperMap.CartoCSS.Tree.Invalid = /*#__PURE__*/function () {
- function Invalid(chunk, index, message) {
- CartoCSS_classCallCheck(this, Invalid);
- this.is = 'invalid';
- this.chunk = chunk;
- this.index = index;
- this.type = 'syntax';
- this.message = message || "Invalid code: " + this.chunk;
- }
- CartoCSS_createClass(Invalid, [{
- key: "ev",
- value: function ev(env) {
- env.error({
- chunk: this.chunk,
- index: this.index,
- type: 'syntax',
- message: this.message || "Invalid code: " + this.chunk
- });
- return {
- is: 'undefined'
- };
- }
- }]);
- return Invalid;
- }();
- SuperMap.CartoCSS.Tree.Keyword = /*#__PURE__*/function () {
- CartoCSS_createClass(Keyword, [{
- key: "ev",
- value: function ev() {
- return this;
- }
- }]);
- function Keyword(value) {
- CartoCSS_classCallCheck(this, Keyword);
- this.value = value;
- var special = {
- 'transparent': 'color',
- 'true': 'boolean',
- 'false': 'boolean'
- };
- this.is = special[value] ? special[value] : 'keyword';
- }
- CartoCSS_createClass(Keyword, [{
- key: "toString",
- value: function toString() {
- return this.value;
- }
- }]);
- return Keyword;
- }();
- /*Layer:class Invalid ),*/
- SuperMap.CartoCSS.Tree.Literal = /*#__PURE__*/function () {
- function Literal(content) {
- CartoCSS_classCallCheck(this, Literal);
- this.value = content || '';
- this.is = 'field';
- }
- CartoCSS_createClass(Literal, [{
- key: "toString",
- value: function toString() {
- return this.value;
- }
- }, {
- key: 'ev',
- value: function ev() {
- return this;
- }
- }]);
- return Literal;
- }();
- SuperMap.CartoCSS.Tree.Operation = /*#__PURE__*/function () {
- function Operation(op, operands, index) {
- CartoCSS_classCallCheck(this, Operation);
- this.is = 'operation';
- this.op = op.trim();
- this.operands = operands;
- this.index = index;
- }
- CartoCSS_createClass(Operation, [{
- key: "ev",
- value: function ev(env) {
- var a = this.operands[0].ev(env),
- b = this.operands[1].ev(env),
- temp;
- if (a.is === 'undefined' || b.is === 'undefined') {
- return {
- is: 'undefined',
- value: 'undefined'
- };
- }
- if (a instanceof SuperMap.CartoCSS.Tree.Dimension && b instanceof SuperMap.CartoCSS.Tree.Color) {
- if (this.op === '*' || this.op === '+') {
- temp = b;
- b = a;
- a = temp;
- } else {
- env.error({
- name: "OperationError",
- message: "Can't substract or divide a color from a number",
- index: this.index
- });
- }
- } // Only concatenate plain strings, because this is easily
- // pre-processed
- if (a instanceof SuperMap.CartoCSS.Tree.Quoted && b instanceof SuperMap.CartoCSS.Tree.Quoted && this.op !== '+') {
- env.error({
- message: "Can't subtract, divide, or multiply strings.",
- index: this.index,
- type: 'runtime',
- filename: this.filename
- });
- return {
- is: 'undefined',
- value: 'undefined'
- };
- } // Fields, literals, dimensions, and quoted strings can be combined.
- 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) {
- if (a.is === 'color' || b.is === 'color') {
- env.error({
- message: "Can't subtract, divide, or multiply colors in expressions.",
- index: this.index,
- type: 'runtime',
- filename: this.filename
- });
- return {
- is: 'undefined',
- value: 'undefined'
- };
- } else {
- return new SuperMap.CartoCSS.Tree.Literal(a.ev(env).toString(true) + this.op + b.ev(env).toString(true));
- }
- }
- if (a.operate === undefined) {
- env.error({
- message: 'Cannot do math with type ' + a.is + '.',
- index: this.index,
- type: 'runtime',
- filename: this.filename
- });
- return {
- is: 'undefined',
- value: 'undefined'
- };
- }
- return a.operate(env, this.op, b);
- }
- }]);
- return Operation;
- }();
- SuperMap.CartoCSS.Tree.Quoted = /*#__PURE__*/function () {
- function Quoted(content) {
- CartoCSS_classCallCheck(this, Quoted);
- this.is = 'string';
- this.value = content || '';
- }
- CartoCSS_createClass(Quoted, [{
- key: "toString",
- value: function toString(quotes) {
- var escapedValue = this.value.replace(/&/g, '&');
- var xmlvalue = escapedValue.replace(/\'/g, '\\\'').replace(/\"/g, '"').replace(/</g, '<').replace(/\>/g, '>');
- return quotes === true ? "'" + xmlvalue + "'" : escapedValue;
- }
- }, {
- key: "ev",
- value: function ev() {
- return this;
- }
- }, {
- key: "operate",
- value: function operate(env, op, other) {
- return new SuperMap.CartoCSS.Tree.Quoted(SuperMap.CartoCSS.Tree.operate(op, this.toString(), other.toString(this.contains_field)));
- }
- }]);
- return Quoted;
- }();
- SuperMap.CartoCSS.Tree.Reference = {
- _validateValue: {
- 'font': function font(env, value) {
- if (env.validation_data && env.validation_data.fonts) {
- return env.validation_data.fonts.indexOf(value) != -1;
- } else {
- return true;
- }
- }
- },
- setData: function setData(data) {
- this.data = data;
- this.selector_cache = generateSelectorCache(data);
- this.mapnikFunctions = generateMapnikFunctions(data);
- this.required_cache = generateRequiredProperties(data);
- function generateSelectorCache(data) {
- var index = {};
- for (var i in data.symbolizers) {
- for (var j in data.symbolizers[i]) {
- if (data.symbolizers[i][j].hasOwnProperty('css')) {
- index[data.symbolizers[i][j].css] = [data.symbolizers[i][j], i, j];
- }
- }
- }
- return index;
- }
- function generateMapnikFunctions(data) {
- var functions = {};
- for (var i in data.symbolizers) {
- for (var j in data.symbolizers[i]) {
- if (data.symbolizers[i][j].type === 'functions') {
- for (var k = 0; k < data.symbolizers[i][j].functions.length; k++) {
- var fn = data.symbolizers[i][j].functions[k];
- functions[fn[0]] = fn[1];
- }
- }
- }
- }
- return functions;
- }
- function generateRequiredProperties(data) {
- var cache = {};
- for (var symbolizer_name in data.symbolizers) {
- cache[symbolizer_name] = [];
- for (var j in data.symbolizers[symbolizer_name]) {
- if (data.symbolizers[symbolizer_name][j].required) {
- cache[symbolizer_name].push(data.symbolizers[symbolizer_name][j].css);
- }
- }
- }
- return cache;
- }
- },
- setVersion: function setVersion(version) {
- if (SuperMap.CartoCSS.mapnik_reference.version.hasOwnProperty(version)) {
- this.setData(SuperMap.CartoCSS.mapnik_reference.version[version]);
- return true;
- }
- return false;
- },
- selectorData: function selectorData(selector, i) {
- if (this.selector_cache && this.selector_cache[selector]) {
- return this.selector_cache[selector][i];
- }
- },
- validSelector: function validSelector(selector) {
- return !!this.selector_cache[selector];
- },
- selectorName: function selectorName(selector) {
- return this.selectorData(selector, 2);
- },
- selector: function selector(_selector) {
- return this.selectorData(_selector, 0);
- },
- symbolizer: function symbolizer(selector) {
- return this.selectorData(selector, 1);
- },
- requiredProperties: function requiredProperties(symbolizer_name, rules) {
- var req = this.required_cache[symbolizer_name];
- for (var i in req) {
- if (!(req[i] in rules)) {
- return 'Property ' + req[i] + ' required for defining ' + symbolizer_name + ' styles.';
- }
- }
- },
- isFont: function isFont(selector) {
- return this.selector(selector).validate === 'font';
- },
- editDistance: function editDistance(a, b) {
- if (a.length === 0) {
- return b.length;
- }
- if (b.length === 0) {
- return a.length;
- }
- var matrix = [];
- for (var i = 0; i <= b.length; i++) {
- matrix[i] = [i];
- }
- for (var j = 0; j <= a.length; j++) {
- matrix[0][j] = j;
- }
- for (i = 1; i <= b.length; i++) {
- for (j = 1; j <= a.length; j++) {
- if (b.charAt(i - 1) === a.charAt(j - 1)) {
- matrix[i][j] = matrix[i - 1][j - 1];
- } else {
- matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution
- Math.min(matrix[i][j - 1] + 1, // insertion
- matrix[i - 1][j] + 1)); // deletion
- }
- }
- }
- return matrix[b.length][a.length];
- },
- validValue: function validValue(env, selector, value) {
- function validateFunctions(value, selector) {
- if (value.value[0].is === 'string') {
- return true;
- }
- for (var i in value.value) {
- for (var j in value.value[i].value) {
- if (value.value[i].value[j].is !== 'call') {
- return false;
- }
- var f = find(this.selector(selector).functions, function (x) {
- //NOSONAR
- return x[0] === value.value[i].value[j].name;
- });
- if (!(f && f[1] === -1)) {
- // This filter is unknown or given an incorrect number of arguments
- if (!f || f[1] !== value.value[i].value[j].args.length) {
- return false;
- }
- }
- }
- }
- return true;
- }
- function validateKeyword(value, selector) {
- if (CartoCSS_typeof(this.selector(selector).type) === 'object') {
- return this.selector(selector).type.indexOf(value.value[0].value) !== -1;
- } else {
- // allow unquoted keywords as strings
- return this.selector(selector).type === 'string';
- }
- }
- var i;
- if (!this.selector(selector)) {
- return false;
- } else if (value.value[0].is === 'keyword') {
- return validateKeyword(value, selector);
- } else if (value.value[0].is === 'undefined') {
- // caught earlier in the chain - ignore here so that
- // error is not overridden
- return true;
- } else if (this.selector(selector).type === 'numbers') {
- for (i in value.value) {
- if (value.value[i].is !== 'float') {
- return false;
- }
- }
- return true;
- } else if (this.selector(selector).type === 'tags') {
- if (!value.value) {
- return false;
- }
- if (!value.value[0].value) {
- return value.value[0].is === 'tag';
- }
- for (i = 0; i < value.value[0].value.length; i++) {
- if (value.value[0].value[i].is !== 'tag') {
- return false;
- }
- }
- return true;
- } else if (this.selector(selector).type == 'functions') {
- // For backwards compatibility, you can specify a string for `functions`-compatible
- // values, though they will not be validated.
- return validateFunctions(value, selector);
- } else if (this.selector(selector).type === 'expression') {
- return true;
- } else if (this.selector(selector).type === 'unsigned') {
- if (value.value[0].is === 'float') {
- value.value[0].round();
- return true;
- } else {
- return false;
- }
- } else {
- if (this.selector(selector).validate) {
- var valid = false;
- for (i = 0; i < value.value.length; i++) {
- if (this.selector(selector).type === value.value[i].is && this._validateValue[this.selector(selector).validate](env, value.value[i].value)) {
- return true;
- }
- }
- return valid;
- } else {
- return this.selector(selector).type === value.value[0].is;
- }
- }
- }
- };
- SuperMap.CartoCSS.Tree.Reference.setVersion("latest");
- SuperMap.CartoCSS.Tree.Rule = /*#__PURE__*/function () {
- function Rule(name, value, index, filename) {
- CartoCSS_classCallCheck(this, Rule);
- this.is = 'rule';
- var parts = name.split('/');
- this.name = parts.pop();
- this.instance = parts.length ? parts[0] : '__default__';
- this.value = value instanceof SuperMap.CartoCSS.Tree.Value ? value : new SuperMap.CartoCSS.Tree.Value([value]);
- this.index = index;
- this.symbolizer = SuperMap.CartoCSS.Tree.Reference.symbolizer(this.name);
- this.filename = filename;
- this.variable = name.charAt(0) === '@';
- }
- CartoCSS_createClass(Rule, [{
- key: "clone",
- value: function clone() {
- var clone = Object.create(SuperMap.CartoCSS.Tree.Rule.prototype);
- clone.name = this.name;
- clone.value = this.value;
- clone.index = this.index;
- clone.instance = this.instance;
- clone.symbolizer = this.symbolizer;
- clone.filename = this.filename;
- clone.variable = this.variable;
- return clone;
- }
- }, {
- key: "updateID",
- value: function updateID() {
- return this.id = this.zoom + '#' + this.instance + '#' + this.name;
- }
- }, {
- key: "toString",
- value: function toString() {
- return '[' + SuperMap.CartoCSS.Tree.Zoom.toString(this.zoom) + '] ' + this.name + ': ' + this.value;
- }
- }, {
- key: "ev",
- value: function ev(context) {
- return new SuperMap.CartoCSS.Tree.Rule(this.name, this.value.ev(context), this.index, this.filename);
- }
- }]);
- return Rule;
- }();
- SuperMap.CartoCSS.Tree.Ruleset = /*#__PURE__*/function () {
- function Ruleset(selectors, rules) {
- CartoCSS_classCallCheck(this, Ruleset);
- this.is = 'ruleset';
- this.selectors = selectors;
- this.rules = rules; // static cache of find() function
- this._lookups = {};
- }
- CartoCSS_createClass(Ruleset, [{
- key: "ev",
- value: function ev(env) {
- var i,
- rule,
- ruleset = new SuperMap.CartoCSS.Tree.Ruleset(this.selectors, this.rules.slice(0));
- ruleset.root = this.root; // push the current ruleset to the frames stack
- env.frames.unshift(ruleset); // Evaluate everything else
- for (i = 0, rule; i < ruleset.rules.length; i++) {
- rule = ruleset.rules[i];
- ruleset.rules[i] = rule.ev ? rule.ev(env) : rule;
- } // Pop the stack
- env.frames.shift();
- return ruleset;
- }
- }, {
- key: "match",
- value: function match(args) {
- return !args || args.length === 0;
- }
- }, {
- key: "variables",
- value: function variables() {
- if (this._variables) {
- return this._variables;
- } else {
- return this._variables = this.rules.reduce(function (hash, r) {
- if (r instanceof SuperMap.CartoCSS.Tree.Rule && r.variable === true) {
- hash[r.name] = r;
- }
- return hash;
- }, {});
- }
- }
- }, {
- key: "variable",
- value: function variable(name) {
- return this.variables()[name];
- }
- }, {
- key: "rulesets",
- value: function rulesets() {
- if (this._rulesets) {
- return this._rulesets;
- } else {
- return this._rulesets = this.rules.filter(function (r) {
- return r instanceof SuperMap.CartoCSS.Tree.Ruleset;
- });
- }
- }
- }, {
- key: "find",
- value: function find(selector, self) {
- self = self || this;
- var rules = [],
- match,
- key = selector.toString();
- if (key in this._lookups) {
- return this._lookups[key];
- }
- this.rulesets().forEach(function (rule) {
- if (rule !== self) {
- for (var j = 0; j < rule.selectors.length; j++) {
- match = selector.match(rule.selectors[j]);
- if (match) {
- if (selector.elements.length > 1) {
- Array.prototype.push.apply(rules, rule.find(new SuperMap.CartoCSS.Tree.Selector(null, null, selector.elements.slice(1)), self));
- } else {
- rules.push(rule);
- }
- break;
- }
- }
- }
- });
- return this._lookups[key] = rules;
- } // Zooms can use variables. This replaces SuperMap.CartoCSS.Tree.Zoom objects on selectors
- // with simple bit-arrays that we can compare easily.
- }, {
- key: "evZooms",
- value: function evZooms(env) {
- for (var i = 0; i < this.selectors.length; i++) {
- var zval = SuperMap.CartoCSS.Tree.Zoom.all;
- for (var z = 0; z < this.selectors[i].zoom.length; z++) {
- zval = this.selectors[i].zoom[z].ev(env).zoom;
- }
- this.selectors[i].zoom = zval;
- }
- }
- }, {
- key: "flatten",
- value: function flatten(result, parents, env) {
- var selectors = [],
- i,
- j;
- if (this.selectors.length === 0) {
- env.frames = env.frames.concat(this.rules);
- } // evaluate zoom variables on this object.
- this.evZooms(env);
- for (i = 0; i < this.selectors.length; i++) {
- var child = this.selectors[i];
- if (!child.filters) {
- // This is an invalid filterset.
- continue;
- }
- if (parents.length) {
- for (j = 0; j < parents.length; j++) {
- var parent = parents[j];
- var mergedFilters = parent.filters.cloneWith(child.filters);
- if (mergedFilters === null) {
- // Filters could be added, but they didn't change the
- // filters. This means that we only have to clone when
- // the zoom levels or the attachment is different too.
- if (parent.zoom === child.zoom && parent.attachment === child.attachment && parent.elements.join() === child.elements.join()) {
- selectors.push(parent);
- continue;
- } else {
- mergedFilters = parent.filters;
- }
- } else if (!mergedFilters) {
- // The merged filters are invalid, that means we don't
- // have to clone.
- continue;
- }
- var clone = Object.create(SuperMap.CartoCSS.Tree.Selector.prototype);
- clone.filters = mergedFilters;
- clone.zoom = child.zoom;
- clone.elements = parent.elements.concat(child.elements);
- if (parent.attachment && child.attachment) {
- clone.attachment = parent.attachment + '/' + child.attachment;
- } else {
- clone.attachment = child.attachment || parent.attachment;
- }
- clone.conditions = parent.conditions + child.conditions;
- clone.index = child.index;
- selectors.push(clone);
- }
- } else {
- selectors.push(child);
- }
- }
- var rules = [];
- for (i = 0; i < this.rules.length; i++) {
- var rule = this.rules[i]; // Recursively flatten any nested rulesets
- if (rule instanceof SuperMap.CartoCSS.Tree.Ruleset) {
- rule.flatten(result, selectors, env);
- } else if (rule instanceof SuperMap.CartoCSS.Tree.Rule) {
- rules.push(rule);
- } else if (rule instanceof SuperMap.CartoCSS.Tree.Invalid) {
- env.error(rule);
- }
- }
- var index = rules.length ? rules[0].index : false;
- for (i = 0; i < selectors.length; i++) {
- // For specificity sort, use the position of the first rule to allow
- // defining attachments that are under current element as a descendant
- // selector.
- if (index !== false) {
- selectors[i].index = index;
- }
- result.push(new SuperMap.CartoCSS.Tree.Definition(selectors[i], rules.slice()));
- }
- return result;
- }
- }]);
- return Ruleset;
- }();
- SuperMap.CartoCSS.Tree.Selector = /*#__PURE__*/function () {
- function Selector(filters, zoom, elements, attachment, conditions, index) {
- CartoCSS_classCallCheck(this, Selector);
- this.elements = elements || [];
- this.attachment = attachment;
- this.filters = filters || {};
- this.zoom = typeof zoom !== 'undefined' ? zoom : SuperMap.CartoCSS.Tree.Zoom.all;
- this.conditions = conditions;
- this.index = index;
- }
- CartoCSS_createClass(Selector, [{
- key: "specificity",
- value: function specificity() {
- return this.elements.reduce(function (memo, e) {
- var spec = e.specificity();
- memo[0] += spec[0];
- memo[1] += spec[1];
- return memo;
- }, [0, 0, this.conditions, this.index]);
- }
- }]);
- return Selector;
- }();
- /*style:class Invalid ),*/
- SuperMap.CartoCSS.Tree.URL = /*#__PURE__*/function () {
- function URL(val, paths) {
- CartoCSS_classCallCheck(this, URL);
- this.is = 'uri';
- this.value = val;
- this.paths = paths;
- }
- CartoCSS_createClass(URL, [{
- key: "toString",
- value: function toString() {
- return this.value.toString();
- }
- }, {
- key: "ev",
- value: function ev(ctx) {
- return new SuperMap.CartoCSS.Tree.URL(this.value.ev(ctx), this.paths);
- }
- }]);
- return URL;
- }();
- SuperMap.CartoCSS.Tree.Value = /*#__PURE__*/function () {
- function Value(value) {
- CartoCSS_classCallCheck(this, Value);
- this.is = 'value';
- this.value = value;
- }
- CartoCSS_createClass(Value, [{
- key: "ev",
- value: function ev(env) {
- if (this.value.length === 1) {
- return this.value[0].ev(env);
- } else {
- return new SuperMap.CartoCSS.Tree.Value(this.value.map(function (v) {
- return v.ev(env);
- }));
- }
- }
- }, {
- key: "toJS",
- value: function toJS(env) {
- //var v = this.value[0].value[0];
- var val = this.ev(env);
- var v = val.toString();
- if (val.is === "color" || val.is === 'uri' || val.is === 'string' || val.is === 'keyword') {
- v = "'" + v + "'";
- } else if (val.is === 'field') {
- // replace [varuable] by ctx['variable']
- v = v.replace(/\[(.*)\]/g, "attributes['\_match1']");
- } else if (val.value && CartoCSS_typeof(val.value) === "object") {
- v = "[" + v + "]";
- }
- return "_value = " + v + ";";
- }
- }, {
- key: "toString",
- value: function toString(env, selector, sep, format) {
- return this.value.map(function (e) {
- return e.toString(env, format);
- }).join(sep || ', ');
- }
- }, {
- key: "clone",
- value: function clone() {
- var obj = Object.create(SuperMap.CartoCSS.Tree.Value.prototype);
- if (Array.isArray(obj)) {
- obj.value = this.value.slice();
- } else {
- obj.value = this.value;
- }
- obj.is = this.is;
- return obj;
- }
- }]);
- return Value;
- }();
- SuperMap.CartoCSS.Tree.Variable = /*#__PURE__*/function () {
- function Variable(name, index, filename) {
- CartoCSS_classCallCheck(this, Variable);
- this.is = 'variable';
- this.name = name;
- this.index = index;
- this.filename = filename;
- }
- CartoCSS_createClass(Variable, [{
- key: "toString",
- value: function toString() {
- return this.name;
- }
- }, {
- key: "ev",
- value: function ev(env) {
- if (this._css) {
- return this._css;
- }
- var thisframe = env.frames.filter(function (f) {
- return f.name === this.name;
- }.bind(this));
- if (thisframe.length) {
- return thisframe[0].value.ev(env);
- } else {
- env.error({
- message: 'variable ' + this.name + ' is undefined',
- index: this.index,
- type: 'runtime',
- filename: this.filename
- });
- return {
- is: 'undefined',
- value: 'undefined'
- };
- }
- }
- }]);
- return Variable;
- }();
- SuperMap.CartoCSS.Tree.Zoom = /*#__PURE__*/function () {
- function Zoom(op, value, index) {
- CartoCSS_classCallCheck(this, Zoom);
- this.op = op;
- this.value = value;
- this.index = index;
- }
- CartoCSS_createClass(Zoom, [{
- key: "setZoom",
- value: function setZoom(zoom) {
- this.zoom = zoom;
- return this;
- }
- }, {
- key: "ev",
- value: function ev(env) {
- var value = parseInt(this.value.ev(env).toString(), 10);
- if (value > SuperMap.CartoCSS.Tree.Zoom.maxZoom || value < 0) {
- env.error({
- message: 'Only zoom levels between 0 and ' + SuperMap.CartoCSS.Tree.Zoom.maxZoom + ' supported.',
- index: this.index
- });
- }
- switch (this.op) {
- case '=':
- this.zoom = "zoom && zoom === " + value;
- return this;
- case '>':
- this.zoom = "zoom && zoom > " + value;
- break;
- case '>=':
- this.zoom = "zoom && zoom >= " + value;
- break;
- case '<':
- this.zoom = "zoom && zoom < " + value;
- break;
- case '<=':
- this.zoom = "zoom && zoom <= " + value;
- break;
- default:
- return this;
- break;
- }
- /*
- for (var i = 0; i <= SuperMap.CartoCSS.Tree.Zoom.maxZoom; i++) {
- if (i >= start && i <= end) {
- zoom |= (1 << i);
- }
- }
- this.zoom = zoom;
- this.zoom=value+this.op+"zoom";*/
- return this;
- }
- }, {
- key: "toString",
- value: function toString() {
- var str = '';
- for (var i = 0; i <= SuperMap.CartoCSS.Tree.Zoom.maxZoom; i++) {
- str += this.zoom & 1 << i ? 'X' : '.';
- }
- return str;
- }
- }]);
- return Zoom;
- }(); // Covers all zoomlevels from 0 to 22
- SuperMap.CartoCSS.Tree.Zoom.all = 23;
- SuperMap.CartoCSS.Tree.Zoom.maxZoom = 22;
- SuperMap.CartoCSS.Tree.Zoom.ranges = {
- 0: 1000000000,
- 1: 500000000,
- 2: 200000000,
- 3: 100000000,
- 4: 50000000,
- 5: 25000000,
- 6: 12500000,
- 7: 6500000,
- 8: 3000000,
- 9: 1500000,
- 10: 750000,
- 11: 400000,
- 12: 200000,
- 13: 100000,
- 14: 50000,
- 15: 25000,
- 16: 12500,
- 17: 5000,
- 18: 2500,
- 19: 1500,
- 20: 750,
- 21: 500,
- 22: 250,
- 23: 100
- };
- ;// CONCATENATED MODULE: ./src/common/style/ThemeStyle.js
- function ThemeStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.ThemeStyle
- * @classdesc 客户端专题图风格类。
- * @category Visualization Theme
- * @param {Object} options - 可选参数。
- * @param {boolean} [options.fill=true] - 是否填充,不需要填充则设置为 false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
- * @param {string} [options.fillColor='#000000'] - 十六进制填充颜色。
- * @param {number} [options.fillOpacity=1] - 填充不透明度。取值范围[0, 1]。
- * @param {boolean} [options.stroke=false] - 是否描边,不需要描边则设置为false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
- * @param {string} [options.strokeColor='#000000'] - 十六进制描边颜色。
- * @param {number} [options.strokeOpacity=1] - 描边的不透明度。取值范围[0, 1]。
- * @param {number} [options.strokeWidth=1] - 线宽度/描边宽度。
- * @param {string} [options.strokeLinecap='butt'] - 线帽样式。strokeLinecap 有三种类型 “butt", "round", "square"。
- * @param {string} [options.strokeLineJoin='iter'] - 线段连接样式。strokeLineJoin 有三种类型 “miter", "round", "bevel"。
- * @param {string} [options.strokeDashstyle='solid'] - 虚线类型。strokeDashstyle 有八种类型 “dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"。solid 表示实线。
- * @param {number} [options.pointRadius=6] - 点半径,单位为像素。
- * @param {number} [options.shadowBlur=0] - 阴影模糊度,(大于 0 有效;)。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
- * @param {string} [options.shadowColor='#000000'] - 阴影颜色。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
- * @param {number} [options.shadowOffsetX=0] - 阴影 X 方向偏移值。
- * @param {number} [options.shadowOffsetY=0] - 阴影 Y 方向偏移值。
- * @param {string} options.label - 专题要素附加文本标签内容。
- * @param {string} [options.fontColor] - 附加文本字体颜色。
- * @param {number} [options.fontSize=12] - 附加文本字体大小,单位是像素。
- * @param {string} [options.fontStyle='normal'] - 附加文本字体样式。可设值:"normal", "italic", "oblique"。
- * @param {string} [options.fontVariant='normal'] - 附加文本字体变体。可设值:"normal", "small-caps"。
- * @param {string} [options.fontWeight='normal'] - 附加文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"。
- * @param {string} [options.fontFamily='arial,sans-serif'] - 附加文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,
- * 浏览器会使用它可识别的第一个可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称
- * ("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。
- * @param {string} [options.labelPosition='top'] - 附加文本位置, 可以是 'inside', 'left', 'right', 'top', 'bottom'。
- * @param {string} [options.labelAlign='center'] - 附加文本水平对齐。可以是 'left', 'right', 'center'。
- * @param {string} [options.labelBaseline='middle'] - 附加文本垂直对齐。 可以是 'top', 'bottom', 'middle' 。
- * @param {number} [options.labelXOffset=0] - 附加文本在x轴方向的偏移量。
- * @param {number} [options.labelYOffset=0] - 附加文本在y轴方向的偏移量。
- */
- var ThemeStyle = function ThemeStyle(options) {
- ThemeStyle_classCallCheck(this, ThemeStyle);
- options = options || {};
- /**
- * @member {boolean} [SuperMap.ThemeStyle.prototype.fill=true]
- * @description 是否填充,不需要填充则设置为 false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
- */
- this.fill = true;
- /**
- * @member {string} [SuperMap.ThemeStyle.prototype.fillColor="#000000"]
- * @description 十六进制填充颜色。
- */
- this.fillColor = "#000000";
- /**
- * @member {number} [SuperMap.ThemeStyle.prototype.fillOpacity=1]
- * @description 填充不透明度。取值范围[0, 1]。
- */
- this.fillOpacity = 1;
- /**
- * @member {boolean} [SuperMap.ThemeStyle.prototype.stroke=false]
- * @description 是否描边,不需要描边则设置为false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
- */
- this.stroke = false;
- /**
- * @member {string} [SuperMap.ThemeStyle.prototype.strokeColor="#000000"]
- * @description 十六进制描边颜色。
- */
- this.strokeColor = "#000000";
- /**
- * @member {number} [SuperMap.ThemeStyle.prototype.strokeOpacity=1]
- * @description 描边的不透明度。取值范围[0, 1]。
- */
- this.strokeOpacity = 1;
- /**
- * @member {number} [SuperMap.ThemeStyle.prototype.strokeWidth=1]
- * @description 线宽度/描边宽度。
- */
- this.strokeWidth = 1;
- /**
- * @member {string} [SuperMap.ThemeStyle.prototype.strokeLinecap="butt"]
- * @description 线帽样式;strokeLinecap 有三种类型 “butt", "round", "square" 。
- */
- this.strokeLinecap = "butt";
- /**
- * @member {string} [SuperMap.ThemeStyle.prototype.strokeLineJoin="miter"]
- * @description 线段连接样式;strokeLineJoin 有三种类型 “miter", "round", "bevel"。
- */
- this.strokeLineJoin = "miter";
- /**
- * @member {string} [SuperMap.ThemeStyle.prototype.strokeDashstyle="solid"]
- * @description 虚线类型; strokeDashstyle 有八种类型 “dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted";
- * solid 表示实线。
- */
- this.strokeDashstyle = "solid";
- /**
- * @member {number} [SuperMap.ThemeStyle.prototype.pointRadius=6]
- * @description 点半径。单位为像素。
- */
- this.pointRadius = 6;
- /**
- * @member {number} [SuperMap.ThemeStyle.prototype.shadowBlur=0]
- * @description 阴影模糊度,(大于 0 有效)。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
- */
- this.shadowBlur = 0;
- /**
- * @member {string} [SuperMap.ThemeStyle.prototype.shadowColor='#000000']
- * @description 阴影颜色。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
- */
- this.shadowColor = "#000000";
- /**
- * @member {number} [SuperMap.ThemeStyle.prototype.shadowOffsetX=0]
- * @description 阴影 X 方向偏移值。
- */
- this.shadowOffsetX = 0;
- /**
- * @member {number} SuperMap.ThemeStyle.prototype.shadowOffsetY
- * @description Y 方向偏移值。
- */
- this.shadowOffsetY = 0;
- /**
- * @member {string} [SuperMap.ThemeStyle.prototype.label]
- * @description 专题要素附加文本标签内容。
- */
- this.label = "";
- /**
- * @member {boolean} [SuperMap.ThemeStyle.prototype.labelRect=false]
- * @description 是否显示文本标签矩形背景。
- */
- this.labelRect = false;
- /**
- * @member {string} [SuperMap.ThemeStyle.prototype.fontColor]
- * @description 附加文本字体颜色。
- */
- this.fontColor = "";
- /**
- * @member {number} [SuperMap.ThemeStyle.prototype.fontSize=12]
- * @description 附加文本字体大小,单位是像素。
- */
- this.fontSize = 12;
- /**
- * @member {string} [SuperMap.ThemeStyle.prototype.fontStyle="normal"]
- * @description 附加文本字体样式。可设值:"normal", "italic", "oblique"。
- */
- this.fontStyle = "normal";
- /**
- * @member {string} [SuperMap.ThemeStyle.prototype.fontVariant="normal"]
- * @description 附加文本字体变体。可设值:"normal", "small-caps"。
- */
- this.fontVariant = "normal";
- /**
- * @member {string} [SuperMap.ThemeStyle.prototype.fontWeight="normal"]
- * @description 附加文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"。
- */
- this.fontWeight = "normal";
- /**
- * @member {string} [SuperMap.ThemeStyle.prototype.fontFamily="arial,sans-serif"]
- * @description 附加文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,浏览器会使用它可识别的第一个
- * 可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。
- */
- this.fontFamily = "arial,sans-serif";
- /**
- * @member {string} [SuperMap.ThemeStyle.prototype.labelPosition='top']
- * @description 附加文本位置, 可以是 'inside', 'left', 'right', 'top', 'bottom'。
- */
- this.labelPosition = "top";
- /**
- * @member {string} [SuperMap.ThemeStyle.prototype.labelAlign='center']
- * @description 附加文本水平对齐。可以是 'left', 'right', 'center'。
- */
- this.labelAlign = "center";
- /**
- * @member {string} [SuperMap.ThemeStyle.prototype.labelBaseline='middle']
- * @description 附加文本垂直对齐。 可以是 'top', 'bottom', 'middle'。
- */
- this.labelBaseline = "middle";
- /**
- * @member {number} [SuperMap.ThemeStyle.prototype.labelXOffset=0]
- * @description 附加文本在 X 轴方向的偏移量。
- */
- this.labelXOffset = 0;
- /**
- * @member {number} [SuperMap.ThemeStyle.prototype.labelYOffset=0]
- * @description 附加文本在 Y 轴方向的偏移量。
- */
- this.labelYOffset = 0;
- Util.extend(this, options);
- };
- SuperMap.ThemeStyle = ThemeStyle;
- ;// CONCATENATED MODULE: ./src/common/style/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/common/overlay/feature/ShapeParameters.js
- function ShapeParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ShapeParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ShapeParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ShapeParameters_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.ShapeParameters
- * @category Visualization Theme
- * @classdesc 图形参数基类,此类不可实例化
- */
- var ShapeParameters = /*#__PURE__*/function () {
- /**
- * @function SuperMap.Feature.ShapeParameters.prototype.constructor
- * @description 图形参数对象。
- * @returns {SuperMap.Feature.ShapeParameters} 图形参数对象。
- */
- function ShapeParameters() {
- ShapeParameters_classCallCheck(this, ShapeParameters);
- /**
- * @member {Array} [SuperMap.Feature.ShapeParameters.prototype.refOriginalPosition=[0,0]]
- * @description 图形参考原点位置,图形的参考中心位置。
- * refOriginalPosition 是长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
- * refOriginalPosition 表示图形的参考中心,通常情况下,图形是使用 canvas 的原点位置作为位置参考,
- * 但 refOriginalPosition 可以改变图形的参考位置,例如: refOriginalPosition = [80, 80],
- * 图形圆的 style.x = 20, style.y = 20,那么圆在 canvas 中的实际位置是 [100, 100]。
- * 图形(Shape) 的所有位置相关属性都是以 refOriginalPosition 为参考中心,
- * 也就是说图形的所有位置信息在 canvas 中都是以 refOriginalPosition 为参考的相对位置,只有
- * refOriginalPosition 的值为 [0, 0] 时,图形的位置信息才是 canvas 绝对位置。
- * 图形的位置信息通常有:style.pointList,style.x,style.y。
- */
- this.refOriginalPosition = [0, 0];
- /**
- * @member {string} SuperMap.Feature.ShapeParameters.prototype.refDataID
- * @description 图形所关联数据的 ID(<{@link SuperMap.Feature.Vector}> 的 id)。
- */
- this.refDataID = null;
- /**
- * @member {boolean} SuperMap.Feature.ShapeParameters.prototype.isHoverByRefDataID
- * @description 是否根据 refDataID 进行高亮。用于同时高亮所有 refDataID 相同的图形。
- */
- this.isHoverByRefDataID = false;
- /**
- * @member {string} SuperMap.Feature.ShapeParameters.prototype.refDataHoverGroup
- * @description 高亮图形组的组名。此属性在 refDataID 有效且 isHoverByRefDataID 为 true 时生效。
- * 一旦设置此属性,且属性值有效,只有关联同一个数据的图形且此属性相同的图形才会高亮。
- */
- this.refDataHoverGroup = null;
- /**
- * @member {Object} SuperMap.Feature.ShapeParameters.prototype.dataInfo
- * @description 图形携带的附加数据。
- */
- this.dataInfo = null;
- /**
- * @member {boolean} SuperMap.Feature.ShapeParameters.prototype.clickable
- * @description 是否可点击。
- */
- this.clickable = true;
- /**
- * @member {boolean} SuperMap.Feature.ShapeParameters.prototype.hoverable
- * @description 是否可点击。
- */
- this.hoverable = true;
- /**
- * @member {Object} SuperMap.Feature.ShapeParameters.prototype.style
- * @description 图形样式对象,可设样式属性在子类中确定。
- */
- this.style = null;
- /**
- * @member {Object} SuperMap.Feature.ShapeParameters.prototype.highlightStyle
- * @description 高亮样式对象,可设样式属性与 style 的可设样式属性相同。
- */
- this.highlightStyle = {};
- this.CLASS_NAME = "SuperMap.Feature.ShapeParameters";
- }
- /**
- * @function SuperMap.Feature.ShapeParameters.prototype.destroy
- * @description 销毁对象。
- */
- ShapeParameters_createClass(ShapeParameters, [{
- key: "destroy",
- value: function destroy() {
- this.refOriginalPosition = null;
- this.refDataID = null;
- this.isHoverByRefDataID = null;
- this.refDataHoverGroup = null;
- this.dataInfo = null;
- this.clickable = null;
- this.hoverable = null;
- this.style = null;
- this.highlightStyle = null;
- }
- }]);
- return ShapeParameters;
- }();
- SuperMap.Feature = SuperMap.Feature || {};
- SuperMap.Feature.ShapeParameters = ShapeParameters;
- ;// CONCATENATED MODULE: ./src/common/overlay/feature/Point.js
- 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); }
- function feature_Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function feature_Point_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Point_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Point_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function feature_Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Point_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- 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); }
- 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); }; }
- function feature_Point_possibleConstructorReturn(self, call) { if (call && (feature_Point_typeof(call) === "object" || typeof call === "function")) { return call; } return feature_Point_assertThisInitialized(self); }
- function feature_Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- 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); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.ShapeParameters.Point
- * @category Visualization Theme
- * @classdesc 点参数对象。
- * @extends {SuperMap.Feature.ShapeParameters}
- */
- var Point_Point = /*#__PURE__*/function (_ShapeParameters) {
- feature_Point_inherits(Point, _ShapeParameters);
- var _super = feature_Point_createSuper(Point);
- /**
- * @function SuperMap.Feature.ShapeParameters.Point.prototype.constructor
- * @description 创建一个图形点参数对象。
- * @param {number} x - 点 x 坐标,必设参数。
- * @param {number} y - 点 y 坐标,必设参数。
- * @returns {SuperMap.Feature.ShapeParameters.Point} 标签参数对象。
- */
- function Point(x, y) {
- var _this;
- feature_Point_classCallCheck(this, Point);
- _this = _super.call(this, x, y);
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Point.prototype.x
- * @description 点 x 坐标。
- */
- _this.x = !isNaN(x) ? x : 0;
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Point.prototype.y
- * @description 点 y 坐标。
- */
- _this.y = !isNaN(y) ? y : 0;
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Point.prototype.r
- * @description 点的半径。
- */
- _this.r = 6;
- _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Point";
- return _this;
- }
- /**
- * @function SuperMap.Feature.ShapeParameters.Point.prototype.destroy
- * @description 销毁对象。
- */
- feature_Point_createClass(Point, [{
- key: "destroy",
- value: function destroy() {
- this.x = null;
- this.y = null;
- this.r = null;
- feature_Point_get(feature_Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
- }
- }]);
- return Point;
- }(ShapeParameters);
- /**
- * @typedef {Object} SuperMap.Feature.ShapeParameters.Point.style
- * @property {number} pointRadius - 点的半径,默认值:6。
- * @property {boolean} fill - 是否填充,不需要填充则设置为false,默认值为 true。此属性与 stroke 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
- * @property {string} fillColor - 十六进制填充颜色。默认值为 "#000000"。
- * @property {number} fillOpacity - 填充不透明度。取值范围[0, 1],默认值 1。
- * @property {boolean} stroke - 是否描边,不需要描边则设置为 false,默认值为 false。此属性与 fill 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
- * @property {string} strokeColor - 十六进制描边颜色。
- * @property {number} strokeWidth - 描边宽度,默认值 1。
- * @property {number} strokeOpacity - 描边的不透明度。取值范围[0, 1],默认值 1。
- * @property {number} shadowBlur - 阴影模糊度,(大于 0 有效; 默认值 0)。
- * @property {string} shadowColor - 阴影颜色; 默认值 '#000000'。
- * @property {number} shadowOffsetX - 阴影 X 方向偏移值; 默认值 0。
- * @property {number} shadowOffsetY - 阴影 Y 方向偏移值; 默认值 0。
- */
- SuperMap.Feature = SuperMap.Feature || {};
- SuperMap.Feature.ShapeParameters.Point = Point_Point;
- ;// CONCATENATED MODULE: ./src/common/overlay/feature/Line.js
- 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); }
- function Line_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Line_createClass(Constructor, protoProps, staticProps) { if (protoProps) Line_defineProperties(Constructor.prototype, protoProps); if (staticProps) Line_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Line_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Line_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function Line_setPrototypeOf(o, p) { Line_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Line_setPrototypeOf(o, p); }
- 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); }; }
- function Line_possibleConstructorReturn(self, call) { if (call && (Line_typeof(call) === "object" || typeof call === "function")) { return call; } return Line_assertThisInitialized(self); }
- function Line_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Line_getPrototypeOf(o) { Line_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Line_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.ShapeParameters.Line
- * @category Visualization Theme
- * @classdesc 线参数对象。
- * @extends {SuperMap.Feature.ShapeParameters}
- */
- var Line_Line = /*#__PURE__*/function (_ShapeParameters) {
- Line_inherits(Line, _ShapeParameters);
- var _super = Line_createSuper(Line);
- /**
- * @function SuperMap.Feature.ShapeParameters.Line.prototype.constructor
- * @description 创建一个图形线参数对象。
- * @param {Array} pointList - 线要素节点数组,二维数组,必设参数。
- * @returns {SuperMap.Feature.ShapeParameters.Line} 圆形参数对象。
- */
- function Line(pointList) {
- var _this;
- Line_classCallCheck(this, Line);
- _this = _super.call(this, pointList);
- /**
- * @member {Array} SuperMap.Feature.ShapeParameters.Line.prototype.pointList
- * @description 线要素节点数组,二维数组。
- * 数组形如:
- * (start code)
- * [
- * [10, 20], //节点
- * [30, 40],
- * [25, 30] //最后一个节点和第一个节点不必相同,绘制时自动封闭
- * ]
- * (end)
- */
- _this.pointList = pointList;
- _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Line";
- return _this;
- }
- /**
- * @function SuperMap.Feature.ShapeParameters.Line.prototype.destroy
- * @description 销毁对象。
- */
- Line_createClass(Line, [{
- key: "destroy",
- value: function destroy() {
- this.pointList = null;
- Line_get(Line_getPrototypeOf(Line.prototype), "destroy", this).call(this);
- }
- }]);
- return Line;
- }(ShapeParameters);
- /**
- * @typedef {Object} SuperMap.Feature.ShapeParameters.Line.style
- * @property {string} strokeColor - 十六进制线颜色。
- * @property {number} strokeWidth - 线宽度,默认值 1。
- * @property {string} strokeLinecap - 线帽样式;strokeLinecap 有三种类型 :“butt", "round", "square"; 默认为"butt"。
- * @property {string} strokeLineJoin - 线段连接样式;strokeLineJoin 有三种类型: “miter", "round", "bevel"; 默认为"miter"。
- * @property {string} strokeDashstyle - 虚线类型; strokeDashstyle 有八种类型 :“dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"; 默认值 "solid"。solid 表示实线。
- * @property {number} strokeOpacity - 线的不透明度。取值范围[0, 1],默认值 1。
- * @property {number} shadowBlur - 阴影模糊度,(大于 0 有效; 默认值 0)。
- * @property {string} shadowColor - 阴影颜色; 默认值 '#000000'。
- * @property {number} shadowOffsetX - 阴影 X 方向偏移值; 默认值 0。
- * @property {number} shadowOffsetY - 阴影 Y 方向偏移值; 默认值 0。
- */
- SuperMap.Feature = SuperMap.Feature || {};
- SuperMap.Feature.ShapeParameters.Line = Line_Line;
- ;// CONCATENATED MODULE: ./src/common/overlay/feature/Polygon.js
- 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); }
- function feature_Polygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function feature_Polygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Polygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Polygon_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Polygon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Polygon_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- 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); }
- 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); }; }
- function feature_Polygon_possibleConstructorReturn(self, call) { if (call && (feature_Polygon_typeof(call) === "object" || typeof call === "function")) { return call; } return feature_Polygon_assertThisInitialized(self); }
- function feature_Polygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- 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); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.ShapeParameters.Polygon
- * @category Visualization Theme
- * @classdesc 面参数对象。
- * @extends {SuperMap.Feature.ShapeParameters}
- */
- var Polygon_Polygon = /*#__PURE__*/function (_ShapeParameters) {
- feature_Polygon_inherits(Polygon, _ShapeParameters);
- var _super = feature_Polygon_createSuper(Polygon);
- /**
- * @function SuperMap.Feature.ShapeParameters.Polygon.prototype.constructor
- * @description 创建一个图形面参数对象。
- * @param {Array} pointList - 横坐标,必设参数。
- * @returns {SuperMap.Feature.ShapeParameters.Polygon} 标签参数对象。
- */
- function Polygon(pointList) {
- var _this;
- feature_Polygon_classCallCheck(this, Polygon);
- _this = _super.call(this, pointList);
- /**
- * @member {Array} SuperMap.Feature.ShapeParameters.Polygon.prototype.pointList
- * @description 面要素节点数组,二维数组。
- * 数组形如:
- * (start code)
- * [
- * [10, 20], //节点
- * [30, 40],
- * [25, 30] //最后一个节点和第一个节点不必相同,绘制时自动封闭
- * ]
- * (end)
- */
- _this.pointList = pointList;
- /**
- * @member {Array} SuperMap.Feature.ShapeParameters.Polygon.prototype.holePolygonPointLists
- * @description 岛洞面多边形顶点数组(三维数组)
- */
- _this.holePolygonPointLists = null;
- _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Polygon";
- return _this;
- }
- /**
- * @function SuperMap.Feature.ShapeParameters.Polygon.prototype.destroy
- * @description 销毁对象。
- */
- feature_Polygon_createClass(Polygon, [{
- key: "destroy",
- value: function destroy() {
- this.pointList = null;
- this.holePolygonPointLists = null;
- Polygon_get(feature_Polygon_getPrototypeOf(Polygon.prototype), "destroy", this).call(this);
- }
- }]);
- return Polygon;
- }(ShapeParameters);
- /**
- * @typedef {Object} SuperMap.Feature.ShapeParameters.Polygon.style
- * @property {boolean} fill - 是否填充,不需要填充则设置为false,默认值为 true。此属性与 stroke 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
- * @property {string} fillColor - 十六进制填充颜色。默认值为 "#000000"。
- * @property {number} fillOpacity - 填充不透明度。取值范围[0, 1],默认值 1。
- * @property {boolean} stroke - 是否描边,不需要描边则设置为 false,默认值为 false。此属性与 fill 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
- * @property {string} strokeColor - 十六进制描边颜色。
- * @property {number} strokeWidth - 描边宽度,默认值 1。
- * @property {number} strokeOpacity - 描边的不透明度。取值范围[0, 1],默认值 1。
- * @property {string} strokeLinecap - 线帽样式;strokeLinecap 有三种类型 :“butt", "round", "square"; 默认为"butt"。
- * @property {string} strokeLineJoin - 线段连接样式;strokeLineJoin 有三种类型: “miter", "round", "bevel"; 默认为"miter"。
- * @property {string} strokeDashstyle - 虚线类型; strokeDashstyle 有八种类型 :“dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"; 默认值 "solid"。solid 表示实线。
- * @property {number} shadowBlur - 阴影模糊度,(大于 0 有效; 默认值 0)。
- * @property {string} shadowColor - 阴影颜色; 默认值 '#000000'。
- * @property {number} shadowOffsetX - 阴影 X 方向偏移值; 默认值 0。
- * @property {number} shadowOffsetY - 阴影 Y 方向偏移值; 默认值 0。
- */
- SuperMap.Feature = SuperMap.Feature || {};
- SuperMap.Feature.ShapeParameters.Polygon = Polygon_Polygon;
- ;// CONCATENATED MODULE: ./src/common/overlay/feature/Rectangle.js
- 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); }
- function feature_Rectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function feature_Rectangle_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Rectangle_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Rectangle_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Rectangle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Rectangle_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- 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); }
- 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); }; }
- function feature_Rectangle_possibleConstructorReturn(self, call) { if (call && (feature_Rectangle_typeof(call) === "object" || typeof call === "function")) { return call; } return feature_Rectangle_assertThisInitialized(self); }
- function feature_Rectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- 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); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.ShapeParameters.Rectangle
- * @category Visualization Theme
- * @classdesc 矩形参数对象。
- * @extends {SuperMap.Feature.ShapeParameters}
- */
- var Rectangle_Rectangle = /*#__PURE__*/function (_ShapeParameters) {
- feature_Rectangle_inherits(Rectangle, _ShapeParameters);
- var _super = feature_Rectangle_createSuper(Rectangle);
- /**
- * @function SuperMap.Feature.ShapeParameters.Rectangle.prototype.constructor
- * @description 创建一个图形矩形参数对象。
- * @param {number} x - 矩形 x 坐标,必设参数。
- * @param {number} y - 矩形 y 坐标,必设参数。
- * @param {number} width - 矩形 width 坐标,必设参数。
- * @param {number} height - 矩形 height 坐标,必设参数。
- * @returns {SuperMap.Feature.ShapeParameters.Rectangle} 图形矩形参数对象。
- */
- function Rectangle(x, y, width, height) {
- var _this;
- feature_Rectangle_classCallCheck(this, Rectangle);
- _this = _super.call(this, x, y, width, height);
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Rectangle.prototype.x
- * @description 左上角 x 坐标。
- */
- _this.x = !isNaN(x) ? x : 0;
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Rectangle.prototype.y
- * @description 左上角 y 坐标。
- */
- _this.y = !isNaN(x) ? y : 0;
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Rectangle.prototype.width
- * @description 宽度。
- */
- _this.width = !isNaN(width) ? width : 0;
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Rectangle.prototype.height
- * @description 高度。
- */
- _this.height = !isNaN(height) ? height : 0;
- _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Rectangle";
- return _this;
- }
- /**
- * @function SuperMap.Feature.ShapeParameters.Rectangle.prototype.destroy
- * @description 销毁对象。
- */
- feature_Rectangle_createClass(Rectangle, [{
- key: "destroy",
- value: function destroy() {
- this.x = null;
- this.y = null;
- this.width = null;
- this.height = null;
- Rectangle_get(feature_Rectangle_getPrototypeOf(Rectangle.prototype), "destroy", this).call(this);
- }
- }]);
- return Rectangle;
- }(ShapeParameters);
- /**
- * @typedef {Object} SuperMap.Feature.ShapeParameters.Rectangle.style
- * @property {boolean} fill - 是否填充,不需要填充则设置为false,默认值为 true。此属性与 stroke 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
- * @property {string} fillColor - 十六进制填充颜色。默认值为 "#000000"。
- * @property {number} fillOpacity - 填充不透明度。取值范围[0, 1],默认值 1。
- * @property {boolean} stroke - 是否描边,不需要描边则设置为 false,默认值为 false。此属性与 fill 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
- * @property {string} strokeColor - 十六进制描边颜色。
- * @property {number} strokeWidth - 描边宽度,默认值 1。
- * @property {number} strokeOpacity - 描边的不透明度。取值范围[0, 1],默认值 1。
- * @property {string} strokeLinecap - 线帽样式;strokeLinecap 有三种类型 :“butt", "round", "square"; 默认为"butt"。
- * @property {string} strokeLineJoin - 线段连接样式;strokeLineJoin 有三种类型: “miter", "round", "bevel"; 默认为"miter"。
- * @property {string} strokeDashstyle - 虚线类型; strokeDashstyle 有八种类型 :“dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"; 默认值 "solid"。solid 表示实线。
- * @property {number} shadowBlur - 阴影模糊度,(大于 0 有效; 默认值 0)。
- * @property {string} shadowColor - 阴影颜色; 默认值 '#000000'。
- * @property {number} shadowOffsetX - 阴影 X 方向偏移值; 默认值 0。
- * @property {number} shadowOffsetY - 阴影 Y 方向偏移值; 默认值 0。
- */
- SuperMap.Feature = SuperMap.Feature || {};
- SuperMap.Feature.ShapeParameters.Rectangle = Rectangle_Rectangle;
- ;// CONCATENATED MODULE: ./src/common/overlay/feature/Sector.js
- 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); }
- function Sector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Sector_createClass(Constructor, protoProps, staticProps) { if (protoProps) Sector_defineProperties(Constructor.prototype, protoProps); if (staticProps) Sector_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Sector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Sector_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function Sector_setPrototypeOf(o, p) { Sector_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Sector_setPrototypeOf(o, p); }
- 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); }; }
- function Sector_possibleConstructorReturn(self, call) { if (call && (Sector_typeof(call) === "object" || typeof call === "function")) { return call; } return Sector_assertThisInitialized(self); }
- function Sector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Sector_getPrototypeOf(o) { Sector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Sector_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.ShapeParameters.Sector
- * @category Visualization Theme
- * @classdesc 扇形参数对象。
- * @extends {SuperMap.Feature.ShapeParameters}
- */
- var Sector = /*#__PURE__*/function (_ShapeParameters) {
- Sector_inherits(Sector, _ShapeParameters);
- var _super = Sector_createSuper(Sector);
- /**
- * @function SuperMap.Feature.ShapeParameters.Sector.prototype.constructor
- * @description 创建一个扇形参数对象。
- * @param {number} x - 圆心 x 坐标,必设参数。
- * @param {number} y - 圆心 y 坐标,必设参数。
- * @param {number} r - 外圆半径,必设参数。
- * @param {number} startAngle - 起始角度,必设参数。取值范围[0, 360)。
- * @param {number} endAngle - 结束角度,必设参数。取值范围(0, 360]。
- * @param {number} [r0=0] - 内圆半径,指定后将出现内弧,同时扇边长度为'r - r0'。取值范围[0, r)。
- * @returns {SuperMap.Feature.ShapeParameters.Sector} 扇形参数对象。
- */
- function Sector(x, y, r, startAngle, endAngle, r0, clockWise) {
- var _this;
- Sector_classCallCheck(this, Sector);
- _this = _super.call(this, x, y, r, startAngle, endAngle, r0, clockWise);
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Sector.prototype.x
- * @description 圆心 x 坐标。
- */
- _this.x = !isNaN(x) ? x : 0;
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Sector.prototype.Y
- * @description 圆心 Y 坐标。
- */
- _this.y = !isNaN(y) ? y : 0;
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Sector.prototype.r
- * @description 外圆半径。
- */
- _this.r = !isNaN(r) ? r : 0;
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Sector.prototype.startAngle
- * @description 起始角度。取值范围[0, 360),默认值:null。
- */
- _this.startAngle = !isNaN(startAngle) ? startAngle : 0;
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Sector.prototype.endAngle
- * @description 结束角度。取值范围(0, 360],默认值:null。
- */
- _this.endAngle = !isNaN(endAngle) ? endAngle : 0;
- /**
- * @member {number} [SuperMap.Feature.ShapeParameters.Sector.prototype.r0=0]
- * @description 内圆半径,指定后将出现内弧,同时扇边长度为 r 减 r0。取值范围[0, r)。
- */
- _this.r0 = !isNaN(r0) ? r0 : 0;
- /**
- * @member {number} [SuperMap.Feature.ShapeParameters.Sector.prototype.clockWise=false]
- * @description 是否是顺时针。默认值:false。
- */
- _this.clockWise = clockWise;
- _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Sector";
- return _this;
- }
- /**
- * @function SuperMap.Feature.ShapeParameters.Sector.prototype.destroy
- * @description 销毁对象。
- */
- Sector_createClass(Sector, [{
- key: "destroy",
- value: function destroy() {
- this.x = null;
- this.y = null;
- this.r = null;
- this.startAngle = null;
- this.endAngle = null;
- this.r0 = null;
- this.clockWise = null;
- Sector_get(Sector_getPrototypeOf(Sector.prototype), "destroy", this).call(this);
- }
- }]);
- return Sector;
- }(ShapeParameters);
- /**
- * @typedef {Object} SuperMap.Feature.ShapeParameters.Sector.style
- * @property {boolean} fill - 是否填充,不需要填充则设置为false,默认值为 true。此属性与 stroke 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
- * @property {string} fillColor - 十六进制填充颜色。默认值为 "#000000"。
- * @property {number} fillOpacity - 填充不透明度。取值范围[0, 1],默认值 1。
- * @property {boolean} stroke - 是否描边,不需要描边则设置为 false,默认值为 false。此属性与 fill 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
- * @property {string} strokeColor - 十六进制描边颜色。
- * @property {number} strokeWidth - 描边宽度,默认值 1。
- * @property {number} strokeOpacity - 描边的不透明度。取值范围[0, 1],默认值 1。
- * @property {number} shadowBlur - 阴影模糊度,(大于 0 有效; 默认值 0)。
- * @property {string} shadowColor - 阴影颜色; 默认值 '#000000'。
- * @property {number} shadowOffsetX - 阴影 X 方向偏移值; 默认值 0。
- * @property {number} shadowOffsetY - 阴影 Y 方向偏移值; 默认值 0。
- */
- SuperMap.Feature = SuperMap.Feature || {};
- SuperMap.Feature.ShapeParameters.Sector = Sector;
- ;// CONCATENATED MODULE: ./src/common/overlay/feature/Label.js
- 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); }
- function Label_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Label_createClass(Constructor, protoProps, staticProps) { if (protoProps) Label_defineProperties(Constructor.prototype, protoProps); if (staticProps) Label_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Label_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Label_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function Label_setPrototypeOf(o, p) { Label_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Label_setPrototypeOf(o, p); }
- 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); }; }
- function Label_possibleConstructorReturn(self, call) { if (call && (Label_typeof(call) === "object" || typeof call === "function")) { return call; } return Label_assertThisInitialized(self); }
- function Label_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Label_getPrototypeOf(o) { Label_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Label_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.ShapeParameters.Label
- * @category Visualization Theme
- * @classdesc 标签参数对象。
- * @extent {SuperMap.Feature.ShapeParameters}
- */
- var Label = /*#__PURE__*/function (_ShapeParameters) {
- Label_inherits(Label, _ShapeParameters);
- var _super = Label_createSuper(Label);
- /**
- * @function SuperMap.Feature.ShapeParameters.Label.prototype.constructor
- * @description 创建一个标签参数对象。
- * @param {number} x - 横坐标,必设参数。
- * @param {number} y - 纵坐标,必设参数。
- * @param {string} text - 图形中的附加文本,必设参数。
- * @returns {SuperMap.Feature.ShapeParameters.Label} 标签参数对象。
- */
- function Label(x, y, text) {
- var _this;
- Label_classCallCheck(this, Label);
- _this = _super.call(this, x, y, text);
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Label.prototype.x
- * @description 标签 x 坐标。
- */
- _this.x = x;
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Label.prototype.y
- * @description 标签 y 坐标。
- */
- _this.y = y;
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Label.prototype.text
- * @description 标签的文本内容。
- */
- _this.text = text;
- _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Label";
- return _this;
- }
- /**
- * @function SuperMap.Feature.ShapeParameters.Label.prototype.destroy
- * @description 销毁对象。
- */
- Label_createClass(Label, [{
- key: "destroy",
- value: function destroy() {
- this.x = null;
- this.y = null;
- this.text = null;
- Label_get(Label_getPrototypeOf(Label.prototype), "destroy", this).call(this);
- }
- }]);
- return Label;
- }(ShapeParameters);
- /**
- * @typedef {Object} SuperMap.Feature.ShapeParameters.Label.style
- * @property {boolean} fill - 是否填充,不需要填充则设置为 false,默认值为 true。此属性与 stroke 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
- * @property {string} fillColor - 十六进制填充颜色。默认值为 "#000000"。
- * @property {number} fillOpacity - 填充不透明度。取值范围[0, 1],默认值 1。
- * @property {boolean} stroke - 是否描边,不需要描边则设置为false,默认值为 false。此属性与 fill 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
- * @property {string} strokeColor - 十六进制描边颜色。
- * @property {number} strokeOpacity - 描边的不透明度。取值范围[0, 1],默认值 1。
- * @property {number} strokeWidth -描边宽度,默认值 1。
- * @property {number} maxWidth - 最大宽度限制。默认值:null。
- * @property {number} fontSize - 标签文本字体大小。默认值 12,单位是像素。
- * @property {string} fontStyle - 标签文本字体样式。可设值:"normal", "italic", "oblique"; 默认值:"normal" 。
- * @property {string} fontVariant - 标签文本字体变体。可设值:"normal", "small-caps"; 默认值:"normal" 。
- * @property {string} fontWeight - 标签文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"; 默认值:"normal" 。
- * @property {string} fontFamily - 标签文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,浏览器会使用它可识别的第一个值。
- * 可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。默认值:"arial,sans-serif".
- * @property {string} labelBaseline - 标签文本垂直对齐, 可以是 'top', 'bottom', 'middle',默认值 'middle'。
- * @property {string} labelAlign - 标签文本水平对齐。可以是 'left', 'right', 'center'; 默认值 'center'。
- * @property {number} shadowBlur - 阴影模糊度,大于 0 有效。默认值:0。
- * @property {number} shadowColor - 阴影颜色。默认值:"#000000'"。
- * @property {number} shadowOffsetX - 阴影横向偏移。默认值:0。
- * @property {number} shadowOffsetY - 阴影纵向偏移。默认值:0。
- */
- SuperMap.Feature = SuperMap.Feature || {};
- SuperMap.Feature.ShapeParameters.Label = Label;
- ;// CONCATENATED MODULE: ./src/common/overlay/feature/Image.js
- 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); }
- function feature_Image_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function feature_Image_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Image_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Image_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function feature_Image_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Image_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- 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); }
- 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); }; }
- function feature_Image_possibleConstructorReturn(self, call) { if (call && (feature_Image_typeof(call) === "object" || typeof call === "function")) { return call; } return feature_Image_assertThisInitialized(self); }
- function feature_Image_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- 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); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.ShapeParameters.Image
- * @category Visualization Theme
- * @classdesc 图片参数对象。
- * @extends {SuperMap.Feature.ShapeParameters}
- */
- var Image_Image = /*#__PURE__*/function (_ShapeParameters) {
- feature_Image_inherits(Image, _ShapeParameters);
- var _super = feature_Image_createSuper(Image);
- /**
- * @function SuperMap.Feature.ShapeParameters.Image.prototype.constructor
- * @description 创建一个图片参数对象。
- * @param {number} x - 左上角横坐标,必设参数。
- * @param {number} y - 左上角纵坐标,必设参数。
- * @param {(string|Object)} image - 图片地址或Cavans对象,必设参数。
- * @param {number} width - 绘制到画布上的宽度,默认为图片高度。
- * @param {number} height - 绘制到画布上的高度,默认为图片高度。
- * @param {number} sx - 从图片中裁剪的左上角横坐标。
- * @param {number} sy - 从图片中裁剪的左上角纵坐标。
- * @param {number} sWidth - 从图片中裁剪的宽度,默认为图片高度。
- * @param {number} sHeight - 绘制到画布上的高度,默认为图片高度。
- * @returns {SuperMap.Feature.ShapeParameters.Image} 圆形参数对象。
- */
- function Image(x, y, image, width, height, sx, sy, sWidth, sHeight) {
- var _this;
- feature_Image_classCallCheck(this, Image);
- _this = _super.call(this, x, y, image, width, height, sx, sy, sWidth, sHeight);
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.x
- * @description 左上角横坐标,必设参数。
- */
- _this.x = x;
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.y
- * @description 左上角纵坐标,必设参数。
- */
- _this.y = y;
- /**
- * @member {(string|Object)} SuperMap.Feature.ShapeParameters.Image.prototype.image
- * @description 图片地址。
- */
- _this.image = image;
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.width
- * @description 绘制到画布上的宽度,默认为图片高度。
- */
- _this.width = width;
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.height
- * @description 绘制到画布上的高度,默认为图片高度。
- */
- _this.height = height;
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.sx
- * @description 从图片中裁剪的左上角横坐标。
- */
- _this.sx = sx;
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.sy
- * @description 从图片中裁剪的左上角纵坐标。
- */
- _this.sy = sy;
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.sWidth
- * @description 从图片中裁剪的宽度,默认为图片高度。
- */
- _this.sWidth = sWidth;
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.sHeight
- * @description 绘制到画布上的高度,默认为图片高度。
- */
- _this.sHeight = sHeight;
- _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Image";
- return _this;
- }
- /**
- * @function SuperMap.Feature.ShapeParameters.Image.prototype.destroy
- * @description 销毁对象。
- */
- feature_Image_createClass(Image, [{
- key: "destroy",
- value: function destroy() {
- this.x = null;
- this.y = null;
- this.image = null;
- this.width = null;
- this.height = null;
- this.sx = null;
- this.sy = null;
- this.sWidth = null;
- this.sHeight = null;
- feature_Image_get(feature_Image_getPrototypeOf(Image.prototype), "destroy", this).call(this);
- }
- }]);
- return Image;
- }(ShapeParameters);
- SuperMap.Feature = SuperMap.Feature || {};
- SuperMap.Feature.ShapeParameters.Image = Image_Image;
- ;// CONCATENATED MODULE: ./src/common/overlay/feature/Circle.js
- 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); }
- function Circle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Circle_createClass(Constructor, protoProps, staticProps) { if (protoProps) Circle_defineProperties(Constructor.prototype, protoProps); if (staticProps) Circle_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Circle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Circle_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function Circle_setPrototypeOf(o, p) { Circle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Circle_setPrototypeOf(o, p); }
- 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); }; }
- function Circle_possibleConstructorReturn(self, call) { if (call && (Circle_typeof(call) === "object" || typeof call === "function")) { return call; } return Circle_assertThisInitialized(self); }
- function Circle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Circle_getPrototypeOf(o) { Circle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Circle_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.ShapeParameters.Circle
- * @classdesc 圆形参数对象。
- * @category Visualization Theme
- * @extends {SuperMap.Feature.ShapeParameters}
- */
- var Circle_Circle = /*#__PURE__*/function (_ShapeParameters) {
- Circle_inherits(Circle, _ShapeParameters);
- var _super = Circle_createSuper(Circle);
- /**
- * @function SuperMap.Feature.ShapeParameters.Circle.prototype.constructor
- * @description 创建一个圆形参数对象。
- * @param {number} x - 圆心 x 坐标,必设参数。
- * @param {number} y - 圆心 y 坐标,必设参数。
- * @param {number} r - 圆半径,必设参数。
- * @returns {SuperMap.Feature.ShapeParameters.Circle} 圆形参数对象。
- */
- function Circle(x, y, r) {
- var _this;
- Circle_classCallCheck(this, Circle);
- _this = _super.call(this, x, y, r);
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Circle.prototype.x
- * @description 圆心 x 坐标。
- */
- _this.x = !isNaN(x) ? x : 0;
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Circle.prototype.y
- * @description 圆心 y 坐标。
- */
- _this.y = !isNaN(y) ? y : 0;
- /**
- * @member {number} SuperMap.Feature.ShapeParameters.Circle.prototype.r
- * @description 圆半径。
- */
- _this.r = !isNaN(r) ? r : 0;
- _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Circle";
- return _this;
- }
- /**
- * @function SuperMap.Feature.ShapeParameters.Circle.prototype.destroy
- * @description 销毁对象。
- */
- Circle_createClass(Circle, [{
- key: "destroy",
- value: function destroy() {
- this.x = null;
- this.y = null;
- this.r = null;
- Circle_get(Circle_getPrototypeOf(Circle.prototype), "destroy", this).call(this);
- }
- }]);
- return Circle;
- }(ShapeParameters);
- SuperMap.Feature = SuperMap.Feature || {};
- SuperMap.Feature.ShapeParameters.Circle = Circle_Circle;
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Eventful.js
- function Eventful_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Eventful_createClass(Constructor, protoProps, staticProps) { if (protoProps) Eventful_defineProperties(Constructor.prototype, protoProps); if (staticProps) Eventful_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.LevelRenderer.Eventful
- * @category Visualization Theme
- * @classdesc 事件分发器超类,所有支持事件处理的类均是此类的子类。
- * 此类不可实例化。
- * @private
- */
- var Eventful = /*#__PURE__*/function () {
- /**
- * @function SuperMap.LevelRenderer.Eventful.prototype.constructor
- * @description 构造函数。对象可以通过 onxxxx 绑定事件。
- * 支持的事件:
- * Symbolizer properties:
- * onclick - {function} 默认值:null。
- * onmouseover - {function} 默认值:null。
- * onmouseout - {function} 默认值:null。
- * onmousemove - {function} 默认值:null。
- * onmousewheel - {function} 默认值:null。
- * onmousedown - {function} 默认值:null。
- * onmouseup - {function} 默认值:null。
- * ondragstart - {function} 默认值:null。
- * ondragend - {function} 默认值:null。
- * ondragenter - {function} 默认值:null。
- * ondragleave - {function} 默认值:null。
- * ondragover - {function} 默认值:null。
- * ondrop - {function} 默认值:null。
- */
- function Eventful() {
- Eventful_classCallCheck(this, Eventful);
- /**
- * @member {Object} SuperMap.LevelRenderer.Eventful.prototype._handlers
- * @description 事件处理对象(事件分发器)。
- */
- this._handlers = {};
- this.CLASS_NAME = "SuperMap.LevelRenderer.Eventful";
- }
- /**
- * @function {Object} SuperMap.LevelRenderer.Eventful.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- Eventful_createClass(Eventful, [{
- key: "destroy",
- value: function destroy() {
- this._handlers = null;
- }
- /**
- * @function SuperMap.LevelRenderer.Eventful.prototype.one
- * @description 单次触发绑定,dispatch后销毁。
- * @param {string} event - 事件名。
- * @param {boolean} handler - 响应函数。
- * @param {Object} context - context。
- * @returns {SuperMap.LevelRenderer.Eventful} this
- */
- }, {
- key: "one",
- value: function one(event, handler, context) {
- var _h = this._handlers;
- if (!handler || !event) {
- return this;
- }
- if (!_h[event]) {
- _h[event] = [];
- }
- _h[event].push({
- h: handler,
- one: true,
- ctx: context || this
- });
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Eventful.prototype.bind
- * @description 绑定事件。
- * @param {string} event - 事件名。
- * @param {boolean} handler - 响应函数。
- * @param {Object} context - context。
- * @returns {SuperMap.LevelRenderer.Eventful} this
- */
- }, {
- key: "bind",
- value: function bind(event, handler, context) {
- var _h = this._handlers;
- if (!handler || !event) {
- return this;
- }
- if (!_h[event]) {
- _h[event] = [];
- }
- _h[event].push({
- h: handler,
- one: false,
- ctx: context || this
- });
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Eventful.prototype.unbind
- * @description 解绑事件。
- * @param {string} event - 事件名。
- * @param {boolean} handler - 响应函数。
- * @returns {SuperMap.LevelRenderer.Eventful} this
- */
- }, {
- key: "unbind",
- value: function unbind(event, handler) {
- var _h = this._handlers;
- if (!event) {
- this._handlers = {};
- return this;
- }
- if (handler) {
- if (_h[event]) {
- var newList = [];
- for (var i = 0, l = _h[event].length; i < l; i++) {
- if (_h[event][i]['h'] != handler) {
- newList.push(_h[event][i]);
- }
- }
- _h[event] = newList;
- }
- if (_h[event] && _h[event].length === 0) {
- delete _h[event];
- }
- } else {
- delete _h[event];
- }
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Eventful.prototype.dispatch
- * @description 事件分发。
- * @param {string} type - 事件类型。
- * @returns {SuperMap.LevelRenderer.Eventful} this
- */
- }, {
- key: "dispatch",
- value: function dispatch(type) {
- if (this._handlers[type]) {
- var args = arguments;
- var argLen = args.length;
- if (argLen > 3) {
- args = Array.prototype.slice.call(args, 1);
- }
- var _h = this._handlers[type];
- var len = _h.length;
- for (var i = 0; i < len;) {
- // Optimize advise from backbone
- switch (argLen) {
- case 1:
- _h[i]['h'].call(_h[i]['ctx']);
- break;
- case 2:
- _h[i]['h'].call(_h[i]['ctx'], args[1]);
- break;
- case 3:
- _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]);
- break;
- default:
- // have more than 2 given arguments
- _h[i]['h'].apply(_h[i]['ctx'], args);
- break;
- }
- if (_h[i]['one']) {
- _h.splice(i, 1);
- len--;
- } else {
- i++;
- }
- }
- }
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Eventful.prototype.dispatchWithContext
- * @description 带有context的事件分发,最后一个参数是事件回调的 context。
- * @param {string} type - 事件类型。
- * @returns {SuperMap.LevelRenderer.Eventful} this
- */
- }, {
- key: "dispatchWithContext",
- value: function dispatchWithContext(type) {
- if (this._handlers[type]) {
- var args = arguments;
- var argLen = args.length;
- if (argLen > 4) {
- args = Array.prototype.slice.call(args, 1, args.length - 1);
- }
- var ctx = args[args.length - 1];
- var _h = this._handlers[type];
- var len = _h.length;
- for (var i = 0; i < len;) {
- // Optimize advise from backbone
- switch (argLen) {
- case 1:
- _h[i]['h'].call(ctx);
- break;
- case 2:
- _h[i]['h'].call(ctx, args[1]);
- break;
- case 3:
- _h[i]['h'].call(ctx, args[1], args[2]);
- break;
- default:
- // have more than 2 given arguments
- _h[i]['h'].apply(ctx, args);
- break;
- }
- if (_h[i]['one']) {
- _h.splice(i, 1);
- len--;
- } else {
- i++;
- }
- }
- }
- return this;
- }
- }]);
- return Eventful;
- }();
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Vector.js
- function levelRenderer_Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function levelRenderer_Vector_createClass(Constructor, protoProps, staticProps) { if (protoProps) levelRenderer_Vector_defineProperties(Constructor.prototype, protoProps); if (staticProps) levelRenderer_Vector_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Tool.Vector
- * @category Visualization Theme
- * @classdesc LevelRenderer 二维向量类
- *
- */
- var levelRenderer_Vector_Vector = /*#__PURE__*/function () {
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.constructor
- * @description 构造函数
- */
- function Vector() {
- levelRenderer_Vector_classCallCheck(this, Vector);
- this.ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;
- this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Vector";
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.create
- * @description 创建一个向量。
- *
- * @param {number} x - x坐标
- * @param {number} y - Y坐标
- * @return {Vector2} 向量。
- */
- levelRenderer_Vector_createClass(Vector, [{
- key: "create",
- value: function create(x, y) {
- var ArrayCtor = this.ArrayCtor;
- var out = new ArrayCtor(2);
- out[0] = x || 0;
- out[1] = y || 0;
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.copy
- * @description 复制一个向量。
- *
- * @param {Vector2} out - 基础向量。
- * @param {Vector2} v - 向量。
- * @return {Vector2} 克隆向量。
- */
- }, {
- key: "copy",
- value: function copy(out, v) {
- out[0] = v[0];
- out[1] = v[1];
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.set
- * @description 设置向量的两个项。
- *
- * @param {Vector2} out - 基础向量。
- * @param {number} a - 项 a。
- * @param {number} b - 项 b。
- * @return {Vector2} 结果。
- */
- }, {
- key: "set",
- value: function set(out, a, b) {
- out[0] = a;
- out[1] = b;
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.add
- * @description 向量相加。
- *
- * @param {Vector2} out - 基础向量。
- * @param {Vector2} v1 - 向量 v1。
- * @param {Vector2} v2 - 向量 v2。
- * @return {Vector2} 结果。
- */
- }, {
- key: "add",
- value: function add(out, v1, v2) {
- out[0] = v1[0] + v2[0];
- out[1] = v1[1] + v2[1];
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.scaleAndAdd
- * @description 向量缩放后相加。
- * @param {Vector2} out - 基础向量。
- * @param {Vector2} v1 - 向量 v1。
- * @param {Vector2} v2 - 向量 v2(缩放向量)。
- * @param {number} a - 缩放参数。
- * @return {Vector2} 结果。
- */
- }, {
- key: "scaleAndAdd",
- value: function scaleAndAdd(out, v1, v2, a) {
- out[0] = v1[0] + v2[0] * a;
- out[1] = v1[1] + v2[1] * a;
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.sub
- * @description 向量相减。
- * @param {Vector2} out - 基础向量。
- * @param {Vector2} v1 - 向量 v1。
- * @param {Vector2} v2 - 向量 v2。
- * @return {Vector2} 结果。
- */
- }, {
- key: "sub",
- value: function sub(out, v1, v2) {
- out[0] = v1[0] - v2[0];
- out[1] = v1[1] - v2[1];
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.len
- * @description 向量长度。
- * @param {Vector2} v - 向量。
- * @return {number} 向量长度。
- */
- }, {
- key: "len",
- value: function len(v) {
- return Math.sqrt(this.lenSquare(v));
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.lenSquare
- * @description 向量长度平方。
- * @param {Vector2} v - 向量。
- * @return {number} 向量长度平方。
- */
- }, {
- key: "lenSquare",
- value: function lenSquare(v) {
- return v[0] * v[0] + v[1] * v[1];
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.mul
- * @description 向量乘法。
- * @param {Vector2} out - 基础向量。
- * @param {Vector2} v1 - 向量 v1。
- * @param {Vector2} v2 - 向量 v2。
- * @return {Vector2} 结果。
- */
- }, {
- key: "mul",
- value: function mul(out, v1, v2) {
- out[0] = v1[0] * v2[0];
- out[1] = v1[1] * v2[1];
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.div
- * @description 向量除法。
- *
- * @param {Vector2} out - 基础向量。
- * @param {Vector2} v1 - 向量 v1。
- * @param {Vector2} v2 - 向量 v2。
- * @return {Vector2} 结果。
- */
- }, {
- key: "div",
- value: function div(out, v1, v2) {
- out[0] = v1[0] / v2[0];
- out[1] = v1[1] / v2[1];
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.dot
- * @description 向量点乘。
- *
- * @param {Vector2} v1 - 向量 v1。
- * @param {Vector2} v2 - 向量 v2。
- * @return {number} 向量点乘。
- */
- }, {
- key: "dot",
- value: function dot(v1, v2) {
- return v1[0] * v2[0] + v1[1] * v2[1];
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.scale
- * @description 向量缩放。
- *
- * @param {Vector2} out - 基础向量。
- * @param {Vector2} v - 向量v。
- * @param {number} s -缩放参数。
- * @return {Vector2} 结果。
- */
- }, {
- key: "scale",
- value: function scale(out, v, s) {
- out[0] = v[0] * s;
- out[1] = v[1] * s;
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.normalize
- * @description 向量归一化。
- *
- * @param {Vector2} out - 基础向量。
- * @param {Vector2} v - 向量 v。
- * @return {Vector2} 结果。
- */
- }, {
- key: "normalize",
- value: function normalize(out, v) {
- var d = this.len(v);
- if (d === 0) {
- out[0] = 0;
- out[1] = 0;
- } else {
- out[0] = v[0] / d;
- out[1] = v[1] / d;
- }
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.distance
- * @description 计算向量间距离。
- *
- * @param {Vector2} v1 - 向量 v1。
- * @param {Vector2} v2 - 向量 v2。
- * @return {number} 向量间距离。
- */
- }, {
- key: "distance",
- value: function distance(v1, v2) {
- return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]));
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.distanceSquare
- * @description 向量距离平方。
- *
- * @param {Vector2} v1 - 向量 v1。
- * @param {Vector2} v2 - 向量 v2。
- * @return {number} 向量距离平方。
- */
- }, {
- key: "distanceSquare",
- value: function distanceSquare(v1, v2) {
- return (v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]);
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.negate
- * @description 求负向量。
- *
- * @param {Vector2} out - 基础向量。
- * @param {Vector2} v - 向量 v。
- * @return {Vector2} 负向量。
- */
- }, {
- key: "negate",
- value: function negate(out, v) {
- out[0] = -v[0];
- out[1] = -v[1];
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.lerp
- * @description 两点之间线性插值。
- *
- * @param {Vector2} out - 基础向量。
- * @param {Vector2} v1 - 向量 v1。
- * @param {Vector2} v2 - 向量 v2。
- * @param {number} t
- * @return {Vector2} 结果。
- */
- }, {
- key: "lerp",
- value: function lerp(out, v1, v2, t) {
- out[0] = v1[0] + t * (v2[0] - v1[0]);
- out[1] = v1[1] + t * (v2[1] - v1[1]);
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.applyTransform
- * @description 矩阵左乘向量。
- *
- * @param {Vector2} out - 基础向量。
- * @param {Vector2} v1 - 向量 v1。
- * @param {Vector2} v2 - 向量 v2。
- * @return {Vector2} 结果。
- */
- }, {
- key: "applyTransform",
- value: function applyTransform(out, v, m) {
- var x = v[0];
- var y = v[1];
- out[0] = m[0] * x + m[2] * y + m[4];
- out[1] = m[1] * x + m[3] * y + m[5];
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.min
- * @description 求两个向量最小值。
- * @param {Vector2} out - 基础向量。
- * @param {Vector2} v1 - 向量 v1。
- * @param {Vector2} v2 - 向量 v2。
- * @return {Vector2} 结果。
- */
- }, {
- key: "min",
- value: function min(out, v1, v2) {
- out[0] = Math.min(v1[0], v2[0]);
- out[1] = Math.min(v1[1], v2[1]);
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.max
- * @description 求两个向量最大值。
- *
- * @param {Vector2} out - 基础向量。
- * @param {Vector2} v1 - 向量 v1。
- * @param {Vector2} v2 - 向量 v2。
- * @return {Vector2} 结果。
- */
- }, {
- key: "max",
- value: function max(out, v1, v2) {
- out[0] = Math.max(v1[0], v2[0]);
- out[1] = Math.max(v1[1], v2[1]);
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.length
- * @description 向量长度。
- *
- * @param {Vector2} v - 向量。
- * @return {number} 向量长度。
- */
- }, {
- key: "length",
- value: function length(v) {
- return this.len(v);
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.lengthSquare
- * @description 向量长度平方。
- *
- * @param {Vector2} v - 向量。
- * @return {number} 向量长度平方。
- */
- }, {
- key: "lengthSquare",
- value: function lengthSquare(v) {
- return this.lenSquare(v);
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.dist
- * @description 计算向量间距离。
- *
- * @param {Vector2} v1 - 向量 v1。
- * @param {Vector2} v2 - 向量 v2。
- * @return {number} 向量间距离。
- */
- }, {
- key: "dist",
- value: function dist(v1, v2) {
- return this.distance(v1, v2);
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Vector.prototype.distSquare
- * @description 向量距离平方。
- *
- * @param {Vector2} v1 - 向量 v1。
- * @param {Vector2} v2 - 向量 v2。
- * @return {number} 向量距离平方
- */
- }, {
- key: "distSquare",
- value: function distSquare(v1, v2) {
- return this.distanceSquare(v1, v2);
- }
- }]);
- return Vector;
- }();
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Curve.js
- function levelRenderer_Curve_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Curve_createClass(Constructor, protoProps, staticProps) { if (protoProps) Curve_defineProperties(Constructor.prototype, protoProps); if (staticProps) Curve_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.LevelRenderer.Tool.Curve
- * @category Visualization Theme
- * @classdesc LevelRenderer 工具-曲线
- * @private
- */
- var Curve_Curve = /*#__PURE__*/function () {
- /**
- * @function SuperMap.LevelRenderer.Tool.Curve.prototype.constructor
- * @description 构造函数。
- */
- function Curve() {
- levelRenderer_Curve_classCallCheck(this, Curve);
- /**
- * @member {SuperMap.LevelRenderer.Tool.Vector} SuperMap.LevelRenderer.Tool.Curve.prototype.vector
- * @description 矢量工具。
- */
- this.vector = new levelRenderer_Vector_Vector();
- /**
- * @member {number} SuperMap.LevelRenderer.Tool.Curve.prototype.EPSILON
- * @description e。
- */
- this.EPSILON = 1e-4;
- /**
- * @member {number} SuperMap.LevelRenderer.Tool.Curve.prototype.THREE_SQRT
- * @description 3 的平方根。
- */
- this.THREE_SQRT = Math.sqrt(3);
- /**
- * @member {number} SuperMap.LevelRenderer.Tool.Curve.prototype.ONE_THIRD
- * @description 1/3。
- */
- this.ONE_THIRD = 1 / 3;
- this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Curve";
- }
- /*
- * Method: evalCubicCoeff
- *
- * Parameters:
- * a - {number} 值。
- * b - {number} 值。
- * c - {number} 值。
- * d - {number} 值。
- * t - {number} 值。
- *
- * Returns:
- * {number}
- */
- /*
- evalCubicCoeff: function(a, b, c, d, t){
- return ((a * t + b) * t + c) * t + d;
- },
- */
- /**
- * @function SuperMap.LevelRenderer.Tool.Curve.prototype.isAroundZero
- * @description 判断一个值是否趋于0,判断参考值:1e-4。
- * @param {number} val - 值。
- * @returns {boolean} 值是否趋于0。
- */
- Curve_createClass(Curve, [{
- key: "isAroundZero",
- value: function isAroundZero(val) {
- return val > -this.EPSILON && val < this.EPSILON;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Curve.prototype.isNotAroundZero
- * @description 判断一个值是否不趋于0,判断参考值:1e-4。
- * @param {number} val - 值。
- * @returns {boolean} 值是否不趋于0。
- */
- }, {
- key: "isNotAroundZero",
- value: function isNotAroundZero(val) {
- return val > this.EPSILON || val < -this.EPSILON;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicAt
- * @description 计算三次贝塞尔值
- * @param {number} p0 - 点p0。
- * @param {number} p1 - 点p1。
- * @param {number} p2 - 点p2。
- * @param {number} p3 - 点p3。
- * @param {number} t - t值。
- * @returns {number} 三次贝塞尔值。
- */
- }, {
- key: "cubicAt",
- value: function cubicAt(p0, p1, p2, p3, t) {
- var onet = 1 - t;
- return onet * onet * (onet * p0 + 3 * t * p1) + t * t * (t * p3 + 3 * onet * p2);
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicDerivativeAt
- * @description 计算三次贝塞尔导数值
- * @param {number} p0 - 点p0。
- * @param {number} p1 - 点p1。
- * @param {number} p2 - 点p2。
- * @param {number} p3 - 点p3。
- * @param {number} t - t值。
- * @returns {number} 三次贝塞尔导数值。
- */
- }, {
- key: "cubicDerivativeAt",
- value: function cubicDerivativeAt(p0, p1, p2, p3, t) {
- var onet = 1 - t;
- return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + (p3 - p2) * t * t);
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicRootAt
- * @description 计算三次贝塞尔方程根,使用盛金公式
- * @param {number} p0 - 点p0。
- * @param {number} p1 - 点p1。
- * @param {number} p2 - 点p2。
- * @param {number} p3 - 点p3。
- * @param {number} val - 值。
- * @param {Array.<number>} roots - 有效根数目。
- * @returns {number} 有效根。
- */
- }, {
- key: "cubicRootAt",
- value: function cubicRootAt(p0, p1, p2, p3, val, roots) {
- // Evaluate roots of cubic functions
- var a = p3 + 3 * (p1 - p2) - p0;
- var b = 3 * (p2 - p1 * 2 + p0);
- var c = 3 * (p1 - p0);
- var d = p0 - val;
- var A = b * b - 3 * a * c;
- var B = b * c - 9 * a * d;
- var C = c * c - 3 * b * d;
- var n = 0;
- if (this.isAroundZero(A) && this.isAroundZero(B)) {
- if (this.isAroundZero(b)) {
- roots[0] = 0;
- } else {
- var t1 = -c / b; //t1, t2, t3, b is not zero
- if (t1 >= 0 && t1 <= 1) {
- roots[n++] = t1;
- }
- }
- } else {
- var disc = B * B - 4 * A * C;
- if (this.isAroundZero(disc)) {
- var K = B / A;
- var _t2 = -b / a + K; // t1, a is not zero
- var t2 = -K / 2; // t2, t3
- if (_t2 >= 0 && _t2 <= 1) {
- roots[n++] = _t2;
- }
- if (t2 >= 0 && t2 <= 1) {
- roots[n++] = t2;
- }
- } else if (disc > 0) {
- var discSqrt = Math.sqrt(disc);
- var Y1 = A * b + 1.5 * a * (-B + discSqrt);
- var Y2 = A * b + 1.5 * a * (-B - discSqrt);
- if (Y1 < 0) {
- Y1 = -Math.pow(-Y1, this.ONE_THIRD);
- } else {
- Y1 = Math.pow(Y1, this.ONE_THIRD);
- }
- if (Y2 < 0) {
- Y2 = -Math.pow(-Y2, this.ONE_THIRD);
- } else {
- Y2 = Math.pow(Y2, this.ONE_THIRD);
- }
- var _t3 = (-b - (Y1 + Y2)) / (3 * a);
- if (_t3 >= 0 && _t3 <= 1) {
- roots[n++] = _t3;
- }
- } else {
- var T = (2 * A * b - 3 * a * B) / (2 * Math.sqrt(A * A * A));
- var theta = Math.acos(T) / 3;
- var ASqrt = Math.sqrt(A);
- var tmp = Math.cos(theta);
- var _t4 = (-b - 2 * ASqrt * tmp) / (3 * a);
- var _t5 = (-b + ASqrt * (tmp + this.THREE_SQRT * Math.sin(theta))) / (3 * a);
- var t3 = (-b + ASqrt * (tmp - this.THREE_SQRT * Math.sin(theta))) / (3 * a);
- if (_t4 >= 0 && _t4 <= 1) {
- roots[n++] = _t4;
- }
- if (_t5 >= 0 && _t5 <= 1) {
- roots[n++] = _t5;
- }
- if (t3 >= 0 && t3 <= 1) {
- roots[n++] = t3;
- }
- }
- }
- return n;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicRootAt
- * @description 计算三次贝塞尔方程极限值的位置
- * @param {number} p0 - 点p0。
- * @param {number} p1 - 点p1。
- * @param {number} p2 - 点p2。
- * @param {number} p3 - 点p3。
- * @param {Array.<number>} extrema - 值。
- * @returns {number} 有效数目。
- */
- }, {
- key: "cubicExtrema",
- value: function cubicExtrema(p0, p1, p2, p3, extrema) {
- var b = 6 * p2 - 12 * p1 + 6 * p0;
- var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;
- var c = 3 * p1 - 3 * p0;
- var n = 0;
- if (this.isAroundZero(a)) {
- if (this.isNotAroundZero(b)) {
- var t1 = -c / b;
- if (t1 >= 0 && t1 <= 1) {
- extrema[n++] = t1;
- }
- }
- } else {
- var disc = b * b - 4 * a * c;
- if (this.isAroundZero(disc)) {
- extrema[0] = -b / (2 * a);
- } else if (disc > 0) {
- var discSqrt = Math.sqrt(disc);
- var _t6 = (-b + discSqrt) / (2 * a);
- var t2 = (-b - discSqrt) / (2 * a);
- if (_t6 >= 0 && _t6 <= 1) {
- extrema[n++] = _t6;
- }
- if (t2 >= 0 && t2 <= 1) {
- extrema[n++] = t2;
- }
- }
- }
- return n;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicSubdivide
- * @description 细分三次贝塞尔曲线
- * @param {number} p0 - 点p0。
- * @param {number} p1 - 点p1。
- * @param {number} p2 - 点p2。
- * @param {number} p3 - 点p3。
- * @param {number} t - t值。
- * @param {Array.<number>} out - 投射点。
- * @returns {number} 投射点。
- */
- }, {
- key: "cubicSubdivide",
- value: function cubicSubdivide(p0, p1, p2, p3, t, out) {
- var p01 = (p1 - p0) * t + p0;
- var p12 = (p2 - p1) * t + p1;
- var p23 = (p3 - p2) * t + p2;
- var p012 = (p12 - p01) * t + p01;
- var p123 = (p23 - p12) * t + p12;
- var p0123 = (p123 - p012) * t + p012; // Seg0
- out[0] = p0;
- out[1] = p01;
- out[2] = p012;
- out[3] = p0123; // Seg1
- out[4] = p0123;
- out[5] = p123;
- out[6] = p23;
- out[7] = p3;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicProjectPoint
- * @description 投射点到三次贝塞尔曲线上,返回投射距离。投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。
- * @param {number} x0 - 点p0横坐标。
- * @param {number} y0 - 点p0纵坐标。
- * @param {number} x1 - 点p1横坐标。
- * @param {number} y1 - 点p1纵坐标。
- * @param {number} x2 - 点p2横坐标。
- * @param {number} y2 - 点p2纵坐标。
- * @param {number} x3 - 点p3横坐标。
- * @param {number} y3 - 点p3纵坐标。
- * @param {number} x - 点p横坐标。
- * @param {number} y - 点p纵坐标。
- * @param {Array.<number>} out - 投射点。
- * @returns {number} 投射点。
- */
- }, {
- key: "cubicProjectPoint",
- value: function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {
- // 临时变量
- var _v0 = this.vector.create();
- var _v1 = this.vector.create();
- var _v2 = this.vector.create(); // var _v3 = vector.create();
- // http://pomax.github.io/bezierinfo/#projections
- var t;
- var interval = 0.005;
- var d = Infinity;
- _v0[0] = x;
- _v0[1] = y; // 先粗略估计一下可能的最小距离的 t 值
- // PENDING
- for (var _t = 0; _t < 1; _t += 0.05) {
- _v1[0] = this.cubicAt(x0, x1, x2, x3, _t);
- _v1[1] = this.cubicAt(y0, y1, y2, y3, _t);
- var d1 = this.vector.distSquare(_v0, _v1);
- if (d1 < d) {
- t = _t;
- d = d1;
- }
- }
- d = Infinity; // At most 32 iteration
- for (var i = 0; i < 32; i++) {
- if (interval < this.EPSILON) {
- break;
- }
- var prev = t - interval;
- var next = t + interval; // t - interval
- _v1[0] = this.cubicAt(x0, x1, x2, x3, prev);
- _v1[1] = this.cubicAt(y0, y1, y2, y3, prev);
- var _d = this.vector.distSquare(_v1, _v0);
- if (prev >= 0 && _d < d) {
- t = prev;
- d = _d;
- } else {
- // t + interval
- _v2[0] = this.cubicAt(x0, x1, x2, x3, next);
- _v2[1] = this.cubicAt(y0, y1, y2, y3, next);
- var d2 = this.vector.distSquare(_v2, _v0);
- if (next <= 1 && d2 < d) {
- t = next;
- d = d2;
- } else {
- interval *= 0.5;
- }
- }
- } // t
- if (out) {
- out[0] = this.cubicAt(x0, x1, x2, x3, t);
- out[1] = this.cubicAt(y0, y1, y2, y3, t);
- } // console.log(interval, i);
- return Math.sqrt(d);
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Curve.prototype.quadraticAt
- * @description 计算二次方贝塞尔值。
- * @param {number} p0 - 点p0。
- * @param {number} p1 - 点p1。
- * @param {number} p2 - 点p2。
- * @param {number} t - t值。
- * @returns {number} 二次方贝塞尔值。
- */
- }, {
- key: "quadraticAt",
- value: function quadraticAt(p0, p1, p2, t) {
- var onet = 1 - t;
- return onet * (onet * p0 + 2 * t * p1) + t * t * p2;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Curve.prototype.quadraticAt
- * @description 计算二次方贝塞尔导数值。
- * @param {number} p0 - 点p0。
- * @param {number} p1 - 点p1。
- * @param {number} p2 - 点p2。
- * @param {number} t - t值。
- * @returns {number} 二次方贝塞尔导数值。
- */
- }, {
- key: "quadraticDerivativeAt",
- value: function quadraticDerivativeAt(p0, p1, p2, t) {
- return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Curve.prototype.quadraticRootAt
- * @description 计算二次方贝塞尔方程根
- * @param {number} p0 - 点p0。
- * @param {number} p1 - 点p1。
- * @param {number} p2 - 点p2。
- * @param {number} val - 值。
- * @param {Array.<number>} roots - 有效根数目。
- * @returns {number} 有效根数目。
- */
- }, {
- key: "quadraticRootAt",
- value: function quadraticRootAt(p0, p1, p2, val, roots) {
- var a = p0 - 2 * p1 + p2;
- var b = 2 * (p1 - p0);
- var c = p0 - val;
- var n = 0;
- if (this.isAroundZero(a)) {
- if (this.isNotAroundZero(b)) {
- var t1 = -c / b;
- if (t1 >= 0 && t1 <= 1) {
- roots[n++] = t1;
- }
- }
- } else {
- var disc = b * b - 4 * a * c;
- if (this.isAroundZero(disc)) {
- var _t7 = -b / (2 * a);
- if (_t7 >= 0 && _t7 <= 1) {
- roots[n++] = _t7;
- }
- } else if (disc > 0) {
- var discSqrt = Math.sqrt(disc);
- var _t8 = (-b + discSqrt) / (2 * a);
- var t2 = (-b - discSqrt) / (2 * a);
- if (_t8 >= 0 && _t8 <= 1) {
- roots[n++] = _t8;
- }
- if (t2 >= 0 && t2 <= 1) {
- roots[n++] = t2;
- }
- }
- }
- return n;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Curve.prototype.quadraticExtremum
- * @description 计算二次贝塞尔方程极限值
- * @param {number} p0 - 点p0。
- * @param {number} p1 - 点p1。
- * @param {number} p2 - 点p2。
- * @returns {number} 二次贝塞尔方程极限值。
- */
- }, {
- key: "quadraticExtremum",
- value: function quadraticExtremum(p0, p1, p2) {
- var divider = p0 + p2 - 2 * p1;
- if (divider === 0) {
- // p1 is center of p0 and p2
- return 0.5;
- } else {
- return (p0 - p1) / divider;
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Curve.prototype.quadraticProjectPoint
- * @description 投射点到二次贝塞尔曲线上,返回投射距离。投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。
- * @param {number} x0 - 点p0横坐标。
- * @param {number} y0 - 点p0纵坐标。
- * @param {number} x1 - 点p1横坐标。
- * @param {number} y1 - 点p1纵坐标。
- * @param {number} x2 - 点p2横坐标。
- * @param {number} y2 - 点p2纵坐标。
- * @param {number} x - 点p横坐标。
- * @param {number} y - 点p纵坐标。
- * @param {Array.<number>} out - 投射点。
- * @returns {number} 投射距离。
- */
- }, {
- key: "quadraticProjectPoint",
- value: function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {
- // 临时变量
- var _v0 = this.vector.create();
- var _v1 = this.vector.create();
- var _v2 = this.vector.create(); // http://pomax.github.io/bezierinfo/#projections
- var t;
- var interval = 0.005;
- var d = Infinity;
- _v0[0] = x;
- _v0[1] = y; // 先粗略估计一下可能的最小距离的 t 值
- // PENDING
- for (var _t = 0; _t < 1; _t += 0.05) {
- _v1[0] = this.quadraticAt(x0, x1, x2, _t);
- _v1[1] = this.quadraticAt(y0, y1, y2, _t);
- var d1 = this.vector.distSquare(_v0, _v1);
- if (d1 < d) {
- t = _t;
- d = d1;
- }
- }
- d = Infinity; // At most 32 iteration
- for (var i = 0; i < 32; i++) {
- if (interval < this.EPSILON) {
- break;
- }
- var prev = t - interval;
- var next = t + interval; // t - interval
- _v1[0] = this.quadraticAt(x0, x1, x2, prev);
- _v1[1] = this.quadraticAt(y0, y1, y2, prev);
- var _d2 = this.vector.distSquare(_v1, _v0);
- if (prev >= 0 && _d2 < d) {
- t = prev;
- d = _d2;
- } else {
- // t + interval
- _v2[0] = this.quadraticAt(x0, x1, x2, next);
- _v2[1] = this.quadraticAt(y0, y1, y2, next);
- var d2 = this.vector.distSquare(_v2, _v0);
- if (next <= 1 && d2 < d) {
- t = next;
- d = d2;
- } else {
- interval *= 0.5;
- }
- }
- } // t
- if (out) {
- out[0] = this.quadraticAt(x0, x1, x2, t);
- out[1] = this.quadraticAt(y0, y1, y2, t);
- } // console.log(interval, i);
- return Math.sqrt(d);
- }
- }]);
- return Curve;
- }();
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Area.js
- function Area_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Area_createClass(Constructor, protoProps, staticProps) { if (protoProps) Area_defineProperties(Constructor.prototype, protoProps); if (staticProps) Area_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.LevelRenderer.Tool.Area
- * @category Visualization Theme
- * @classdesc LevelRenderer 工具-图形范围判断
- * @private
- */
- var Area = /*#__PURE__*/function () {
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.constructor
- * @description 构造函数。
- */
- function Area() {
- Area_classCallCheck(this, Area);
- /**
- * @member {SuperMap.LevelRenderer.Tool.Util} SuperMap.LevelRenderer.Tool.Areal.prototype.util
- * @description 基础工具对象。
- */
- this.util = new Util_Util();
- /**
- * @member {SuperMap.LevelRenderer.Tool.Curve} SuperMap.LevelRenderer.Tool.Areal.prototype.curve
- * @description 曲线工具对象
- */
- this.curve = new Curve_Curve();
- /**
- * @member {Object} SuperMap.LevelRenderer.Tool.Areal.prototype._ctx
- * @description Cavans2D 渲染上下文
- */
- this._ctx = null;
- /**
- * @member {Object} SuperMap.LevelRenderer.Tool.Areal.prototype._textWidthCache
- * @description 文本宽度缓存
- */
- this._textWidthCache = {};
- /**
- * @member {Object} SuperMap.LevelRenderer.Tool.Areal.prototype._textHeightCache
- * @description 文本高度缓存
- */
- this._textHeightCache = {};
- /**
- * @member {number} SuperMap.LevelRenderer.Tool.Areal.prototype._textWidthCacheCounter
- * @description 文本宽度缓存数量
- */
- this._textWidthCacheCounter = 0;
- /**
- * @member {number} SuperMap.LevelRenderer.Tool.Areal.prototype._textHeightCacheCounter
- * @description 文本高度缓存数量
- */
- this._textHeightCacheCounter = 0;
- /**
- * @member {number} SuperMap.LevelRenderer.Tool.Areal.prototype.TEXT_CACHE_MAX
- * @description 文本最大缓存数量
- */
- this.TEXT_CACHE_MAX = 5000;
- /**
- * @member {number} SuperMap.LevelRenderer.Tool.Areal.prototype.PI2
- * @description 2*PI 的值
- */
- this.PI2 = Math.PI * 2;
- /**
- * @member {Array} SuperMap.LevelRenderer.Tool.Areal.prototype.roots
- * @description 临时数组
- */
- this.roots = [-1, -1, -1];
- /**
- * @member {Array} SuperMap.LevelRenderer.Tool.Areal.prototype.extrema
- * @description 临时数组
- */
- this.extrema = [-1, -1];
- this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Area";
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.normalizeRadian
- * @description 弧度标准化函数。
- * @param {number} angle - 弧度值。
- * @returns {number} 标准化后的弧度值。
- */
- Area_createClass(Area, [{
- key: "normalizeRadian",
- value: function normalizeRadian(angle) {
- angle %= this.PI2;
- if (angle < 0) {
- angle += this.PI2;
- }
- return angle;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInside
- * @description 包含判断。
- * @param {Object} shape - 图形。
- * @param {number} area - 目标区域。
- * @param {number} x - 横坐标。
- * @param {number} y - 纵坐标。
- * @returns {boolean} 图形是否包含鼠标位置。
- */
- }, {
- key: "isInside",
- value: function isInside(shape, area, x, y) {
- if (!area || !shape) {
- // 无参数或不支持类型
- return false;
- }
- var zoneType = shape.type;
- this._ctx = this._ctx || this.util.getContext(); // 未实现或不可用时则数学运算,主要是line,brokenLine,ring
- var _mathReturn = this._mathMethod(shape, area, x, y);
- if (typeof _mathReturn != 'undefined') {
- return _mathReturn;
- }
- if (shape.buildPath && this._ctx.isPointInPath) {
- return this._buildPathMethod(shape, this._ctx, area, x, y);
- } // 上面的方法都行不通时
- switch (zoneType) {
- case 'ellipse': // Todo,不精确
- case 'smicellipse':
- // Todo,不精确
- return true;
- // 旋轮曲线 不准确
- case 'trochoid':
- var _r = area.location == 'out' ? area.r1 + area.r2 + area.d : area.r1 - area.r2 + area.d;
- return this.isInsideCircle(area, x, y, _r);
- // 玫瑰线 不准确
- case 'rose':
- return this.isInsideCircle(area, x, y, area.maxr);
- // 路径,椭圆,曲线等-----------------13
- default:
- return false;
- // Todo,暂不支持
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype._mathMethod
- * @description 包含判断。用数学方法判断,三个方法中最快,但是支持的shape少。
- * @param {Object} shape - 图形。
- * @param {number} area - 目标区域。
- * @param {number} x - 横坐标。
- * @param {number} y - 纵坐标。
- * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形中。
- */
- }, {
- key: "_mathMethod",
- value: function _mathMethod(shape, area, x, y) {
- var zoneType = shape.type; // 在矩形内则部分图形需要进一步判断
- switch (zoneType) {
- // 贝塞尔曲线
- case 'bezier-curve':
- if (typeof area.cpX2 === 'undefined') {
- return this.isInsideQuadraticStroke(area.xStart, area.yStart, area.cpX1, area.cpY1, area.xEnd, area.yEnd, area.lineWidth, x, y);
- }
- return this.isInsideCubicStroke(area.xStart, area.yStart, area.cpX1, area.cpY1, area.cpX2, area.cpY2, area.xEnd, area.yEnd, area.lineWidth, x, y);
- // 线
- case 'line':
- return this.isInsideLine(area.xStart, area.yStart, area.xEnd, area.yEnd, area.lineWidth, x, y);
- // 折线
- case 'broken-line':
- return this.isInsideBrokenLine(area.pointList, area.lineWidth, x, y);
- // 扩展折线
- case 'smicbroken-line':
- {
- // SMIC-修改 - start
- var icX = x;
- var icY = y;
- if (shape.refOriginalPosition) {
- icX = x - shape.refOriginalPosition[0];
- icY = y - shape.refOriginalPosition[1];
- }
- return this.isInsideBrokenLine(area.pointList, area.lineWidth, icX, icY);
- }
- //初始代码:
- // return isInsideBrokenLine(
- // area.pointList, area.lineWidth, x, y
- // );
- // SMIC-修改 - end
- // 圆环
- case 'ring':
- return this.isInsideRing(area.x, area.y, area.r0, area.r, x, y);
- case 'smicring':
- {
- var areaX = area.x;
- var areaY = area.y;
- if (shape.refOriginalPosition) {
- areaX = area.x + shape.refOriginalPosition[0];
- areaY = area.y + shape.refOriginalPosition[1];
- }
- return this.isInsideRing(areaX, areaY, area.r0, area.r, x, y);
- }
- // 圆形
- case 'circle':
- return this.isInsideCircle(area.x, area.y, area.r, x, y);
- // 扩展-点
- case 'smicpoint':
- {
- // SMIC-修改 - start
- var _icX = x;
- var _icY = y;
- if (shape.refOriginalPosition) {
- _icX = x - shape.refOriginalPosition[0];
- _icY = y - shape.refOriginalPosition[1];
- }
- return this.isInsideCircle(area.x, area.y, area.r, _icX, _icY);
- }
- //初始代码:
- // 无
- // SMIC-修改 - end
- // 扇形
- case 'sector':
- {
- var startAngle = area.startAngle * Math.PI / 180;
- var endAngle = area.endAngle * Math.PI / 180;
- if (!area.clockWise) {
- startAngle = -startAngle;
- endAngle = -endAngle;
- }
- return this.isInsideSector(area.x, area.y, area.r0, area.r, startAngle, endAngle, !area.clockWise, x, y);
- }
- //初始代码:
- // 无
- // SMIC-增加 - end
- // 扇形
- case 'smicsector':
- {
- var _startAngle = area.startAngle * Math.PI / 180;
- var _endAngle = area.endAngle * Math.PI / 180;
- if (!area.clockWise) {
- _startAngle = -_startAngle;
- _endAngle = -_endAngle;
- }
- var _areaX = area.x;
- var _areaY = area.y;
- if (shape.refOriginalPosition) {
- _areaX = area.x + shape.refOriginalPosition[0];
- _areaY = area.y + shape.refOriginalPosition[1];
- }
- return this.isInsideSector(_areaX, _areaY, area.r0, area.r, _startAngle, _endAngle, !area.clockWise, x, y);
- }
- // 多边形
- case 'path':
- return this.isInsidePath(area.pathArray, Math.max(area.lineWidth, 5), area.brushType, x, y);
- case 'polygon':
- case 'star':
- case 'smicstar':
- case 'isogon':
- case 'smicisogon':
- return this.isInsidePolygon(area.pointList, x, y);
- // 扩展多边形
- case 'smicpolygon':
- {
- // SMIC-修改 - start
- var _icX2 = x;
- var _icY2 = y;
- if (shape.refOriginalPosition) {
- _icX2 = x - shape.refOriginalPosition[0];
- _icY2 = y - shape.refOriginalPosition[1];
- } //岛洞面
- if (shape.holePolygonPointLists && shape.holePolygonPointLists.length > 0) {
- var isOnBase = this.isInsidePolygon(area.pointList, _icX2, _icY2); // 遍历岛洞子面
- var holePLS = shape.holePolygonPointLists;
- var isOnHole = false;
- for (var i = 0, holePLSen = holePLS.length; i < holePLSen; i++) {
- var holePL = holePLS[i];
- var isOnSubHole = this.isInsidePolygon(holePL, _icX2, _icY2);
- if (isOnSubHole === true) {
- isOnHole = true;
- }
- } // 捕获判断
- return isOnBase === true && isOnHole === false;
- } else {
- return this.isInsidePolygon(area.pointList, _icX2, _icY2);
- }
- }
- // 初始代码:
- // 无
- // SMIC-修改 - end
- // 文本
- case 'text':
- var rect = area.__rect || shape.getRect(area);
- return this.isInsideRect(rect.x, rect.y, rect.width, rect.height, x, y);
- // 扩展文本
- case 'smictext':
- //用文本背景矩形判断
- var textBg = shape.getTextBackground(area);
- return this.isInsidePolygon(textBg, x, y);
- //初始代码:
- // 无
- // SMIC-修改 - end
- // 矩形
- case 'rectangle':
- case 'image':
- // 图片
- return this.isInsideRect(area.x, area.y, area.width, area.height, x, y);
- case 'smicimage':
- {
- var _areaX2 = area.x;
- var _areaY2 = area.y;
- if (shape.refOriginalPosition) {
- _areaX2 = area.x + shape.refOriginalPosition[0];
- _areaY2 = area.y + shape.refOriginalPosition[1];
- }
- return this.isInsideRect(_areaX2, _areaY2, area.width, area.height, x, y);
- }
- //// 扩展矩形
- //case 'smicpolygon':
- // // SMIC-修改 - start
- // var icX = x;
- // var icY = y;
- // if(shape.refOriginalPosition) {
- // icX = x - shape.refOriginalPosition[0];
- // icY = y - shape.refOriginalPosition[1];
- // }
- // return this.isInsideRect(
- // area.x, area.y, area.width, area.height, icX, icY
- // );
- //初始代码:
- // 无
- // SMIC-修改 - end
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype._buildPathMethod
- * @description 包含判断。通过buildPath方法来判断,三个方法中较快,但是不支持线条类型的 shape。
- * @param {Object} shape - 图形。
- * @param {Object} context - 上下文。
- * @param {number} area - 目标区域。
- * @param {number} x - 横坐标。
- * @param {number} y - 纵坐标。
- * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形中。
- */
- }, {
- key: "_buildPathMethod",
- value: function _buildPathMethod(shape, context, area, x, y) {
- // 图形类实现路径创建了则用类的path
- context.beginPath();
- shape.buildPath(context, area);
- context.closePath();
- return context.isPointInPath(x, y);
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isOutside
- * @description 图形是否不包含鼠标位置。
- * @param {Object} shape - 图形。
- * @param {number} area - 目标区域。
- * @param {number} x - 横坐标。
- * @param {number} y - 纵坐标。
- * @returns {boolean} 图形是否不包含鼠标位置, true表示坐标处在图形外。
- */
- }, {
- key: "isOutside",
- value: function isOutside(shape, area, x, y) {
- return !this.isInside(shape, area, x, y);
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideLine
- * @description 线段包含判断。
- * @param {number} x0 - 线起始点横坐标。
- * @param {number} y0 - 线起始点纵坐标。
- * @param {number} x1 - 线终点横坐标。
- * @param {number} y1 - 线终点纵坐标。
- * @param {number} lineWidth - 线宽。
- * @param {number} x - 鼠标位置横坐标。
- * @param {number} y - 鼠标位置纵坐标。
- * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形内。
- */
- }, {
- key: "isInsideLine",
- value: function isInsideLine(x0, y0, x1, y1, lineWidth, x, y) {
- if (lineWidth === 0) {
- return false;
- }
- var _l = Math.max(lineWidth, 5);
- var _a = 0;
- var _b = 0; // Quick reject
- 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) {
- return false;
- }
- if (x0 !== x1) {
- _a = (y0 - y1) / (x0 - x1);
- _b = (x0 * y1 - x1 * y0) / (x0 - x1);
- } else {
- return Math.abs(x - x0) <= _l / 2;
- }
- var tmp = _a * x - y + _b;
- var _s = tmp * tmp / (_a * _a + 1);
- return _s <= _l / 2 * _l / 2;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideCubicStroke
- * @description 三次贝塞尔曲线描边包含判断。
- * @param {number} x0 - 点1横坐标。
- * @param {number} y0 - 点1纵坐标。
- * @param {number} x1 - 点2横坐标。
- * @param {number} y1 - 点2纵坐标。
- * @param {number} x2 - 点3纵坐标。
- * @param {number} y2 - 点3纵坐标。
- * @param {number} lineWidth - 线宽。
- * @param {number} x - 鼠标位置横坐标。
- * @param {number} y - 鼠标位置纵坐标。
- * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
- */
- }, {
- key: "isInsideCubicStroke",
- value: function isInsideCubicStroke(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {
- if (lineWidth === 0) {
- return false;
- }
- var _l = Math.max(lineWidth, 5); // Quick reject
- 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) {
- return false;
- }
- var d = this.curve.cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);
- return d <= _l / 2;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideQuadraticStroke
- * @description 二次贝塞尔曲线描边包含判断。
- * @param {number} x0 - 点1横坐标。
- * @param {number} y0 - 点1纵坐标。
- * @param {number} x1 - 点2横坐标。
- * @param {number} y1 - 点2纵坐标。
- * @param {number} x2 - 点3纵坐标。
- * @param {number} y2 - 点3纵坐标。
- * @param {number} lineWidth - 线宽。
- * @param {number} x - 鼠标位置横坐标。
- * @param {number} y - 鼠标位置纵坐标。
- * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
- */
- }, {
- key: "isInsideQuadraticStroke",
- value: function isInsideQuadraticStroke(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {
- if (lineWidth === 0) {
- return false;
- }
- var _l = Math.max(lineWidth, 5); // Quick reject
- 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) {
- return false;
- }
- var d = this.curve.quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);
- return d <= _l / 2;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideArcStroke
- * @description 圆弧描边包含判断。
- * @param {number} cx - 圆心横坐标。
- * @param {number} cy - 圆心纵坐标。
- * @param {number} r - 圆半径。
- * @param {number} startAngle - 起始角度。
- * @param {number} endAngle - 终止角度。
- * @param {number} anticlockwise - 顺时针还是逆时针。
- * @param {number} lineWidth - 线宽。
- * @param {number} x - 鼠标位置横坐标。
- * @param {number} y - 鼠标位置纵坐标。
- * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
- */
- }, {
- key: "isInsideArcStroke",
- value: function isInsideArcStroke(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {
- var PI2 = this.PI2;
- if (lineWidth === 0) {
- return false;
- }
- var _l = Math.max(lineWidth, 5);
- x -= cx;
- y -= cy;
- var d = Math.sqrt(x * x + y * y);
- if (d - _l > r || d + _l < r) {
- return false;
- }
- if (Math.abs(startAngle - endAngle) >= PI2) {
- // Is a circle
- return true;
- }
- if (anticlockwise) {
- var tmp = startAngle;
- startAngle = this.normalizeRadian(endAngle);
- endAngle = this.normalizeRadian(tmp);
- } else {
- startAngle = this.normalizeRadian(startAngle);
- endAngle = this.normalizeRadian(endAngle);
- }
- if (startAngle > endAngle) {
- endAngle += PI2;
- }
- var angle = Math.atan2(y, x);
- if (angle < 0) {
- angle += PI2;
- }
- return angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideBrokenLine
- * @description 图形 BrokenLine 是否包含鼠标位置, true表示坐标处在图形内。
- * @param {Array} points - 曲线点对象。
- * @param {number} lineWidth - 线宽。
- * @param {number} x - 鼠标位置横坐标。
- * @param {number} y - 鼠标位置纵坐标。
- * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
- */
- }, {
- key: "isInsideBrokenLine",
- value: function isInsideBrokenLine(points, lineWidth, x, y) {
- var _lineWidth = Math.max(lineWidth, 10);
- for (var i = 0, l = points.length - 1; i < l; i++) {
- var x0 = points[i][0];
- var y0 = points[i][1];
- var x1 = points[i + 1][0];
- var y1 = points[i + 1][1];
- if (this.isInsideLine(x0, y0, x1, y1, _lineWidth, x, y)) {
- return true;
- }
- }
- return false;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideRing
- * @description 图形 Ring 是否包含鼠标位置, true表示坐标处在图形内。
- * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
- */
- }, {
- key: "isInsideRing",
- value: function isInsideRing(cx, cy, r0, r, x, y) {
- var d = (x - cx) * (x - cx) + (y - cy) * (y - cy);
- return d < r * r && d > r0 * r0;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideRect
- * @description 图形 Rect 是否包含鼠标位置, true表示坐标处在图形内。
- * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
- */
- }, {
- key: "isInsideRect",
- value: function isInsideRect(x0, y0, width, height, x, y) {
- return x >= x0 && x <= x0 + width && y >= y0 && y <= y0 + height;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideCircle
- * @description 图形 Circle 是否包含鼠标位置, true表示坐标处在图形内。
- * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
- */
- }, {
- key: "isInsideCircle",
- value: function isInsideCircle(x0, y0, r, x, y) {
- return (x - x0) * (x - x0) + (y - y0) * (y - y0) < r * r;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideSector
- * @description 图形 Sector 是否包含鼠标位置, true表示坐标处在图形内。
- * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
- */
- }, {
- key: "isInsideSector",
- value: function isInsideSector(cx, cy, r0, r, startAngle, endAngle, anticlockwise, x, y) {
- return this.isInsideArcStroke(cx, cy, (r0 + r) / 2, startAngle, endAngle, anticlockwise, r - r0, x, y);
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsidePolygon
- * @description 图形 Polygon 是否包含鼠标位置, true表示坐标处在图形内。与 canvas 一样采用 non-zero winding rule
- * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
- */
- }, {
- key: "isInsidePolygon",
- value: function isInsidePolygon(points, x, y) {
- var N = points.length;
- var w = 0;
- for (var i = 0, j = N - 1; i < N; i++) {
- var x0 = points[j][0];
- var y0 = points[j][1];
- var x1 = points[i][0];
- var y1 = points[i][1];
- w += this.windingLine(x0, y0, x1, y1, x, y);
- j = i;
- }
- return w !== 0;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.windingLine
- */
- }, {
- key: "windingLine",
- value: function windingLine(x0, y0, x1, y1, x, y) {
- if (y > y0 && y > y1 || y < y0 && y < y1) {
- return 0;
- }
- if (y1 == y0) {
- return 0;
- }
- var dir = y1 < y0 ? 1 : -1;
- var t = (y - y0) / (y1 - y0);
- var x_ = t * (x1 - x0) + x0;
- return x_ > x ? dir : 0;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.swapExtrema
- */
- }, {
- key: "swapExtrema",
- value: function swapExtrema() {
- var tmp = this.extrema[0];
- this.extrema[0] = this.extrema[1];
- this.extrema[1] = tmp;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.windingCubic
- */
- }, {
- key: "windingCubic",
- value: function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {
- var curve = this.curve;
- var roots = this.roots;
- var extrema = this.extrema; // Quick reject
- if (y > y0 && y > y1 && y > y2 && y > y3 || y < y0 && y < y1 && y < y2 && y < y3) {
- return 0;
- }
- var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots);
- if (nRoots === 0) {
- return 0;
- } else {
- var w = 0;
- var nExtrema = -1;
- var y0_, y1_;
- for (var i = 0; i < nRoots; i++) {
- var t = roots[i];
- var x_ = curve.cubicAt(x0, x1, x2, x3, t);
- if (x_ < x) {
- // Quick reject
- continue;
- }
- if (nExtrema < 0) {
- nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema);
- if (extrema[1] < extrema[0] && nExtrema > 1) {
- this.swapExtrema();
- }
- y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]);
- if (nExtrema > 1) {
- y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]);
- }
- }
- if (nExtrema == 2) {
- // 分成三段单调函数
- if (t < extrema[0]) {
- w += y0_ < y0 ? 1 : -1;
- } else if (t < extrema[1]) {
- w += y1_ < y0_ ? 1 : -1;
- } else {
- w += y3 < y1_ ? 1 : -1;
- }
- } else {
- // 分成两段单调函数
- if (t < extrema[0]) {
- w += y0_ < y0 ? 1 : -1;
- } else {
- w += y3 < y0_ ? 1 : -1;
- }
- }
- }
- return w;
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.windingQuadratic
- */
- }, {
- key: "windingQuadratic",
- value: function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {
- var curve = this.curve;
- var roots = this.roots; // Quick reject
- if (y > y0 && y > y1 && y > y2 || y < y0 && y < y1 && y < y2) {
- return 0;
- }
- var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots);
- if (nRoots === 0) {
- return 0;
- } else {
- var t = curve.quadraticExtremum(y0, y1, y2);
- if (t >= 0 && t <= 1) {
- var w = 0;
- var y_ = curve.quadraticAt(y0, y1, y2, t);
- for (var i = 0; i < nRoots; i++) {
- var x_ = curve.quadraticAt(x0, x1, x2, roots[i]);
- if (x_ > x) {
- continue;
- }
- if (roots[i] < t) {
- w += y_ < y0 ? 1 : -1;
- } else {
- w += y2 < y_ ? 1 : -1;
- }
- }
- return w;
- } else {
- var _x_ = curve.quadraticAt(x0, x1, x2, roots[0]);
- if (_x_ > x) {
- return 0;
- }
- return y2 < y0 ? 1 : -1;
- }
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.windingArc
- * // TODO Arc 旋转
- */
- }, {
- key: "windingArc",
- value: function windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {
- var roots = this.roots;
- var PI2 = this.PI2;
- y -= cy;
- if (y > r || y < -r) {
- return 0;
- }
- var tmp = Math.sqrt(r * r - y * y);
- roots[0] = -tmp;
- roots[1] = tmp;
- if (Math.abs(startAngle - endAngle) >= PI2) {
- // Is a circle
- startAngle = 0;
- endAngle = PI2;
- var dir = anticlockwise ? 1 : -1;
- if (x >= roots[0] + cx && x <= roots[1] + cx) {
- return dir;
- } else {
- return 0;
- }
- }
- if (anticlockwise) {
- var _tmp = startAngle;
- startAngle = this.normalizeRadian(endAngle);
- endAngle = this.normalizeRadian(_tmp);
- } else {
- startAngle = this.normalizeRadian(startAngle);
- endAngle = this.normalizeRadian(endAngle);
- }
- if (startAngle > endAngle) {
- endAngle += PI2;
- }
- var w = 0;
- for (var i = 0; i < 2; i++) {
- var x_ = roots[i];
- if (x_ + cx > x) {
- var angle = Math.atan2(y, x_);
- var _dir = anticlockwise ? 1 : -1;
- if (angle < 0) {
- angle = PI2 + angle;
- }
- if (angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle) {
- if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {
- _dir = -_dir;
- }
- w += _dir;
- }
- }
- }
- return w;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsidePath
- * @description 与 canvas 一样采用 non-zero winding rule
- */
- }, {
- key: "isInsidePath",
- value: function isInsidePath(pathArray, lineWidth, brushType, x, y) {
- var w = 0;
- var xi = 0;
- var yi = 0;
- var x0 = 0;
- var y0 = 0;
- var beginSubpath = true;
- var firstCmd = true;
- brushType = brushType || 'fill';
- var hasStroke = brushType === 'stroke' || brushType === 'both';
- var hasFill = brushType === 'fill' || brushType === 'both'; // var roots = [-1, -1, -1];
- for (var i = 0; i < pathArray.length; i++) {
- var seg = pathArray[i];
- var p = seg.points; // Begin a new subpath
- if (beginSubpath || seg.command === 'M') {
- if (i > 0) {
- // Close previous subpath
- if (hasFill) {
- w += this.windingLine(xi, yi, x0, y0, x, y);
- }
- if (w !== 0) {
- return true;
- }
- }
- x0 = p[p.length - 2];
- y0 = p[p.length - 1];
- beginSubpath = false;
- if (firstCmd && seg.command !== 'A') {
- // 如果第一个命令不是M, 是lineTo, bezierCurveTo
- // 等绘制命令的话,是会从该绘制的起点开始算的
- // Arc 会在之后做单独处理所以这里忽略
- firstCmd = false;
- xi = x0;
- yi = y0;
- }
- }
- switch (seg.command) {
- case 'M':
- xi = p[0];
- yi = p[1];
- break;
- case 'L':
- if (hasStroke) {
- if (this.isInsideLine(xi, yi, p[0], p[1], lineWidth, x, y)) {
- return true;
- }
- }
- if (hasFill) {
- w += this.windingLine(xi, yi, p[0], p[1], x, y);
- }
- xi = p[0];
- yi = p[1];
- break;
- case 'C':
- if (hasStroke) {
- if (this.isInsideCubicStroke(xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], lineWidth, x, y)) {
- return true;
- }
- }
- if (hasFill) {
- w += this.windingCubic(xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], x, y);
- }
- xi = p[4];
- yi = p[5];
- break;
- case 'Q':
- if (hasStroke) {
- if (this.isInsideQuadraticStroke(xi, yi, p[0], p[1], p[2], p[3], lineWidth, x, y)) {
- return true;
- }
- }
- if (hasFill) {
- w += this.windingQuadratic(xi, yi, p[0], p[1], p[2], p[3], x, y);
- }
- xi = p[2];
- yi = p[3];
- break;
- case 'A':
- // TODO Arc 旋转
- // TODO Arc 判断的开销比较大
- var cx = p[0];
- var cy = p[1];
- var rx = p[2];
- var ry = p[3];
- var theta = p[4];
- var dTheta = p[5];
- var x1 = Math.cos(theta) * rx + cx;
- var y1 = Math.sin(theta) * ry + cy; // 不是直接使用 arc 命令
- if (!firstCmd) {
- w += this.windingLine(xi, yi, x1, y1);
- } else {
- firstCmd = false; // 第一个命令起点还未定义
- x0 = x1;
- y0 = y1;
- } // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放
- var _x = (x - cx) * ry / rx + cx;
- if (hasStroke) {
- if (this.isInsideArcStroke(cx, cy, ry, theta, theta + dTheta, 1 - p[7], lineWidth, _x, y)) {
- return true;
- }
- }
- if (hasFill) {
- w += this.windingArc(cx, cy, ry, theta, theta + dTheta, 1 - p[7], _x, y);
- }
- xi = Math.cos(theta + dTheta) * rx + cx;
- yi = Math.sin(theta + dTheta) * ry + cy;
- break;
- case 'z':
- if (hasStroke) {
- if (this.isInsideLine(xi, yi, x0, y0, lineWidth, x, y)) {
- return true;
- }
- }
- beginSubpath = true;
- break;
- }
- }
- if (hasFill) {
- w += this.windingLine(xi, yi, x0, y0, x, y);
- }
- return w !== 0;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.getTextWidth
- * @description 测算多行文本宽度
- */
- }, {
- key: "getTextWidth",
- value: function getTextWidth(text, textFont) {
- var key = text + ':' + textFont;
- if (this._textWidthCache[key]) {
- return this._textWidthCache[key];
- }
- this._ctx = this._ctx || this.util.getContext();
- this._ctx.save();
- if (textFont) {
- this._ctx.font = textFont;
- }
- text = (text + '').split('\n');
- var width = 0;
- for (var i = 0, l = text.length; i < l; i++) {
- width = Math.max(this._ctx.measureText(text[i]).width, width);
- }
- this._ctx.restore();
- this._textWidthCache[key] = width;
- if (++this._textWidthCacheCounter > this.TEXT_CACHE_MAX) {
- // 内存释放
- this._textWidthCacheCounter = 0;
- this._textWidthCache = {};
- }
- return width;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Areal.prototype.getTextHeight
- * @description 测算多行文本高度
- */
- }, {
- key: "getTextHeight",
- value: function getTextHeight(text, textFont) {
- var key = text + ':' + textFont;
- if (this._textHeightCache[key]) {
- return this._textHeightCache[key];
- }
- this._ctx = this._ctx || this.util.getContext();
- this._ctx.save();
- if (textFont) {
- this._ctx.font = textFont;
- }
- text = (text + '').split('\n'); // 比较粗暴
- //var height = (this._ctx.measureText('国').width + 2) * text.length; //打包不支持中文,替换掉
- var height = (this._ctx.measureText('ZH').width + 2) * text.length;
- this._ctx.restore();
- this._textHeightCache[key] = height;
- if (++this._textHeightCacheCounter > this.TEXT_CACHE_MAX) {
- // 内存释放
- this._textHeightCacheCounter = 0;
- this._textHeightCache = {};
- }
- return height;
- }
- }]);
- return Area;
- }();
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/ComputeBoundingBox.js
- function ComputeBoundingBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ComputeBoundingBox_createClass(Constructor, protoProps, staticProps) { if (protoProps) ComputeBoundingBox_defineProperties(Constructor.prototype, protoProps); if (staticProps) ComputeBoundingBox_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.LevelRenderer.Tool.ComputeBoundingBox
- * @category Visualization Theme
- * @classdesc LevelRenderer 工具-图形 Bounds 计算
- * @private
- */
- var ComputeBoundingBox = /*#__PURE__*/function () {
- /**
- * @function SuperMap.LevelRenderer.Tool.ComputeBoundingBox.prototype.constructor
- * @description 构造函数。
- */
- function ComputeBoundingBox() {
- ComputeBoundingBox_classCallCheck(this, ComputeBoundingBox);
- if (arguments.length === 3) {
- this.computeBoundingBox(arguments);
- }
- this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.ComputeBoundingBox";
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.ComputeBoundingBox.prototype.computeBoundingBox
- * @description 从顶点数组中计算出最小包围盒,写入'min'和'max'中。
- * @param {Array.<Object>} points - 顶点数组。
- * @param {Array} min - 最小
- * @param {Array} max - 最大
- */
- ComputeBoundingBox_createClass(ComputeBoundingBox, [{
- key: "computeBoundingBox",
- value: function computeBoundingBox(points, min, max) {
- if (points.length === 0) {
- return;
- }
- var left = points[0][0];
- var right = points[0][0];
- var top = points[0][1];
- var bottom = points[0][1];
- for (var i = 1; i < points.length; i++) {
- var p = points[i];
- if (p[0] < left) {
- left = p[0];
- }
- if (p[0] > right) {
- right = p[0];
- }
- if (p[1] < top) {
- top = p[1];
- }
- if (p[1] > bottom) {
- bottom = p[1];
- }
- }
- min[0] = left;
- min[1] = top;
- max[0] = right;
- max[1] = bottom;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.ComputeBoundingBox.prototype.cubeBezier
- * @description 从三阶贝塞尔曲线(p0, p1, p2, p3)中计算出最小包围盒,写入'min'和'max'中。原:computeCubeBezierBoundingBox。
- * @param {Array.<number>} p0 - 三阶贝塞尔曲线p0点
- * @param {Array.<number>} p1 - 三阶贝塞尔曲线p1点
- * @param {Array.<number>} p2 - 三阶贝塞尔曲线p2点
- * @param {Array.<number>} p3 - 三阶贝塞尔曲线p3点
- * @param {Array.<number>} min - 最小
- * @param {Array.<number>} max - 最大
- */
- }, {
- key: "cubeBezier",
- value: function cubeBezier(p0, p1, p2, p3, min, max) {
- var curve = new Curve_Curve();
- var xDim = [];
- curve.cubicExtrema(p0[0], p1[0], p2[0], p3[0], xDim);
- for (var i = 0; i < xDim.length; i++) {
- xDim[i] = curve.cubicAt(p0[0], p1[0], p2[0], p3[0], xDim[i]);
- }
- var yDim = [];
- curve.cubicExtrema(p0[1], p1[1], p2[1], p3[1], yDim);
- for (var _i = 0; _i < yDim.length; _i++) {
- yDim[_i] = curve.cubicAt(p0[1], p1[1], p2[1], p3[1], yDim[_i]);
- }
- xDim.push(p0[0], p3[0]);
- yDim.push(p0[1], p3[1]);
- var left = Math.min.apply(null, xDim);
- var right = Math.max.apply(null, xDim);
- var top = Math.min.apply(null, yDim);
- var bottom = Math.max.apply(null, yDim);
- min[0] = left;
- min[1] = top;
- max[0] = right;
- max[1] = bottom;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.ComputeBoundingBox.prototype.quadraticBezier
- * @description 从二阶贝塞尔曲线(p0, p1, p2)中计算出最小包围盒,写入'min'和'max'中。原:computeQuadraticBezierBoundingBox。
- * @param {Array.<number>} p0 - 二阶贝塞尔曲线p0点
- * @param {Array.<number>} p1 - 二阶贝塞尔曲线p1点
- * @param {Array.<number>} p2 - 二阶贝塞尔曲线p2点
- * @param {Array.<number>} min - 最小
- * @param {Array.<number>} max - 最大
- */
- }, {
- key: "quadraticBezier",
- value: function quadraticBezier(p0, p1, p2, min, max) {
- var curve = new Curve_Curve(); // Find extremities, where derivative in x dim or y dim is zero
- var t1 = curve.quadraticExtremum(p0[0], p1[0], p2[0]);
- var t2 = curve.quadraticExtremum(p0[1], p1[1], p2[1]);
- t1 = Math.max(Math.min(t1, 1), 0);
- t2 = Math.max(Math.min(t2, 1), 0);
- var ct1 = 1 - t1;
- var ct2 = 1 - t2;
- var x1 = ct1 * ct1 * p0[0] + 2 * ct1 * t1 * p1[0] + t1 * t1 * p2[0];
- var y1 = ct1 * ct1 * p0[1] + 2 * ct1 * t1 * p1[1] + t1 * t1 * p2[1];
- var x2 = ct2 * ct2 * p0[0] + 2 * ct2 * t2 * p1[0] + t2 * t2 * p2[0];
- var y2 = ct2 * ct2 * p0[1] + 2 * ct2 * t2 * p1[1] + t2 * t2 * p2[1];
- min[0] = Math.min(p0[0], p2[0], x1, x2);
- min[1] = Math.min(p0[1], p2[1], y1, y2);
- max[0] = Math.max(p0[0], p2[0], x1, x2);
- max[1] = Math.max(p0[1], p2[1], y1, y2);
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.ComputeBoundingBox.prototype.arc
- * @description 从圆弧中计算出最小包围盒,写入'min'和'max'中。原:computeArcBoundingBox。
- * @param {number} x - 圆弧中心点 x
- * @param {number} y - 圆弧中心点 y
- * @param {number} r - 圆弧半径
- * @param {number} startAngle - 圆弧开始角度
- * @param {number} endAngle - 圆弧结束角度
- * @param {number} anticlockwise - 是否是顺时针
- * @param {number} min - 最小
- * @param {number} max - 最大
- */
- }, {
- key: "arc",
- value: function arc(x, y, r, startAngle, endAngle, anticlockwise, min, max) {
- var vec2 = new levelRenderer_Vector_Vector();
- var start = vec2.create();
- var end = vec2.create();
- var extremity = vec2.create();
- start[0] = Math.cos(startAngle) * r + x;
- start[1] = Math.sin(startAngle) * r + y;
- end[0] = Math.cos(endAngle) * r + x;
- end[1] = Math.sin(endAngle) * r + y;
- vec2.min(min, start, end);
- vec2.max(max, start, end); // Thresh to [0, Math.PI * 2]
- startAngle = startAngle % (Math.PI * 2);
- if (startAngle < 0) {
- startAngle = startAngle + Math.PI * 2;
- }
- endAngle = endAngle % (Math.PI * 2);
- if (endAngle < 0) {
- endAngle = endAngle + Math.PI * 2;
- }
- if (startAngle > endAngle && !anticlockwise) {
- endAngle += Math.PI * 2;
- } else if (startAngle < endAngle && anticlockwise) {
- startAngle += Math.PI * 2;
- }
- if (anticlockwise) {
- var tmp = endAngle;
- endAngle = startAngle;
- startAngle = tmp;
- } // var number = 0;
- // var step = (anticlockwise ? -Math.PI : Math.PI) / 2;
- for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {
- if (angle > startAngle) {
- extremity[0] = Math.cos(angle) * r + x;
- extremity[1] = Math.sin(angle) * r + y;
- vec2.min(min, extremity, min);
- vec2.max(max, extremity, max);
- }
- }
- }
- }]);
- return ComputeBoundingBox;
- }();
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Env.js
- function Env_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Env_createClass(Constructor, protoProps, staticProps) { if (protoProps) Env_defineProperties(Constructor.prototype, protoProps); if (staticProps) Env_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.LevelRenderer.Tool.Env
- * @category Visualization Theme
- * @classdesc 环境识别
- * @private
- */
- var Env = /*#__PURE__*/function () {
- function Env() {
- Env_classCallCheck(this, Env);
- // Zepto.js
- // (c) 2010-2013 Thomas Fuchs
- // Zepto.js may be freely distributed under the MIT license.
- this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Env";
- var me = this;
- function detect(ua) {
- var os = me.os = {};
- var browser = me.browser = {};
- var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/);
- var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
- var ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
- var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
- var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/);
- var webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/);
- var touchpad = webos && ua.match(/TouchPad/);
- var kindle = ua.match(/Kindle\/([\d.]+)/);
- var silk = ua.match(/Silk\/([\d._]+)/);
- var blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/);
- var bb10 = ua.match(/(BB10).*Version\/([\d.]+)/);
- var rimtabletos = ua.match(/(RIM\sTablet\sOS)\s([\d.]+)/);
- var playbook = ua.match(/PlayBook/);
- var chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/);
- var firefox = ua.match(/Firefox\/([\d.]+)/);
- var ie = ua.match(/MSIE ([\d.]+)/);
- var safari = webkit && ua.match(/Mobile\//) && !chrome;
- var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome; // Todo: clean this up with a better OS/browser seperation:
- // - discern (more) between multiple browsers on android
- // - decide if kindle fire in silk mode is android or not
- // - Firefox on Android doesn't specify the Android version
- // - possibly devide in os, device and browser hashes
- /*eslint-disable*/
- if (browser.webkit = !!webkit) {
- browser.version = webkit[1];
- }
- if (android) {
- os.android = true;
- os.version = android[2];
- }
- if (iphone && !ipod) {
- os.ios = os.iphone = true;
- os.version = iphone[2].replace(/_/g, '.');
- }
- if (ipad) {
- os.ios = os.ipad = true;
- os.version = ipad[2].replace(/_/g, '.');
- }
- if (ipod) {
- os.ios = os.ipod = true;
- os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;
- }
- if (webos) {
- os.webos = true;
- os.version = webos[2];
- }
- if (touchpad) {
- os.touchpad = true;
- }
- if (blackberry) {
- os.blackberry = true;
- os.version = blackberry[2];
- }
- if (bb10) {
- os.bb10 = true;
- os.version = bb10[2];
- }
- if (rimtabletos) {
- os.rimtabletos = true;
- os.version = rimtabletos[2];
- }
- if (playbook) {
- browser.playbook = true;
- }
- if (kindle) {
- os.kindle = true;
- os.version = kindle[1];
- }
- if (silk) {
- browser.silk = true;
- browser.version = silk[1];
- }
- if (!silk && os.android && ua.match(/Kindle Fire/)) {
- browser.silk = true;
- }
- if (chrome) {
- browser.chrome = true;
- browser.version = chrome[1];
- }
- if (firefox) {
- browser.firefox = true;
- browser.version = firefox[1];
- }
- if (ie) {
- browser.ie = true;
- browser.version = ie[1];
- }
- if (safari && (ua.match(/Safari/) || !!os.ios)) {
- browser.safari = true;
- }
- if (webview) {
- browser.webview = true;
- }
- if (ie) {
- browser.ie = true;
- browser.version = ie[1];
- }
- os.tablet = !!(ipad || playbook || android && !ua.match(/Mobile/) || firefox && ua.match(/Tablet/) || ie && !ua.match(/Phone/) && ua.match(/Touch/));
- 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/)));
- return {
- browser: browser,
- os: os,
- // 原生canvas支持
- canvasSupported: document.createElement('canvas').getContext ? true : false
- };
- }
- return detect(navigator.userAgent);
- }
- Env_createClass(Env, [{
- key: "destory",
- value: function destory() {
- return true;
- }
- }]);
- return Env;
- }();
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Event.js
- function Event_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Event_createClass(Constructor, protoProps, staticProps) { if (protoProps) Event_defineProperties(Constructor.prototype, protoProps); if (staticProps) Event_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.LevelRenderer.Tool.Event
- * @category Visualization Theme
- * @classdesc LevelRenderer 工具-事件辅助类
- * @private
- */
- var Event_Event = /*#__PURE__*/function () {
- /**
- * @function SuperMap.LevelRenderer.Tool.Event.prototype.constructor
- * @description 构造函数。
- */
- function Event() {
- Event_classCallCheck(this, Event);
- /**
- * @member {function} SuperMap.LevelRenderer.Tool.Event.prototype.stop
- * @description 停止冒泡和阻止默认行为
- */
- this.stop = typeof window.addEventListener === 'function' ? function (e) {
- e.preventDefault();
- e.stopPropagation();
- e.cancelBubble = true;
- } : function (e) {
- e.returnValue = false;
- e.cancelBubble = true;
- };
- this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Event";
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Event.prototype.getX
- * @description 提取鼠标(手指)x坐标。
- * @param {Event} e - 事件。
- * @returns {number} 鼠标(手指)x坐标。
- */
- Event_createClass(Event, [{
- key: "getX",
- value: function getX(e) {
- 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;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Event.prototype.getY
- * @description 提取鼠标(手指)y坐标。
- * @param {Event} e - 事件。
- * @returns {number} 鼠标(手指)y坐标。
- */
- }, {
- key: "getY",
- value: function getY(e) {
- 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;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Event.prototype.getDelta
- * @description 提取鼠标滚轮变化。
- * @param {Event} e - 事件。
- * @returns {number} 滚轮变化,正值说明滚轮是向上滚动,如果是负值说明滚轮是向下滚动。
- */
- }, {
- key: "getDelta",
- value: function getDelta(e) {
- return typeof e.zrenderDelta != 'undefined' && e.zrenderDelta || typeof e.wheelDelta != 'undefined' && e.wheelDelta || typeof e.detail != 'undefined' && -e.detail;
- }
- }]);
- return Event;
- }();
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Http.js
- 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); }
- function Http_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Http_createClass(Constructor, protoProps, staticProps) { if (protoProps) Http_defineProperties(Constructor.prototype, protoProps); if (staticProps) Http_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Tool.Http
- * @category Visualization Theme
- * @classdesc LevelRenderer 工具-Http
- */
- var Http = /*#__PURE__*/function () {
- /**
- * @function SuperMap.LevelRenderer.Tool.Http.constructor
- * @description 构造函数。
- */
- function Http() {
- Http_classCallCheck(this, Http);
- this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Http";
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Http.prototype.get
- * @description get请求。
- * @param {(string|IHTTPGetOption)} url - 请求url
- * @param {function} onsuccess - 请求成功函数
- * @param {function} onerror - 请求失败函数
- * @param {Object} opts - 额外参数
- * @returns {number} cos值
- */
- Http_createClass(Http, [{
- key: "get",
- value: function get(url, onsuccess, onerror) {
- if (Http_typeof(url) === 'object') {
- var obj = url;
- url = obj.url;
- onsuccess = obj.onsuccess;
- onerror = obj.onerror;
- }
- var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new window.ActiveXObject('Microsoft.XMLHTTP');
- xhr.open('GET', url, true);
- xhr.onreadystatechange = function () {
- if (xhr.readyState == 4) {
- if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {
- onsuccess && onsuccess(xhr.responseText);
- } else {
- onerror && onerror();
- }
- xhr.onreadystatechange = new Function();
- xhr = null;
- }
- };
- xhr.send(null);
- }
- }]);
- return Http;
- }();
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Config.js
- function Config_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- var Config = function Config() {
- Config_classCallCheck(this, Config);
- };
- /**
- * @enum EVENT
- * @description 事件
- * @type {Object}
- * @private
- */
- Config.EVENT = {
- //窗口大小变化
- RESIZE: 'resize',
- //鼠标按钮被(手指)按下,事件对象是:目标图形元素或空
- CLICK: 'click',
- //双击事件
- DBLCLICK: 'dblclick',
- //鼠标滚轮变化,事件对象是:目标图形元素或空
- MOUSEWHEEL: 'mousewheel',
- //鼠标(手指)被移动,事件对象是:目标图形元素或空
- MOUSEMOVE: 'mousemove',
- //鼠标移到某图形元素之上,事件对象是:目标图形元素
- MOUSEOVER: 'mouseover',
- //鼠标从某图形元素移开,事件对象是:目标图形元素
- MOUSEOUT: 'mouseout',
- //鼠标按钮(手指)被按下,事件对象是:目标图形元素或空
- MOUSEDOWN: 'mousedown',
- //鼠标按键(手指)被松开,事件对象是:目标图形元素或空
- MOUSEUP: 'mouseup',
- //全局离开,MOUSEOUT触发比较频繁,一次离开优化绑定
- GLOBALOUT: 'globalout',
- // 一次成功元素拖拽的行为事件过程是:
- // dragstart > dragenter > dragover [> dragleave] > drop > dragend
- //开始拖拽时触发,事件对象是:被拖拽图形元素
- DRAGSTART: 'dragstart',
- //拖拽完毕时触发(在drop之后触发),事件对象是:被拖拽图形元素
- DRAGEND: 'dragend',
- //拖拽图形元素进入目标图形元素时触发,事件对象是:目标图形元素
- DRAGENTER: 'dragenter',
- //拖拽图形元素在目标图形元素上移动时触发,事件对象是:目标图形元素
- DRAGOVER: 'dragover',
- //拖拽图形元素离开目标图形元素时触发,事件对象是:目标图形元素
- DRAGLEAVE: 'dragleave',
- //拖拽图形元素放在目标图形元素内时触发,事件对象是:目标图形元素
- DROP: 'drop',
- //touch end - start < delay is click
- touchClickDelay: 300
- };
- /**
- * @enum catchBrushException
- * @description 是否异常捕获
- * @type {boolean}
- * @private
- */
- Config.catchBrushException = false;
- /**
- * @enum debugMode
- * @description debug 日志选项:catchBrushException 为 true 下有效。
- * 0 : 不生成debug数据,发布用
- * 1 : 异常抛出,调试用
- * 2 : 控制台输出,调试用
- * @type {boolean}
- * @private
- */
- Config.debugMode = 0;
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Log.js
- function Log_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Log_createClass(Constructor, protoProps, staticProps) { if (protoProps) Log_defineProperties(Constructor.prototype, protoProps); if (staticProps) Log_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Tool.Log
- * @category Visualization Theme
- * @classdesc LevelRenderer 工具-日志
- */
- var Log = /*#__PURE__*/function () {
- /**
- * @function SuperMap.LevelRenderer.Tool.Log.constructor
- * @description 构造函数。
- */
- function Log() {
- Log_classCallCheck(this, Log);
- this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Log";
- return function () {
- if (Config.debugMode === 0) {
- return;
- } else if (Config.debugMode == 1) {
- for (var k in arguments) {
- throw new Error(arguments[k]);
- }
- } else if (Config.debugMode > 1) {
- for (var _k in arguments) {
- console.log(arguments[_k]);
- }
- }
- };
- /* for debug
- return function(mes) {
- document.getElementById('wrong-message').innerHTML =
- mes + ' ' + (new Date() - 0)
- + '<br/>'
- + document.getElementById('wrong-message').innerHTML;
- };
- */
- }
- Log_createClass(Log, [{
- key: "destory",
- value: function destory() {
- return true;
- }
- }]);
- return Log;
- }();
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Math.js
- function Math_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Math_createClass(Constructor, protoProps, staticProps) { if (protoProps) Math_defineProperties(Constructor.prototype, protoProps); if (staticProps) Math_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Tool.Math
- * @category Visualization Theme
- * @classdesc LevelRenderer 工具-数学辅助类
- */
- var MathTool = /*#__PURE__*/function () {
- /**
- * @function SuperMap.LevelRenderer.Tool.Math.constructor
- * @description 构造函数。
- */
- function MathTool() {
- Math_classCallCheck(this, MathTool);
- /**
- * @member {number} SuperMap.LevelRenderer.Tool.Math._radians
- * @description 角度与弧度转化参数
- */
- this._radians = window.Math.PI / 180;
- this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Math";
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Math.prototype.sin
- * @description 正弦函数。
- * @param {number} angle - 弧度(角度)参数。
- * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
- * @returns {number} sin 值。
- */
- Math_createClass(MathTool, [{
- key: "sin",
- value: function sin(angle, isDegrees) {
- return window.Math.sin(isDegrees ? angle * this._radians : angle);
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Math.prototype.cos
- * @description 余弦函数。
- * @param {number} angle - 弧度(角度)参数。
- * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
- * @returns {number} cos 值。
- */
- }, {
- key: "cos",
- value: function cos(angle, isDegrees) {
- return window.Math.cos(isDegrees ? angle * this._radians : angle);
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Math.prototype.degreeToRadian
- * @description 角度转弧度。
- * @param {number} angle - 弧度(角度)参数。
- * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
- * @returns {number} 弧度值。
- */
- }, {
- key: "degreeToRadian",
- value: function degreeToRadian(angle) {
- return angle * this._radians;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Math.prototype.radianToDegree
- * @description 弧度转角度。
- * @param {number} angle - 弧度(角度)参数。
- * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
- * @returns {number} 角度。
- */
- }, {
- key: "radianToDegree",
- value: function radianToDegree(angle) {
- return angle / this._radians;
- }
- }]);
- return MathTool;
- }();
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Matrix.js
- function Matrix_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Matrix_createClass(Constructor, protoProps, staticProps) { if (protoProps) Matrix_defineProperties(Constructor.prototype, protoProps); if (staticProps) Matrix_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Tool.Matrix
- * @category Visualization Theme
- * @classdesc LevelRenderer 工具-3x2矩阵操作类
- */
- var Matrix = /*#__PURE__*/function () {
- /**
- * @function SuperMap.LevelRenderer.Tool.Matrix.constructor
- * @description 构造函数。
- */
- function Matrix() {
- Matrix_classCallCheck(this, Matrix);
- /**
- * @member {Object} SuperMap.LevelRenderer.Tool.Matrix.prototype.ArrayCtor
- * @description 数组类型控制
- */
- this.ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;
- this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Matrix";
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.create
- * @description 创建一个单位矩阵。
- * @returns {(Float32Array|Array.<number>)} 单位矩阵。
- */
- Matrix_createClass(Matrix, [{
- key: "create",
- value: function create() {
- var ArrayCtor = this.ArrayCtor;
- var out = new ArrayCtor(6);
- this.identity(out);
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.identity
- * @description 设置矩阵为单位矩阵。
- * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
- * @returns {(Float32Array|Array.<number>)} 单位矩阵。
- */
- }, {
- key: "identity",
- value: function identity(out) {
- out[0] = 1;
- out[1] = 0;
- out[2] = 0;
- out[3] = 1;
- out[4] = 0;
- out[5] = 0;
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.copy
- * @description 复制矩阵。
- * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
- * @returns {(Float32Array|Array.<number>)} 克隆矩阵。
- */
- }, {
- key: "copy",
- value: function copy(out, m) {
- out[0] = m[0];
- out[1] = m[1];
- out[2] = m[2];
- out[3] = m[3];
- out[4] = m[4];
- out[5] = m[5];
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.mul
- * @description 矩阵相乘。
- * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
- * @param {(Float32Array|Array.<number>)} m1 - 矩阵m1。
- * @param {(Float32Array|Array.<number>)} m2- 矩阵m2。
- * @returns {(Float32Array|Array.<number>)} 结果矩阵。
- */
- }, {
- key: "mul",
- value: function mul(out, m1, m2) {
- out[0] = m1[0] * m2[0] + m1[2] * m2[1];
- out[1] = m1[1] * m2[0] + m1[3] * m2[1];
- out[2] = m1[0] * m2[2] + m1[2] * m2[3];
- out[3] = m1[1] * m2[2] + m1[3] * m2[3];
- out[4] = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];
- out[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.mul
- * @description 平移变换。
- * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
- * @param {(Float32Array|Array.<number>)} a - 矩阵。
- * @param {(Float32Array|Array.<number>)} v- 平移参数。
- * @returns {(Float32Array|Array.<number>)} 结果矩阵。
- */
- }, {
- key: "translate",
- value: function translate(out, a, v) {
- out[0] = a[0];
- out[1] = a[1];
- out[2] = a[2];
- out[3] = a[3];
- out[4] = a[4] + v[0];
- out[5] = a[5] + v[1];
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.rotate
- * @description 平移变换。
- * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
- * @param {(Float32Array|Array.<number>)} a - 矩阵。
- * @param {(Float32Array|Array.<number>)} rad - 旋转参数。
- * @returns {(Float32Array|Array.<number>)} 结果矩阵。
- */
- }, {
- key: "rotate",
- value: function rotate(out, a, rad) {
- var aa = a[0];
- var ac = a[2];
- var atx = a[4];
- var ab = a[1];
- var ad = a[3];
- var aty = a[5];
- var st = Math.sin(rad);
- var ct = Math.cos(rad);
- out[0] = aa * ct + ab * st;
- out[1] = -aa * st + ab * ct;
- out[2] = ac * ct + ad * st;
- out[3] = -ac * st + ct * ad;
- out[4] = ct * atx + st * aty;
- out[5] = ct * aty - st * atx;
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.scale
- * @description 缩放变换。
- * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
- * @param {(Float32Array|Array.<number>)} a - 矩阵。
- * @param {(Float32Array|Array.<number>)} v - 缩放参数。
- * @returns {(Float32Array|Array.<number>)} 结果矩阵。
- */
- }, {
- key: "scale",
- value: function scale(out, a, v) {
- var vx = v[0];
- var vy = v[1];
- out[0] = a[0] * vx;
- out[1] = a[1] * vy;
- out[2] = a[2] * vx;
- out[3] = a[3] * vy;
- out[4] = a[4] * vx;
- out[5] = a[5] * vy;
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.invert
- * @description 求逆矩阵。
- * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
- * @param {(Float32Array|Array.<number>)} a - 矩阵。
- * @returns {(Float32Array|Array.<number>)} 结果矩阵。
- */
- }, {
- key: "invert",
- value: function invert(out, a) {
- var aa = a[0];
- var ac = a[2];
- var atx = a[4];
- var ab = a[1];
- var ad = a[3];
- var aty = a[5];
- var det = aa * ad - ab * ac;
- if (!det) {
- return null;
- }
- det = 1.0 / det;
- out[0] = ad * det;
- out[1] = -ab * det;
- out[2] = -ac * det;
- out[3] = aa * det;
- out[4] = (ac * aty - ad * atx) * det;
- out[5] = (ab * atx - aa * aty) * det;
- return out;
- }
- /**
- * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.mulVector
- * @description 矩阵左乘向量。
- * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
- * @param {(Float32Array|Array.<number>)} a - 矩阵。
- * @param {(Float32Array|Array.<number>)} v - 缩放参数。
- * @returns {(Float32Array|Array.<number>)} 结果矩阵。
- */
- }, {
- key: "mulVector",
- value: function mulVector(out, a, v) {
- var aa = a[0];
- var ac = a[2];
- var atx = a[4];
- var ab = a[1];
- var ad = a[3];
- var aty = a[5];
- out[0] = v[0] * aa + v[1] * ac + atx;
- out[1] = v[0] * ab + v[1] * ad + aty;
- return out;
- }
- }]);
- return Matrix;
- }();
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SUtil.js
- function SUtil_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SUtil_createClass(Constructor, protoProps, staticProps) { if (protoProps) SUtil_defineProperties(Constructor.prototype, protoProps); if (staticProps) SUtil_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- var SUtil_SUtil = /*#__PURE__*/function () {
- function SUtil() {
- SUtil_classCallCheck(this, SUtil);
- }
- SUtil_createClass(SUtil, null, [{
- key: "SUtil_smoothBezier",
- /**
- * @function SuperMap.LevelRenderer.SUtil.SUtil_smoothBezier
- * @description 贝塞尔平滑曲线。
- * @private
- * @param {Array} points - 线段顶点数组。
- * @param {number} smooth - 平滑等级, 0-1。
- * @param {boolean} isLoop - isLoop。
- * @param {Array} constraint - 将计算出来的控制点约束在一个包围盒内,比如 [[0, 0], [100, 100]], 这个包围盒会与整个折线的包围盒做一个并集用来约束控制点。
- * @param {Array} [originalPosition=[0, 0]] - 参考原点。
- * @return {Array} 生成的平滑节点数组。
- */
- value: function SUtil_smoothBezier(points, smooth, isLoop, constraint, originalPosition) {
- if (!originalPosition || originalPosition !== 2) {
- originalPosition = [0, 0];
- }
- var __OP = originalPosition;
- var cps = [];
- var v = [];
- var v1 = [];
- var v2 = [];
- var hasConstraint = !!constraint;
- var min, max;
- if (hasConstraint) {
- min = [Infinity, Infinity];
- max = [-Infinity, -Infinity];
- var _len = points.length;
- for (var i = 0; i < _len; i++) {
- SUtil.Util_vector.min(min, min, [points[i][0] + __OP[0], points[i][1] + __OP[1]]);
- SUtil.Util_vector.max(max, max, [points[i][0] + __OP[0], points[i][1] + __OP[1]]);
- } // 与指定的包围盒做并集
- SUtil.Util_vector.min(min, min, constraint[0]);
- SUtil.Util_vector.max(max, max, constraint[1]);
- }
- var len = points.length;
- for (var _i = 0; _i < len; _i++) {
- var point = [points[_i][0] + __OP[0], points[_i][1] + __OP[1]];
- var prevPoint = void 0;
- var nextPoint = void 0;
- if (isLoop) {
- prevPoint = [points[_i ? _i - 1 : len - 1][0] + __OP[0], points[_i ? _i - 1 : len - 1][1] + __OP[1]];
- nextPoint = [points[(_i + 1) % len][0] + __OP[0], points[(_i + 1) % len][1] + __OP[1]];
- } else {
- if (_i === 0 || _i === len - 1) {
- cps.push([points[_i][0] + __OP[0], points[_i][1] + __OP[1]]);
- continue;
- } else {
- prevPoint = [points[_i - 1][0] + __OP[0], points[_i - 1][1] + __OP[1]];
- nextPoint = [points[_i + 1][0] + __OP[0], points[_i + 1][1] + __OP[1]];
- }
- }
- SUtil.Util_vector.sub(v, nextPoint, prevPoint); // use degree to scale the handle length
- SUtil.Util_vector.scale(v, v, smooth);
- var d0 = SUtil.Util_vector.distance(point, prevPoint);
- var d1 = SUtil.Util_vector.distance(point, nextPoint);
- var sum = d0 + d1;
- if (sum !== 0) {
- d0 /= sum;
- d1 /= sum;
- }
- SUtil.Util_vector.scale(v1, v, -d0);
- SUtil.Util_vector.scale(v2, v, d1);
- var cp0 = SUtil.Util_vector.add([], point, v1);
- var cp1 = SUtil.Util_vector.add([], point, v2);
- if (hasConstraint) {
- SUtil.Util_vector.max(cp0, cp0, min);
- SUtil.Util_vector.min(cp0, cp0, max);
- SUtil.Util_vector.max(cp1, cp1, min);
- SUtil.Util_vector.min(cp1, cp1, max);
- }
- cps.push(cp0);
- cps.push(cp1);
- }
- if (isLoop) {
- cps.push(cps.shift());
- }
- return cps;
- }
- /**
- * @function SuperMap.LevelRenderer.SUtil.SUtil_smoothSpline
- * @description 插值折线。
- * @private
- * @param {Array} points - 线段顶点数组。
- * @param {boolean} isLoop - isLoop。
- * @param {Array} constraint - 将计算出来的控制点约束在一个包围盒内,比如 [[0, 0], [100, 100]], 这个包围盒会与整个折线的包围盒做一个并集用来约束控制点。
- * @param {Array} originalPosition - 参考原点。默认值:[0, 0]。
- * @return {Array} 生成的平滑节点数组。
- */
- }, {
- key: "SUtil_smoothSpline",
- value: function SUtil_smoothSpline(points, isLoop, constraint, originalPosition) {
- if (!originalPosition || originalPosition !== 2) {
- originalPosition = [0, 0];
- }
- var __OP = originalPosition;
- var len = points.length;
- var ret = [];
- var distance = 0;
- for (var i = 1; i < len; i++) {
- 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]]);
- }
- var segs = distance / 5;
- segs = segs < len ? len : segs;
- for (var _i2 = 0; _i2 < segs; _i2++) {
- var pos = _i2 / (segs - 1) * (isLoop ? len : len - 1);
- var idx = Math.floor(pos);
- var w = pos - idx;
- var p0 = void 0;
- var p1 = [points[idx % len][0] + __OP[0], points[idx % len][1] + __OP[1]];
- var p2 = void 0;
- var p3 = void 0;
- if (!isLoop) {
- p0 = [points[idx === 0 ? idx : idx - 1][0] + __OP[0], points[idx === 0 ? idx : idx - 1][1] + __OP[1]];
- p2 = [points[idx > len - 2 ? len - 1 : idx + 1][0] + __OP[0], points[idx > len - 2 ? len - 1 : idx + 1][1] + __OP[1]];
- p3 = [points[idx > len - 3 ? len - 1 : idx + 2][0] + __OP[0], points[idx > len - 3 ? len - 1 : idx + 2][1] + __OP[1]];
- } else {
- p0 = [points[(idx - 1 + len) % len][0] + __OP[0], points[(idx - 1 + len) % len][1] + __OP[1]];
- p2 = [points[(idx + 1) % len][0] + __OP[0], points[(idx + 1) % len][1] + __OP[1]];
- p3 = [points[(idx + 2) % len][0] + __OP[0], points[(idx + 2) % len][1] + __OP[1]];
- }
- var w2 = w * w;
- var w3 = w * w2;
- 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)]);
- }
- return ret; // inner Function
- function interpolate(p0, p1, p2, p3, t, t2, t3) {
- var v0 = (p2 - p0) * 0.5;
- var v1 = (p3 - p1) * 0.5;
- return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;
- }
- }
- /**
- * @function SuperMap.LevelRenderer.SUtil.SUtil_dashedLineTo
- * @description 虚线 lineTo。
- */
- }, {
- key: "SUtil_dashedLineTo",
- value: function SUtil_dashedLineTo(ctx, x1, y1, x2, y2, dashLength, customDashPattern) {
- // http://msdn.microsoft.com/en-us/library/ie/dn265063(v=vs.85).aspx
- var dashPattern = [5, 5];
- dashLength = typeof dashLength != 'number' ? 5 : dashLength;
- if (ctx.setLineDash) {
- dashPattern[0] = dashLength;
- dashPattern[1] = dashLength;
- if (customDashPattern && customDashPattern instanceof Array) {
- ctx.setLineDash(customDashPattern);
- } else {
- ctx.setLineDash(dashPattern);
- } // ctx.setLineDash(dashPattern);
- ctx.moveTo(x1, y1);
- ctx.lineTo(x2, y2);
- return;
- }
- var dx = x2 - x1;
- var dy = y2 - y1;
- var numDashes = Math.floor(Math.sqrt(dx * dx + dy * dy) / dashLength);
- dx = dx / numDashes;
- dy = dy / numDashes;
- var flag = true;
- for (var i = 0; i < numDashes; ++i) {
- if (flag) {
- ctx.moveTo(x1, y1);
- } else {
- ctx.lineTo(x1, y1);
- }
- flag = !flag;
- x1 += dx;
- y1 += dy;
- }
- ctx.lineTo(x2, y2);
- }
- }]);
- return SUtil;
- }(); // 把所有工具对象放到全局静态变量上,以便直接调用工具方法,
- // 避免使用工具时频繁的创建工具对象带来的性能消耗。
- SUtil_SUtil.Util_area = new Area();
- SUtil_SUtil.Util_color = new Color();
- SUtil_SUtil.Util_computeBoundingBox = new ComputeBoundingBox();
- SUtil_SUtil.Util_curve = new Curve_Curve();
- SUtil_SUtil.Util_env = new Env();
- SUtil_SUtil.Util_event = new Event_Event();
- SUtil_SUtil.Util_http = new Http();
- SUtil_SUtil.Util_log = new Log();
- SUtil_SUtil.Util_math = new MathTool();
- SUtil_SUtil.Util_matrix = new Matrix();
- SUtil_SUtil.Util = new Util_Util();
- SUtil_SUtil.Util_vector = new levelRenderer_Vector_Vector();
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Transformable.js
- function Transformable_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Transformable_createClass(Constructor, protoProps, staticProps) { if (protoProps) Transformable_defineProperties(Constructor.prototype, protoProps); if (staticProps) Transformable_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Transformable
- * @category Visualization Theme
- * @classdesc 可变换超类,所有支持 Canvas Transform 变换操作的类均是此类的子类。此类不可实例化。
- */
- var Transformable = /*#__PURE__*/function () {
- /**
- * @function SuperMap.LevelRenderer.Transformable.constructor
- * @description 构造函数。
- */
- function Transformable() {
- Transformable_classCallCheck(this, Transformable);
- /**
- * @member {Array.<number>} SuperMap.LevelRenderer.Transformable.prototype.position
- * @description 平移, 默认值:[0, 0]。
- */
- this.position = [0, 0];
- /**
- * @member {Array.<number>} SuperMap.LevelRenderer.Transformable.prototype.rotation
- * @description 旋转,可以通过数组二三项指定旋转的原点, 默认值:[0, 0, 0]。
- */
- this.rotation = [0, 0, 0];
- /**
- * @member {Array.<number>} SuperMap.LevelRenderer.Transformable.prototype.scale
- * @description 缩放,可以通过数组三四项指定缩放的原点, 默认值:[1, 1, 0, 0]。
- */
- this.scale = [1, 1, 0, 0];
- /**
- * @member {boolean} SuperMap.LevelRenderer.Transformable.prototype.needLocalTransform
- * @description 是否变换。默认值:false。
- */
- this.needLocalTransform = false;
- /**
- * @member {boolean} SuperMap.LevelRenderer.Transformable.prototype.needTransform
- * @description 是否有坐标变换。默认值:false。
- */
- this.needTransform = false;
- this.CLASS_NAME = "SuperMap.LevelRenderer.Transformable";
- /**
- * @function SuperMap.LevelRenderer.Transformable.prototype.lookAt
- * @description 设置图形的朝向。
- */
- this.lookAt = function () {
- var v = SUtil_SUtil.Util_vector.create(); // {Array.<Number>|Float32Array} target
- return function (target) {
- if (!this.transform) {
- this.transform = SUtil_SUtil.Util_matrix.create();
- }
- var m = this.transform;
- SUtil_SUtil.Util_vector.sub(v, target, this.position);
- if (isAroundZero(v[0]) && isAroundZero(v[1])) {
- return;
- }
- SUtil_SUtil.Util_vector.normalize(v, v); // Y Axis
- // TODO Scale origin ?
- m[2] = v[0] * this.scale[1];
- m[3] = v[1] * this.scale[1]; // X Axis
- m[0] = v[1] * this.scale[0];
- m[1] = -v[0] * this.scale[0]; // Position
- m[4] = this.position[0];
- m[5] = this.position[1];
- this.decomposeTransform();
- function isAroundZero(val) {
- var EPSILON = 5e-5;
- return val > -EPSILON && val < EPSILON;
- }
- };
- }();
- }
- /**
- * @function SuperMap.LevelRenderer.Transformable.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- Transformable_createClass(Transformable, [{
- key: "destroy",
- value: function destroy() {
- this.position = null;
- this.rotation = null;
- this.scale = null;
- this.needLocalTransform = null;
- this.needTransform = null;
- }
- /**
- * @function SuperMap.LevelRenderer.Transformable.prototype.updateNeedTransform
- * @description 更新 needLocalTransform
- */
- }, {
- key: "updateNeedTransform",
- value: function updateNeedTransform() {
- this.needLocalTransform = isNotAroundZero(this.rotation[0]) || isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1]) || isNotAroundZero(this.scale[0] - 1) || isNotAroundZero(this.scale[1] - 1);
- function isNotAroundZero(val) {
- var EPSILON = 5e-5;
- return val > EPSILON || val < -EPSILON;
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Transformable.prototype.updateTransform
- * @description 判断是否需要有坐标变换,更新 needTransform 属性。如果有坐标变换, 则从 position, rotation, scale 以及父节点的 transform 计算出自身的 transform 矩阵
- */
- }, {
- key: "updateTransform",
- value: function updateTransform() {
- this.updateNeedTransform();
- if (this.parent) {
- this.needTransform = this.needLocalTransform || this.parent.needTransform;
- } else {
- this.needTransform = this.needLocalTransform;
- }
- if (!this.needTransform) {
- return;
- }
- var origin = [0, 0];
- var m = this.transform || SUtil_SUtil.Util_matrix.create();
- SUtil_SUtil.Util_matrix.identity(m);
- if (this.needLocalTransform) {
- if (isNotAroundZero(this.scale[0]) || isNotAroundZero(this.scale[1])) {
- origin[0] = -this.scale[2] || 0;
- origin[1] = -this.scale[3] || 0;
- var haveOrigin = isNotAroundZero(origin[0]) || isNotAroundZero(origin[1]);
- if (haveOrigin) {
- SUtil_SUtil.Util_matrix.translate(m, m, origin);
- }
- SUtil_SUtil.Util_matrix.scale(m, m, this.scale);
- if (haveOrigin) {
- origin[0] = -origin[0];
- origin[1] = -origin[1];
- SUtil_SUtil.Util_matrix.translate(m, m, origin);
- }
- }
- if (this.rotation instanceof Array) {
- if (this.rotation[0] !== 0) {
- origin[0] = -this.rotation[1] || 0;
- origin[1] = -this.rotation[2] || 0;
- var _haveOrigin = isNotAroundZero(origin[0]) || isNotAroundZero(origin[1]);
- if (_haveOrigin) {
- SUtil_SUtil.Util_matrix.translate(m, m, origin);
- }
- SUtil_SUtil.Util_matrix.rotate(m, m, this.rotation[0]);
- if (_haveOrigin) {
- origin[0] = -origin[0];
- origin[1] = -origin[1];
- SUtil_SUtil.Util_matrix.translate(m, m, origin);
- }
- }
- } else {
- if (this.rotation !== 0) {
- SUtil_SUtil.Util_matrix.rotate(m, m, this.rotation);
- }
- }
- if (isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1])) {
- SUtil_SUtil.Util_matrix.translate(m, m, this.position);
- }
- } // 保存这个变换矩阵
- this.transform = m; // 应用父节点变换
- if (this.parent && this.parent.needTransform) {
- if (this.needLocalTransform) {
- SUtil_SUtil.Util_matrix.mul(this.transform, this.parent.transform, this.transform);
- } else {
- SUtil_SUtil.Util_matrix.copy(this.transform, this.parent.transform);
- }
- }
- function isNotAroundZero(val) {
- var EPSILON = 5e-5;
- return val > EPSILON || val < -EPSILON;
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Transformable.prototype.setTransform
- * @description 将自己的 transform 应用到 context 上。
- *
- * @param {Context2D} ctx - Context2D 上下文。
- */
- }, {
- key: "setTransform",
- value: function setTransform(ctx) {
- if (this.needTransform) {
- var m = this.transform;
- ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Transformable.prototype.decomposeTransform
- * @description 分解`transform`矩阵到`position`, `rotation`, `scale` 。
- */
- }, {
- key: "decomposeTransform",
- value: function decomposeTransform() {
- if (!this.transform) {
- return;
- }
- var m = this.transform;
- var sx = m[0] * m[0] + m[1] * m[1];
- var position = this.position;
- var scale = this.scale;
- var rotation = this.rotation;
- if (isNotAroundZero(sx - 1)) {
- sx = Math.sqrt(sx);
- }
- var sy = m[2] * m[2] + m[3] * m[3];
- if (isNotAroundZero(sy - 1)) {
- sy = Math.sqrt(sy);
- }
- position[0] = m[4];
- position[1] = m[5];
- scale[0] = sx;
- scale[1] = sy;
- scale[2] = scale[3] = 0;
- rotation[0] = Math.atan2(-m[1] / sy, m[0] / sx);
- rotation[1] = rotation[2] = 0;
- function isNotAroundZero(val) {
- var EPSILON = 5e-5;
- return val > EPSILON || val < -EPSILON;
- }
- }
- }]);
- return Transformable;
- }();
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Shape.js
- 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); }
- function Shape_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Shape_createClass(Constructor, protoProps, staticProps) { if (protoProps) Shape_defineProperties(Constructor.prototype, protoProps); if (staticProps) Shape_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Shape_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Shape_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function Shape_setPrototypeOf(o, p) { Shape_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Shape_setPrototypeOf(o, p); }
- 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); }; }
- function Shape_possibleConstructorReturn(self, call) { if (call && (Shape_typeof(call) === "object" || typeof call === "function")) { return call; } return Shape_assertThisInitialized(self); }
- function Shape_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Shape_getPrototypeOf(o) { Shape_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Shape_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Shape
- * @category Visualization Theme
- * @classdesc 图形(shape)基类。
- * @extends SuperMap.LevelRenderer.Eventful
- * @extends SuperMap.LevelRenderer.Transformable
- */
- var Shape_Shape = /*#__PURE__*/function (_SuperMap$mixin) {
- Shape_inherits(Shape, _SuperMap$mixin);
- var _super = Shape_createSuper(Shape);
- /**
- * @function SuperMap.LevelRenderer.Shape.constructor
- * @description 构造函数。
- *
- * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
- *
- */
- function Shape(options) {
- var _this;
- Shape_classCallCheck(this, Shape);
- _this = _super.call(this, options);
- options = options || {};
- /**
- * @member {string} SuperMap.LevelRenderer.Shape.prototype.id
- * @description 唯一标识。
- */
- _this.id = null;
- /**
- * @member {Object} SuperMap.LevelRenderer.Shape.prototype.style
- * @description 基础绘制样式。
- * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
- * @param {string} style.color - 填充颜色。默认值:"#000000'"。
- * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
- * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
- * @param {number} style.lineWidth - 描边宽度。默认值:1。
- * @param {number} style.opacity - 绘制透明度。默认值:1。
- * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
- * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
- * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
- * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
- * @param {string} style.text - 图形中的附加文本。默认值:""。
- * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
- * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
- * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
- * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
- * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
- *
- */
- _this.style = {};
- /**
- * @member {Object} SuperMap.LevelRenderer.Shape.prototype.style.__rect
- * @description 包围图形的最小矩形盒子。
- *
- * @param {number} x - 左上角顶点x轴坐标。
- * @param {number} y - 左上角顶点y轴坐标。
- * @param {number} width - 包围盒矩形宽度。
- * @param {number} height - 包围盒矩形高度。
- */
- /**
- * @member {Object} SuperMap.LevelRenderer.Shape.prototype.highlightStyle
- * @description 高亮样式。
- *
- * @param {string} highlightStyle.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
- * @param {string} highlightStyle.color - 填充颜色。默认值:"#000000'"。
- * @param {string} highlightStyle.strokeColor - 描边颜色。默认值:"#000000'"。
- * @param {string} highlightStyle.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
- * @param {number} highlightStyle.lineWidth - 描边宽度。默认值:1。
- * @param {number} highlightStyle.opacity - 绘制透明度。默认值:1。
- * @param {number} highlightStyle.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
- * @param {number} highlightStyle.shadowColor - 阴影颜色。默认值:"#000000'"。
- * @param {number} highlightStyle.shadowOffsetX - 阴影横向偏移。默认值:0。
- * @param {number} highlightStyle.shadowOffsetY - 阴影纵向偏移。默认值:0。
- * @param {string} highlightStyle.text - 图形中的附加文本。默认值:""。
- * @param {string} highlightStyle.textColor - 文本颜色。默认值:"#000000'"。
- * @param {string} highlightStyle.textFont - 附加文本样式。示例:'bold 18px verdana'。
- * @param {string} highlightStyle.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
- * @param {string} highlightStyle.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
- * @param {string} highlightStyle.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
- */
- _this.highlightStyle = null;
- /**
- * @member {Object} SuperMap.LevelRenderer.Shape.prototype.parent
- * @description 父节点,只读属性。<SuperMap.LevelRenderer.Group>
- */
- _this.parent = null;
- /**
- * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.__dirty
- * @description {boolean}
- */
- _this.__dirty = true;
- /**
- * @member {Array} SuperMap.LevelRenderer.Shape.prototype.__clipShapes
- * @description {Array}
- *
- */
- _this.__clipShapes = [];
- /**
- * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.invisible
- * @description 图形是否可见,为 true 时不绘制图形,但是仍能触发鼠标事件。默认值:false。
- */
- _this.invisible = false;
- /**
- * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.ignore
- * @description 图形是否忽略,为 true 时忽略图形的绘制以及事件触发。默认值:false。
- */
- _this.ignore = false;
- /**
- * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.zlevel
- * @description z 层 level,决定绘画在哪层 canvas 中。默认值:0。
- */
- _this.zlevel = 0;
- /**
- * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.draggable
- * @description 是否可拖拽。默认值:false。
- */
- _this.draggable = false;
- /**
- * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.clickable
- * @description 是否可点击。默认值:false。
- */
- _this.clickable = false;
- /**
- * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.hoverable
- * @description 是否可以 hover。默认值:true。
- */
- _this.hoverable = true;
- /**
- * @member {number} SuperMap.LevelRenderer.Shape.prototype.z
- * @description z值,跟zlevel一样影响shape绘制的前后顺序,z值大的shape会覆盖在z值小的上面,但是并不会创建新的canvas,所以优先级低于zlevel,而且频繁改动的开销比zlevel小很多。默认值:0。
- */
- _this.z = 0; //地理扩展
- /**
- * @member {Array} SuperMap.LevelRenderer.Shape.prototype.refOriginalPosition
- * @description 图形参考原点位置,图形的参考中心位置。
- * refOriginalPosition 是长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
- *
- * refOriginalPosition 表示图形的参考中心,通常情况下,图形是使用 canvas 的原点位置作为位置参考,
- * 但 refOriginalPosition 可以改变图形的参考位置,例如: refOriginalPosition = [80, 80],
- * 图形圆的 style.x = 20, style.y = 20,那么圆在 canvas 中的实际位置是 [100, 100]。
- *
- * 图形(Shape) 的所有位置相关属性都是以 refOriginalPosition 为参考中心,
- * 也就是说图形的所有位置信息在 canvas 中都是以 refOriginalPosition 为参考的相对位置,只有
- * refOriginalPosition 的值为 [0, 0] 时,形的位置信息才是 canvas 绝对位置。
- *
- * 图形的位置信息通常有:style.pointList,style.x,style.y。
- *
- * refOriginalPosition。默认值是: [0, 0]。
- */
- _this.refOriginalPosition = [0, 0];
- /**
- * @member {string} SuperMap.LevelRenderer.Shape.prototype.refDataID
- * @description 图形所关联数据的 ID。
- *
- */
- _this.refDataID = null;
- /**
- * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.isHoverByRefDataID
- * @description 是否根据 refDataID 进行高亮。用于同时高亮所有 refDataID 相同的图形。
- *
- */
- _this.isHoverByRefDataID = false;
- /**
- * @member {string} SuperMap.LevelRenderer.Shape.prototype.refDataHoverGroup
- * @description 高亮图形组的组名。此属性在 refDataID 有效且 isHoverByRefDataID 为 true 时生效。
- * 一旦设置此属性,且属性值有效,只有关联同一个数据的图形且此属性相同的图形才会高亮。
- *
- */
- _this.refDataHoverGroup = null;
- /**
- * @member {Object} SuperMap.LevelRenderer.Shape.prototype.dataInfo
- * @description 图形的数据信息。
- *
- */
- _this.dataInfo = null;
- Util.extend(Shape_assertThisInitialized(_this), options);
- _this.id = _this.id || Util.createUniqueID("smShape_");
- _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape";
- /**
- * @function SuperMap.LevelRenderer.Shape.prototype.getTansform
- * @description 变换鼠标位置到 shape 的局部坐标空间
- *
- */
- _this.getTansform = function () {
- var invTransform = [];
- return function (x, y) {
- var originPos = [x, y]; // 对鼠标的坐标也做相同的变换
- if (this.needTransform && this.transform) {
- SUtil_SUtil.Util_matrix.invert(invTransform, this.transform);
- SUtil_SUtil.Util_matrix.mulVector(originPos, invTransform, [x, y, 1]);
- if (x == originPos[0] && y == originPos[1]) {
- // 避免外部修改导致的 needTransform 不准确
- this.updateNeedTransform();
- }
- }
- return originPos;
- };
- }();
- return _this;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- Shape_createClass(Shape, [{
- key: "destroy",
- value: function destroy() {
- this.id = null;
- this.style = null;
- this.highlightStyle = null;
- this.parent = null;
- this.__dirty = null;
- this.__clipShapes = null;
- this.invisible = null;
- this.ignore = null;
- this.zlevel = null;
- this.draggable = null;
- this.clickable = null;
- this.hoverable = null;
- this.z = null;
- this.refOriginalPosition = null;
- this.refDataID = null;
- this.refDataHoverGroup = null;
- this.isHoverByRefDataID = null;
- this.dataInfo = null;
- Shape_get(Shape_getPrototypeOf(Shape.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.prototype.brush
- * @description 绘制图形。
- *
- * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
- * @param {boolean} isHighlight - 是否使用高亮属性。
- * @param {Function} updateCallback - 需要异步加载资源的 shape 可以通过这个 callback(e),让painter更新视图,base.brush 没用,需要的话重载 brush。
- */
- }, {
- key: "brush",
- value: function brush(ctx, isHighlight) {
- var style = this.beforeBrush(ctx, isHighlight);
- ctx.beginPath();
- this.buildPath(ctx, style);
- switch (style.brushType) {
- /* jshint ignore:start */
- case 'both':
- this.setCtxGlobalAlpha(ctx, "fill", style);
- ctx.fill();
- if (style.lineWidth > 0) {
- this.setCtxGlobalAlpha(ctx, "stroke", style);
- ctx.stroke();
- }
- this.setCtxGlobalAlpha(ctx, "reset", style);
- break;
- case 'stroke':
- this.setCtxGlobalAlpha(ctx, "stroke", style);
- style.lineWidth > 0 && ctx.stroke();
- this.setCtxGlobalAlpha(ctx, "reset", style);
- break;
- /* jshint ignore:end */
- default:
- this.setCtxGlobalAlpha(ctx, "fill", style);
- ctx.fill();
- this.setCtxGlobalAlpha(ctx, "reset", style);
- break;
- }
- this.drawText(ctx, style, this.style);
- this.afterBrush(ctx);
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.prototype.beforeBrush
- * @description 具体绘制操作前的一些公共操作。
- *
- * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
- * @param {boolean} isHighlight - 是否使用高亮属性。
- * @return {Object} 处理后的样式。
- */
- }, {
- key: "beforeBrush",
- value: function beforeBrush(ctx, isHighlight) {
- var style = this.style;
- if (this.brushTypeOnly) {
- style.brushType = this.brushTypeOnly;
- }
- if (isHighlight) {
- // 根据style扩展默认高亮样式
- style = this.getHighlightStyle(style, this.highlightStyle || {}, this.brushTypeOnly);
- }
- if (this.brushTypeOnly == 'stroke') {
- style.strokeColor = style.strokeColor || style.color;
- }
- ctx.save();
- this.doClip(ctx);
- this.setContext(ctx, style); // 设置transform
- this.setTransform(ctx);
- return style;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.prototype.afterBrush
- * @description 绘制后的处理。
- *
- * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
- *
- */
- }, {
- key: "afterBrush",
- value: function afterBrush(ctx) {
- ctx.restore();
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.prototype.setContext
- * @description 设置 fillStyle, strokeStyle, shadow 等通用绘制样式。
- *
- * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
- * @param {Object} style - 样式。
- *
- */
- }, {
- key: "setContext",
- value: function setContext(ctx, style) {
- 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']];
- for (var i = 0, len = STYLE_CTX_MAP.length; i < len; i++) {
- var styleProp = STYLE_CTX_MAP[i][0];
- var styleValue = style[styleProp];
- var ctxProp = STYLE_CTX_MAP[i][1];
- if (typeof styleValue != 'undefined') {
- ctx[ctxProp] = styleValue;
- }
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.prototype.doClip
- *
- */
- }, {
- key: "doClip",
- value: function doClip(ctx) {
- var clipShapeInvTransform = SUtil_SUtil.Util_matrix.create();
- if (this.__clipShapes) {
- for (var i = 0; i < this.__clipShapes.length; i++) {
- var clipShape = this.__clipShapes[i];
- if (clipShape.needTransform) {
- var m = clipShape.transform;
- SUtil_SUtil.Util_matrix.invert(clipShapeInvTransform, m);
- ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
- }
- ctx.beginPath();
- clipShape.buildPath(ctx, clipShape.style);
- ctx.clip(); // Transform back
- if (clipShape.needTransform) {
- var _m = clipShapeInvTransform;
- ctx.transform(_m[0], _m[1], _m[2], _m[3], _m[4], _m[5]);
- }
- }
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.prototype.getHighlightStyle
- * @description 根据默认样式扩展高亮样式
- *
- * @param {Object} style - 样式。
- * @param {Object} highlightStyle - 高亮样式。
- * @param {string} brushTypeOnly - brushTypeOnly。
- *
- */
- }, {
- key: "getHighlightStyle",
- value: function getHighlightStyle(style, highlightStyle, brushTypeOnly) {
- var newStyle = {};
- for (var k in style) {
- newStyle[k] = style[k];
- }
- var highlightColor = SUtil_SUtil.Util_color.getHighlightColor(); // 根据highlightStyle扩展
- if (style.brushType != 'stroke') {
- // 带填充则用高亮色加粗边线
- newStyle.strokeColor = highlightColor; // SMIC-方法修改 - start
- newStyle.lineWidth = style.lineWidth || 1; // 原始代码
- // newStyle.lineWidth = (style.lineWidth || 1)
- // + this.getHighlightZoom();
- // 修改代码1
- // if(!style.lineType || style.lineType === "solid"){
- // newStyle.lineWidth = (style.lineWidth || 1)
- // + this.getHighlightZoom();
- // }
- // else{
- // newStyle.lineWidth = (style.lineWidth || 1);
- // }
- // SMIC-方法修改 - end
- newStyle.brushType = 'both';
- } else {
- if (brushTypeOnly != 'stroke') {
- // 描边型的则用原色加工高亮
- newStyle.strokeColor = highlightColor; // SMIC-方法修改 - start
- newStyle.lineWidth = style.lineWidth || 1; // 原始代码
- // newStyle.lineWidth = (style.lineWidth || 1)
- // + this.getHighlightZoom();
- // 修改代码1
- // if(!style.lineType || style.lineType === "solid"){
- // newStyle.lineWidth = (style.lineWidth || 1)
- // + this.getHighlightZoom();
- // }
- // else{
- // newStyle.lineWidth = (style.lineWidth || 1);
- // }
- // SMIC-方法修改 - end
- } else {
- // 线型的则用原色加工高亮
- newStyle.strokeColor = highlightStyle.strokeColor || SUtil_SUtil.Util_color.mix(style.strokeColor, SUtil_SUtil.Util_color.toRGB(highlightColor));
- }
- } // 可自定义覆盖默认值
- for (var _k in highlightStyle) {
- if (typeof highlightStyle[_k] != 'undefined') {
- newStyle[_k] = highlightStyle[_k];
- }
- }
- return newStyle;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.prototype.getHighlightZoom
- * @description 高亮放大效果参数,当前统一设置为6,如有需要差异设置,通过 this.type 判断实例类型
- *
- */
- }, {
- key: "getHighlightZoom",
- value: function getHighlightZoom() {
- return this.type != 'text' ? 6 : 2;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.prototype.drift
- * @description 移动位置
- *
- * @param {Object} dx - 横坐标变化。
- * @param {Object} dy - 纵坐标变化。
- *
- */
- }, {
- key: "drift",
- value: function drift(dx, dy) {
- this.position[0] += dx;
- this.position[1] += dy;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.prototype.buildPath
- * @description 构建绘制的Path。子类必须重新实现此方法。
- *
- * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
- * @param {Object} style - 样式。
- */
- }, {
- key: "buildPath",
- value: function buildPath(ctx, style) {
- // eslint-disable-line no-unused-vars
- SUtil_SUtil.Util_log('buildPath not implemented in ' + this.type);
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.prototype.getRect
- * @description 计算返回包围盒矩形。子类必须重新实现此方法。
- *
- * @param {Object} style - 样式。
- */
- }, {
- key: "getRect",
- value: function getRect(style) {
- // eslint-disable-line no-unused-vars
- SUtil_SUtil.Util_log('getRect not implemented in ' + this.type);
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.prototype.isCover
- * @description 判断鼠标位置是否在图形内。
- *
- * @param {number} x - x。
- * @param {number} y - y。
- */
- }, {
- key: "isCover",
- value: function isCover(x, y) {
- var originPos = this.getTansform(x, y);
- x = originPos[0];
- y = originPos[1]; // 快速预判并保留判断矩形
- var rect = this.style.__rect;
- if (!rect) {
- rect = this.style.__rect = this.getRect(this.style);
- }
- if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) {
- // 矩形内
- return SUtil_SUtil.Util_area.isInside(this, this.style, x, y);
- }
- return false;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.prototype.drawText
- * @description 绘制附加文本。
- *
- * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
- * @param {string} style - 样式。
- * @param {string} normalStyle - normalStyle 默认样式,用于定位文字显示。
- */
- }, {
- key: "drawText",
- value: function drawText(ctx, style, normalStyle) {
- if (typeof style.text == 'undefined' || style.text === false) {
- return;
- } // 字体颜色策略
- var textColor = style.textColor || style.color || style.strokeColor;
- ctx.fillStyle = textColor; // 文本与图形间空白间隙
- var dd = 10;
- var al; // 文本水平对齐
- var bl; // 文本垂直对齐
- var tx; // 文本横坐标
- var ty; // 文本纵坐标
- var textPosition = style.textPosition // 用户定义
- || this.textPosition // shape默认
- || 'top'; // 全局默认
- // Smic 方法修改 -start
- var __OP = [];
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- __OP = [0, 0];
- } else {
- __OP = this.refOriginalPosition;
- } //原代码:
- // Smic 方法修改 -end
- switch (textPosition) {
- case 'inside':
- case 'top':
- case 'bottom':
- case 'left':
- case 'right':
- if (this.getRect) {
- var rect = (normalStyle || style).__rect || this.getRect(normalStyle || style);
- switch (textPosition) {
- case 'inside':
- tx = rect.x + rect.width / 2;
- ty = rect.y + rect.height / 2;
- al = 'center';
- bl = 'middle';
- if (style.brushType != 'stroke' && textColor == style.color) {
- ctx.fillStyle = '#fff';
- }
- break;
- case 'left':
- tx = rect.x - dd;
- ty = rect.y + rect.height / 2;
- al = 'end';
- bl = 'middle';
- break;
- case 'right':
- tx = rect.x + rect.width + dd;
- ty = rect.y + rect.height / 2;
- al = 'start';
- bl = 'middle';
- break;
- case 'top':
- tx = rect.x + rect.width / 2;
- ty = rect.y - dd;
- al = 'center';
- bl = 'bottom';
- break;
- case 'bottom':
- tx = rect.x + rect.width / 2;
- ty = rect.y + rect.height + dd;
- al = 'center';
- bl = 'top';
- break;
- }
- }
- break;
- case 'start':
- case 'end':
- var xStart = 0;
- var xEnd = 0;
- var yStart = 0;
- var yEnd = 0;
- if (typeof style.pointList != 'undefined') {
- var pointList = style.pointList;
- if (pointList.length < 2) {
- // 少于2个点就不画了~
- return;
- }
- var length = pointList.length;
- switch (textPosition) {
- // Smic 方法修改 -start
- case 'start':
- xStart = pointList[0][0] + __OP[0];
- xEnd = pointList[1][0] + __OP[0];
- yStart = pointList[0][1] + __OP[1];
- yEnd = pointList[1][1] + __OP[1];
- break;
- case 'end':
- xStart = pointList[length - 2][0] + __OP[0];
- xEnd = pointList[length - 1][0] + __OP[0];
- yStart = pointList[length - 2][1] + __OP[1];
- yEnd = pointList[length - 1][1] + __OP[1];
- break;
- //原代码:
- /*
- case 'start':
- xStart = pointList[0][0];
- xEnd = pointList[1][0];
- yStart = pointList[0][1];
- yEnd = pointList[1][1];
- break;
- case 'end':
- xStart = pointList[length - 2][0];
- xEnd = pointList[length - 1][0];
- yStart = pointList[length - 2][1];
- yEnd = pointList[length - 1][1];
- break;
- */
- // Smic 方法修改 -end
- }
- } else {
- // Smic 方法修改 -start
- xStart = style.xStart + __OP[0] || 0;
- xEnd = style.xEnd + __OP[0] || 0;
- yStart = style.yStart + __OP[1] || 0;
- yEnd = style.yEnd + __OP[1] || 0; //原代码:
- /*
- xStart = style.xStart || 0;
- xEnd = style.xEnd || 0;
- yStart = style.yStart || 0;
- yEnd = style.yEnd || 0;
- */
- // Smic 方法修改 -end
- }
- switch (textPosition) {
- case 'start':
- al = xStart < xEnd ? 'end' : 'start';
- bl = yStart < yEnd ? 'bottom' : 'top';
- tx = xStart;
- ty = yStart;
- break;
- case 'end':
- al = xStart < xEnd ? 'start' : 'end';
- bl = yStart < yEnd ? 'top' : 'bottom';
- tx = xEnd;
- ty = yEnd;
- break;
- }
- dd -= 4;
- if (xStart && xEnd && xStart != xEnd) {
- tx -= al == 'end' ? dd : -dd;
- } else {
- al = 'center';
- }
- if (yStart != yEnd) {
- ty -= bl == 'bottom' ? dd : -dd;
- } else {
- bl = 'middle';
- }
- break;
- case 'specific':
- tx = style.textX || 0;
- ty = style.textY || 0;
- al = 'start';
- bl = 'middle';
- break;
- } // Smic 方法修改 -start
- if (style.labelXOffset && !isNaN(style.labelXOffset)) {
- tx += style.labelXOffset;
- }
- if (style.labelYOffset && !isNaN(style.labelYOffset)) {
- ty += style.labelYOffset;
- } //原代码:
- // Smic 方法修改 -end
- if (tx != null && ty != null) {
- Shape._fillText(ctx, style.text, tx, ty, style.textFont, style.textAlign || al, style.textBaseline || bl);
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.prototype.modSelf
- * @description 图形发生改变
- */
- }, {
- key: "modSelf",
- value: function modSelf() {
- this.__dirty = true;
- if (this.style) {
- this.style.__rect = null;
- }
- if (this.highlightStyle) {
- this.highlightStyle.__rect = null;
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.prototype.isSilent
- * @description 图形是否会触发事件,通过 bind 绑定的事件
- */
- }, {
- key: "isSilent",
- value: function isSilent() {
- 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);
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.prototype.setCtxGlobalAlpha
- * @description 设置 Cavans 上下文全局透明度
- *
- * @param {Object} _ctx - Cavans 上下文
- * @param {string} type - one of 'stroke', 'fill', or 'reset'
- * @param {Object} style - Symbolizer hash
- */
- }, {
- key: "setCtxGlobalAlpha",
- value: function setCtxGlobalAlpha(_ctx, type, style) {
- if (type === "fill") {
- _ctx.globalAlpha = typeof style["fillOpacity"] === "undefined" ? typeof style["opacity"] === "undefined" ? 1 : style['opacity'] : style['fillOpacity'];
- } else if (type === "stroke") {
- _ctx.globalAlpha = typeof style["strokeOpacity"] === "undefined" ? typeof style["opacity"] === "undefined" ? 1 : style['opacity'] : style['strokeOpacity'];
- } else {
- _ctx.globalAlpha = typeof style["opacity"] === "undefined" ? 1 : style['opacity'];
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.prototype._fillText
- * @description 填充文本
- */
- }], [{
- key: "_fillText",
- value: function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) {
- if (textFont) {
- ctx.font = textFont;
- }
- ctx.textAlign = textAlign;
- ctx.textBaseline = textBaseline;
- var rect = Shape._getTextRect(text, x, y, textFont, textAlign, textBaseline);
- text = (text + '').split('\n');
- var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', textFont);
- switch (textBaseline) {
- case 'top':
- y = rect.y;
- break;
- case 'bottom':
- y = rect.y + lineHeight;
- break;
- default:
- y = rect.y + lineHeight / 2;
- }
- for (var i = 0, l = text.length; i < l; i++) {
- ctx.fillText(text[i], x, y);
- y += lineHeight;
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Shape._getTextRect
- * @description 返回矩形区域,用于局部刷新和文字定位
- *
- * @param {string} text - text。
- * @param {number} x - x。
- * @param {number} y - y。
- * @param {string} textFont - textFont。
- * @param {string} textAlign - textAlign。
- * @param {string} textBaseline - textBaseline。
- * @return {Object} 矩形区域。
- */
- }, {
- key: "_getTextRect",
- value: function _getTextRect(text, x, y, textFont, textAlign, textBaseline) {
- var width = SUtil_SUtil.Util_area.getTextWidth(text, textFont);
- var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', textFont);
- text = (text + '').split('\n');
- switch (textAlign) {
- case 'end':
- case 'right':
- x -= width;
- break;
- case 'center':
- x -= width / 2;
- break;
- }
- switch (textBaseline) {
- case 'top':
- break;
- case 'bottom':
- y -= lineHeight * text.length;
- break;
- default:
- y -= lineHeight * text.length / 2;
- }
- return {
- x: x,
- y: y,
- width: width,
- height: lineHeight * text.length
- };
- }
- }]);
- return Shape;
- }(SuperMap.mixin(Eventful, Transformable));
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicPoint.js
- 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); }
- function SmicPoint_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SmicPoint_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicPoint_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicPoint_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SmicPoint_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicPoint_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SmicPoint_setPrototypeOf(o, p) { SmicPoint_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicPoint_setPrototypeOf(o, p); }
- 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); }; }
- function SmicPoint_possibleConstructorReturn(self, call) { if (call && (SmicPoint_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicPoint_assertThisInitialized(self); }
- function SmicPoint_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SmicPoint_getPrototypeOf(o) { SmicPoint_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicPoint_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Shape.SmicPoint
- * @category Visualization Theme
- * @classdesc 点。
- * @extends SuperMap.LevelRenderer.Shape
- * @example
- * var shape = new SuperMap.LevelRenderer.Shape.SmicPoint({
- * style: {
- * x: 100,
- * y: 100,
- * r: 40,
- * brushType: 'both',
- * color: 'blue',
- * strokeColor: 'red',
- * lineWidth: 3,
- * text: 'point'
- * }
- * });
- * levelRenderer.addShape(shape);
- *
- *
- */
- var SmicPoint = /*#__PURE__*/function (_Shape) {
- SmicPoint_inherits(SmicPoint, _Shape);
- var _super = SmicPoint_createSuper(SmicPoint);
- /**
- * @member {Object} SuperMap.LevelRenderer.Shape.SmicPoint.prototype.style
- * @description 绘制样式。
- *
- * @param {number} style.x - 圆心x坐标,必设参数。
- * @param {number} style.y - 圆心y坐标,必设参数。
- * @param {number} style.r - 半径,必设参数。
- * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
- * @param {string} style.color - 填充颜色。默认值:"#000000'"。
- * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
- * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
- * @param {number} style.lineWidth - 描边宽度。默认值:1。
- * @param {number} style.opacity - 绘制透明度。默认值:1。
- * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
- * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
- * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
- * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
- * @param {string} style.text - 图形中的附加文本。默认值:""。
- * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
- * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
- * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
- * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
- * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
- */
- //打开接口 style
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicPoint.constructor
- * @description 构造函数。
- *
- * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
- *
- */
- function SmicPoint(options) {
- var _this;
- SmicPoint_classCallCheck(this, SmicPoint);
- _this = _super.call(this, options);
- /**
- * @member {string} SuperMap.LevelRenderer.Shape.SmicPoint.prototype.type
- * @description 图形类型。
- */
- _this.type = 'smicpoint';
- if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
- _this.refOriginalPosition = [0, 0];
- }
- _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicPoint";
- return _this;
- }
- /**
- * @function cdestroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- SmicPoint_createClass(SmicPoint, [{
- key: "destroy",
- value: function destroy() {
- this.type = null;
- SmicPoint_get(SmicPoint_getPrototypeOf(SmicPoint.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicPoint.prototype.buildPath
- * @description 创建点触。
- *
- * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
- * @param {Object} style - style。
- *
- */
- }, {
- key: "buildPath",
- value: function buildPath(ctx, style) {
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r, 0, Math.PI * 2, true);
- return;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicPoint.prototype.getRect
- * @description 计算返回点的包围盒矩形。该包围盒是直接从四个控制点计算,并非最小包围盒。
- *
- * @param {Object} style - style
- * @return {Object} 边框对象。包含属性:x,y,width,height。
- */
- }, {
- key: "getRect",
- value: function getRect(style) {
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- if (style.__rect) {
- return style.__rect;
- }
- var lineWidth;
- if (style.brushType == 'stroke' || style.brushType == 'fill') {
- lineWidth = style.lineWidth || 1;
- } else {
- lineWidth = 0;
- }
- style.__rect = {
- x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
- y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
- width: style.r * 2 + lineWidth,
- height: style.r * 2 + lineWidth
- };
- return style.__rect;
- }
- }]);
- return SmicPoint;
- }(Shape_Shape);
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicText.js
- 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); }
- function SmicText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SmicText_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicText_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicText_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SmicText_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicText_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SmicText_setPrototypeOf(o, p) { SmicText_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicText_setPrototypeOf(o, p); }
- 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); }; }
- function SmicText_possibleConstructorReturn(self, call) { if (call && (SmicText_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicText_assertThisInitialized(self); }
- function SmicText_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SmicText_getPrototypeOf(o) { SmicText_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicText_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Shape.SmicText
- * @category Visualization Theme
- * @extends {SuperMap.LevelRenderer.Shape}
- * @example
- * var shape = new SuperMap.LevelRenderer.Shape.SmicText({
- * style: {
- * text: 'Label',
- * x: 100,
- * y: 100,
- * textFont: '14px Arial'
- * }
- * });
- * levelRenderer.addShape(shape);
- *
- */
- var SmicText = /*#__PURE__*/function (_Shape) {
- SmicText_inherits(SmicText, _Shape);
- var _super = SmicText_createSuper(SmicText);
- /**
- * @member {Object} SuperMap.LevelRenderer.Shape.SmicText.prototype.style
- * @description 绘制样式。
- *
- * @param {number} style.x - 横坐标,必设参数。
- * @param {number} style.y - 纵坐标,必设参数。
- * @param {string} style.text - 图形中的附加文本。默认值:""。
- * @param {number} style.maxWidth - 最大宽度限制。默认值:null。
- * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
- * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
- * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
- * @param {string} style.brushType -画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
- * @param {string} style.color - 填充颜色。默认值:"#000000'"。
- * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
- * @param {number} style.lineWidth - 描边宽度。默认值:1。
- * @param {number} style.opacity - 绘制透明度。默认值:1。
- * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
- * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
- * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
- * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
- */
- //打开接口 style
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicText.constructor
- * @description 构造函数。
- *
- * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
- *
- */
- function SmicText(options) {
- var _this;
- SmicText_classCallCheck(this, SmicText);
- _this = _super.call(this, options);
- /**
- * @member {string} SuperMap.LevelRenderer.Shape.SmicText.prototype.type
- * @description 图形类型.
- */
- _this.type = 'smictext';
- if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
- _this.refOriginalPosition = [0, 0];
- }
- _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicText";
- return _this;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- SmicText_createClass(SmicText, [{
- key: "destroy",
- value: function destroy() {
- this.type = null;
- SmicText_get(SmicText_getPrototypeOf(SmicText.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.brush
- * @description 笔触。
- *
- * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
- * @param {boolean} isHighlight - 是否使用高亮属性。
- *
- */
- }, {
- key: "brush",
- value: function brush(ctx, isHighlight) {
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- var style = this.style;
- if (isHighlight) {
- // 根据style扩展默认高亮样式
- style = this.getHighlightStyle(style, this.highlightStyle || {});
- }
- if (typeof style.text == 'undefined' || style.text === false) {
- return;
- }
- ctx.save();
- this.doClip(ctx);
- this.setContext(ctx, style); // 设置transform
- this.setTransform(ctx);
- if (style.textFont) {
- ctx.font = style.textFont;
- }
- ctx.textAlign = style.textAlign || 'start';
- ctx.textBaseline = style.textBaseline || 'middle';
- var text = (style.text + '').split('\n');
- var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', style.textFont);
- var rect = this.getRectNoRotation(style); // var x = style.x;
- var x = style.x + __OP[0];
- var y;
- if (style.textBaseline == 'top') {
- y = rect.y;
- } else if (style.textBaseline == 'bottom') {
- y = rect.y + lineHeight;
- } else {
- y = rect.y + lineHeight / 2;
- }
- var ox = style.x + __OP[0];
- var oy = style.y + __OP[1]; //文本绘制
- for (var i = 0, l = text.length; i < l; i++) {
- //是否渲染矩形背景及颜色
- if (style.labelRect) {
- //+4,-2是为了让文字距边框左右边缘有点间隔
- ctx.fillRect(rect.x - 2, rect.y, rect.width + 4, rect.height);
- ctx.fillStyle = style.strokeColor;
- ctx.strokeRect(rect.x - 2, rect.y, rect.width + 4, rect.height);
- ctx.fillStyle = style.textColor;
- }
- switch (style.brushType) {
- case 'stroke':
- this.setCtxGlobalAlpha(ctx, "stroke", style);
- if (style.textRotation && style.textRotation !== 0) {
- ctx.save();
- ctx.translate(ox, oy);
- ctx.rotate(style.textRotation * Math.PI / 180);
- if (style.textBaseline == 'top') {
- if (style.maxWidth) {
- ctx.strokeText(text[i], 0, lineHeight * i, style.maxWidth);
- } else {
- ctx.strokeText(text[i], 0, lineHeight * i);
- }
- } else if (style.textBaseline == 'bottom') {
- if (style.maxWidth) {
- ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
- } else {
- ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height);
- }
- } else {
- if (style.maxWidth) {
- ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
- } else {
- ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
- }
- }
- ctx.restore();
- } else {
- if (style.maxWidth) {
- ctx.strokeText(text[i], x, y, style.maxWidth);
- } else {
- ctx.strokeText(text[i], x, y);
- }
- }
- this.setCtxGlobalAlpha(ctx, "reset", style);
- break;
- case 'both':
- if (style.textRotation && style.textRotation !== 0) {
- ctx.save();
- ctx.translate(ox, oy);
- ctx.rotate(style.textRotation * Math.PI / 180);
- if (style.textBaseline == 'top') {
- if (style.maxWidth) {
- this.setCtxGlobalAlpha(ctx, "fill", style);
- ctx.fillText(text[i], 0, lineHeight * i, style.maxWidth);
- this.setCtxGlobalAlpha(ctx, "reset", style);
- this.setCtxGlobalAlpha(ctx, "stroke", style);
- ctx.strokeText(text[i], 0, lineHeight * i, style.maxWidth);
- this.setCtxGlobalAlpha(ctx, "reset", style);
- } else {
- this.setCtxGlobalAlpha(ctx, "fill", style);
- ctx.fillText(text[i], 0, lineHeight * i);
- this.setCtxGlobalAlpha(ctx, "reset", style);
- this.setCtxGlobalAlpha(ctx, "stroke", style);
- ctx.strokeText(text[i], 0, lineHeight * i);
- this.setCtxGlobalAlpha(ctx, "reset", style);
- }
- } else if (style.textBaseline == 'bottom') {
- if (style.maxWidth) {
- this.setCtxGlobalAlpha(ctx, "fill", style);
- ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
- this.setCtxGlobalAlpha(ctx, "reset", style);
- this.setCtxGlobalAlpha(ctx, "stroke", style);
- ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
- this.setCtxGlobalAlpha(ctx, "reset", style);
- } else {
- this.setCtxGlobalAlpha(ctx, "fill", style);
- ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height);
- this.setCtxGlobalAlpha(ctx, "reset", style);
- this.setCtxGlobalAlpha(ctx, "stroke", style);
- ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height);
- this.setCtxGlobalAlpha(ctx, "reset", style);
- }
- } else {
- if (style.maxWidth) {
- this.setCtxGlobalAlpha(ctx, "fill", style);
- ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
- this.setCtxGlobalAlpha(ctx, "reset", style);
- this.setCtxGlobalAlpha(ctx, "stroke", style);
- ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
- this.setCtxGlobalAlpha(ctx, "reset", style);
- } else {
- this.setCtxGlobalAlpha(ctx, "fill", style);
- ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
- this.setCtxGlobalAlpha(ctx, "reset", style);
- this.setCtxGlobalAlpha(ctx, "stroke", style);
- ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
- this.setCtxGlobalAlpha(ctx, "reset", style);
- }
- }
- ctx.restore();
- } else {
- if (style.maxWidth) {
- this.setCtxGlobalAlpha(ctx, "fill", style);
- ctx.fillText(text[i], x, y, style.maxWidth);
- this.setCtxGlobalAlpha(ctx, "reset", style);
- this.setCtxGlobalAlpha(ctx, "stroke", style);
- ctx.strokeText(text[i], x, y, style.maxWidth);
- this.setCtxGlobalAlpha(ctx, "reset", style);
- } else {
- this.setCtxGlobalAlpha(ctx, "fill", style);
- ctx.fillText(text[i], x, y);
- this.setCtxGlobalAlpha(ctx, "reset", style);
- this.setCtxGlobalAlpha(ctx, "stroke", style);
- ctx.strokeText(text[i], x, y);
- this.setCtxGlobalAlpha(ctx, "reset", style);
- }
- }
- break;
- default:
- //fill or others
- this.setCtxGlobalAlpha(ctx, "fill", style);
- if (style.textRotation && style.textRotation !== 0) {
- ctx.save();
- ctx.translate(ox, oy);
- ctx.rotate(style.textRotation * Math.PI / 180);
- if (style.textBaseline == 'top') {
- if (style.maxWidth) {
- ctx.fillText(text[i], 0, lineHeight * i, style.maxWidth);
- } else {
- ctx.fillText(text[i], 0, lineHeight * i);
- }
- } else if (style.textBaseline == 'bottom') {
- if (style.maxWidth) {
- ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
- } else {
- ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height);
- }
- } else {
- if (style.maxWidth) {
- ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
- } else {
- ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
- }
- }
- ctx.restore();
- } else {
- if (style.maxWidth) {
- ctx.fillText(text[i], x, y, style.maxWidth);
- } else {
- ctx.fillText(text[i], x, y);
- }
- }
- this.setCtxGlobalAlpha(ctx, "reset", style);
- }
- y += lineHeight;
- }
- ctx.restore();
- return;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.getRect
- * @description 返回文字包围盒矩形
- */
- }, {
- key: "getRect",
- value: function getRect(style) {
- if (style.__rect) {
- return style.__rect;
- }
- var left, top, right, bottom;
- var tbg = this.getTextBackground(style, true);
- for (var i = 0, len = tbg.length; i < len; i++) {
- var poi = tbg[i]; //用第一个点初始化
- if (i == 0) {
- left = poi[0];
- right = poi[0];
- top = poi[1];
- bottom = poi[1];
- } else {
- if (poi[0] < left) {
- left = poi[0];
- }
- if (poi[0] > right) {
- right = poi[0];
- }
- if (poi[1] < top) {
- top = poi[1];
- }
- if (poi[1] > bottom) {
- bottom = poi[1];
- }
- }
- }
- style.__rect = {
- x: left,
- y: top,
- width: right - left,
- height: bottom - top
- };
- return style.__rect;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.getRectNoRotation
- * @description 返回忽略旋转和maxWidth时文字包围盒矩形
- */
- }, {
- key: "getRectNoRotation",
- value: function getRectNoRotation(style) {
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', style.textFont);
- var width = SUtil_SUtil.Util_area.getTextWidth(style.text, style.textFont);
- var height = SUtil_SUtil.Util_area.getTextHeight(style.text, style.textFont); //处理文字位置,注:文本的绘制是由此 rect 决定
- var textX = style.x + __OP[0]; // 默认start == left
- if (style.textAlign == 'end' || style.textAlign == 'right') {
- textX -= width;
- } else if (style.textAlign == 'center') {
- textX -= width / 2;
- }
- var textY;
- if (style.textBaseline == 'top') {
- // textY = style.y;
- textY = style.y + __OP[1];
- } else if (style.textBaseline == 'bottom') {
- textY = style.y + __OP[1] - height;
- } else {
- // middle
- textY = style.y + __OP[1] - height / 2;
- }
- var isWidthChangeByMaxWidth = false;
- var widthBeforeChangeByMaxWidth; //处理 maxWidth
- if (style.maxWidth) {
- var maxWidth = parseInt(style.maxWidth);
- if (maxWidth < width) {
- widthBeforeChangeByMaxWidth = width;
- isWidthChangeByMaxWidth = true;
- width = maxWidth;
- }
- textX = style.x + __OP[0];
- if (style.textAlign == 'end' || style.textAlign == 'right') {
- textX -= width;
- } else if (style.textAlign == 'center') {
- textX -= width / 2;
- }
- } //处理斜体字
- if (style.textFont) {
- var textFont = style.textFont;
- var textFontStr = textFont.toLowerCase();
- if (textFontStr.indexOf("italic") > -1) {
- if (isWidthChangeByMaxWidth === true) {
- width += lineHeight / 3 * (width / widthBeforeChangeByMaxWidth);
- } else {
- width += lineHeight / 3;
- }
- }
- }
- var rect = {
- x: textX,
- y: textY,
- width: width,
- height: height
- };
- return rect;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.getTextBackground
- * @description 获取文本背景框范围
- *
- * @param {Object} style - 样式。
- * @param {boolean} redo - 是否强制重新计算 textBackground。
- */
- }, {
- key: "getTextBackground",
- value: function getTextBackground(style, redo) {
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- if (!redo && style.__textBackground) {
- return style.__textBackground;
- } //不旋转时矩形框
- var rect = this.getRectNoRotation(style); //旋转中心点
- var ox = style.x + __OP[0];
- var oy = style.y + __OP[1]; //背景框
- var background = [];
- if (style.textRotation && style.textRotation !== 0) {
- var textRotation = style.textRotation;
- var ltPoi = this.getRotatedLocation(rect.x, rect.y, ox, oy, textRotation);
- var rtPoi = this.getRotatedLocation(rect.x + rect.width, rect.y, ox, oy, textRotation);
- var rbPoi = this.getRotatedLocation(rect.x + rect.width, rect.y + rect.height, ox, oy, textRotation);
- var lbPoi = this.getRotatedLocation(rect.x, rect.y + rect.height, ox, oy, textRotation);
- background.push(ltPoi);
- background.push(rtPoi);
- background.push(rbPoi);
- background.push(lbPoi);
- } else {
- var _ltPoi = [rect.x, rect.y];
- var _rtPoi = [rect.x + rect.width, rect.y];
- var _rbPoi = [rect.x + rect.width, rect.y + rect.height];
- var _lbPoi = [rect.x, rect.y + rect.height];
- background.push(_ltPoi);
- background.push(_rtPoi);
- background.push(_rbPoi);
- background.push(_lbPoi);
- }
- style.__textBackground = background;
- return style.__textBackground;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.getRotatedLocation
- * @description 获取一个点绕旋转中心顺时针旋转后的位置。(此方法用于屏幕坐标)
- *
- * @param {number} x - 旋转点横坐标。
- * @param {number} y - 旋转点纵坐标。
- * @param {number} rx - 旋转中心点横坐标。
- * @param {number} ry - 旋转中心点纵坐标。
- * @param {number} angle - 旋转角度(度)。
- * @return {Array} 旋转后的坐标位置,长度为 2 的一维数组,数组第一个元素表示 x 坐标,第二个元素表示 y 坐标。
- */
- }, {
- key: "getRotatedLocation",
- value: function getRotatedLocation(x, y, rx, ry, angle) {
- var loc = new Array(),
- x0,
- y0;
- y = -y;
- ry = -ry;
- angle = -angle; //顺时针旋转
- x0 = (x - rx) * Math.cos(angle / 180 * Math.PI) - (y - ry) * Math.sin(angle / 180 * Math.PI) + rx;
- y0 = (x - rx) * Math.sin(angle / 180 * Math.PI) + (y - ry) * Math.cos(angle / 180 * Math.PI) + ry;
- loc[0] = x0;
- loc[1] = -y0;
- return loc;
- }
- }]);
- return SmicText;
- }(Shape_Shape);
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicCircle.js
- 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); }
- function SmicCircle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SmicCircle_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicCircle_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicCircle_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SmicCircle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicCircle_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SmicCircle_setPrototypeOf(o, p) { SmicCircle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicCircle_setPrototypeOf(o, p); }
- 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); }; }
- function SmicCircle_possibleConstructorReturn(self, call) { if (call && (SmicCircle_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicCircle_assertThisInitialized(self); }
- function SmicCircle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SmicCircle_getPrototypeOf(o) { SmicCircle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicCircle_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Shape.SmicCircle
- * @category Visualization Theme
- * @classdesc 圆形
- * @extends SuperMap.LevelRenderer.Shape
- * @example
- * var shape = new SuperMap.LevelRenderer.Shape.SmicCircle({
- * style: {
- * x: 100,
- * y: 100,
- * r: 60,
- * brushType: "both",
- * color: "blue",
- * strokeColor: "red",
- * lineWidth: 3,
- * text: "Circle"
- * }
- * });
- * levelRenderer.addShape(shape);
- *
- *
- */
- var SmicCircle = /*#__PURE__*/function (_Shape) {
- SmicCircle_inherits(SmicCircle, _Shape);
- var _super = SmicCircle_createSuper(SmicCircle);
- /**
- * @member {Object} SuperMap.LevelRenderer.Shape.SmicCircle.prototype.style
- * @description 绘制样式。
- *
- * @param {number} x - 圆心x坐标,必设参数
- * @param {number} y - 圆心y坐标,必设参数
- * @param {number} r - 半径,必设参数
- * @param {string} brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
- * @param {string} color - 填充颜色,默认值"#000000"
- * @param {string} strokeColor - 描边颜色,默认值为'#000000'
- * @param {string} lineCape — 线帽样式,可以是 butt, round, square,默认是butt
- * @param {number} lineWidth - 描边宽度、默认是1
- * @param {number} opacity - 绘制透明度、默认是1,不透明
- * @param {number} shadowBlur - 阴影模糊度,大于0有效,默认是0
- * @param {string} shadowColor - 阴影颜色,默认是'#000000'
- * @param {number} shadowOffsetX - 阴影横向偏移,默认是0
- * @param {number} shadowOffsetY - 阴影纵向偏移,默认是0
- * @param {string} text - 图形中的附加文本,默认是0
- * @param {string} textColor - 文本颜色,默认是'#000000'
- * @param {string} textFont - 附加文本样式,eg:'bold 18px verdana'
- * @param {string} textPosition - 附加文本位置, 可以是 inside, left, right, top, bottom
- * @param {string} textAlign - 默认根据textPosition自动设置,附加文本水平对齐。可以是start, end, left, right, center
- * @param {string} textBaseline 默认根据textPosition自动设置,附加文本垂直对齐。可以是top, bottom, middle, alphabetic, hanging, ideographic
- */
- //打开接口 style
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicCircle.constructor
- * @description 构造函数。
- *
- * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
- *
- */
- function SmicCircle(options) {
- var _this;
- SmicCircle_classCallCheck(this, SmicCircle);
- _this = _super.call(this, options);
- /**
- * @member {string} SuperMap.LevelRenderer.Shape.SmicCircle.prototype.type
- * @description 图形类型。
- */
- _this.type = 'smiccircle';
- if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
- _this.refOriginalPosition = [0, 0];
- }
- _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicCircle";
- return _this;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicCircle.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- SmicCircle_createClass(SmicCircle, [{
- key: "destroy",
- value: function destroy() {
- this.type = null;
- SmicCircle_get(SmicCircle_getPrototypeOf(SmicCircle.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicCircle.prototype.buildPath
- * @description 创建图形路径。
- *
- * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
- * @param {Object} style - style。
- *
- */
- }, {
- key: "buildPath",
- value: function buildPath(ctx, style) {
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- var x = style.x + __OP[0]; // 圆心x
- var y = style.y + __OP[1]; // 圆心y
- ctx.moveTo(x + style.r, y);
- ctx.arc(x, y, style.r, 0, Math.PI * 2, true);
- return true;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicCircle.prototype.getRect
- * @description 返回圆形包围盒矩形
- *
- * @param {Object} style - style
- * @return {Object} 边框对象。包含属性:x,y,width,height。
- *
- */
- }, {
- key: "getRect",
- value: function getRect(style) {
- if (style.__rect) {
- return style.__rect;
- }
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- var x = style.x + __OP[0]; // 圆心x
- var y = style.y + __OP[1]; // 圆心y
- var r = style.r; // 圆r
- var lineWidth;
- if (style.brushType == 'stroke' || style.brushType == 'fill') {
- lineWidth = style.lineWidth || 1;
- } else {
- lineWidth = 0;
- }
- style.__rect = {
- x: Math.round(x - r - lineWidth / 2),
- y: Math.round(y - r - lineWidth / 2),
- width: r * 2 + lineWidth,
- height: r * 2 + lineWidth
- };
- return style.__rect;
- }
- }]);
- return SmicCircle;
- }(Shape_Shape);
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicPolygon.js
- 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); }
- function SmicPolygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SmicPolygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicPolygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicPolygon_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SmicPolygon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicPolygon_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SmicPolygon_setPrototypeOf(o, p) { SmicPolygon_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicPolygon_setPrototypeOf(o, p); }
- 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); }; }
- function SmicPolygon_possibleConstructorReturn(self, call) { if (call && (SmicPolygon_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicPolygon_assertThisInitialized(self); }
- function SmicPolygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SmicPolygon_getPrototypeOf(o) { SmicPolygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicPolygon_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Shape.SmicPolygon
- * @category Visualization Theme
- * @classdesc 多边形。
- * @extends SuperMap.LevelRenderer.Shape
- * @example
- * var shape = new SuperMap.LevelRenderer.Shape.SmicPolygon({
- * style: {
- * // 100x100 的正方形
- * pointList: [[0, 0], [100, 0], [100, 100], [0, 100]],
- * color: 'blue'
- * }
- * });
- * levelRenderer.addShape(shape);
- *
- */
- var SmicPolygon = /*#__PURE__*/function (_Shape) {
- SmicPolygon_inherits(SmicPolygon, _Shape);
- var _super = SmicPolygon_createSuper(SmicPolygon);
- /**
- * @member {Object} SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.style
- * @description 绘制样式。
- *
- * @param {Array} pointList - 节点数组,二维数组。默认值:null,必设参数。其形式如下:
- * (code)
- * (start code)
- * [
- * [10, 20], //单个节点
- * [30, 40],
- * [25, 30]
- * ]
- * (end)
- * @param {string} style.smooth - 是否做平滑插值, 平滑算法可以选择 "bezier", "spline"。默认值:"";
- * @param {number} style.smoothConstraint - 平滑约束。
- * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
- * @param {string} style.color - 填充颜色。默认值:"#000000'"。
- * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
- * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
- * @param {number} style.lineWidth - 描边宽度。默认值:1。
- * @param {number} style.opacity - 绘制透明度。默认值:1。
- * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
- * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
- * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
- * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
- * @param {string} style.text - 图形中的附加文本。默认值:""。
- * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
- * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
- * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
- * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
- * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
- */
- //打开接口 style
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicPolygon.constructor
- * @description 构造函数。
- *
- * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
- *
- */
- function SmicPolygon(options) {
- var _this;
- SmicPolygon_classCallCheck(this, SmicPolygon);
- _this = _super.call(this, options);
- /**
- * @member {string} SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.type
- * @description 图形类型.
- */
- _this.type = 'smicpolygon';
- /**
- * @member {Array} SuperMap.LevelRenderer.Shape.SmicPolygon.prototype._holePolygonPointList
- * @description 岛洞面多边形顶点数组(三维数组)
- *
- */
- _this.holePolygonPointLists = null;
- if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
- _this.refOriginalPosition = [0, 0];
- }
- _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicPolygon";
- return _this;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- SmicPolygon_createClass(SmicPolygon, [{
- key: "destroy",
- value: function destroy() {
- this.type = null;
- this.holePolygonPointLists = null;
- SmicPolygon_get(SmicPolygon_getPrototypeOf(SmicPolygon.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.brush
- * @description 笔触。
- *
- * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
- * @param {boolean} isHighlight - 是否使用高亮属性。
- *
- */
- }, {
- key: "brush",
- value: function brush(ctx, isHighlight) {
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var style = this.style;
- if (isHighlight) {
- // 根据style扩展默认高亮样式
- style = this.getHighlightStyle(style, this.highlightStyle || {});
- }
- ctx.save();
- this.setContext(ctx, style); // 设置 transform
- this.setTransform(ctx); // 先 fill 再stroke
- var hasPath = false;
- if (style.brushType == 'fill' || style.brushType == 'both' || typeof style.brushType == 'undefined') {
- // 默认为fill
- ctx.beginPath();
- if (style.lineType == 'dashed' || style.lineType == 'dotted' || style.lineType == 'dot' || style.lineType == 'dash' || style.lineType == 'dashdot' || style.lineType == 'longdash' || style.lineType == 'longdashdot') {
- // 特殊处理,虚线围不成path,实线再build一次
- this.buildPath(ctx, {
- lineType: 'solid',
- lineWidth: style.lineWidth,
- pointList: style.pointList
- });
- } else {
- this.buildPath(ctx, style);
- hasPath = true; // 这个path能用
- }
- ctx.closePath();
- this.setCtxGlobalAlpha(ctx, "fill", style);
- ctx.fill();
- this.setCtxGlobalAlpha(ctx, "reset", style);
- }
- if (style.lineWidth > 0 && (style.brushType == 'stroke' || style.brushType == 'both')) {
- if (!hasPath) {
- ctx.beginPath();
- this.buildPath(ctx, style);
- }
- this.setCtxGlobalAlpha(ctx, "stroke", style);
- ctx.stroke();
- this.setCtxGlobalAlpha(ctx, "reset", style);
- }
- this.drawText(ctx, style, this.style); //岛洞
- var hpStyle = Util.cloneObject(style);
- if (hpStyle.pointList) {
- if (this.holePolygonPointLists && this.holePolygonPointLists.length > 0) {
- var holePLS = this.holePolygonPointLists;
- var holePLSen = holePLS.length;
- for (var i = 0; i < holePLSen; i++) {
- var holePL = holePLS[i]; //岛洞面
- hpStyle.pointList = holePL;
- ctx.globalCompositeOperation = "destination-out"; // 先 fill 再stroke
- hasPath = false;
- if (hpStyle.brushType == 'fill' || hpStyle.brushType == 'both' || typeof hpStyle.brushType == 'undefined') {
- // 默认为fill
- ctx.beginPath();
- if (hpStyle.lineType == 'dashed' || hpStyle.lineType == 'dotted' || hpStyle.lineType == 'dot' || hpStyle.lineType == 'dash' || hpStyle.lineType == 'dashdot' || hpStyle.lineType == 'longdash' || hpStyle.lineType == 'longdashdot') {
- // 特殊处理,虚线围不成path,实线再build一次
- this.buildPath(ctx, {
- lineType: 'solid',
- lineWidth: hpStyle.lineWidth,
- pointList: hpStyle.pointList
- });
- } else {
- this.buildPath(ctx, hpStyle);
- hasPath = true; // 这个path能用
- }
- ctx.closePath();
- this.setCtxGlobalAlpha(ctx, "fill", hpStyle);
- ctx.fill();
- this.setCtxGlobalAlpha(ctx, "reset", hpStyle);
- }
- if (hpStyle.lineWidth > 0 && (hpStyle.brushType == 'stroke' || hpStyle.brushType == 'both')) {
- if (!hasPath) {
- ctx.beginPath();
- this.buildPath(ctx, hpStyle);
- } //如果描边,先回复 globalCompositeOperation 默认值再描边。
- ctx.globalCompositeOperation = "source-over";
- this.setCtxGlobalAlpha(ctx, "stroke", hpStyle);
- ctx.stroke();
- this.setCtxGlobalAlpha(ctx, "reset", hpStyle);
- } else {
- ctx.globalCompositeOperation = "source-over";
- }
- }
- }
- }
- ctx.restore();
- return;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.buildPath
- * @description 创建多边形路径。
- *
- * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
- * @param {Object} style - style。
- *
- */
- }, {
- key: "buildPath",
- value: function buildPath(ctx, style) {
- if (style.showShadow) {
- ctx.shadowBlur = style.shadowBlur;
- ctx.shadowColor = style.shadowColor;
- ctx.shadowOffsetX = style.shadowOffsetX;
- ctx.shadowOffsetY = style.shadowOffsetY;
- }
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition; // 虽然能重用 brokenLine,但底层图形基于性能考虑,重复代码减少调用吧
- var pointList = style.pointList;
- if (pointList.length < 2) {
- // 少于2个点就不画了~
- return;
- }
- if (style.smooth && style.smooth !== 'spline') {
- var controlPoints = SUtil_SUtil.SUtil_smoothBezier(pointList, style.smooth, true, style.smoothConstraint, __OP);
- ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
- var cp1;
- var cp2;
- var p;
- var len = pointList.length;
- for (var i = 0; i < len; i++) {
- cp1 = controlPoints[i * 2];
- cp2 = controlPoints[i * 2 + 1];
- p = [pointList[(i + 1) % len][0] + __OP[0], pointList[(i + 1) % len][1] + __OP[1]];
- ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);
- }
- } else {
- if (style.smooth === 'spline') {
- pointList = SUtil_SUtil.SUtil_smoothSpline(pointList, true, null, __OP);
- }
- if (!style.lineType || style.lineType == 'solid') {
- // 默认为实线
- ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
- for (var _i = 1; _i < pointList.length; _i++) {
- ctx.lineTo(pointList[_i][0] + __OP[0], pointList[_i][1] + __OP[1]);
- }
- ctx.lineTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
- } else if (style.lineType === 'dashed' || style.lineType === 'dotted' || style.lineType === 'dot' || style.lineType === 'dash' || style.lineType === 'longdash') {
- // SMIC-方法修改 - start
- var dashLengthForStyle = style._dashLength || (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1);
- style._dashLength = dashLengthForStyle;
- var dashLength = style.lineWidth || 1;
- var pattern1 = dashLength;
- var pattern2 = dashLength; //dashed
- if (style.lineType === 'dashed') {
- pattern1 *= 5;
- pattern2 *= 5;
- if (style.lineCap && style.lineCap !== "butt") {
- pattern1 -= dashLength;
- pattern2 += dashLength;
- }
- } //dotted
- if (style.lineType === 'dotted') {
- if (style.lineCap && style.lineCap !== "butt") {
- pattern1 = 1;
- pattern2 += dashLength;
- }
- } //dot
- if (style.lineType === 'dot') {
- pattern2 *= 4;
- if (style.lineCap && style.lineCap !== "butt") {
- pattern1 = 1;
- pattern2 += dashLength;
- }
- } //dash
- if (style.lineType === 'dash') {
- pattern1 *= 4;
- pattern2 *= 4;
- if (style.lineCap && style.lineCap !== "butt") {
- pattern1 -= dashLength;
- pattern2 += dashLength;
- }
- } //longdash
- if (style.lineType === 'longdash') {
- pattern1 *= 8;
- pattern2 *= 4;
- if (style.lineCap && style.lineCap !== "butt") {
- pattern1 -= dashLength;
- pattern2 += dashLength;
- }
- }
- ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
- for (var _i2 = 1; _i2 < pointList.length; _i2++) {
- 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]);
- }
- 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]);
- } else if (style.lineType === 'dashdot' || style.lineType === 'longdashdot') {
- var _dashLengthForStyle = style._dashLength || (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1);
- style._dashLength = _dashLengthForStyle;
- var _dashLength = style.lineWidth || 1;
- var _pattern = _dashLength;
- var _pattern2 = _dashLength;
- var pattern3 = _dashLength;
- var pattern4 = _dashLength; //dashdot
- if (style.lineType === 'dashdot') {
- _pattern *= 4;
- _pattern2 *= 4;
- pattern4 *= 4;
- if (style.lineCap && style.lineCap !== "butt") {
- _pattern -= _dashLength;
- _pattern2 += _dashLength;
- pattern3 = 1;
- pattern4 += _dashLength;
- }
- } //longdashdot
- if (style.lineType === 'longdashdot') {
- _pattern *= 8;
- _pattern2 *= 4;
- pattern4 *= 4;
- if (style.lineCap && style.lineCap !== "butt") {
- _pattern -= _dashLength;
- _pattern2 += _dashLength;
- pattern3 = 1;
- pattern4 += _dashLength;
- }
- }
- ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
- for (var _i3 = 1; _i3 < pointList.length; _i3++) {
- 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]);
- }
- 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]);
- }
- }
- return;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.getRect
- * @description 计算返回多边形包围盒矩阵。该包围盒是直接从四个控制点计算,并非最小包围盒。
- *
- * @param {Object} style - style
- * @return {Object} 边框对象。包含属性:x,y,width,height。
- *
- */
- }, {
- key: "getRect",
- value: function getRect(style, refOriginalPosition) {
- var __OP;
- if (!refOriginalPosition) {
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- __OP = this.refOriginalPosition;
- } else {
- __OP = refOriginalPosition;
- }
- if (style.__rect) {
- return style.__rect;
- }
- var minX = Number.MAX_VALUE;
- var maxX = Number.MIN_VALUE;
- var minY = Number.MAX_VALUE;
- var maxY = Number.MIN_VALUE;
- var pointList = style.pointList;
- for (var i = 0, l = pointList.length; i < l; i++) {
- if (pointList[i][0] + __OP[0] < minX) {
- minX = pointList[i][0] + __OP[0];
- }
- if (pointList[i][0] + __OP[0] > maxX) {
- maxX = pointList[i][0] + __OP[0];
- }
- if (pointList[i][1] + __OP[1] < minY) {
- minY = pointList[i][1] + __OP[1];
- }
- if (pointList[i][1] + __OP[1] > maxY) {
- maxY = pointList[i][1] + __OP[1];
- }
- }
- var lineWidth;
- if (style.brushType == 'stroke' || style.brushType == 'fill') {
- lineWidth = style.lineWidth || 1;
- } else {
- lineWidth = 0;
- }
- style.__rect = {
- x: Math.round(minX - lineWidth / 2),
- y: Math.round(minY - lineWidth / 2),
- width: maxX - minX + lineWidth,
- height: maxY - minY + lineWidth
- };
- return style.__rect;
- }
- }]);
- return SmicPolygon;
- }(Shape_Shape);
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicBrokenLine.js
- 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); }
- function SmicBrokenLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SmicBrokenLine_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicBrokenLine_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicBrokenLine_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SmicBrokenLine_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicBrokenLine_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SmicBrokenLine_setPrototypeOf(o, p) { SmicBrokenLine_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicBrokenLine_setPrototypeOf(o, p); }
- 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); }; }
- function SmicBrokenLine_possibleConstructorReturn(self, call) { if (call && (SmicBrokenLine_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicBrokenLine_assertThisInitialized(self); }
- function SmicBrokenLine_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SmicBrokenLine_getPrototypeOf(o) { SmicBrokenLine_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicBrokenLine_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Shape.SmicBrokenLine
- * @category Visualization Theme
- * @classdesc 折线(ic)。
- * @extends SuperMap.LevelRenderer.Shape
- * @example
- * var shape = new SuperMap.LevelRenderer.Shape.SmicBrokenLine({
- * style: {
- * pointList: [[0, 0], [100, 100], [100, 0]],
- * smooth: 'bezier',
- * strokeColor: 'purple'
- * }
- * });
- * levelRenderer.addShape(shape);
- *
- *
- */
- var SmicBrokenLine = /*#__PURE__*/function (_Shape) {
- SmicBrokenLine_inherits(SmicBrokenLine, _Shape);
- var _super = SmicBrokenLine_createSuper(SmicBrokenLine);
- /**
- * @member {Object} SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.style
- * @description 绘制样式。
- *
- * @param {Array} pointList - 节点数组,二维数组。默认值:null,必设参数。其形式如下:
- * (code)
- * (start code)
- * [
- * [10, 20], //单个节点
- * [30, 40],
- * [25, 30]
- * ]
- * (end)
- * @param {string} smooth - 是否做平滑插值, 平滑算法可以选择 "bezier", "spline"。默认值:"";
- * @param {number} smoothConstraint - 平滑约束。
- * @param {string} strokeColor - 描边颜色。默认值:"#000000'"。
- * @param {string} lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
- * @param {number} lineWidth - 描边宽度。默认值:1。
- * @param {number} opacity - 绘制透明度。默认值:1。
- * @param {number} shadowBlur - 阴影模糊度,大于0有效。默认值:0。
- * @param {number} shadowColor - 阴影颜色。默认值:"#000000'"。
- * @param {number} shadowOffsetX - 阴影横向偏移。默认值:0。
- * @param {number} shadowOffsetY - 阴影纵向偏移。默认值:0。
- * @param {string} text - 图形中的附加文本。默认值:""。
- * @param {string} textColor - 文本颜色。默认值:"#000000'"。
- * @param {string} textFont - 附加文本样式。示例:'bold 18px verdana'。
- * @param {string} textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
- * @param {string} textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
- * @param {string} textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
- */
- //打开接口 style
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicBrokenLine.constructor
- * @description 构造函数。
- *
- * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
- *
- */
- function SmicBrokenLine(options) {
- var _this;
- SmicBrokenLine_classCallCheck(this, SmicBrokenLine);
- _this = _super.call(this, options);
- /**
- * @member {string} SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.brushTypeOnly
- * @description 线条只能描边。
- */
- _this.brushTypeOnly = 'stroke';
- /**
- * @member {string} SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.textPosition
- * @description 文本位置。
- */
- _this.textPosition = 'end';
- /**
- * @member {string} SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.type
- * @description 图形类型.
- */
- _this.type = 'smicbroken-line';
- if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
- _this.refOriginalPosition = [0, 0];
- }
- _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicBrokenLine";
- return _this;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- SmicBrokenLine_createClass(SmicBrokenLine, [{
- key: "destroy",
- value: function destroy() {
- this.brushTypeOnly = null;
- this.textPosition = null;
- this.type = null;
- SmicBrokenLine_get(SmicBrokenLine_getPrototypeOf(SmicBrokenLine.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.buildPath
- * @description 创建折线路径。
- *
- * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
- * @param {Object} style - style。
- *
- */
- }, {
- key: "buildPath",
- value: function buildPath(ctx, style) {
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- var pointList = style.pointList;
- if (pointList.length < 2) {
- // 少于2个点就不画了~
- return;
- }
- var len = Math.min(style.pointList.length, Math.round(style.pointListLength || style.pointList.length));
- if (style.smooth && style.smooth !== 'spline') {
- var controlPoints = SUtil_SUtil.SUtil_smoothBezier(pointList, style.smooth, false, style.smoothConstraint, __OP);
- ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
- var cp1;
- var cp2;
- var p;
- for (var _i = 0; _i < len - 1; _i++) {
- cp1 = controlPoints[_i * 2];
- cp2 = controlPoints[_i * 2 + 1];
- p = [pointList[_i + 1][0] + __OP[0], pointList[_i + 1][1] + __OP[1]];
- ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);
- }
- } else {
- if (style.smooth === 'spline') {
- pointList = SUtil_SUtil.SUtil_smoothSpline(pointList, null, null, __OP);
- len = pointList.length;
- }
- if (!style.lineType || style.lineType === 'solid') {
- // 默认为实线
- ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
- for (var _i2 = 1; _i2 < len; _i2++) {
- ctx.lineTo(pointList[_i2][0] + __OP[0], pointList[_i2][1] + __OP[1]);
- }
- } else if (style.lineType === 'dashed' || style.lineType === 'dotted' || style.lineType === 'dot' || style.lineType === 'dash' || style.lineType === 'longdash') {
- var dashLength = style.lineWidth || 1;
- var pattern1 = dashLength;
- var pattern2 = dashLength; //dashed
- if (style.lineType === 'dashed') {
- pattern1 *= 5;
- pattern2 *= 5;
- if (style.lineCap && style.lineCap !== "butt") {
- pattern1 -= dashLength;
- pattern2 += dashLength;
- }
- } //dotted
- if (style.lineType === 'dotted') {
- if (style.lineCap && style.lineCap !== "butt") {
- pattern1 = 1;
- pattern2 += dashLength;
- }
- } //dot
- if (style.lineType === 'dot') {
- pattern2 *= 4;
- if (style.lineCap && style.lineCap !== "butt") {
- pattern1 = 1;
- pattern2 += dashLength;
- }
- } //dash
- if (style.lineType === 'dash') {
- pattern1 *= 4;
- pattern2 *= 4;
- if (style.lineCap && style.lineCap !== "butt") {
- pattern1 -= dashLength;
- pattern2 += dashLength;
- }
- } //longdash
- if (style.lineType === 'longdash') {
- pattern1 *= 8;
- pattern2 *= 4;
- if (style.lineCap && style.lineCap !== "butt") {
- pattern1 -= dashLength;
- pattern2 += dashLength;
- }
- }
- ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
- for (var i = 1; i < len; i++) {
- 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]);
- }
- } else if (style.lineType === 'dashdot' || style.lineType === 'longdashdot') {
- var _dashLength = style.lineWidth || 1;
- var _pattern = _dashLength;
- var _pattern2 = _dashLength;
- var pattern3 = _dashLength;
- var pattern4 = _dashLength; //dashdot
- if (style.lineType === 'dashdot') {
- _pattern *= 4;
- _pattern2 *= 4;
- pattern4 *= 4;
- if (style.lineCap && style.lineCap !== "butt") {
- _pattern -= _dashLength;
- _pattern2 += _dashLength;
- pattern3 = 1;
- pattern4 += _dashLength;
- }
- } //longdashdot
- if (style.lineType === 'longdashdot') {
- _pattern *= 8;
- _pattern2 *= 4;
- pattern4 *= 4;
- if (style.lineCap && style.lineCap !== "butt") {
- _pattern -= _dashLength;
- _pattern2 += _dashLength;
- pattern3 = 1;
- pattern4 += _dashLength;
- }
- }
- _dashLength = (style.lineWidth || 1) * (style.lineType === 'dashed' ? 5 : 1);
- ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
- for (var _i3 = 1; _i3 < len; _i3++) {
- 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]);
- }
- }
- }
- return;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.getRect
- * @description 计算返回折线包围盒矩形。该包围盒是直接从四个控制点计算,并非最小包围盒。
- *
- * @param {Object} style - style
- * @return {Object} 边框对象。包含属性:x,y,width,height。
- */
- }, {
- key: "getRect",
- value: function getRect(style) {
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- return SmicPolygon.prototype.getRect.apply(this, [style, __OP]);
- }
- }]);
- return SmicBrokenLine;
- }(Shape_Shape);
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicImage.js
- 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); }
- function SmicImage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SmicImage_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicImage_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicImage_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SmicImage_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicImage_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SmicImage_setPrototypeOf(o, p) { SmicImage_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicImage_setPrototypeOf(o, p); }
- 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); }; }
- function SmicImage_possibleConstructorReturn(self, call) { if (call && (SmicImage_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicImage_assertThisInitialized(self); }
- function SmicImage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SmicImage_getPrototypeOf(o) { SmicImage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicImage_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Shape.SmicImage
- * @category Visualization Theme
- * @classdesc 图片绘制。
- * @extends SuperMap.LevelRenderer.Shape
- * @example
- * var shape = new SuperMap.LevelRenderer.Shape.SmicImage({
- * style: {
- * image: 'test.jpg',
- * x: 100,
- * y: 100
- * }
- * });
- * levelRenderer.addShape(shape);
- *
- *
- */
- var SmicImage = /*#__PURE__*/function (_Shape) {
- SmicImage_inherits(SmicImage, _Shape);
- var _super = SmicImage_createSuper(SmicImage);
- /**
- * @member {Object} SuperMap.LevelRenderer.Shape.SmicImage.prototype.style
- * @description 绘制样式。
- *
- * @param {number} style.x - 左上角横坐标,必设参数。
- * @param {number} style.y - 左上角纵坐标,必设参数。
- * @param {(string/Cavans)} style.image - 图片地址或cavans对象,必设参数。
- * @param {number} style.width - 绘制到画布上的宽度,默认为图片高度。
- * @param {number} style.height - 绘制到画布上的高度,默认为图片高度。
- * @param {number} style.sx - 从图片中裁剪的左上角横坐标。
- * @param {number} style.sy - 从图片中裁剪的左上角纵坐标。
- * @param {number} style.sWidth - 从图片中裁剪的宽度,默认为图片高度。
- * @param {number} style.sHeight - 绘制到画布上的高度,默认为图片高度。
- * @param {number} style.opacity - 绘制透明度。默认值:1。
- * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
- * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
- * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
- * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
- * @param {string} style.text - 图形中的附加文本。默认值:""。
- * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
- * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
- * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
- * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
- * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
- */
- //打开接口 style
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicImage.constructor
- * @description 构造函数。
- *
- * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
- *
- */
- function SmicImage(options) {
- var _this;
- SmicImage_classCallCheck(this, SmicImage);
- _this = _super.call(this, options);
- /**
- * @member {string} SuperMap.LevelRenderer.Shape.SmicImage.prototype.type
- * @description 图形类型。
- */
- _this.type = 'smicimage';
- /**
- * @member {string} SuperMap.LevelRenderer.Shape.SmicImage.prototype._imageCache
- * @description 图片缓存。
- */
- _this._imageCache = {};
- if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
- _this.refOriginalPosition = [0, 0];
- }
- _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicImage";
- return _this;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicImage.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- SmicImage_createClass(SmicImage, [{
- key: "destroy",
- value: function destroy() {
- this.type = null;
- this._imageCache = null;
- SmicImage_get(SmicImage_getPrototypeOf(SmicImage.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicImage.prototype.buildPath
- * @description 创建图片。
- *
- * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
- * @param {Object} style - style。
- *
- */
- }, {
- key: "brush",
- value: function brush(ctx, isHighlight, refresh) {
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- var style = this.style || {};
- if (isHighlight) {
- // 根据style扩展默认高亮样式
- style = this.getHighlightStyle(style, this.highlightStyle || {});
- }
- var image = style.image;
- var me = this;
- if (typeof image === 'string') {
- var src = image;
- if (this._imageCache[src]) {
- image = this._imageCache[src];
- } else {
- image = new Image();
- image.onload = function () {
- image.onload = null;
- clearTimeout(SmicImage._refreshTimeout);
- SmicImage._needsRefresh.push(me); // 防止因为缓存短时间内触发多次onload事件
- SmicImage._refreshTimeout = setTimeout(function () {
- refresh && refresh(SmicImage._needsRefresh); // 清空 needsRefresh
- SmicImage._needsRefresh = [];
- }, 10);
- };
- image.src = src;
- this._imageCache[src] = image;
- }
- }
- if (image) {
- // 图片已经加载完成
- if (image.nodeName.toUpperCase() == 'IMG') {
- if (window.ActiveXObject) {
- if (image.readyState != 'complete') {
- return;
- }
- } else {
- if (!image.complete) {
- return;
- }
- }
- } // Else is canvas
- var width = style.width || image.width;
- var height = style.height || image.height;
- var x = style.x + __OP[0];
- var y = style.y + __OP[1]; // 图片加载失败
- if (!image.width || !image.height) {
- return;
- }
- ctx.save();
- this.doClip(ctx);
- this.setContext(ctx, style); // 设置transform
- this.setTransform(ctx);
- if (style.sWidth && style.sHeight) {
- var sx = style.sx + __OP[0] || 0;
- var sy = style.sy + __OP[1] || 0;
- ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);
- } else if (style.sx && style.sy) {
- var _sx = style.sx + __OP[0];
- var _sy = style.sy + __OP[1];
- var sWidth = width - _sx;
- var sHeight = height - _sy;
- ctx.drawImage(image, _sx, _sy, sWidth, sHeight, x, y, width, height);
- } else {
- ctx.drawImage(image, x, y, width, height);
- } // 如果没设置宽和高的话自动根据图片宽高设置
- if (!style.width) {
- style.width = width;
- }
- if (!style.height) {
- style.height = height;
- }
- if (!this.style.width) {
- this.style.width = width;
- }
- if (!this.style.height) {
- this.style.height = height;
- }
- this.drawText(ctx, style, this.style);
- ctx.restore();
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicImage.prototype.getRect
- * @description 计算返回图片的包围盒矩形。
- *
- * @param {Object} style - style
- * @return {Object} 边框对象。包含属性:x,y,width,height。
- */
- }, {
- key: "getRect",
- value: function getRect(style) {
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- return {
- x: style.x + __OP[0],
- y: style.y + __OP[1],
- width: style.width,
- height: style.height
- };
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicImage.prototype.clearCache
- * @description 清除图片缓存。
- *
- * @param {Object} style - style
- * @return {Object} 边框对象。包含属性:x,y,width,height。
- *
- */
- }, {
- key: "clearCache",
- value: function clearCache() {
- this._imageCache = {};
- }
- }]);
- return SmicImage;
- }(Shape_Shape);
- SmicImage._needsRefresh = [];
- SmicImage._refreshTimeout = null;
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicRectangle.js
- 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); }
- function SmicRectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SmicRectangle_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicRectangle_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicRectangle_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SmicRectangle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicRectangle_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SmicRectangle_setPrototypeOf(o, p) { SmicRectangle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicRectangle_setPrototypeOf(o, p); }
- 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); }; }
- function SmicRectangle_possibleConstructorReturn(self, call) { if (call && (SmicRectangle_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicRectangle_assertThisInitialized(self); }
- function SmicRectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SmicRectangle_getPrototypeOf(o) { SmicRectangle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicRectangle_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Shape.SmicRectangle
- * @category Visualization Theme
- * @classdesc 矩形。
- * @extends SuperMap.LevelRenderer.Shape
- * @example
- * var shape = new SuperMap.LevelRenderer.Shape.SmicRectangle({
- * style: {
- * x: 0,
- * y: 0,
- * width: 100,
- * height: 100,
- * radius: 20
- * }
- * });
- * levelRenderer.addShape(shape);
- *
- */
- var SmicRectangle = /*#__PURE__*/function (_Shape) {
- SmicRectangle_inherits(SmicRectangle, _Shape);
- var _super = SmicRectangle_createSuper(SmicRectangle);
- /**
- * @member {Object} SuperMap.LevelRenderer.Shape.SmicRectangle.prototype.style
- * @description 绘制样式。
- *
- * @param {number} style.x - 左上角 x 坐标,必设参数。
- * @param {number} style.y - 左上角 y 坐标,必设参数。
- * @param {number} style.width - 宽度,必设参数。
- * @param {number} style.height - 高度,必设参数。
- * @param {Array} style.radius - 矩形圆角,可以用数组分别指定四个角的圆角,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 则 radius为 [r1、r2、r3、r4 ]。
- * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
- * @param {string} style.color - 填充颜色。默认值:"#000000'"。
- * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
- * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
- * @param {number} style.lineWidth - 描边宽度。默认值:1。
- * @param {number} style.opacity - 绘制透明度。默认值:1。
- * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
- * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
- * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
- * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
- * @param {string} style.text - 图形中的附加文本。默认值:""。
- * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
- * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
- * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
- * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
- * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
- */
- //打开接口 style
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicRectangle.constructor
- * @description 构造函数。
- *
- * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
- *
- */
- function SmicRectangle(options) {
- var _this;
- SmicRectangle_classCallCheck(this, SmicRectangle);
- _this = _super.call(this, options);
- /**
- * @member {string} SuperMap.LevelRenderer.Shape.SmicRectangle.prototype.type
- * @description 图形类型.
- */
- _this.type = 'smicrectangle';
- if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
- _this.refOriginalPosition = [0, 0];
- }
- _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicRectangle";
- return _this;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicRectangle.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- SmicRectangle_createClass(SmicRectangle, [{
- key: "destroy",
- value: function destroy() {
- this.type = null;
- SmicRectangle_get(SmicRectangle_getPrototypeOf(SmicRectangle.prototype), "destroy", this).call(this);
- }
- /**
- * APIMethod: _buildRadiusPath
- * 创建矩形的圆角路径。
- *
- * Parameters:
- * ctx - {CanvasRenderingContext2D} Context2D 上下文。
- * style - {Object} style。
- *
- */
- }, {
- key: "_buildRadiusPath",
- value: function _buildRadiusPath(ctx, style) {
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition; // 左上、右上、右下、左下角的半径依次为r1、r2、r3、r4
- // r缩写为1 相当于 [1, 1, 1, 1]
- // r缩写为[1] 相当于 [1, 1, 1, 1]
- // r缩写为[1, 2] 相当于 [1, 2, 1, 2]
- // r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2]
- var x = style.x + __OP[0];
- var y = style.y + __OP[1];
- var width = style.width;
- var height = style.height;
- var r = style.radius;
- var r1;
- var r2;
- var r3;
- var r4;
- if (typeof r === 'number') {
- r1 = r2 = r3 = r4 = r;
- } else if (r instanceof Array) {
- if (r.length === 1) {
- r1 = r2 = r3 = r4 = r[0];
- } else if (r.length === 2) {
- r1 = r3 = r[0];
- r2 = r4 = r[1];
- } else if (r.length === 3) {
- r1 = r[0];
- r2 = r4 = r[1];
- r3 = r[2];
- } else {
- r1 = r[0];
- r2 = r[1];
- r3 = r[2];
- r4 = r[3];
- }
- } else {
- r1 = r2 = r3 = r4 = 0;
- }
- var total;
- if (r1 + r2 > width) {
- total = r1 + r2;
- r1 *= width / total;
- r2 *= width / total;
- }
- if (r3 + r4 > width) {
- total = r3 + r4;
- r3 *= width / total;
- r4 *= width / total;
- }
- if (r2 + r3 > height) {
- total = r2 + r3;
- r2 *= height / total;
- r3 *= height / total;
- }
- if (r1 + r4 > height) {
- total = r1 + r4;
- r1 *= height / total;
- r4 *= height / total;
- }
- ctx.moveTo(x + r1, y);
- ctx.lineTo(x + width - r2, y);
- r2 !== 0 && ctx.quadraticCurveTo(x + width, y, x + width, y + r2);
- ctx.lineTo(x + width, y + height - r3);
- r3 !== 0 && ctx.quadraticCurveTo(x + width, y + height, x + width - r3, y + height);
- ctx.lineTo(x + r4, y + height);
- r4 !== 0 && ctx.quadraticCurveTo(x, y + height, x, y + height - r4);
- ctx.lineTo(x, y + r1);
- r1 !== 0 && ctx.quadraticCurveTo(x, y, x + r1, y);
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicRectangle.prototype.buildPath
- * @description 创建矩形路径。
- *
- * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
- * @param {Object} style - style。
- *
- */
- }, {
- key: "buildPath",
- value: function buildPath(ctx, style) {
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- if (!style.radius) {
- ctx.moveTo(style.x + __OP[0], style.y + __OP[1]);
- ctx.lineTo(style.x + __OP[0] + style.width, style.y + __OP[1]);
- ctx.lineTo(style.x + __OP[0] + style.width, style.y + __OP[1] + style.height);
- ctx.lineTo(style.x + __OP[0], style.y + __OP[1] + style.height);
- ctx.lineTo(style.x + __OP[0], style.y + __OP[1]); // ctx.rect(style.x, style.y, style.width, style.height);
- } else {
- this._buildRadiusPath(ctx, style);
- }
- ctx.closePath();
- return;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicRectangle.prototype.getRect
- * @description 计算返回矩形包围盒矩阵。该包围盒是直接从四个控制点计算,并非最小包围盒。
- *
- * @param {Object} style - style
- * @return {Object} 边框对象。包含属性:x,y,width,height。
- */
- }, {
- key: "getRect",
- value: function getRect(style) {
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- if (style.__rect) {
- return style.__rect;
- }
- var lineWidth;
- if (style.brushType == 'stroke' || style.brushType == 'fill') {
- lineWidth = style.lineWidth || 1;
- } else {
- lineWidth = 0;
- }
- style.__rect = {
- x: Math.round(style.x + __OP[0] - lineWidth / 2),
- y: Math.round(style.y + __OP[1] - lineWidth / 2),
- width: style.width + lineWidth,
- height: style.height + lineWidth
- };
- return style.__rect;
- }
- }]);
- return SmicRectangle;
- }(Shape_Shape);
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicSector.js
- 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); }
- function SmicSector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SmicSector_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicSector_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicSector_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SmicSector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicSector_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SmicSector_setPrototypeOf(o, p) { SmicSector_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicSector_setPrototypeOf(o, p); }
- 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); }; }
- function SmicSector_possibleConstructorReturn(self, call) { if (call && (SmicSector_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicSector_assertThisInitialized(self); }
- function SmicSector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SmicSector_getPrototypeOf(o) { SmicSector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicSector_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Shape.SmicSector
- * @category Visualization Theme
- * @classdesc 扇形。
- * @extends SuperMap.LevelRenderer.Shape
- * @example
- * var shape = new SuperMap.LevelRenderer.Shape.SmicSector({
- * style: {
- * x: 100,
- * y: 100,
- * r: 60,
- * r0: 30,
- * startAngle: 0,
- * endEngle: 180
- * }
- * });
- * levelRenderer.addShape(shape);
- *
- *
- */
- var SmicSector = /*#__PURE__*/function (_Shape) {
- SmicSector_inherits(SmicSector, _Shape);
- var _super = SmicSector_createSuper(SmicSector);
- /**
- * @member {Object} SuperMap.LevelRenderer.Shape.SmicSector.prototype.style
- * @description 绘制样式。
- *
- * @param {number} style.x - 圆心 x 坐标,必设参数。
- * @param {number} style.y - 圆心 y 坐标,必设参数。
- * @param {number} style.r - 外圆半径,必设参数。
- * @param {number} style.r0 - 内圆半径,指定后将出现内弧,同时扇边长度为`r - r0`。取值范围[0, r),默认值:0。
- * @param {number} style.startAngle - 起始角度,必设参数。取值范围[0, 360)。
- * @param {number} style.endAngle - 结束角度,必设参数。取值范围(0, 360。
- * @param {boolean} style.clockWise - 是否是顺时针。默认值:false。
- * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
- * @param {string} style.color - 填充颜色。默认值:"#000000'"。
- * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
- * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
- * @param {number} style.lineWidth - 描边宽度。默认值:1。
- * @param {number} style.opacity - 绘制透明度。默认值:1。
- * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
- * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
- * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
- * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
- * @param {string} style.text - 图形中的附加文本。默认值:""。
- * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
- * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
- * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
- * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
- * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
- */
- //打开接口 style
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicSector.constructor
- * @description 构造函数。
- *
- * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
- *
- */
- function SmicSector(options) {
- var _this;
- SmicSector_classCallCheck(this, SmicSector);
- _this = _super.call(this, options);
- /**
- * @member {string} SuperMap.LevelRenderer.Shape.SmicSector.protptype.type
- * @description 图形类型。
- */
- _this.type = 'smicsector';
- if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
- _this.refOriginalPosition = [0, 0];
- }
- _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicSector";
- return _this;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicSector.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- SmicSector_createClass(SmicSector, [{
- key: "destroy",
- value: function destroy() {
- this.type = null;
- SmicSector_get(SmicSector_getPrototypeOf(SmicSector.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicSector.prototype.buildPath
- * @description 创建扇形路径。
- *
- * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
- * @param {Object} style - style。
- *
- */
- }, {
- key: "buildPath",
- value: function buildPath(ctx, style) {
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- var x = style.x + __OP[0]; // 圆心x
- var y = style.y + __OP[1]; // 圆心y
- var r0 = style.r0 || 0; // 形内半径[0,r)
- var r = style.r; // 扇形外半径(0,r]
- var startAngle = style.startAngle; // 起始角度[0,360)
- var endAngle = style.endAngle; // 结束角度(0,360]
- var clockWise = style.clockWise || false;
- startAngle = SUtil_SUtil.Util_math.degreeToRadian(startAngle);
- endAngle = SUtil_SUtil.Util_math.degreeToRadian(endAngle);
- if (!clockWise) {
- // 扇形默认是逆时针方向,Y轴向上
- // 这个跟arc的标准不一样,为了兼容echarts
- startAngle = -startAngle;
- endAngle = -endAngle;
- }
- var unitX = SUtil_SUtil.Util_math.cos(startAngle);
- var unitY = SUtil_SUtil.Util_math.sin(startAngle);
- ctx.moveTo(unitX * r0 + x, unitY * r0 + y);
- ctx.lineTo(unitX * r + x, unitY * r + y);
- ctx.arc(x, y, r, startAngle, endAngle, !clockWise);
- ctx.lineTo(SUtil_SUtil.Util_math.cos(endAngle) * r0 + x, SUtil_SUtil.Util_math.sin(endAngle) * r0 + y);
- if (r0 !== 0) {
- ctx.arc(x, y, r0, endAngle, startAngle, clockWise);
- }
- ctx.closePath();
- return;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicSector.prototype.getRect
- * @description 返回扇形包围盒矩形
- *
- * @param {Object} style - style
- * @return {Object} 边框对象。包含属性:x,y,width,height。
- *
- */
- }, {
- key: "getRect",
- value: function getRect(style) {
- if (style.__rect) {
- return style.__rect;
- }
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- var min0 = SUtil_SUtil.Util_vector.create();
- var min1 = SUtil_SUtil.Util_vector.create();
- var max0 = SUtil_SUtil.Util_vector.create();
- var max1 = SUtil_SUtil.Util_vector.create();
- var x = style.x + __OP[0]; // 圆心x
- var y = style.y + __OP[1]; // 圆心y
- var r0 = style.r0 || 0; // 形内半径[0,r)
- var r = style.r; // 扇形外半径(0,r]
- var startAngle = SUtil_SUtil.Util_math.degreeToRadian(style.startAngle);
- var endAngle = SUtil_SUtil.Util_math.degreeToRadian(style.endAngle);
- var clockWise = style.clockWise;
- if (!clockWise) {
- startAngle = -startAngle;
- endAngle = -endAngle;
- }
- if (r0 > 1) {
- SUtil_SUtil.Util_computeBoundingBox.arc(x, y, r0, startAngle, endAngle, !clockWise, min0, max0);
- } else {
- min0[0] = max0[0] = x;
- min0[1] = max0[1] = y;
- }
- SUtil_SUtil.Util_computeBoundingBox.arc(x, y, r, startAngle, endAngle, !clockWise, min1, max1);
- SUtil_SUtil.Util_vector.min(min0, min0, min1);
- SUtil_SUtil.Util_vector.max(max0, max0, max1);
- style.__rect = {
- x: min0[0],
- y: min0[1],
- width: max0[0] - min0[0],
- height: max0[1] - min0[1]
- };
- return style.__rect;
- }
- }]);
- return SmicSector;
- }(Shape_Shape);
- ;// CONCATENATED MODULE: ./src/common/overlay/feature/ShapeFactory.js
- function ShapeFactory_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ShapeFactory_createClass(Constructor, protoProps, staticProps) { if (protoProps) ShapeFactory_defineProperties(Constructor.prototype, protoProps); if (staticProps) ShapeFactory_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.ShapeFactory
- * @category Visualization Theme
- * @classdesc 图形工厂类。
- * 目前支持创建的图形有:<br>
- * 用于统计专题图:<br>
- * 点 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Point}> <br>
- * 线 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Line}> <br>
- * 面 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Polygon}> <br>
- * 矩形 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Rectangle}> <br>
- * 扇形 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Sector}> <br>
- * 标签 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Label}> <br>
- * 图片 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Image}> <br>
- * 用于符号专题图:<br>
- * 圆形 - 参数对象:<{@link SuperMap.Feature.ShapeParameters.Cilcle}>
- */
- var ShapeFactory = /*#__PURE__*/function () {
- /**
- * @function SuperMap.Feature.ShapeFactory.prototype.constructor
- * @description 构建图形工厂对象。
- * @param {Object} shapeParameters - 图形参数对象,<{@link SuperMap.Feature.ShapeParameters}> 子类对象,可选参数。
- * @returns {SuperMap.Feature.ShapeFactory} 返回图形工厂类对象。
- */
- function ShapeFactory(shapeParameters) {
- ShapeFactory_classCallCheck(this, ShapeFactory);
- /**
- * @member {Object} SuperMap.Feature.ShapeParameters.prototype.shapeParameters
- * @description 图形参数对象,<{@link SuperMap.Feature.ShapeParameters}> 子类对象。必设参数,默认值 null。
- */
- this.shapeParameters = shapeParameters;
- this.CLASS_NAME = "SuperMap.Feature.ShapeFactory";
- }
- /**
- * @function SuperMap.Feature.ShapeParameters.prototype.destroy
- * @description 销毁图形工厂类对象。
- */
- ShapeFactory_createClass(ShapeFactory, [{
- key: "destroy",
- value: function destroy() {
- this.shapeParameters = null;
- }
- /**
- * @function SuperMap.Feature.ShapeParameters.prototype.createShape
- * @description 创建一个图形。具体图形由 shapeParameters 决定。
- * @param {Object} shapeParameters - 图形参数对象,<{@link SuperMap.Feature.ShapeParameters}> 子类对象。
- * 此参数可选,如果使用此参数(不为 null),shapeParameters 属性值将被修改为参数的值,然后再使用 shapeParameters 属性值创建图形;
- * 如果不使用此参数,createShape 方法将直接使用 shapeParameters 属性创建图形。
- * @returns {Object} 图形对象(或 null - 图形创建失败)。
- */
- }, {
- key: "createShape",
- value: function createShape(shapeParameters) {
- if (shapeParameters) {
- this.shapeParameters = shapeParameters;
- }
- if (!this.shapeParameters) {
- return null;
- }
- var sps = this.shapeParameters;
- if (sps instanceof Point_Point) {
- // 点
- //设置style
- var style = new Object();
- style["x"] = sps.x;
- style["y"] = sps.y;
- style["r"] = sps.r;
- style = Util.copyAttributesWithClip(style, sps.style, ['x', 'y']); //创建图形
- var shape = new SmicPoint();
- shape.style = ShapeFactory.transformStyle(style);
- shape.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
- Util.copyAttributesWithClip(shape, sps, ['x', 'y', 'style', 'highlightStyle']);
- return shape;
- } else if (sps instanceof Line_Line) {
- // 线
- //检查参数 pointList 是否存在
- if (!sps.pointList) {
- return null;
- } // 设置style
- var _style = new Object();
- _style["pointList"] = sps.pointList;
- _style = Util.copyAttributesWithClip(_style, sps.style, ['pointList']); // 创建图形
- var _shape = new SmicBrokenLine();
- _shape.style = ShapeFactory.transformStyle(_style);
- _shape.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
- Util.copyAttributesWithClip(_shape, sps, ['pointList', 'style', 'highlightStyle']);
- return _shape;
- } else if (sps instanceof Polygon_Polygon) {
- // 面
- //检查参数 pointList 是否存在
- if (!sps.pointList) {
- return null;
- } //设置style
- var _style2 = new Object();
- _style2["pointList"] = sps.pointList;
- _style2 = Util.copyAttributesWithClip(_style2, sps.style, ['pointList']); //创建图形
- var _shape2 = new SmicPolygon();
- _shape2.style = ShapeFactory.transformStyle(_style2);
- _shape2.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
- Util.copyAttributesWithClip(_shape2, sps, ['pointList', 'style', "highlightStyle"]);
- return _shape2;
- } else if (sps instanceof Rectangle_Rectangle) {
- // 矩形
- //检查参数 pointList 是否存在
- if (!sps.x && !sps.y & !sps.width & !sps.height) {
- return null;
- } //设置style
- var _style3 = new Object();
- _style3["x"] = sps.x;
- _style3["y"] = sps.y;
- _style3["width"] = sps.width;
- _style3["height"] = sps.height;
- _style3 = Util.copyAttributesWithClip(_style3, sps.style, ['x', 'y', 'width', 'height']); //创建图形
- var _shape3 = new SmicRectangle();
- _shape3.style = ShapeFactory.transformStyle(_style3);
- _shape3.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
- Util.copyAttributesWithClip(_shape3, sps, ['x', 'y', 'width', 'height', 'style', 'highlightStyle']);
- return _shape3;
- } else if (sps instanceof Sector) {
- // 扇形
- //设置style
- var _style4 = new Object();
- _style4["x"] = sps.x;
- _style4["y"] = sps.y;
- _style4["r"] = sps.r;
- _style4["startAngle"] = sps.startAngle;
- _style4["endAngle"] = sps.endAngle;
- if (sps["r0"]) {
- _style4["r0"] = sps.r0;
- }
- if (sps["clockWise"]) {
- _style4["clockWise"] = sps.clockWise;
- }
- _style4 = Util.copyAttributesWithClip(_style4, sps.style, ['x', 'y', 'r', 'startAngle', 'endAngle', 'r0', 'endAngle']); //创建图形
- var _shape4 = new SmicSector();
- _shape4.style = ShapeFactory.transformStyle(_style4);
- _shape4.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
- Util.copyAttributesWithClip(_shape4, sps, ['x', 'y', 'r', 'startAngle', 'endAngle', 'r0', 'endAngle', 'style', 'highlightStyle']);
- return _shape4;
- } else if (sps instanceof Label) {
- // 标签
- //设置style
- var _style5 = new Object();
- _style5["x"] = sps.x;
- _style5["y"] = sps.y;
- _style5["text"] = sps.text;
- _style5 = Util.copyAttributesWithClip(_style5, sps.style, ['x', 'y', 'text']); //创建图形
- var _shape5 = new SmicText();
- _shape5.style = ShapeFactory.transformStyle(_style5);
- _shape5.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
- Util.copyAttributesWithClip(_shape5, sps, ['x', 'y', 'text', 'style', 'highlightStyle']);
- return _shape5;
- } else if (sps instanceof Image_Image) {
- // 图片
- //设置style
- var _style6 = new Object();
- _style6["x"] = sps.x;
- _style6["y"] = sps.y;
- if (sps["image"]) {
- _style6["image"] = sps.image;
- }
- if (sps["width"]) {
- _style6["width"] = sps.width;
- }
- if (sps["height"]) {
- _style6["height"] = sps.height;
- }
- if (sps["sx"]) {
- _style6["sx"] = sps.sx;
- }
- if (sps["sy"]) {
- _style6["sy"] = sps.sy;
- }
- if (sps["sWidth"]) {
- _style6["sWidth"] = sps.sWidth;
- }
- if (sps["sHeight"]) {
- _style6["sHeight"] = sps.sHeight;
- }
- _style6 = Util.copyAttributesWithClip(_style6, sps.style, ['x', 'y', 'image', 'width', 'height', 'sx', 'sy', 'sWidth', 'sHeight']); //创建图形
- var _shape6 = new SmicImage();
- _shape6.style = ShapeFactory.transformStyle(_style6);
- _shape6.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
- Util.copyAttributesWithClip(_shape6, sps, ['x', 'y', 'image', 'width', 'height', 'style', 'highlightStyle']);
- return _shape6;
- } else if (sps instanceof Circle_Circle) {
- //圆形 用于符号专题图
- //设置stytle
- var _style7 = new Object();
- _style7["x"] = sps.x;
- _style7["r"] = sps.r;
- _style7["y"] = sps.y;
- _style7 = Util.copyAttributesWithClip(_style7, sps.style, ['x', 'y', 'r']); //创建图形
- var _shape7 = new SmicCircle();
- _shape7.style = ShapeFactory.transformStyle(_style7);
- _shape7.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
- Util.copyAttributesWithClip(_shape7, sps, ['x', 'y', 'r', 'style', 'highlightStyle', 'lineWidth', 'text', 'textPosition']);
- return _shape7;
- }
- return null;
- }
- /**
- * @function SuperMap.Feature.ShapeParameters.prototype.transformStyle
- * @description 将用户 feature.style (类 Svg style 标准) 的样式,转换为 levelRenderer 的样式标准(类 CSS-Canvas 样式)
- * @param {Object} style - 用户 style。
- * @returns {Object} 符合 levelRenderer 的 style。
- */
- }], [{
- key: "transformStyle",
- value: function transformStyle(style) {
- var newStyle = {}; //字体 ["font-style", "font-variant", "font-weight", "font-size / line-height", "font-family"];
- var fontStr = ["normal", "normal", "normal", "12", "arial,sans-serif"]; //画笔类型 ["fill", "stroke"];
- var brushType = [true, false];
- for (var ss in style) {
- switch (ss) {
- case "fill":
- brushType[0] = style[ss];
- break;
- case "fillColor":
- newStyle["color"] = style[ss];
- break;
- case "stroke":
- brushType[1] = style[ss];
- break;
- case "strokeWidth":
- newStyle["lineWidth"] = style[ss];
- break;
- case "strokeLinecap":
- newStyle["lineCap"] = style[ss];
- break;
- case "strokeLineJoin":
- newStyle["lineJoin"] = style[ss];
- break;
- case "strokeDashstyle":
- newStyle["lineType"] = style[ss];
- break;
- case "pointRadius":
- newStyle["r"] = style[ss];
- break;
- case "label":
- newStyle["text"] = style[ss];
- break;
- case "labelRect":
- newStyle["labelRect"] = style[ss];
- break;
- case "fontColor":
- newStyle["textColor"] = style[ss];
- break;
- case "fontStyle":
- fontStr[0] = style[ss];
- break;
- case "fontVariant":
- fontStr[1] = style[ss];
- break;
- case "fontWeight":
- fontStr[2] = style[ss];
- break;
- case "fontSize":
- var unit = "";
- if (style[ss] && style[ss].toString().indexOf("px") < 0) {
- unit = "px";
- }
- fontStr[3] = style[ss] + unit;
- break;
- case "fontFamily":
- fontStr[4] = style[ss];
- break;
- case "fontOpacity":
- newStyle["opacity"] = style[ss];
- break;
- case "labelPosition":
- newStyle["textPosition"] = style[ss];
- break;
- case "labelAlign":
- newStyle["textAlign"] = style[ss];
- break;
- case "labelBaseline":
- newStyle["textBaseline"] = style[ss];
- break;
- case "labelRotation":
- newStyle["textRotation"] = style[ss];
- break;
- default:
- newStyle[ss] = style[ss];
- break;
- }
- } //拼接字体字符串
- newStyle["textFont"] = fontStr.join(" "); //画笔类型
- if (brushType[0] === true && brushType[1] === false) {
- newStyle["brushType"] = "fill";
- } else if (brushType[0] === false && brushType[1] === true) {
- newStyle["brushType"] = "stroke";
- } else if (brushType[0] === true && brushType[1] === true) {
- newStyle["brushType"] = "both";
- } else {
- newStyle["brushType"] = "fill";
- } //默认线宽 1
- if (newStyle["lineWidth"] == null) {
- newStyle["lineWidth"] = 1;
- }
- return newStyle;
- }
- /**
- * @function SuperMap.Feature.ShapeParameters.prototype.Background
- * @description 创建一个矩形背景框图形对象。
- * @param {SuperMap.Feature.ShapeFactory} shapeFactory - 图形工厂对象,必设参数。
- * @param {Array.<number>} box - 框区域,长度为 4 的一维数组,像素坐标,[left, bottom, right, top],必设参数。
- * @param {Object} setting - 图表配置参数,必设参数。本函数中图形配置对象 setting 可设属性:
- * @param {Object} setting.backgroundStyle - 背景样式,此样式对象对象可设属性:<SuperMap.Feature.ShapeParameters.Rectangle#style>。
- * @param {Array} [setting.backgroundRadius=[0,0,0,0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4,则 backgroundRadius 为 [r1、r2、r3、r4 ]。
- * @returns {Object} 背景框图形,一个可视化图形(矩形)对象。
- */
- }, {
- key: "Background",
- value: function Background(shapeFactory, box, setting) {
- var sets = setting ? setting : {}; // 背景框图形参数对象
- var bgSP = new Rectangle_Rectangle(box[0], box[3], Math.abs(box[2] - box[0]), Math.abs(box[3] - box[1])); // 默认样式
- bgSP.style = {
- fillColor: "#f3f3f3"
- }; // 设置用户 style
- if (sets.backgroundStyle) {
- Util.copyAttributesWithClip(bgSP.style, sets.backgroundStyle);
- } // 设置背景框圆角参数
- if (sets.backgroundRadius) {
- bgSP.style["radius"] = sets.backgroundRadius;
- } // 禁止背景框响应事件
- bgSP.clickable = false;
- bgSP.hoverable = false;
- return shapeFactory.createShape(bgSP);
- }
- /**
- * @function SuperMap.Feature.ShapeParameters.prototype.GraphAxis
- * @description 创建一个统计图表坐标轴图形对象组。
- * @param {SuperMap.Feature.ShapeFactory} shapeFactory - 图形工厂对象,必设参数。
- * @param {Array.<number>} dataViewBox - 统计图表模型的数据视图框,长度为 4 的一维数组,像素坐标,[left, bottom, right, top],必设参数。
- * @param {Object} setting - 图表配置参数,必设参数。
- * @param {Object} setting.axisStyle - 坐标轴样式,此样式对象对象可设属性:<SuperMap.Feature.ShapeParameters.Line#style>。
- * @param {boolean} [setting.axisUseArrow=false] - 坐标轴是否使用箭头。
- * @param {number} [setting.axisYTick=0] - y 轴刻度数量,0表示不使用箭头。
- * @param {Array.<string>} setting.axisYLabels - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
- * @param {Object} setting.axisYLabelsStyle - y 轴上的标签组样式,此样式对象对象可设属性:<SuperMap.Feature.ShapeParameters.Label#style>。
- * @param {Array.<number>} [setting.axisYLabelsOffset=[0,0]] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正,默认值:0;数组第二项表示 y 轴标签组纵向上的偏移量,向下为正,默认值:0。
- * @param {Array.<string>} setting.axisXLabels - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。
- * 标签排布规则:当标签数量与 xShapeInfo 中的属性 xPositions 数量相同(即标签个数与数据个数相等时), 按照 xPositions 提供的位置在水平方向上排布标签,否则沿数据视图框下面条边等距排布标签。
- * @param {Object} setting.axisXLabelsStyle - x 轴上的标签组样式,此样式对象对象可设属性:<SuperMap.Feature.ShapeParameters.Label#style>。
- * @param {Array.<number>} [setting.axisXLabelsOffset=[0,0]] - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正,默认值:0;数组第二项表示 x 轴标签组纵向上的偏移量,向下为正,默认值:0。
- * @param {boolean} setting.useXReferenceLine - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
- * @param {Object} setting.xReferenceLineStyle - 水平参考线样式,此样式对象对象可设属性:<SuperMap.Feature.ShapeParameters.Line#style>。
- * @param {number} [setting.axis3DParameter=0] - 3D 坐标轴参数,此属性值在大于等于 15 时有效。
- * @param {Object} xShapeInfo - X 方向上的图形信息对象,包含两个属性。
- * @param {Array.<number>} xShapeInfo.xPositions - 图形在 x 轴方向上的像素坐标值,是一个一维数组,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
- * @param {number} xShapeInfo.width - 图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
- * @returns {Array.<Object>} 统计图表坐标轴图形对象数组。
- */
- }, {
- key: "GraphAxis",
- value: function GraphAxis(shapeFactory, dataViewBox, setting, xShapeInfo) {
- var dvb = dataViewBox;
- var sets = setting ? setting : {}; // 参考线图形对象组
- var refLines = []; //坐标轴箭头对象组
- var arrows = []; // 是否使用参水平考线,默认不使用
- var isAddRefLine = sets.useXReferenceLine ? sets.useXReferenceLine : false; // y 轴上的刻度
- var axisytick = sets.axisYTick && !isNaN(sets.axisYTick) ? sets.axisYTick : 0; // 坐标轴节点数组
- var pois = []; //z 轴箭头数组
- var zArrowPois = []; // x,y 轴主干节点数组
- var xMainPois = [];
- if (axisytick == 0) {
- xMainPois.push([dvb[0], dvb[3] - 5]);
- xMainPois.push([dvb[0], dvb[1]]); // 3D 坐标轴 第三象限平分线
- if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
- var axis3DParameter = parseInt(sets.axis3DParameter);
- var axis3DPoi = [dvb[0] - axis3DParameter, dvb[1] + axis3DParameter]; // 添加 3D 轴节点
- if (sets.axisUseArrow) {
- // 添加 3D 轴箭头节点坐标
- //箭头坐标
- zArrowPois.push([axis3DPoi[0] + 1.5, axis3DPoi[1] - 7.5]);
- zArrowPois.push([axis3DPoi[0] - 1, axis3DPoi[1] + 1]);
- zArrowPois.push([axis3DPoi[0] + 7.5, axis3DPoi[1] - 1.5]); //3D轴
- xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
- } else {
- xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
- }
- xMainPois.push([dvb[0], dvb[1]]);
- }
- xMainPois.push([dvb[2] + 5, dvb[1]]);
- } else {
- // 单位刻度长度
- var unitTick = Math.abs(dvb[1] - dvb[3]) / axisytick; // 刻度 y 坐标
- var thckY = dvb[3];
- xMainPois.push([dvb[0], thckY - 5]);
- for (var i = 0; i < axisytick; i++) {
- xMainPois.push([dvb[0], thckY]);
- xMainPois.push([dvb[0] - 5, thckY]);
- xMainPois.push([dvb[0], thckY]); // 参考线
- if (isAddRefLine) {
- // 参考线参数对象
- var refLineSP = new Line_Line([[dvb[0], thckY], [dvb[2], thckY]]); // 参考线默认样式对象
- refLineSP.style = {
- strokeColor: "#cfcfcf",
- strokeLinecap: "butt",
- strokeLineJoin: "round",
- strokeWidth: 1
- }; // 禁止事件
- refLineSP.clickable = false;
- refLineSP.hoverable = false; // 用户style
- if (sets.xReferenceLineStyle) {
- Util.copyAttributesWithClip(refLineSP.style, sets.xReferenceLineStyle);
- } // 生成参考线图形对象
- refLines.push(shapeFactory.createShape(refLineSP));
- } // y 刻度增量
- thckY += unitTick;
- }
- xMainPois.push([dvb[0], dvb[1]]); // 3D 坐标轴 第三象限平分线
- if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
- var _axis3DParameter = parseInt(sets.axis3DParameter);
- var _axis3DPoi = [dvb[0] - _axis3DParameter, dvb[1] + _axis3DParameter];
- /*
- // 箭头计算过程
- var axis3DPoiRef = [axis3DPoi[0] + 7, axis3DPoi[1] - 7]; // 7 是 10 为斜边 cos(45度)时邻边的值
- var axis3DPoiLT = [axis3DPoiRef[0] - 4, axis3DPoiRef[1] - 4];
- var axis3DPoiRB = [axis3DPoiRef[0] + 4, axis3DPoiRef[1] + 4];
- if(sets.axisUseArrow){
- xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
- xMainPois.push([axis3DPoiLT[0], axis3DPoiLT[1]]);
- xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
- xMainPois.push([axis3DPoiRB[0], axis3DPoiRB[1]]);
- xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
- }
- else{
- xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
- }
- */
- // 添加 3D 轴节点
- if (sets.axisUseArrow) {
- // 添加 3D 轴和箭头坐标
- //箭头坐标
- zArrowPois.push([_axis3DPoi[0] + 1.5, _axis3DPoi[1] - 7.5]);
- zArrowPois.push([_axis3DPoi[0] - 1, _axis3DPoi[1] + 1]);
- zArrowPois.push([_axis3DPoi[0] + 7.5, _axis3DPoi[1] - 1.5]); //3D轴
- xMainPois.push([_axis3DPoi[0], _axis3DPoi[1]]);
- } else {
- xMainPois.push([_axis3DPoi[0], _axis3DPoi[1]]);
- }
- xMainPois.push([dvb[0], dvb[1]]);
- }
- xMainPois.push([dvb[2] + 5, dvb[1]]);
- } // 坐标轴箭头
- if (sets.axisUseArrow) {
- // x 轴箭头节点数组
- var xArrowPois = [[dvb[2] + 5, dvb[1] + 4], [dvb[2] + 13, dvb[1]], [dvb[2] + 5, dvb[1] - 4]]; // y 轴箭头节点数组
- var yArrowPois = [[dvb[0] - 4, dvb[3] - 5], [dvb[0], dvb[3] - 13], [dvb[0] + 4, dvb[3] - 5]]; //x轴箭头
- var xSP = new Polygon_Polygon(xArrowPois);
- xSP.style = {
- fillColor: "#008acd"
- };
- Util.copyAttributesWithClip(xSP.style, sets.axisStyle);
- arrows.push(shapeFactory.createShape(xSP)); //y轴箭头
- var ySP = new Polygon_Polygon(yArrowPois);
- ySP.style = {
- fillColor: "#008acd"
- };
- Util.copyAttributesWithClip(ySP.style, sets.axisStyle);
- arrows.push(shapeFactory.createShape(ySP)); // z轴箭头 坐标轴箭头是否要使用
- if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
- var zSP = new Polygon_Polygon(zArrowPois);
- zSP.style = {
- fillColor: "#008acd"
- };
- Util.copyAttributesWithClip(zSP.style, sets.axisStyle);
- arrows.push(shapeFactory.createShape(zSP));
- }
- } //不带箭头的坐标轴
- pois = xMainPois; // 坐标轴参数对象
- var axisSP = new Line_Line(pois); // 坐标轴默认style
- axisSP.style = {
- strokeLinecap: "butt",
- strokeLineJoin: "round",
- strokeColor: "#008acd",
- strokeWidth: 1
- }; // 用户 style
- if (sets.axisStyle) {
- Util.copyAttributesWithClip(axisSP.style, sets.axisStyle);
- } // 禁止事件
- axisSP.clickable = false;
- axisSP.hoverable = false; // 创建坐标轴图形对象
- var axisMain = [shapeFactory.createShape(axisSP)]; // Y 轴标签
- var yLabels = [];
- if (sets.axisYLabels && sets.axisYLabels.length && sets.axisYLabels.length > 0) {
- var axisYLabels = sets.axisYLabels;
- var len = axisYLabels.length; // 标签偏移量
- var ylOffset = [0, 0];
- if (sets.axisYLabelsOffset && sets.axisYLabelsOffset.length) {
- ylOffset = sets.axisYLabelsOffset;
- }
- if (len == 1) {
- // 标签参数对象
- var labelYSP = new Label(dvb[0] - 5 + ylOffset[0], dvb[3] + ylOffset[1], axisYLabels[0]);
- labelYSP.style = {
- labelAlign: "right"
- }; // 用户 style
- if (sets.axisYLabelsStyle) {
- Util.copyAttributesWithClip(labelYSP.style, sets.axisYLabelsStyle);
- } // 禁止事件
- labelYSP.clickable = false;
- labelYSP.hoverable = false; // 制作标签
- yLabels.push(shapeFactory.createShape(labelYSP));
- } else {
- var labelY = dvb[3]; // y 轴标签单位距离
- var yUnit = Math.abs(dvb[1] - dvb[3]) / (len - 1);
- for (var j = 0; j < len; j++) {
- // 标签参数对象
- var _labelYSP = new Label(dvb[0] - 5 + ylOffset[0], labelY + ylOffset[1], axisYLabels[j]);
- _labelYSP.style = {
- labelAlign: "right"
- }; // 用户 style
- if (sets.axisYLabelsStyle) {
- Util.copyAttributesWithClip(_labelYSP.style, sets.axisYLabelsStyle);
- } // 禁止事件
- _labelYSP.clickable = false;
- _labelYSP.hoverable = false; // 制作标签
- yLabels.push(shapeFactory.createShape(_labelYSP)); // y 轴标签 y 方向增量
- labelY += yUnit;
- }
- }
- } // X 轴标签
- var xLabels = [];
- if (sets.axisXLabels && sets.axisXLabels.length && sets.axisXLabels.length > 0) {
- var axisXLabels = sets.axisXLabels;
- var _len = axisXLabels.length; // 标签偏移量
- var xlOffset = [0, 0];
- if (sets.axisXLabelsOffset && sets.axisXLabelsOffset.length) {
- xlOffset = sets.axisXLabelsOffset;
- } // 标签个数与数据字段个数相等等时,标签在 x 轴均匀排列
- if (xShapeInfo && xShapeInfo.xPositions && xShapeInfo.xPositions.length && xShapeInfo.xPositions.length == _len) {
- var xsCenter = xShapeInfo.xPositions;
- for (var K = 0; K < _len; K++) {
- // 标签参数对象
- var labelXSP = new Label(xsCenter[K] + xlOffset[0], dvb[1] + xlOffset[1], axisXLabels[K]); // 默认 style
- labelXSP.style = {
- labelAlign: "center",
- labelBaseline: "top"
- }; // 用户 style
- if (sets.axisXLabelsStyle) {
- Util.copyAttributesWithClip(labelXSP.style, sets.axisXLabelsStyle);
- } // 禁止事件
- labelXSP.clickable = false;
- labelXSP.hoverable = false; // 创建标签对象
- xLabels.push(shapeFactory.createShape(labelXSP));
- }
- } else {
- if (_len == 1) {
- // 标签参数对象
- var _labelXSP = new Label(dvb[0] - 5 + xlOffset[0], dvb[1] + xlOffset[0], axisXLabels[0]); // 默认 style
- _labelXSP.style = {
- labelAlign: "center",
- labelBaseline: "top"
- }; // 用户 style
- if (sets.axisXLabelsStyle) {
- Util.copyAttributesWithClip(_labelXSP.style, sets.axisXLabelsStyle);
- } // 禁止事件
- _labelXSP.clickable = false;
- _labelXSP.hoverable = false; // 创建标签对象
- xLabels.push(shapeFactory.createShape(_labelXSP));
- } else {
- var labelX = dvb[0]; // x 轴标签单位距离
- var xUnit = Math.abs(dvb[2] - dvb[0]) / (_len - 1);
- for (var m = 0; m < _len; m++) {
- // 标签参数对象
- var _labelXSP2 = new Label(labelX + xlOffset[0], dvb[1] + xlOffset[1], axisXLabels[m]); // 默认 style
- _labelXSP2.style = {
- labelAlign: "center",
- labelBaseline: "top"
- }; // 用户 style
- if (sets.axisXLabelsStyle) {
- Util.copyAttributesWithClip(_labelXSP2.style, sets.axisXLabelsStyle);
- } // 禁止事件
- _labelXSP2.clickable = false;
- _labelXSP2.hoverable = false; // 创建标签对象
- xLabels.push(shapeFactory.createShape(_labelXSP2)); // x 轴标签 x 方向增量
- labelX += xUnit;
- }
- }
- }
- } // 组装并返回构成坐标轴的图形
- return refLines.concat(axisMain).concat(yLabels).concat(xLabels).concat(arrows);
- }
- /**
- * @function SuperMap.Feature.ShapeParameters.prototype.ShapeStyleTool
- * @description 一个图形 style 处理工具。此工具将指定的默认 style,通用 style,按 styleGroup 取得的 style 和按数据值 value 范围取得的 style 进行合并,得到图形最终的 style。
- * @param {Object} defaultStyle - 默认style,此样式对象可设属性根据图形类型参考 <{@link SuperMap.Feature.ShapeParameters}> 子类对象的 style 属性。
- * @param {Object} style - 图形对象基础 style,此参数控制图形的基础样式,可设属性根据图形类型参考 <{@link SuperMap.Feature.ShapeParameters}> 子类对象的 style 属性。优先级低于 styleGroup,styleByCodomain。
- * @param {Array.<Object>} styleGroup - 一个 style 数组,优先级低于 styleByCodomain,高于 style。此数组每个元素是样式对象,
- * 其可设属性根据图形类型参考 <{@link SuperMap.Feature.ShapeParameters}> 子类对象的 style 属性。通过 index 参数从 styleGroup 中取 style。
- * @param {Array.<Object>} styleByCodomain - 按数据(参数 value)所在值域范围控制数据的可视化对象样式。
- * (start code)
- * // styleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
- * // start: 值域值下限(包含);
- * // end: 值域值上限(不包含);
- * // style: 数据可视化图形的 style,其可设属性根据图形类型参考 <SuperMap.Feature.ShapeParameters> 子类对象的 style 属性。。
- * // dataStyleByCodomain 数组形如:
- * [
- * {
- * start:0,
- * end:250,
- * style:{
- * fillColor:"#00CD00"
- * }
- * },
- * {
- * start:250,
- * end:500,
- * style:{
- * fillColor:"#00EE00"
- * }
- * },
- * {
- * start:500,
- * end:750,
- * style:{
- * fillColor:"#00FF7F"
- * }
- * },
- * {
- * start:750,
- * end:1500,
- * style:{
- * fillColor:"#00FF00"
- * }
- * }
- * ]
- * (end)
- * @param {number} index - styleGroup 的索引值,用于取出 styleGroup 指定的 style。
- * @param {number} value - 数据值,用于取出 styleByCodomain 指定的 style。
- * @returns {Object} 合并后的样式 (style) 对象。
- */
- }, {
- key: "ShapeStyleTool",
- value: function ShapeStyleTool(defaultStyle, style, styleGroup, styleByCodomain, index, value) {
- // 用 defaultStyle 初始化 style 对象
- var finalStyle = defaultStyle ? defaultStyle : {}; // 基础 style
- if (style) {
- Util.copyAttributesWithClip(finalStyle, style);
- } // 按索引赋 style
- if (styleGroup && styleGroup.length && typeof index !== "undefined" && !isNaN(index) && index >= 0) {
- if (styleGroup[index]) {
- Util.copyAttributesWithClip(finalStyle, styleGroup[index]);
- }
- } // 按值域赋 style
- if (styleByCodomain && styleByCodomain.length && typeof value !== "undefined") {
- var dsc = styleByCodomain;
- var dscLen = dsc.length;
- var v = parseFloat(value);
- for (var i = 0; i < dscLen; i++) {
- if (dsc[i].start <= v && v < dsc[i].end) {
- Util.copyAttributesWithClip(finalStyle, dsc[i].style);
- break;
- }
- }
- }
- return finalStyle;
- }
- }]);
- return ShapeFactory;
- }();
- SuperMap.Feature = SuperMap.Feature || {};
- SuperMap.Feature.ShapeFactory = ShapeFactory;
- ;// CONCATENATED MODULE: ./src/common/overlay/feature/Theme.js
- function feature_Theme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function feature_Theme_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Theme_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Theme_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.Theme
- * @category Visualization Theme
- * @classdesc 专题要素基类,此类不可实例化。
- */
- var Theme_Theme = /*#__PURE__*/function () {
- /**
- * @function SuperMap.Feature.Theme.prototype.constructor
- * @description 构造函数。
- * @param {Object} data - 用户数据,用于生成可视化 shape,必设参数。
- * @param {SuperMap.Layer.Theme} layer - 此专题要素所在图层,必设参数。
- * @returns {SuperMap.Feature.Theme} 返回一个专题要素。
- */
- function Theme(data, layer) {
- feature_Theme_classCallCheck(this, Theme);
- if (!data) {
- return;
- } // layer 必须已经添加到地图, 且已初始化渲染器
- if (!layer || !layer.map || !layer.renderer) {
- return;
- }
- /**
- * @member {string} SuperMap.Feature.Theme.prototype.id
- * @description 专题要素唯一标识。
- */
- this.id = Util.createUniqueID(this.CLASS_NAME + "_");
- /**
- * @member {SuperMap.LonLat} SuperMap.Feature.Theme.prototype.lonlat
- * @description 专题要素地理参考位置。子类中必须根据用户数据(或地理位置参数)对其赋值。
- */
- this.lonlat = null;
- /**
- * @member {Array} SuperMap.Feature.Theme.prototype.location
- * @description 专题要素像素参考位置。通常由地理参考位置决定。长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
- */
- this.location = [];
- /**
- * @readonly
- * @member {Object} SuperMap.Feature.Theme.prototype.data
- * @description 用户数据,用于生成可视化 shape,可在子类中规定数据格式或类型,如:<SuperMap.Feature.Vector>。
- */
- this.data = data;
- /**
- * @readonly
- * @member {Array} SuperMap.Feature.Theme.prototype.shapes
- * @description 构成此专题要素的可视化图形对象数组,数组顺序控制渲染。
- */
- this.shapes = [];
- /**
- * @readonly
- * @member {SuperMap.Layer.Theme} SuperMap.Feature.Theme.prototype.layer
- * @description 此专题要素所在专题图层。
- */
- this.layer = layer;
- this.CLASS_NAME = "SuperMap.Feature.Theme";
- }
- /**
- * @function SuperMap.Feature.Theme.prototype.destroy
- * @description 销毁专题要素。
- */
- feature_Theme_createClass(Theme, [{
- key: "destroy",
- value: function destroy() {
- this.data = null;
- this.id = null;
- this.lonlat = null;
- this.location = null;
- this.shapes = null;
- this.layer = null;
- }
- /**
- * @function SuperMap.Feature.Theme.prototype.getLocalXY
- * @description 地理坐标转为像素坐标。
- * @param {(SuperMap.Geometry.Point|SuperMap.Geometry.GeoText|SuperMap.LonLat)} coordinate - 地理坐标点。
- * @returns {Array} 长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
- */
- }, {
- key: "getLocalXY",
- value: function getLocalXY(coordinate) {
- var resolution = this.layer.map.getResolution();
- var extent = this.layer.map.getExtent();
- if (coordinate instanceof Point || coordinate instanceof GeoText) {
- var x = coordinate.x / resolution + -extent.left / resolution;
- var y = extent.top / resolution - coordinate.y / resolution;
- return [x, y];
- } else if (coordinate instanceof LonLat) {
- var _x = coordinate.lon / resolution + -extent.left / resolution;
- var _y = extent.top / resolution - coordinate.lat / resolution;
- return [_x, _y];
- } else {
- return null;
- }
- }
- }]);
- return Theme;
- }();
- SuperMap.Feature = SuperMap.Feature || {};
- SuperMap.Feature.Theme = Theme_Theme;
- ;// CONCATENATED MODULE: ./src/common/overlay/Graph.js
- 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); }
- function Graph_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Graph_createClass(Constructor, protoProps, staticProps) { if (protoProps) Graph_defineProperties(Constructor.prototype, protoProps); if (staticProps) Graph_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Graph_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Graph_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function Graph_setPrototypeOf(o, p) { Graph_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Graph_setPrototypeOf(o, p); }
- 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); }; }
- function Graph_possibleConstructorReturn(self, call) { if (call && (Graph_typeof(call) === "object" || typeof call === "function")) { return call; } return Graph_assertThisInitialized(self); }
- function Graph_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Graph_getPrototypeOf(o) { Graph_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Graph_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.Theme.Graph
- * @classdesc 统计专题要素基类。
- * @category Visualization Theme
- * @description 此类定义了统计专题要素基础模型,具体的图表模型通过继承此类,在子类中实现 assembleShapes 方法。
- * 统计专题要素模型采用了可视化图形大小自适应策略,用较少的参数控制着图表诸多图形,图表配置对象 <SuperMap.Feature.Theme.Graph.setting> 的基础属性只有 7 个,
- * 它们控制着图表结构、值域范围、数据小数位等基础图表形态。构成图表的图形必须在图表结构里自适应大小。
- * 此类不可实例化,此类的可实例化子类必须实现 assembleShapes() 方法。
- * @extends SuperMap.Feature.Theme
- * @param {SuperMap.Feature.Vector} data - 用户数据。
- * @param {SuperMap.Layer.Theme} layer - 此专题要素所在图层。
- * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
- * @param {Object} setting - 图表配置对象。
- * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
- */
- var Graph = /*#__PURE__*/function (_Theme) {
- Graph_inherits(Graph, _Theme);
- var _super = Graph_createSuper(Graph);
- function Graph(data, layer, fields, setting, lonlat, options) {
- var _this;
- Graph_classCallCheck(this, Graph);
- _this = _super.call(this, data, layer, fields, setting, lonlat, options);
- /**
- * @member {SuperMap.Feature.ShapeFactory} SuperMap.Feature.Theme.Graph.prototype.shapeFactory
- * @description 内置的图形工厂对象,调用其 createShape 方法创建图形。
- */
- _this.shapeFactory = new ShapeFactory();
- /**
- * @member {Object} SuperMap.Feature.Theme.Graph.prototype.shapeParameters
- * @description 当前图形参数对象,<SuperMap.Feature.ShapeParameters> 的子类对象。
- */
- _this.shapeParameters = null;
- /**
- * @member {boolean} [SuperMap.Feature.Theme.Graph.prototype.RelativeCoordinate]
- * @description 图形是否已经计算了相对坐标。
- */
- _this.RelativeCoordinate = false;
- /**
- * @member {Object} SuperMap.Feature.Theme.Graph.prototype.setting
- * @description 图表配置对象,该对象控制着图表的可视化显示。
- * @param {number} width - 专题要素(图表)宽度。
- * @param {number} height - 专题要素(图表)高度。
- * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
- * @param {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
- * @param {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
- * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox
- * (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
- * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。
- * 如果不设置此参数,在取数据值时不对数据做小数位处理。
- *
- */
- _this.setting = null;
- /**
- * @readonly
- * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.origonPoint
- * @description 专题要素(图表)原点,图表左上角点像素坐标,是长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
- */
- _this.origonPoint = null;
- /**
- * @readonly
- * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.chartBox
- * @description 专题要素(图表)区域,即图表框,长度为 4 的一维数组,数组的 4 个元素依次表示图表框左端 x 坐标值、
- * 下端 y坐标值、 右端 x坐标值、 上端 y 坐标值;[left, bottom, right, top]。
- */
- _this.chartBox = null;
- /**
- * @readonly
- * @member {SuperMap.Bounds} SuperMap.Feature.Theme.Graph.prototype.chartBounds
- * @description 图表 Bounds 随着 lonlat、XOffset、YOffset 更新,注意 chartBounds 是图表像素范围,不是地理范围。
- */
- _this.chartBounds = null;
- /**
- * @readonly
- * @member {number} SuperMap.Feature.Theme.Graph.prototype.width
- * @description 专题要素(图表)宽度 。
- */
- _this.width = null;
- /**
- * @readonly
- * @member {number} SuperMap.Feature.Theme.Graph.prototype.height
- * @description 专题要素(图表)高度 。
- */
- _this.height = null;
- /**
- * @readonly
- * @member {number} SuperMap.Feature.Theme.Graph.prototype.XOffset
- * @description 专题要素(图表)在 X 方向上的偏移值,单位像素。
- */
- _this.XOffset = 0;
- /**
- * @readonly
- * @member {number} SuperMap.Feature.Theme.Graph.prototype.YOffset
- * @description 专题要素(图表)在 Y 方向上的偏移值,单位像素。
- */
- _this.YOffset = 0;
- /**
- * @readonly
- * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.DVBParameter
- * @description 数据视图框参数,长度为 4 的一维数组(数组元素值 >= 0),[leftOffset, bottomOffset, rightOffset, topOffset],chartBox 内偏距值。
- * 此属性用于指定数据视图框 dataViewBox 的范围。
- */
- _this.DVBParameter = null;
- /**
- * @readonly
- * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.dataViewBox
- * @description 数据视图框,长度为 4 的一维数组,[left, bottom, right, top]。
- * dataViewBox 是统计专题要素最核心的内容,它负责解释数据在一个像素区域里的数据可视化含义,
- * 这种含义用可视化图形表达出来,这些表示数据的图形和一些辅助图形组合在一起构成统计专题图表。
- */
- _this.dataViewBox = null;
- /**
- * @readonly
- * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.DVBCodomain
- * @description 数据视图框的内允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
- * dataViewBox 中允许的数据范围,对数据溢出值域范围情况的处理需要在 assembleShapes 中进行。
- */
- _this.DVBCodomain = null;
- /**
- * @readonly
- * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.DVBCenterPoint
- * @description 数据视图框中心点,长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
- */
- _this.DVBCenterPoint = null;
- /**
- * @readonly
- * @member {string} SuperMap.Feature.Theme.Graph.prototype.DVBUnitValue
- * @description 单位值。在 assembleShapes() 中初始化其具体意义,例如:饼图的 DVBUnitValue 可以定义为"360/数据总和",
- * 折线图的 DVBUnitValue 可以定义为 "DVBCodomain/DVBHeight"。
- */
- _this.DVBUnitValue = null;
- /**
- * @readonly
- * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.DVBOrigonPoint
- * @description 数据视图框原点,数据视图框左上角点,长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
- */
- _this.DVBOrigonPoint = null;
- /**
- * @readonly
- * @member {number} SuperMap.Feature.Theme.Graph.prototype.DVBWidth
- * @description 数据视图框宽度。
- */
- _this.DVBWidth = null;
- /**
- * @readonly
- * @member {number} SuperMap.Feature.Theme.Graph.prototype.DVBHeight
- * @description 数据视图框高度。
- */
- _this.DVBHeight = null;
- /**
- * @readonly
- * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.origonPointOffset
- * @description 数据视图框原点相对于图表框的原点偏移量,长度为 2 的一维数组,第一个元素表示 x 偏移量,第二个元素表示 y 偏移量。
- */
- _this.origonPointOffset = null;
- /**
- * @readonly
- * @member {Array.<string>} SuperMap.Feature.Theme.Graph.prototype.fields
- * @description 数据{SuperMap.Feature.Vector}属性字段。
- */
- _this.fields = fields || [];
- /**
- * @readonly
- * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.dataValues
- * @description 图表展示的数据值,通过 fields 从数据 feature 属性中获得。
- */
- _this.dataValues = null; // 图表位置
- if (lonlat) {
- _this.lonlat = lonlat;
- } else {
- // 默认使用 bounds 中心
- _this.lonlat = _this.data.geometry.getBounds().getCenterLonLat();
- } // 配置项检测与赋值
- if (setting && setting.width && setting.height && setting.codomain) {
- _this.setting = setting;
- }
- _this.CLASS_NAME = "SuperMap.Feature.Theme.Graph";
- return _this;
- }
- /**
- * @function SuperMap.Feature.Theme.Graph.prototype.destroy
- * @description 销毁专题要素。
- */
- Graph_createClass(Graph, [{
- key: "destroy",
- value: function destroy() {
- this.shapeFactory = null;
- this.shapeParameters = null;
- this.width = null;
- this.height = null;
- this.origonPoint = null;
- this.chartBox = null;
- this.dataViewBox = null;
- this.chartBounds = null;
- this.DVBParameter = null;
- this.DVBOrigonPoint = null;
- this.DVBCenterPoint = null;
- this.DVBWidth = null;
- this.DVBHeight = null;
- this.DVBCodomain = null;
- this.DVBUnitValue = null;
- this.origonPointOffset = null;
- this.XOffset = null;
- this.YOffset = null;
- this.fields = null;
- this.dataValues = null;
- this.setting = null;
- Graph_get(Graph_getPrototypeOf(Graph.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.Feature.Theme.Graph.prototype.initBaseParameter
- * @description 初始化专题要素(图表)基础参数。在调用此方法前,此类的图表模型相关属性都是不可用的 ,此方法在 assembleShapes 函数中调用。
- * 调用此函数关系到 setting 对象的以下属性。
- * @param {number} width - 专题要素(图表)宽度。
- * @param {number} height - 专题要素(图表)高度。
- * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
- * @param {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
- * @param {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
- * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox。
- * (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
- * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
- * @returns {boolean} 初始化参数是否成功。
- */
- }, {
- key: "initBaseParameter",
- value: function initBaseParameter() {
- // 参数初始化是否成功
- var isSuccess = true; // setting 属性是否已成功赋值
- if (!this.setting) {
- return false;
- }
- var sets = this.setting; // 检测 setting 的必设参数
- if (!(sets.width && sets.height && sets.codomain)) {
- return false;
- } // 数据
- var decimalNumber = typeof sets.decimalNumber !== "undefined" && !isNaN(sets.decimalNumber) ? sets.decimalNumber : -1;
- var dataEffective = Theme_Theme.getDataValues(this.data, this.fields, decimalNumber);
- this.dataValues = dataEffective ? dataEffective : []; // 基础参数 width, height, codomain
- this.width = parseFloat(sets.width);
- this.height = parseFloat(sets.height);
- this.DVBCodomain = sets.codomain; // 图表偏移
- // if(sets.XOffset) {this.XOffset = sets.XOffset};
- // if(sets.YOffset) {this.YOffset = sets.YOffset};
- this.XOffset = sets.XOffset ? sets.XOffset : 0;
- this.YOffset = sets.YOffset ? sets.YOffset : 0; // 其他默认值
- this.origonPoint = [];
- this.chartBox = [];
- this.dataViewBox = [];
- this.DVBParameter = sets.dataViewBoxParameter ? sets.dataViewBoxParameter : [0, 0, 0, 0];
- this.DVBOrigonPoint = [];
- this.DVBCenterPoint = [];
- this.origonPointOffset = []; // 图表位置
- this.resetLocation(); // 专题要素宽度 w
- var w = this.width; // 专题要素高度 h
- var h = this.height; // 专题要素像素位置 loc
- var loc = this.location; // 专题要素像素位置 loc
- this.origonPoint = [loc[0] - w / 2, loc[1] - h / 2]; // 专题要素原点(左上角)
- var op = this.origonPoint; // 图表框([left, bottom, right, top])
- this.chartBox = [op[0], op[1] + h, op[0] + w, op[1]]; // 图表框
- var cb = this.chartBox; // 数据视图框参数,它是图表框各方向对应的内偏距
- var dbbP = this.DVBParameter; // 数据视图框 ([left, bottom, right, top])
- this.dataViewBox = [cb[0] + dbbP[0], cb[1] - dbbP[1], cb[2] - dbbP[2], cb[3] + dbbP[3]]; // 数据视图框
- var dvb = this.dataViewBox; //检查数据视图框是否合法
- if (dvb[0] >= dvb[2] || dvb[1] <= dvb[3]) {
- return false;
- } // 数据视图框原点
- this.DVBOrigonPoint = [dvb[0], dvb[3]]; // 数据视图框宽度
- this.DVBWidth = Math.abs(dvb[2] - dvb[0]); // 数据视图框高度
- this.DVBHeight = Math.abs(dvb[1] - dvb[3]); // 数据视图框中心点
- this.DVBCenterPoint = [this.DVBOrigonPoint[0] + this.DVBWidth / 2, this.DVBOrigonPoint[1] + this.DVBHeight / 2]; // 数据视图框原点与图表框的原点偏移量
- this.origonPointOffset = [this.DVBOrigonPoint[0] - op[0], this.DVBOrigonPoint[1] - op[1]];
- return isSuccess;
- }
- /**
- * @function SuperMap.Feature.Theme.Graph.prototype.resetLocation
- * @description 根据地理位置 lonlat 重置专题要素(图表)位置。
- * @param {SuperMap.LonLat} lonlat - 专题要素新的像素中心位置。
- * @returns {Array.<number>} - 新专题要素像素参考位置。长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
- */
- }, {
- key: "resetLocation",
- value: function resetLocation(lonlat) {
- if (lonlat) {
- this.lonlat = lonlat;
- } // 获取地理位置对应的像素坐标 newLocalLX
- var newLocalLX = this.getLocalXY(this.lonlat); // 处理偏移量 XOffset, YOffset
- newLocalLX[0] += this.XOffset;
- newLocalLX[1] += this.YOffset; // 将图形位置赋予 location 属性(注意 location 属性表示的是专题要素中心位置)
- this.location = newLocalLX; // 更新图表像素 Bounds
- var w = this.width;
- var h = this.height;
- var loc = this.location;
- this.chartBounds = new Bounds(loc[0] - w / 2, loc[1] + h / 2, loc[0] + w / 2, loc[1] - h / 2); //重新计算当前渐变色
- this.resetLinearGradient();
- return loc;
- }
- /**
- * @function SuperMap.Feature.Theme.Graph.prototype.resetLinearGradient
- * @description resetLocation 中调用 图表的相对坐标存在的时候,重新计算渐变的颜色(目前用于二维柱状图渐变色 所以子类实现此方法)。
- */
- }, {
- key: "resetLinearGradient",
- value: function resetLinearGradient() {//子类实现此方法
- }
- /**
- * @function SuperMap.Feature.Theme.Graph.prototype.shapesConvertToRelativeCoordinate
- * @description 将(构成图表)图形的节点转为相对坐标表示,此函数必须且只能在 assembleShapes() 结束时调用。
- */
- }, {
- key: "shapesConvertToRelativeCoordinate",
- value: function shapesConvertToRelativeCoordinate() {
- var shapes = this.shapes;
- var shapeROP = this.location;
- for (var i = 0, len = shapes.length; i < len; i++) {
- shapes[i].refOriginalPosition = shapeROP;
- var style = shapes[i].style;
- for (var sty in style) {
- switch (sty) {
- case "pointList":
- var pl = style[sty];
- for (var j = 0, len2 = pl.length; j < len2; j++) {
- pl[j][0] -= shapeROP[0];
- pl[j][1] -= shapeROP[1];
- }
- break;
- case "x":
- style[sty] -= shapeROP[0];
- break;
- case "y":
- style[sty] -= shapeROP[1];
- break;
- default:
- break;
- }
- }
- }
- this.RelativeCoordinate = true;
- }
- /**
- * @function SuperMap.Feature.Theme.Graph.prototype.assembleShapes
- * @description 图形装配函数。抽象方法,可视化子类必须实现此方法。<br>
- * 重写此方法的步骤:<br>
- * 1. 图表的某些特殊配置项(setting)处理,例如多数图表模型需要重新指定 dataViewBoxParameter 的默认值。<br>
- * 2. 调用 initBaseParameter() 方法初始化模型属性值,此步骤必须执行,只有当 initBaseParameter 返回 true 时才可以允许进行后续步骤。<br>
- * 3. 计算图形参数,制作图形,图形组合。在组装图表过程中,应该特别注意数据视图框单位值的定义、数据值溢出值域范围的处理和图形大小自适应。<br>
- * 4. 调用 shapesConvertToRelativeCoordinate() 方法,将图形的坐标值转为相对坐标,此步骤必须执行。
- * @example
- * //子类实现 assembleShapes() 接口的步骤示例:
- * assembleShapes: function(){
- * // 第一步:图表的某些特殊配置项(setting)处理,例如多数图表模型需要重新指定 dataViewBoxParameter 的默认值。此步骤是非必须过程。
- *
- * // 图表配置对象
- * var sets = this.setting;
- * // 默认数据视图框,这里展示在使用坐标轴和不使用坐标轴情况下对数据视图框参数赋予不同的默认值
- * if(!sets.dataViewBoxParameter){
- * if(typeof(sets.useAxis) === "undefined" || sets.useAxis){
- * sets.dataViewBoxParameter = [45, 15, 15, 15];
- * }
- * else{
- * sets.dataViewBoxParameter = [5, 5, 5, 5];
- * }
- * }
- *
- * // 第二步:初始化图表模型基本参数,只有在图表模型基本参数初始化成功时才可模型相关属性,如 this.dataViewBox、 this.DVBCodomain等。此步骤是必须过程。
- * if(!this.initBaseParameter()) return;
- *
- * // 第三步:用图形组装图表,在组装图表过程中,应该特别注意数据视图框单位值的定义、数据值溢出值域范围的处理和图形大小自适应。
- * // 定义图表数据视图框中单位值的含义,下面行代码表示将数据视图框单位值定义为数据视图框高度上每像素代表的数据值
- * this.DVBUnitValue = (this.codomain[1] - this.codomain[0])/this.DVBHeight;
- * var uv = this.DVBUnitValue;
- *
- * // 图形参数计算代码......
- *
- * // 关于图形装配,实际上就是利用图形工程对象 this.shapeFactory 的 createShape() 方法通过图形参数对象创建可视化的图形对象,并把这些图形对象按序添加到模型的图形库(his.shapes)中。下面的代码演示创建一个面图形参数对象,并允许通过图形配置对象设置图形的 style 和 highlightStyle,
- * var barParams = new SuperMap.Feature.ShapeParameters.Polygon(poiLists);
- * barParams.style = sets.barStyle? sets.barStyle:{fillColor: "lightblue"};
- * barParams.highlightStyle = sets.barHoverStyle? sets.barHoverStyle:{fillColor: "blue"};
- * // 图形携带数据ID信息
- * barParams.refDataID = this.data.id;
- * // 创建图形并添加到图表图形数组中
- * this.shapes.push(this.shapeFactory.createShape(barParams));
- *
- * // 第四步:调用 shapesConvertToRelativeCoordinate() 方法,将图形库(his.shapes)中的图形转为由相对坐标表示的图形,客户端统计专题图模块从结构上要求可视化图形使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数。此步骤是必须过程。
- * this.shapesConvertToRelativeCoordinate();
- * },
- */
- }, {
- key: "assembleShapes",
- value: function assembleShapes() {//子类必须实现此方法
- }
- /**
- * @function SuperMap.Feature.Theme.Graph.prototype.getLocalXY
- * @description 地理坐标转为像素坐标。
- * @param {SuperMap.Lonlat} lonlat - 带转换的地理坐标。
- * @returns 屏幕像素坐标。
- */
- }, {
- key: "getLocalXY",
- value: function getLocalXY(lonlat) {
- return this.layer.getLocalXY(lonlat);
- }
- }]);
- return Graph;
- }(Theme_Theme);
- /**
- * @function SuperMap.Feature.Theme.getDataValues
- * @description 根据字段名数组获取指定数据(feature)的属性值数组。属性值类型必须为 Number。
- * @param {SuperMap.Feature.Vector} data - 数据。
- * @param {Array.<string>} [fields] - 字段名数组。
- * @param {number} [decimalNumber] - 小数位处理参数,对获取到的属性数据值进行小数位处理。
- * @returns {Array.<string>} 字段名数组对应的属性数据值数组。
- */
- Theme_Theme.getDataValues = function (data, fields, decimalNumber) {
- if (!data.attributes) {
- return false;
- }
- var fieldsValue = [];
- var attrs = data.attributes;
- for (var i = 0; i < fields.length; i++) {
- for (var field in attrs) {
- if (field !== fields[i]) {
- continue;
- } // 数字转换判断
- try {
- if (!isNaN(decimalNumber) && decimalNumber >= 0) {
- fieldsValue.push(parseFloat(attrs[field].toString()).toFixed(decimalNumber));
- } else {
- fieldsValue.push(parseFloat(attrs[field].toString()));
- }
- } catch (e) {
- throw new Error("not a number");
- }
- }
- }
- if (fieldsValue.length === fields.length) {
- return fieldsValue;
- } else {
- return false;
- }
- };
- SuperMap.Feature.Theme.Graph = Graph;
- ;// CONCATENATED MODULE: ./src/common/overlay/Bar.js
- 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); }
- function Bar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Bar_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bar_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bar_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Bar_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Bar_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function Bar_setPrototypeOf(o, p) { Bar_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Bar_setPrototypeOf(o, p); }
- 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); }; }
- function Bar_possibleConstructorReturn(self, call) { if (call && (Bar_typeof(call) === "object" || typeof call === "function")) { return call; } return Bar_assertThisInitialized(self); }
- function Bar_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Bar_getPrototypeOf(o) { Bar_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Bar_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.Theme.Bar
- * @classdesc 柱状图 。
- * @category Visualization Theme
- * @example
- * // barStyleByCodomain参数用法如下:
- * // barStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
- * // start: 值域值下限(包含);
- * // end: 值域值上限(不包含);
- * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Polygon.style> 。
- * // barStyleByCodomain 数组形如:
- * [
- * {
- * start:0,
- * end:250,
- * style:{
- * fillColor:"#00CD00"
- * }
- * },
- * {
- * start:250,
- * end:500,
- * style:{
- * fillColor:"#00EE00"
- * }
- * },
- * {
- * start:500,
- * end:750,
- * style:{
- * fillColor:"#00FF7F"
- * }
- * },
- * {
- * start:750,
- * end:1500,
- * style:{
- * fillColor:"#00FF00"
- * }
- * }
- * ]
- * @extends SuperMap.Feature.Theme.Graph
- * @param {SuperMap.Feature.Vector} data - 用户数据。
- * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
- * @param {Array.<string>} fields - data 属性中的参与此图表生成的属性字段名称。
- * @param {SuperMap.Feature.Theme.Bar.setting} setting - 图表配置对象。
- * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
- */
- var Bar = /*#__PURE__*/function (_Graph) {
- Bar_inherits(Bar, _Graph);
- var _super = Bar_createSuper(Bar);
- function Bar(data, layer, fields, setting, lonlat) {
- var _this;
- Bar_classCallCheck(this, Bar);
- _this = _super.call(this, data, layer, fields, setting, lonlat);
- _this.CLASS_NAME = "SuperMap.Feature.Theme.Bar";
- return _this;
- }
- /**
- * @function SuperMap.Feature.Theme.Bar.prototype.destroy
- * @override
- */
- Bar_createClass(Bar, [{
- key: "destroy",
- value: function destroy() {
- Bar_get(Bar_getPrototypeOf(Bar.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.Feature.Theme.Bar.prototype.assembleShapes
- * @description 图表图形装配函数。
- */
- }, {
- key: "assembleShapes",
- value: function assembleShapes() {
- //默认渐变颜色数组
- var deafaultColors = [["#00FF00", "#00CD00"], ["#00CCFF", "#5E87A2"], ["#00FF66", "#669985"], ["#CCFF00", "#94A25E"], ["#FF9900", "#A2945E"]]; //默认阴影
- var deafaultShawdow = {
- showShadow: true,
- shadowBlur: 8,
- shadowColor: "rgba(100,100,100,0.8)",
- shadowOffsetX: 2,
- shadowOffsetY: 2
- }; // 图表配置对象
- var sets = this.setting;
- if (!sets.barLinearGradient) {
- sets.barLinearGradient = deafaultColors;
- } // 默认数据视图框
- if (!sets.dataViewBoxParameter) {
- if (typeof sets.useAxis === "undefined" || sets.useAxis) {
- sets.dataViewBoxParameter = [45, 15, 15, 15];
- } else {
- sets.dataViewBoxParameter = [5, 5, 5, 5];
- }
- } // 重要步骤:初始化参数
- if (!this.initBaseParameter()) {
- return;
- } // 值域
- var codomain = this.DVBCodomain; // 重要步骤:定义图表 Bar 数据视图框中单位值的含义
- this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight; // 数据视图域
- var dvb = this.dataViewBox; // 用户数据值
- var fv = this.dataValues;
- if (fv.length < 1) {
- return;
- } // 没有数据
- // 数据溢出值域范围处理
- for (var _i = 0, fvLen = fv.length; _i < fvLen; _i++) {
- if (fv[_i] < codomain[0] || fv[_i] > codomain[1]) {
- return;
- }
- } // 获取 x 轴上的图形信息
- var xShapeInfo = this.calculateXShapeInfo();
- if (!xShapeInfo) {
- return;
- } // 每个柱条 x 位置
- var xsLoc = xShapeInfo.xPositions; // 柱条宽度
- var xsWdith = xShapeInfo.width; // 背景框,默认启用
- if (typeof sets.useBackground === "undefined" || sets.useBackground) {
- // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
- this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
- } // 坐标轴, 默认启用
- if (typeof sets.useAxis === "undefined" || sets.useAxis) {
- // 添加坐标轴图形数组
- this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
- }
- for (var i = 0; i < fv.length; i++) {
- // 计算柱条 top 边的 y 轴坐标值
- var yPx = dvb[1] - (fv[i] - codomain[0]) / this.DVBUnitValue; // 柱条节点数组
- 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]]; // 柱条参数对象(一个面参数对象)
- var barParams = new Polygon_Polygon(poiLists); // 柱条 阴影 style
- if (typeof sets.showShadow === "undefined" || sets.showShadow) {
- if (sets.barShadowStyle) {
- var sss = sets.barShadowStyle;
- if (sss.shadowBlur) {
- deafaultShawdow.shadowBlur = sss.shadowBlur;
- }
- if (sss.shadowColor) {
- deafaultShawdow.shadowColor = sss.shadowColor;
- }
- if (sss.shadowOffsetX) {
- deafaultShawdow.shadowOffsetX = sss.shadowOffsetX;
- }
- if (sss.shadowOffsetY) {
- deafaultShawdow.shadowOffsetY = sss.shadowOffsetY;
- }
- }
- barParams.style = {};
- Util.copyAttributesWithClip(barParams.style, deafaultShawdow);
- } // 图形携带的数据信息
- barParams.refDataID = this.data.id;
- barParams.dataInfo = {
- field: this.fields[i],
- value: fv[i]
- }; // 柱条 hover click
- if (typeof sets.barHoverAble !== "undefined") {
- barParams.hoverable = sets.barHoverAble;
- }
- if (typeof sets.barClickAble !== "undefined") {
- barParams.clickable = sets.barClickAble;
- } // 创建柱条并添加到图表图形数组中
- this.shapes.push(this.shapeFactory.createShape(barParams));
- } // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
- // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
- this.shapesConvertToRelativeCoordinate();
- }
- /**
- * @function SuperMap.Feature.Theme.Bar.prototype.calculateXShapeInfo
- * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
- * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
- * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
- * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
- * 本函数中图形配置对象 setting 可设属性:
- * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
- * 长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,
- * 第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
- * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:
- * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
- * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
- *
- */
- }, {
- key: "calculateXShapeInfo",
- value: function calculateXShapeInfo() {
- var dvb = this.dataViewBox; // 数据视图框
- var sets = this.setting; // 图表配置对象
- var fvc = this.dataValues.length; // 数组值个数
- if (fvc < 1) {
- return null;
- }
- var xBlank; // x 轴空白间隔参数
- var xShapePositions = []; // x 轴上图形的位置
- var xShapeWidth = 0; // x 轴上图形宽度(自适应)
- var dvbWidth = this.DVBWidth; // 数据视图框宽度
- // x 轴空白间隔参数处理
- if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 3) {
- xBlank = sets.xShapeBlank;
- var xsLen = dvbWidth - (xBlank[0] + xBlank[2] + (fvc - 1) * xBlank[1]);
- if (xsLen <= fvc) {
- return null;
- }
- xShapeWidth = xsLen / fvc;
- } else {
- // 默认使用等距离空白间隔,空白间隔为图形宽度
- xShapeWidth = dvbWidth / (2 * fvc + 1);
- xBlank = [xShapeWidth, xShapeWidth, xShapeWidth];
- } // 图形 x 轴上的位置计算
- var xOffset = 0;
- for (var i = 0; i < fvc; i++) {
- if (i == 0) {
- xOffset = xBlank[0] + xShapeWidth / 2;
- } else {
- xOffset += xShapeWidth + xBlank[1];
- }
- xShapePositions.push(dvb[0] + xOffset);
- }
- return {
- "xPositions": xShapePositions,
- "width": xShapeWidth
- };
- }
- /**
- * @function SuperMap.Feature.Theme.Bar.prototype.resetLinearGradient
- * @description 图表的相对坐标存在的时候,重新计算渐变的颜色(目前用于二维柱状图 所以子类实现此方法)。
- */
- }, {
- key: "resetLinearGradient",
- value: function resetLinearGradient() {
- if (this.RelativeCoordinate) {
- var shpelength = this.shapes.length;
- var barLinearGradient = this.setting.barLinearGradient;
- var index = -1;
- for (var i = 0; i < shpelength; i++) {
- var shape = this.shapes[i];
- if (shape.CLASS_NAME === "SuperMap.LevelRenderer.Shape.SmicPolygon") {
- var style = shape.style; //计算出当前的绝对 x y
- var x1 = this.location[0] + style.pointList[0][0];
- var x2 = this.location[0] + style.pointList[1][0]; //渐变颜色
- index++; //以防定义的颜色数组不够用
- if (index >= barLinearGradient.length) {
- index = index % barLinearGradient.length;
- }
- var color1 = barLinearGradient[index][0];
- var color2 = barLinearGradient[index][1]; //颜色
- var zcolor = new Color();
- var linearGradient = zcolor.getLinearGradient(x1, 0, x2, 0, [[0, color1], [1, color2]]); //赋值
- shape.style.color = linearGradient;
- }
- }
- }
- }
- }]);
- return Bar;
- }(Graph);
- /**
- * @typedef {Object} SuperMap.Feature.Theme.Bar.setting
- * @property {number} width - 专题要素(图表)宽度。
- * @property {number} height - 专题要素(图表)高度。
- * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
- * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
- * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
- * @property {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)
- * 在左、下,右,上四个方向上的内偏距值。当使用坐标轴时 dataViewBoxParameter 的默认值为:[45, 15, 15, 15];
- * 不使用坐标轴时 dataViewBoxParameter 的默认值为:[5, 5, 5, 5]。
- * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
- * @property {boolean} [useBackground=true] - 是否使用图表背景框。
- * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} [backgroundStyle] - 背景样式。
- * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,
- * 则 backgroundRadius 为 [r1、r2、r3、r4]。
- * @property {Array.<number>} xShapeBlank - 水平方向上的图形空白间隔参数。长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,
- * 第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
- * @property {boolean} [showShadow=true] - 阴影开关。
- * @property {Object} [barShadowStyle] - 阴影样式,如:{shadowBlur : 8, shadowOffsetX: 2 , shadowOffsetY : 2,shadowColor : "rgba(100,100,100,0.8)"}
- * @property {Array.<string>} [barLinearGradient] - 按字段设置柱条样式[渐变开始颜色,渐变终止颜色] 与 themeLayer.themeFields 中的字段一一对应),
- * 如:[["#00FF00","#00CD00"],["#00CCFF","#5E87A2"],["#00FF66","#669985"],["#CCFF00","#94A25E"],["#FF9900","#A2945E"]]
- * @property {boolean} [useAxis=true] - 是否使用坐标轴。</br>
- * @property {SuperMap.Feature.ShapeParameters.Line.style} [axisStyle] - 坐标轴样式。
- * @property {boolean} [axisUseArrow=false] - 坐标轴是否使用箭头。
- * @property {number} [axisYTick=0] - y 轴刻度数量。
- * @property {Array.<string>} [axisYLabels] - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
- * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisYLabelsStyle] - y 轴上的标签组样式。
- * @property {Array.<number>} [axisYLabelsOffset=[0,0]] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正;数组第二项表示 y 轴标签组纵向上的偏移量,向下为正。
- * @property {Array.<string>} [axisXLabels] - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。标签排布规则:当标签数量与 xShapeInfo 中的属性 xShapeCenter 数量相同(即标签个数与数据个数相等时), 按照 xShapeCenter 提供的位置排布标签,否则沿数据视图框下面条边等距排布标签。
- * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisXLabelsStyle] - x 轴上的标签组样式。
- * @property {Array.<number>} [axisXLabelsOffset=[0,0]] - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正;数组第二项表示 x 轴标签组纵向上的偏移量,向下为正。
- * @property {boolean} [useXReferenceLine] - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
- * @property {SuperMap.Feature.ShapeParameters.Line.style} xReferenceLineStyle - 水平参考线样式。
- * @property {Object} barStyle - 柱状图柱条基础 style,此参数控制柱条基础样式,优先级低于 barStyleByFields 和 barStyleByCodomain。
- * @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。
- * @property {Array.<SuperMap.Feature.ShapeParameters.Polygon.style>} barStyleByCodomain - 按柱条代表的数据值所在值域范围控制柱条样式,优先级高于 barStyle 和 barStyleByFields。
- * @property {Object} [barHoverStyle] - 柱条 hover 状态时的样式,barHoverAble 为 true 时有效。
- * @property {Object} [barHoverAble] - 是否允许柱条使用 hover 状态,默认允许。同时设置 barHoverAble 和 barClickAble 为 false,可以直接屏蔽柱条对专题图层事件的响应。
- * @property {Object} [barClickAble] - 是否允许柱条被点击,默认允许。同时设置 barHoverAble 和 barClickAble 为 false,可以直接屏蔽柱条对专题图层事件的响应。
- */
- SuperMap.Feature.Theme.Bar = Bar;
- ;// CONCATENATED MODULE: ./src/common/overlay/Bar3D.js
- 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); }
- function Bar3D_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Bar3D_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bar3D_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bar3D_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Bar3D_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Bar3D_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function Bar3D_setPrototypeOf(o, p) { Bar3D_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Bar3D_setPrototypeOf(o, p); }
- 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); }; }
- function Bar3D_possibleConstructorReturn(self, call) { if (call && (Bar3D_typeof(call) === "object" || typeof call === "function")) { return call; } return Bar3D_assertThisInitialized(self); }
- function Bar3D_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Bar3D_getPrototypeOf(o) { Bar3D_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Bar3D_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.Theme.Bar3D
- * @classdesc 三维柱状图 。
- * @category Visualization Theme
- * @extends SuperMap.Feature.Theme.Graph
- * @param {SuperMap.Feature.Vector} data - 用户数据。
- * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
- * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
- * @param {SuperMap.Feature.Theme.Bar3D.setting} setting - 图表配置对象。
- * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置,默认为 data 指代的地理要素 Bounds 中心。
- *
-
- *
- * @example
- * // barFaceStyleByCodomain 用法示例如下:
- * // barFaceStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
- * // start: 值域值下限(包含);
- * // end: 值域值上限(不包含);
- * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Polygon.style> 。
- * // barFaceStyleByCodomain 数组形如:
- * [
- * {
- * start:0,
- * end:250,
- * style:{
- * fillColor:"#00CD00"
- * }
- * },
- * {
- * start:250,
- * end:500,
- * style:{
- * fillColor:"#00EE00"
- * }
- * },
- * {
- * start:500,
- * end:750,
- * style:{
- * fillColor:"#00FF7F"
- * }
- * },
- * {
- * start:750,
- * end:1500,
- * style:{
- * fillColor:"#00FF00"
- * }
- * }
- * ]
- *
- * @example
- * // barSideStyleByCodomain 用法示例如下:
- * // barSideStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
- * // start: 值域值下限(包含);
- * // end: 值域值上限(不包含);
- * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Polygon.style> 。
- * // barSideStyleByCodomain 数组形如:
- * [
- * {
- * start:0,
- * end:250,
- * style:{
- * fillColor:"#00CD00"
- * }
- * },
- * {
- * start:250,
- * end:500,
- * style:{
- * fillColor:"#00EE00"
- * }
- * },
- * {
- * start:500,
- * end:750,
- * style:{
- * fillColor:"#00FF7F"
- * }
- * },
- * {
- * start:750,
- * end:1500,
- * style:{
- * fillColor:"#00FF00"
- * }
- * }
- * ]
- *
- * @example
- * // barTopStyleByCodomain 用法示例如下:
- * // barTopStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
- * // start: 值域值下限(包含);
- * // end: 值域值上限(不包含);
- * // style: 数据可视化图形的 style,这个样式对象的可设属性:<SuperMap.Feature.ShapeParameters.Polygon.style> 。
- * // barTopStyleByCodomain 数组形如:
- * [
- * {
- * start:0,
- * end:250,
- * style:{
- * fillColor:"#00CD00"
- * }
- * },
- * {
- * start:250,
- * end:500,
- * style:{
- * fillColor:"#00EE00"
- * }
- * },
- * {
- * start:500,
- * end:750,
- * style:{
- * fillColor:"#00FF7F"
- * }
- * },
- * {
- * start:750,
- * end:1500,
- * style:{
- * fillColor:"#00FF00"
- * }
- * }
- * ]
- */
- var Bar3D = /*#__PURE__*/function (_Graph) {
- Bar3D_inherits(Bar3D, _Graph);
- var _super = Bar3D_createSuper(Bar3D);
- function Bar3D(data, layer, fields, setting, lonlat) {
- var _this;
- Bar3D_classCallCheck(this, Bar3D);
- _this = _super.call(this, data, layer, fields, setting, lonlat);
- _this.CLASS_NAME = "SuperMap.Feature.Theme.Bar3D";
- return _this;
- }
- /**
- * @function SuperMap.Feature.Theme.Bar3D.prototype.destroy
- * @override
- */
- Bar3D_createClass(Bar3D, [{
- key: "destroy",
- value: function destroy() {
- Bar3D_get(Bar3D_getPrototypeOf(Bar3D.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.Feature.Theme.Bar3D.prototype.assembleShapes
- * @description 图形装配实现(扩展接口)。
- */
- }, {
- key: "assembleShapes",
- value: function assembleShapes() {
- // 图表配置对象
- var sets = this.setting; // 默认数据视图框
- if (!sets.dataViewBoxParameter) {
- if (typeof sets.useAxis === "undefined" || sets.useAxis) {
- sets.dataViewBoxParameter = [45, 25, 20, 20];
- } else {
- sets.dataViewBoxParameter = [5, 5, 5, 5];
- }
- } // 3d 柱图的坐标轴默认使用坐标轴箭头
- sets.axisUseArrow = typeof sets.axisUseArrow !== "undefined" ? sets.axisUseArrow : true;
- sets.axisXLabelsOffset = typeof sets.axisXLabelsOffset !== "undefined" ? sets.axisXLabelsOffset : [-10, 10]; // 重要步骤:初始化参数
- if (!this.initBaseParameter()) {
- return;
- } // 值域
- var codomain = this.DVBCodomain; // 重要步骤:定义图表 Bar 数据视图框中单位值的含义
- this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight; // 数据视图域
- var dvb = this.dataViewBox; // 用户数据值
- var fv = this.dataValues;
- if (fv.length < 1) {
- return;
- } // 没有数据
- // 数据溢出值域范围处理
- for (var i = 0, fvLen = fv.length; i < fvLen; i++) {
- if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
- return;
- }
- } // 获取 x 轴上的图形信息
- var xShapeInfo = this.calculateXShapeInfo();
- if (!xShapeInfo) {
- return;
- } // 每个柱条 x 位置
- var xsLoc = xShapeInfo.xPositions; // 柱条宽度
- var xsWdith = xShapeInfo.width; // 坐标轴, 默认启用
- if (typeof sets.useBackground === "undefined" || sets.useBackground) {
- this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
- } // 坐标轴
- if (!sets.axis3DParameter || isNaN(sets.axis3DParameter) || sets.axis3DParameter < 15) {
- sets.axis3DParameter = 20;
- }
- if (typeof sets.useAxis === "undefined" || sets.useAxis) {
- this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
- } // 3d 偏移量, 默认值 10;
- var offset3d = sets.bar3DParameter && !isNaN(sets.bar3DParameter) ? sets.bar3DParameter : 10;
- for (var _i = 0; _i < fv.length; _i++) {
- // 无 3d 偏移量时的柱面顶部 y 坐标
- var yPx = dvb[1] - (fv[_i] - codomain[0]) / this.DVBUnitValue; // 无 3d 偏移量时的柱面的左、右端 x 坐标
- var iPoiL = xsLoc[_i] - xsWdith / 2;
- var iPoiR = xsLoc[_i] + xsWdith / 2; // 3d 柱顶面节点
- var bar3DTopPois = [[iPoiL, yPx], [iPoiR, yPx], [iPoiR - offset3d, yPx + offset3d], [iPoiL - offset3d, yPx + offset3d]]; // 3d 柱侧面节点
- var bar3DSidePois = [[iPoiR, yPx], [iPoiR - offset3d, yPx + offset3d], [iPoiR - offset3d, dvb[1] + offset3d], [iPoiR, dvb[1]]]; // 3d 柱正面节点
- var bar3DFacePois = [[iPoiL - offset3d, dvb[1] + offset3d], [iPoiR - offset3d, dvb[1] + offset3d], [iPoiR - offset3d, yPx + offset3d], [iPoiL - offset3d, yPx + offset3d]];
- if (offset3d <= 0) {
- // offset3d <= 0 时正面不偏移
- bar3DFacePois = [[iPoiL, dvb[1]], [iPoiR, dvb[1]], [iPoiR, yPx], [iPoiL, yPx]];
- } // 新建 3d 柱面顶面、侧面、正面图形参数对象
- var polyTopSP = new Polygon_Polygon(bar3DTopPois);
- var polySideSP = new Polygon_Polygon(bar3DSidePois);
- var polyFaceSP = new Polygon_Polygon(bar3DFacePois); // 侧面、正面图形 style 默认值
- sets.barSideStyle = sets.barSideStyle ? sets.barSideStyle : sets.barFaceStyle;
- sets.barSideStyleByFields = sets.barSideStyleByFields ? sets.barSideStyleByFields : sets.barFaceStyleByFields;
- sets.barSideStyleByCodomain = sets.barSideStyleByCodomain ? sets.barSideStyleByCodomain : sets.barFaceStyleByCodomain;
- sets.barTopStyle = sets.barTopStyle ? sets.barTopStyle : sets.barFaceStyle;
- sets.barTopStyleByFields = sets.barTopStyleByFields ? sets.barTopStyleByFields : sets.barFaceStyleByFields;
- sets.barTopStyleByCodomain = sets.barTopStyleByCodomain ? sets.barTopStyleByCodomain : sets.barFaceStyleByCodomain; // 顶面、侧面、正面图形 style
- polyFaceSP.style = ShapeFactory.ShapeStyleTool({
- stroke: true,
- strokeColor: "#ffffff",
- fillColor: "#ee9900"
- }, sets.barFaceStyle, sets.barFaceStyleByFields, sets.barFaceStyleByCodomain, _i, fv[_i]);
- polySideSP.style = ShapeFactory.ShapeStyleTool({
- stroke: true,
- strokeColor: "#ffffff",
- fillColor: "#ee9900"
- }, sets.barSideStyle, sets.barSideStyleByFields, sets.barSideStyleByCodomain, _i, fv[_i]);
- polyTopSP.style = ShapeFactory.ShapeStyleTool({
- stroke: true,
- strokeColor: "#ffffff",
- fillColor: "#ee9900"
- }, sets.barTopStyle, sets.barTopStyleByFields, sets.barTopStyleByCodomain, _i, fv[_i]); // 3d 柱条高亮样式
- sets.barSideHoverStyle = sets.barSideHoverStyle ? sets.barSideHoverStyle : sets.barFaceHoverStyle;
- sets.barTopHoverStyle = sets.barTopHoverStyle ? sets.barTopHoverStyle : sets.barFaceHoverStyle;
- polyFaceSP.highlightStyle = ShapeFactory.ShapeStyleTool({
- stroke: true
- }, sets.barFaceHoverStyle);
- polySideSP.highlightStyle = ShapeFactory.ShapeStyleTool({
- stroke: true
- }, sets.barSideHoverStyle);
- polyTopSP.highlightStyle = ShapeFactory.ShapeStyleTool({
- stroke: true
- }, sets.barTopHoverStyle); // 图形携带的数据 id 信息 & 高亮模式
- polyTopSP.refDataID = polySideSP.refDataID = polyFaceSP.refDataID = this.data.id; // hover 模式(组合)
- polyTopSP.isHoverByRefDataID = polySideSP.isHoverByRefDataID = polyFaceSP.isHoverByRefDataID = true; // 高亮组(当鼠标 hover 到组内任何一个图形,整个组的图形都会高亮。refDataHoverGroup 在 isHoverByRefDataID 为 true 时有效)
- polyTopSP.refDataHoverGroup = polySideSP.refDataHoverGroup = polyFaceSP.refDataHoverGroup = Util.createUniqueID("lr_shg"); // 图形携带的数据信息
- polyTopSP.dataInfo = polySideSP.dataInfo = polyFaceSP.dataInfo = {
- field: this.fields[_i],
- value: fv[_i]
- }; // 3d 柱条顶面、侧面、正面图形 hover click 设置
- if (typeof sets.barHoverAble !== "undefined") {
- polyTopSP.hoverable = polySideSP.hoverable = polyFaceSP.hoverable = sets.barHoverAble;
- }
- if (typeof sets.barClickAble !== "undefined") {
- polyTopSP.clickable = polySideSP.clickable = polyFaceSP.clickable = sets.barClickAble;
- } // 创建3d 柱条的顶面、侧面、正面图形并添加到图表的图形列表数组
- this.shapes.push(this.shapeFactory.createShape(polySideSP));
- this.shapes.push(this.shapeFactory.createShape(polyTopSP));
- this.shapes.push(this.shapeFactory.createShape(polyFaceSP));
- } // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
- // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
- this.shapesConvertToRelativeCoordinate();
- }
- /**
- * @function SuperMap.Feature.Theme.Bar3D.prototype.calculateXShapeInfo
- * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
- * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
- * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
- * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
- * 本函数中图形配置对象 setting 可设属性:
- * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
- * 长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,
- * 第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
- * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:
- * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
- * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
- */
- }, {
- key: "calculateXShapeInfo",
- value: function calculateXShapeInfo() {
- var dvb = this.dataViewBox; // 数据视图框
- var sets = this.setting; // 图表配置对象
- var fvc = this.dataValues.length; // 数组值个数
- if (fvc < 1) {
- return null;
- }
- var xBlank; // x 轴空白间隔参数
- var xShapePositions = []; // x 轴上图形的位置
- var xShapeWidth = 0; // x 轴上图形宽度(自适应)
- var dvbWidth = this.DVBWidth; // 数据视图框宽度
- // x 轴空白间隔参数处理
- if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 3) {
- xBlank = sets.xShapeBlank;
- var xsLen = dvbWidth - (xBlank[0] + xBlank[2] + (fvc - 1) * xBlank[1]);
- if (xsLen <= fvc) {
- return null;
- }
- xShapeWidth = xsLen / fvc;
- } else {
- // 默认使用等距离空白间隔,空白间隔为图形宽度
- xShapeWidth = dvbWidth / (2 * fvc + 1);
- xBlank = [xShapeWidth, xShapeWidth, xShapeWidth];
- } // 图形 x 轴上的位置计算
- var xOffset = 0;
- for (var i = 0; i < fvc; i++) {
- if (i == 0) {
- xOffset = xBlank[0] + xShapeWidth / 2;
- } else {
- xOffset += xShapeWidth + xBlank[1];
- }
- xShapePositions.push(dvb[0] + xOffset);
- }
- return {
- "xPositions": xShapePositions,
- "width": xShapeWidth
- };
- }
- }]);
- return Bar3D;
- }(Graph);
- /**
- * @typedef {Object} SuperMap.Feature.Theme.Bar3D.setting
- * @property {number} width - 专题要素(图表)宽度。
- * @property {number} height - 专题要素(图表)高度。
- * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
- * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
- * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
- * @property {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。当使用坐标轴时 dataViewBoxParameter 的默认值为:[45, 25, 20, 20];不使用坐标轴时 dataViewBoxParameter 的默认值为:[5, 5, 5, 5]。
- * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
- * @property {boolean} [useBackground=true] - 是否使用图表背景框。
- * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} [backgroundStyle] - 背景样式。
- * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,则 backgroundRadius 为 [r1、r2、r3、r4 ]。
- * @property {Array.<number>} [xShapeBlank] - 水平方向上的图形空白间隔参数。长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
- * @property {number} [bar3DParameter=10] - 3D 柱状参数,3d柱形正面相对于背面向 x 轴和 y 轴负方向偏移的绝对值。
- * @property {boolean} [useAxis=true] - 是否使用坐标轴。
- * @property {SuperMap.Feature.ShapeParameters.Line.style} [axisStyle] - 坐标轴样式。
- * @property {boolean} [axisUseArrow=true] -坐标轴是否使用箭头。
- * @property {number} [axisYTick=0] - y 轴刻度数量。
- * @property {Array.<string>} [axisYLabels] - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
- * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisYLabelsStyle] - y 轴上的标签组样式。
- * @property {Array.<number>} [axisYLabelsOffset=0] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正,默认值:0;数组第二项表示 y 轴标签组纵向上的偏移量,向下为正。
- * @property {Array.<string>} [axisXLabels] - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。标签排布规则:当标签数量与 xShapeInfo 中的属性 xShapeCenter 数量相同(即标签个数与数据个数相等时), 按照 xShapeCenter 提供的位置排布标签,否则沿数据视图框下面条边等距排布标签。
- * @property {SuperMap.Feature.ShapeParameters.Label.style} axisXLabelsStyle - x 轴上的标签组样式。
- * @property {Array.<number>} axisXLabelsOffset - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正,默认值:-10;数组第二项表示 x 轴标签组纵向上的偏移量,向下为正,默认值:10。
- * @property {boolean} [useXReferenceLine] - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
- * @property {SuperMap.Feature.ShapeParameters.Line.style} [xReferenceLineStyle] - 水平参考线样式。
- * @property {number} [axis3DParameter=20] - 3D 坐标轴参数,此属性值在大于等于 15 时有效。
- * @property {SuperMap.Feature.ShapeParameters.Polygon.style} barFaceStyle - 3d 柱状图柱条正面基础 style,此参数控制柱条正面基础样式,优先级低于 barFaceStyleByFields 和 barFaceStyleByCodomain。
- * @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。
- * @property {Array.<Object>} [barFaceStyleByCodomain] - 按柱条正面代表的数据值所在值域范围控制柱条正面样式,优先级高于 barFaceStyle 和 barFaceStyleByFields。
- * @property {SuperMap.Feature.ShapeParameters.Polygon.style} [barSideStyle=barFaceStyle] - 3d 柱状图柱条侧面基础 style,此参数控制柱条侧面基础样式,优先级低于 barSideStyleByFields 和 barSideStyleByCodomain。
- * @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。
- * @property {Array.<Object>} [barSideStyleByCodomain=barFaceStyleByCodomain] - 按柱条侧面代表的数据值所在值域范围控制柱条侧面样式,优先级高于 barSideStyle 和 barSideStyleByFields。
- * @property {Object} [barFaceHoverStyle] - 3d 柱条正面 hover 状态时的样式,barHoverAble 为 true 时有效。
- * @property {Object} [barSideHoverStyle=barFaceHoverStyle] - 3d 柱条侧面 hover 状态时的样式,barHoverAble 为 true 时有效。
- * @property {Object} [barTopHoverStyle=barFaceHoverStyle] - 3d 柱条顶面 hover 状态时的样式,barHoverAble 为 true 时有效。
- * @property {boolean} [barHoverAble=true] - 是否允许柱条使用 hover 状态。同时设置 barHoverAble 和 barClickAble 为 false,可以直接屏蔽柱条对专题图层事件的响应。
- * @property {boolean} [barClickAble=true] - 是否允许柱条被点击。同时设置 barHoverAble 和 barClickAble 为 false,可以直接屏蔽柱条对专题图层事件的响应。
- * @property {SuperMap.Feature.ShapeParameters.Polygon.style} [barTopStyle=barFaceStyle] - 3d 柱状图柱条顶面基础 style,此参数控制柱条顶面基础样式,优先级低于 barTopStyleByFields 和 barTopStyleByCodomain。
- * @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。
- * @property {Array.<Object>} [barTopStyleByCodomain=barFaceStyleByCodomain] - 按柱条顶面代表的数据值所在值域范围控制柱条顶面样式,优先级高于 barTopStyle 和 barTopStyleByFields。
- */
- SuperMap.Feature.Theme.Bar3D = Bar3D;
- ;// CONCATENATED MODULE: ./src/common/overlay/RankSymbol.js
- 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); }
- function RankSymbol_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function RankSymbol_createClass(Constructor, protoProps, staticProps) { if (protoProps) RankSymbol_defineProperties(Constructor.prototype, protoProps); if (staticProps) RankSymbol_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function RankSymbol_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RankSymbol_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function RankSymbol_setPrototypeOf(o, p) { RankSymbol_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RankSymbol_setPrototypeOf(o, p); }
- 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); }; }
- function RankSymbol_possibleConstructorReturn(self, call) { if (call && (RankSymbol_typeof(call) === "object" || typeof call === "function")) { return call; } return RankSymbol_assertThisInitialized(self); }
- function RankSymbol_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function RankSymbol_getPrototypeOf(o) { RankSymbol_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RankSymbol_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.Theme.RankSymbol
- * @classdesc 符号专题要素基类。
- * @category Visualization Theme
- * @description 此类定义了符号专题要素基础模型,具体的图表模型通过继承此类,在子类中实现 assembleShapes 方法。
- * 符号专题要素模型采用了可视化图形大小自适应策略,用较少的参数控制着图表诸多图形,图表配置对象 <SuperMap.Feature.Theme.RankSymbol.setting> 的基础属性只有 5 个,
- * 它们控制着图表结构、值域范围、数据小数位等基础图表形态。构成图表的图形必须在图表结构里自适应大小。
- * 此类不可实例化,此类的可实例化子类必须实现 assembleShapes() 方法。
- * @param {SuperMap.Feature.Vector} data - 用户数据。
- * @param {SuperMap.Layer.RankSymbol} layer - 此专题要素所在图层。
- * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
- * @param {Object} setting - 图表配置对象。
- * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
- *
- * @extends SuperMap.Feature.Theme.Graph
- *
- */
- var RankSymbol = /*#__PURE__*/function (_Graph) {
- RankSymbol_inherits(RankSymbol, _Graph);
- var _super = RankSymbol_createSuper(RankSymbol);
- function RankSymbol(data, layer, fields, setting, lonlat, options) {
- var _this;
- RankSymbol_classCallCheck(this, RankSymbol);
- _this = _super.call(this, data, layer, fields, setting, lonlat, options);
- /**
- * @member SuperMap.Feature.Theme.RankSymbol.prototype.setting -{Object}
- * @description 符号配置对象,该对象控制着图表的可视化显示。
- * 下面是此配置对象的 5 个基础可设属性:<br>
- * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
- * @param {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
- * @param {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
- * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
- * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
- * 除了以上 5 个基础属性,此对象的可设属性在不同子类中有较大差异,不同子类中对同一属性的解释也可能不同。
- * 请在此类的子类中查看 setting 对象的可设属性和属性含义。
- */
- _this.setting = null; // 配置项检测与赋值
- if (setting && setting.codomain) {
- _this.setting = setting;
- _this.DVBCodomain = _this.setting.codomain;
- }
- _this.CLASS_NAME = "SuperMap.Feature.Theme.RankSymbol";
- return _this;
- }
- /**
- * @function SuperMap.Feature.Theme.RankSymbol.prototype.destroy
- * @description 销毁专题要素。
- */
- RankSymbol_createClass(RankSymbol, [{
- key: "destroy",
- value: function destroy() {
- this.setting = null;
- RankSymbol_get(RankSymbol_getPrototypeOf(RankSymbol.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.Feature.Theme.RankSymbol.prototype.initBaseParameter
- * @description 初始化专题要素(图形)基础参数。
- * 在调用此方法前,此类的图表模型相关属性都是不可用的 ,此方法在 assembleShapes 函数中调用。
- * 调用此函数关系到 setting 对象的以下属性。
- * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
- * @param {number} [XOffset] - 专题要素(图形)在 X 方向上的偏移值,单位像素。
- * @param {number} [YOffset] - 专题要素(图形)在 Y 方向上的偏移值,单位像素。
- * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图形框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
- * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
- * @returns {boolean} 初始化参数是否成功。
- */
- }, {
- key: "initBaseParameter",
- value: function initBaseParameter() {
- // 参数初始化是否成功
- var isSuccess = true; // setting 属性是否已成功赋值
- if (!this.setting) {
- return false;
- }
- var sets = this.setting; // 图表偏移
- if (sets.XOffset) {
- this.XOffset = sets.XOffset;
- }
- if (sets.YOffset) {
- this.YOffset = sets.YOffset;
- }
- this.XOffset = sets.XOffset ? sets.XOffset : 0;
- this.YOffset = sets.YOffset ? sets.YOffset : 0; // 其他默认值
- this.origonPoint = [];
- this.chartBox = [];
- this.dataViewBox = [];
- this.DVBParameter = sets.dataViewBoxParameter ? sets.dataViewBoxParameter : [0, 0, 0, 0];
- this.DVBOrigonPoint = [];
- this.DVBCenterPoint = [];
- this.origonPointOffset = []; // 图表位置
- this.resetLocation(); // 专题要素宽度 w
- var w = this.width; // 专题要素高度 h
- var h = this.height; // 专题要素像素位置 loc
- var loc = this.location; // 专题要素像素位置 loc
- this.origonPoint = [loc[0] - w / 2, loc[1] - h / 2]; // 专题要素原点(左上角)
- var op = this.origonPoint; // 图表框([left, bottom, right, top])
- this.chartBox = [op[0], op[1] + h, op[0] + w, op[1]]; // 图表框
- var cb = this.chartBox; // 数据视图框参数,它是图表框各方向对应的内偏距
- var dbbP = this.DVBParameter; // 数据视图框 ([left, bottom, right, top])
- this.dataViewBox = [cb[0] + dbbP[0], cb[1] - dbbP[1], cb[2] - dbbP[2], cb[3] + dbbP[3]]; // 数据视图框
- var dvb = this.dataViewBox; //检查数据视图框是否合法
- if (dvb[0] >= dvb[2] || dvb[1] <= dvb[3]) {
- return false;
- } // 数据视图框原点
- this.DVBOrigonPoint = [dvb[0], dvb[3]]; // 数据视图框宽度
- this.DVBWidth = Math.abs(dvb[2] - dvb[0]); // 数据视图框高度
- this.DVBHeight = Math.abs(dvb[1] - dvb[3]); // 数据视图框中心点
- this.DVBCenterPoint = [this.DVBOrigonPoint[0] + this.DVBWidth / 2, this.DVBOrigonPoint[1] + this.DVBHeight / 2]; // 数据视图框原点与图表框的原点偏移量
- this.origonPointOffset = [this.DVBOrigonPoint[0] - op[0], this.DVBOrigonPoint[1] - op[1]];
- return isSuccess;
- }
- }]);
- return RankSymbol;
- }(Graph);
- SuperMap.Feature.Theme.RankSymbol = RankSymbol;
- ;// CONCATENATED MODULE: ./src/common/overlay/Circle.js
- 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); }
- function overlay_Circle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function overlay_Circle_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Circle_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Circle_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function overlay_Circle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Circle_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- 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); }
- 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); }; }
- function overlay_Circle_possibleConstructorReturn(self, call) { if (call && (overlay_Circle_typeof(call) === "object" || typeof call === "function")) { return call; } return overlay_Circle_assertThisInitialized(self); }
- function overlay_Circle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- 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); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.Theme.Circle
- * @classdesc 圆类。
- * @category Visualization Theme
- * @extends SuperMap.Feature.Theme.RankSymbol
- * @param {SuperMap.Feature.Vector} data - 用户数据。
- * @param {SuperMap.Layer.RankSymbol} layer - 此专题要素所在图层。
- * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
- * @param {SuperMap.Feature.Theme.Circle.setting} setting - 图表配置对象。
- * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置,默认为 data 指代的地理要素 Bounds 中心。
- */
- var Circle = /*#__PURE__*/function (_RankSymbol) {
- overlay_Circle_inherits(Circle, _RankSymbol);
- var _super = overlay_Circle_createSuper(Circle);
- function Circle(data, layer, fields, setting, lonlat) {
- var _this;
- overlay_Circle_classCallCheck(this, Circle);
- _this = _super.call(this, data, layer, fields, setting, lonlat);
- _this.CLASS_NAME = "SuperMap.Feature.Theme.Circle";
- return _this;
- }
- /**
- * @function SuperMap.Feature.Theme.Circle.prototype.destroy
- * @override
- */
- overlay_Circle_createClass(Circle, [{
- key: "destroy",
- value: function destroy() {
- overlay_Circle_get(overlay_Circle_getPrototypeOf(Circle.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.Feature.Theme.Circle.prototype.assembleShapes
- * @description 装配图形(扩展接口)。
- */
- }, {
- key: "assembleShapes",
- value: function assembleShapes() {
- //默认填充颜色
- var defaultFillColor = "#ff9277"; // setting 属性是否已成功赋值
- if (!this.setting) {
- return false;
- }
- var sets = this.setting; // 检测 setting 的必设参数
- if (!sets.codomain) {
- return false;
- } // 数据
- var decimalNumber = typeof sets.decimalNumber !== "undefined" && !isNaN(sets.decimalNumber) ? sets.decimalNumber : -1;
- var dataEffective = Theme_Theme.getDataValues(this.data, this.fields, decimalNumber);
- this.dataValues = dataEffective ? dataEffective : []; // 数据值数组
- var fv = this.dataValues; //if(fv.length != 1) return; // 没有数据 或者数据不唯一
- //if(fv[0] < 0) return; //数据为负值
- //用户应该定义最大 最小半径 默认最大半径MaxR:100 最小半径MinR:0;
- if (!sets.maxR) {
- sets.maxR = 100;
- }
- if (!sets.minR) {
- sets.minR = 0;
- } // 值域范围
- var codomain = this.DVBCodomain; // 重要步骤:定义Circle数据视图框中单位值的含义,单位值:1所代表的长度
- // 用户定义了值域范围
- if (codomain && codomain[1] - codomain[0] > 0) {
- this.DVBUnitValue = sets.maxR / (codomain[1] - codomain[0]);
- } else {
- //this.DVBUnitValue = sets.maxR / maxValue;
- this.DVBUnitValue = sets.maxR;
- }
- var uv = this.DVBUnitValue; //圆半径
- var r = fv[0] * uv + sets.minR;
- this.width = 2 * r;
- this.height = 2 * r; // 重要步骤:初始化参数
- if (!this.initBaseParameter()) {
- return;
- } //假如用户设置了值域范围 没有在值域范围直接返回
- if (codomain) {
- if (fv[0] < codomain[0] || fv[0] > codomain[1]) {
- return;
- }
- }
- var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为圆心
- //圆形对象参数
- var circleSP = new Circle_Circle(dvbCenter[0], dvbCenter[1], r); //circleSP.sytle 初始化
- circleSP.style = ShapeFactory.ShapeStyleTool(null, sets.circleStyle, null, null, 0); //图形的填充颜色
- if (typeof sets.fillColor !== "undefined") {
- //用户自定义
- circleSP.style.fillColor = sets.fillColor;
- } else {
- //当前默认
- circleSP.style.fillColor = defaultFillColor;
- } //圆形 Hover样式
- circleSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.circleHoverStyle); //圆形 Hover 与 click 设置
- if (typeof sets.circleHoverAble !== "undefined") {
- circleSP.hoverable = sets.circleHoverAble;
- }
- if (typeof sets.circleClickAble !== "undefined") {
- circleSP.clickable = sets.circleClickAble;
- } //图形携带的数据信息
- circleSP.refDataID = this.data.id;
- circleSP.dataInfo = {
- field: this.fields[0],
- r: r,
- value: fv[0]
- }; // 创建扇形并把此扇形添加到图表图形数组
- this.shapes.push(this.shapeFactory.createShape(circleSP)); // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
- // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
- this.shapesConvertToRelativeCoordinate();
- }
- }]);
- return Circle;
- }(RankSymbol);
- /**
- * @typedef {Object} SuperMap.Feature.Theme.Circle.setting
- * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
- * @property {number} [maxR] - 圆形的最大半径。
- * @property {number} [minR] - 圆形的最小半径。
- * @property {string} [fillColor] - 圆形的填充色,如:fillColor: "#FFB980"。
- * @property {Object} [circleStyle] - 圆形的基础 style,此参数控制圆形基础样式,优先级低于 circleStyleByFields 和 circleStyleByCodomain。
- * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
- * @property {Object} [circleHoverStyle] - 圆形 hover 状态时的样式,circleHoverAble 为 true 时有效。
- * @property {boolean} [circleHoverAble=true] - 是否允许圆形使用 hover 状态。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
- * @property {boolean} [circleClickAble=true] - 是否允许圆形被点击。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
- *
- */
- SuperMap.Feature.Theme.Circle = Circle;
- ;// CONCATENATED MODULE: ./src/common/overlay/Line.js
- 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); }
- function overlay_Line_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function overlay_Line_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Line_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Line_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function overlay_Line_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Line_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- 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); }
- 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); }; }
- function overlay_Line_possibleConstructorReturn(self, call) { if (call && (overlay_Line_typeof(call) === "object" || typeof call === "function")) { return call; } return overlay_Line_assertThisInitialized(self); }
- function overlay_Line_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- 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); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.Theme.Line
- * @classdesc 折线图。
- * @category Visualization Theme
- * @example
- * // pointStyleByCodomain 参数用法示例
- * // pointStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
- * // start: 值域值下限(包含);
- * // end: 值域值上限(不包含);
- * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Point.style> 。
- * // pointStyleByCodomain 数组形如:
- * [
- * {
- * start:0,
- * end:250,
- * style:{
- * fillColor:"#00CD00"
- * }
- * },
- * {
- * start:250,
- * end:500,
- * style:{
- * fillColor:"#00EE00"
- * }
- * },
- * {
- * start:500,
- * end:750,
- * style:{
- * fillColor:"#00FF7F"
- * }
- * },
- * {
- * start:750,
- * end:1500,
- * style:{
- * fillColor:"#00FF00"
- * }
- * }
- * ]
- *
- * @extends SuperMap.Feature.Theme.Graph
- * @param {SuperMap.Feature.Vector} data - 用户数据。
- * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
- * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
- * @param {SuperMap.Feature.Theme.Line.setting} setting - 图表配置对象。
- * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
- */
- var Line = /*#__PURE__*/function (_Graph) {
- overlay_Line_inherits(Line, _Graph);
- var _super = overlay_Line_createSuper(Line);
- function Line(data, layer, fields, setting, lonlat, options) {
- var _this;
- overlay_Line_classCallCheck(this, Line);
- _this = _super.call(this, data, layer, fields, setting, lonlat, options);
- _this.CLASS_NAME = "SuperMap.Feature.Theme.Line";
- return _this;
- }
- /**
- * @function SuperMap.Feature.Theme.Line.prototype.destroy
- * @override
- */
- overlay_Line_createClass(Line, [{
- key: "destroy",
- value: function destroy() {
- overlay_Line_get(overlay_Line_getPrototypeOf(Line.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.Feature.Theme.Line.prototype.assembleShapes
- * @description 装配图形(扩展接口)。
- */
- }, {
- key: "assembleShapes",
- value: function assembleShapes() {
- // 图表配置对象
- var sets = this.setting; // 默认数据视图框
- if (!sets.dataViewBoxParameter) {
- if (typeof sets.useAxis === "undefined" || sets.useAxis) {
- sets.dataViewBoxParameter = [45, 15, 15, 15];
- } else {
- sets.dataViewBoxParameter = [5, 5, 5, 5];
- }
- } // 重要步骤:初始化参数
- if (!this.initBaseParameter()) {
- return;
- }
- var dvb = this.dataViewBox; // 值域
- var codomain = this.DVBCodomain; // 重要步骤:定义图表 Bar 数据视图框中单位值的含义
- this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
- var uv = this.DVBUnitValue; // 数据值数组
- var fv = this.dataValues;
- if (fv.length < 1) {
- return;
- } // 没有数据
- // 获取 x 轴上的图形信息
- var xShapeInfo = this.calculateXShapeInfo();
- if (!xShapeInfo) {
- return;
- } // 折线每个节点的 x 位置
- var xsLoc = xShapeInfo.xPositions; // 背景框,默认启用
- if (typeof sets.useBackground === "undefined" || sets.useBackground) {
- // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
- this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
- } // 折线图必须使用坐标轴
- this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo)); // var isDataEffective = true;
- var xPx; // 折线节点 x 坐标
- var yPx; // 折线节点 y 坐标
- var poiLists = []; // 折线节点数组
- var shapePois = []; // 折线节点图形数组
- for (var i = 0, len = fv.length; i < len; i++) {
- // 数据溢出值域检查
- if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
- // isDataEffective = false;
- return null;
- }
- xPx = xsLoc[i];
- yPx = dvb[1] - (fv[i] - codomain[0]) / uv; // 折线节点参数对象
- var poiSP = new Point_Point(xPx, yPx); // 折线节点 style
- poiSP.style = ShapeFactory.ShapeStyleTool({
- fillColor: "#ee9900"
- }, sets.pointStyle, sets.pointStyleByFields, sets.pointStyleByCodomain, i, fv[i]); // 折线节点 hover 样式
- poiSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.pointHoverStyle); // 折线节点 hover click
- if (typeof sets.pointHoverAble !== "undefined") {
- poiSP.hoverable = sets.pointHoverAble;
- }
- if (typeof sets.pointClickAble !== "undefined") {
- poiSP.clickable = sets.pointClickAble;
- } // 图形携带的数据信息
- poiSP.refDataID = this.data.id;
- poiSP.dataInfo = {
- field: this.fields[i],
- value: fv[i]
- }; // 创建图形并把此图形添加到折线节点图形数组
- shapePois.push(this.shapeFactory.createShape(poiSP)); // 添加折线节点到折线节点数组
- var poi = [xPx, yPx];
- poiLists.push(poi);
- } // 折线参数对象
- var lineSP = new Line_Line(poiLists);
- lineSP.style = ShapeFactory.ShapeStyleTool({
- strokeColor: "#ee9900"
- }, sets.lineStyle); // 禁止事件响应
- lineSP.clickable = false;
- lineSP.hoverable = false;
- var shapeLine = this.shapeFactory.createShape(lineSP);
- this.shapes.push(shapeLine); // 添加节点到图表图形数组
- this.shapes = this.shapes.concat(shapePois); // // 数据范围检测未通过,清空图形
- // if (isDataEffective === false) {
- // this.shapes = [];
- // }
- // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
- // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
- this.shapesConvertToRelativeCoordinate();
- }
- /**
- * @function SuperMap.Feature.Theme.Line.prototype.calculateXShapeInfo
- * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
- * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
- * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
- * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
- * 本函数中图形配置对象 setting 可设属性:<br>
- * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
- * 长度为 2 的数组,第一元素表示第折线左端点与数据视图框左端的空白间距,第二个元素表示折线右端点右端与数据视图框右端端的空白间距 。
- * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:<br>
- * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。<br>
- * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
- */
- }, {
- key: "calculateXShapeInfo",
- value: function calculateXShapeInfo() {
- var dvb = this.dataViewBox; // 数据视图框
- var sets = this.setting; // 图表配置对象
- var fvc = this.dataValues.length; // 数组值个数
- if (fvc < 1) {
- return null;
- }
- var xBlank; // x 轴空白间隔参数
- var xShapePositions = []; // x 轴上图形的位置
- var xShapeWidth = 0; // x 轴上图形宽度(自适应)
- var dvbWidth = this.DVBWidth; // 数据视图框宽度
- var unitOffset = 0; // 单位偏移量
- // x 轴空白间隔参数处理
- if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 2) {
- xBlank = sets.xShapeBlank;
- var xsLen = dvbWidth - (xBlank[0] + xBlank[1]);
- if (xsLen <= fvc) {
- return null;
- }
- unitOffset = xsLen / (fvc - 1);
- } else {
- // 默认使用等距离空白间隔,空白间隔为图形宽度
- unitOffset = dvbWidth / (fvc + 1);
- xBlank = [unitOffset, unitOffset, unitOffset];
- } // 图形 x 轴上的位置计算
- var xOffset = 0;
- for (var i = 0; i < fvc; i++) {
- if (i == 0) {
- xOffset = xBlank[0];
- } else {
- xOffset += unitOffset;
- }
- xShapePositions.push(dvb[0] + xOffset);
- }
- return {
- "xPositions": xShapePositions,
- "width": xShapeWidth
- };
- }
- }]);
- return Line;
- }(Graph);
- /**
- * @typedef {Object} SuperMap.Feature.Theme.Line.setting
- * @property {number} width - 专题要素(图表)宽度。
- * @property {number} height - 专题要素(图表)高度。
- * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
- * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
- * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
- * @property {Array.<number>} [dataViewBoxParameter] - {Array.<number>} 数据视图框 dataViewBox 参数,
- * 它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
- * 当使用坐标轴时 dataViewBoxParameter 的默认值为:[45, 15, 15, 15];不使用坐标轴时 dataViewBoxParameter 的默认值为:[5, 5, 5, 5]。
- * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
- * @property {boolean} [useBackground] - 是否使用图表背景框。
- * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} backgroundStyle - 背景样式。
- * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,
- * 则 backgroundRadius 为 [r1、r2、r3、r4 ]。
- * @property {Array.<number>} xShapeBlank - 水平方向上的图形空白间隔参数。长度为 2 的数组,第一元素表示折线左端点与数据视图框左端的空白间距,
- * 第二个元素表示折线右端点右端与数据视图框右端端的空白间距。
- * @property {SuperMap.Feature.ShapeParameters.Line.style} [axisStyle] - 坐标轴样式。
- * @property {boolean} [axisUseArrow=false] - 坐标轴是否使用箭头。
- * @property {number} [axisYTick=0] - y 轴刻度数量。
- * @property {Array.<string>} [axisYLabels] - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
- * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisYLabelsStyle] - y 轴上的标签组样式。
- * @property {Array.<number>} [axisYLabelsOffset=0] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正。
- * 数组第二项表示 y 轴标签组纵向上的偏移量,向下为正。
- * @property {Array.<string>} [axisXLabels] - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。
- * 标签排布规则:当标签数量与 xShapeInfo 中的属性 xShapeCenter 数量相同(即标签个数与数据个数相等时), 按照 xShapeCenter 提供的位置排布标签,
- * 否则沿数据视图框下面条边等距排布标签。
- * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisXLabelsStyle] - x 轴上的标签组样式。
- * @property {Array.<number>} [axisXLabelsOffset=0] - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正;
- * 数组第二项表示 x 轴标签组纵向上的偏移量,向下为正;
- * @property {boolean} [useXReferenceLine=true] - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
- * @property {SuperMap.Feature.ShapeParameters.Line.style} ]xReferenceLineStyle] - 水平参考线样式。
- * @property {SuperMap.Feature.ShapeParameters.Line.style} [lineStyle] - 折线图中折线 style。
- * @property {SuperMap.Feature.ShapeParameters.Point.style} [pointStyle] - 折线图中折线节点基础 style,此参数控制折线节点基础样式,优先级低于 pointStyleByFields 和 pointStyleByCodomain。
- * @property {SuperMap.Feature.ShapeParameters.Point.style} [pointStyleByFields] - 按专题字段 themeFields(<SuperMap.Layer.Graph.themeFields>)为折线节点赋 style,此参数按字段控制折线节点样式,
- * 优先级低于 pointStyleByCodomain,高于 pointStyle。此数组中的元素是样式对象。
- * 此参数中的 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"],
- * pointStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的折线节点使用 style1,字段 POP_1995 对应的折线节点使用 style2 ,字段 POP_1999 对应的折线节点使用 style3。
- * @property {Array.<Object>} pointStyleByCodomain - 按折线节点代表的数据值所在值域范围控制折线节点样式,优先级高于 pointStyle 和 pointStyleByFields。
- * @property {Object} [pointHoverStyle=true] - 折线节点 hover 状态时的样式,pointHoverAble 为 true 时有效。
- * @property {boolean} [pointHoverAble=true] - 是否允许折线节点使用 hover 状态。同时设置 pointHoverAble 和 pointClickAble 为 false,可以直接屏蔽折线节点对专题图层事件的响应。
- * @property {boolean} [pointClickAble=true] - 是否允许折线节点被点击。同时设置 pointHoverAble 和 pointClickAble 为 false,可以直接屏蔽折线节点对专题图层事件的响应。
-
- */
- SuperMap.Feature.Theme.Line = Line;
- ;// CONCATENATED MODULE: ./src/common/overlay/Pie.js
- 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); }
- function Pie_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Pie_createClass(Constructor, protoProps, staticProps) { if (protoProps) Pie_defineProperties(Constructor.prototype, protoProps); if (staticProps) Pie_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Pie_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Pie_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function Pie_setPrototypeOf(o, p) { Pie_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Pie_setPrototypeOf(o, p); }
- 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); }; }
- function Pie_possibleConstructorReturn(self, call) { if (call && (Pie_typeof(call) === "object" || typeof call === "function")) { return call; } return Pie_assertThisInitialized(self); }
- function Pie_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Pie_getPrototypeOf(o) { Pie_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Pie_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.Theme.Pie
- * @classdesc 饼图。
- * @category Visualization Theme
- * @param {SuperMap.Feature.Vector} data - 用户数据。
- * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
- * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
- * @param {SuperMap.Feature.Theme.Point.setting} setting - 图表配置对象。
- * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
- * @extends SuperMap.Feature.Theme.Graph
- * @example
- * // sectorStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
- * // start: 值域值下限(包含);
- * // end: 值域值上限(不包含);
- * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Sector.style> 。
- * // sectorStyleByCodomain 数组形如:
- * [
- * {
- * start:0,
- * end:250,
- * style:{
- * fillColor:"#00CD00"
- * }
- * },
- * {
- * start:250,
- * end:500,
- * style:{
- * fillColor:"#00EE00"
- * }
- * },
- * {
- * start:500,
- * end:750,
- * style:{
- * fillColor:"#00FF7F"
- * }
- * },
- * {
- * start:750,
- * end:1500,
- * style:{
- * fillColor:"#00FF00"
- * }
- * }
- * ]
- * @extends {SuperMap.Feature.Theme.Graph}
- */
- var Pie = /*#__PURE__*/function (_Graph) {
- Pie_inherits(Pie, _Graph);
- var _super = Pie_createSuper(Pie);
- function Pie(data, layer, fields, setting, lonlat) {
- var _this;
- Pie_classCallCheck(this, Pie);
- _this = _super.call(this, data, layer, fields, setting, lonlat);
- _this.CLASS_NAME = "SuperMap.Feature.Theme.Pie";
- return _this;
- }
- /**
- * @function SuperMap.Feature.Theme.Pie.prototype.destroy
- * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
- */
- Pie_createClass(Pie, [{
- key: "destroy",
- value: function destroy() {
- Pie_get(Pie_getPrototypeOf(Pie.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.Feature.Theme.Pie.prototype.assembleShapes
- * @description 装配图形(扩展接口)。
- */
- }, {
- key: "assembleShapes",
- value: function assembleShapes() {
- // 图表配置对象
- var sets = this.setting; // 一个默认 style 组
- var defaultStyleGroup = [{
- fillColor: "#ff9277"
- }, {
- fillColor: "#dddd00"
- }, {
- fillColor: "#ffc877"
- }, {
- fillColor: "#bbe3ff"
- }, {
- fillColor: "#d5ffbb"
- }, {
- fillColor: "#bbbbff"
- }, {
- fillColor: "#ddb000"
- }, {
- fillColor: "#b0dd00"
- }, {
- fillColor: "#e2bbff"
- }, {
- fillColor: "#ffbbe3"
- }, {
- fillColor: "#ff7777"
- }, {
- fillColor: "#ff9900"
- }, {
- fillColor: "#83dd00"
- }, {
- fillColor: "#77e3ff"
- }, {
- fillColor: "#778fff"
- }, {
- fillColor: "#c877ff"
- }, {
- fillColor: "#ff77ab"
- }, {
- fillColor: "#ff6600"
- }, {
- fillColor: "#aa8800"
- }, {
- fillColor: "#77c7ff"
- }, {
- fillColor: "#ad77ff"
- }, {
- fillColor: "#ff77ff"
- }, {
- fillColor: "#dd0083"
- }, {
- fillColor: "#777700"
- }, {
- fillColor: "#00aa00"
- }, {
- fillColor: "#0088aa"
- }, {
- fillColor: "#8400dd"
- }, {
- fillColor: "#aa0088"
- }, {
- fillColor: "#dd0000"
- }, {
- fillColor: "#772e00"
- }]; // 重要步骤:初始化参数
- if (!this.initBaseParameter()) {
- return;
- } // 背景框,默认不启用
- if (sets.useBackground) {
- this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
- } // 数据值数组
- var fv = this.dataValues;
- if (fv.length < 1) {
- return;
- } // 没有数据
- // 值域范围
- var codomain = this.DVBCodomain; // 值域范围检测
- for (var _i = 0; _i < fv.length; _i++) {
- if (fv[_i] < codomain[0] || fv[_i] > codomain[1]) {
- return;
- }
- } // 值的绝对值总和
- var valueSum = 0;
- for (var _i2 = 0; _i2 < fv.length; _i2++) {
- valueSum += Math.abs(fv[_i2]);
- } // 重要步骤:定义图表 Pie 数据视图框中单位值的含义,单位值:每度代表的数值
- this.DVBUnitValue = 360 / valueSum;
- var uv = this.DVBUnitValue;
- var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为扇心
- var startAngle = 0; // 扇形起始边角度
- var endAngle = 0; // 扇形终止边角度
- var startAngleTmp = startAngle; // 扇形临时起始边角度
- // 扇形(自适应)半径
- var r = this.DVBHeight < this.DVBWidth ? this.DVBHeight / 2 : this.DVBWidth / 2;
- for (var i = 0; i < fv.length; i++) {
- var fvi = Math.abs(fv[i]); //计算终止角
- if (i === 0) {
- endAngle = startAngle + fvi * uv;
- } else if (i === fvi.length - 1) {
- endAngle = startAngleTmp;
- } else {
- endAngle = startAngle + fvi * uv;
- } //矫正误差计算
- if (endAngle - startAngle >= 360) {
- endAngle = 359.9999999;
- } // 扇形参数对象
- var sectorSP = new Sector(dvbCenter[0], dvbCenter[1], r, startAngle, endAngle); // 扇形样式
- if (typeof sets.sectorStyleByFields === "undefined") {
- // 使用默认 style 组
- var colorIndex = i % defaultStyleGroup.length;
- sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, defaultStyleGroup, null, colorIndex);
- } else {
- sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, sets.sectorStyleByFields, sets.sectorStyleByCodomain, i, fv[i]);
- } // 扇形 hover 样式
- sectorSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.sectorHoverStyle); // 扇形 hover 与 click 设置
- if (typeof sets.sectorHoverAble !== "undefined") {
- sectorSP.hoverable = sets.sectorHoverAble;
- }
- if (typeof sets.sectorClickAble !== "undefined") {
- sectorSP.clickable = sets.sectorClickAble;
- } // 图形携带的数据信息
- sectorSP.refDataID = this.data.id;
- sectorSP.dataInfo = {
- field: this.fields[i],
- value: fv[i]
- }; // 创建扇形并把此扇形添加到图表图形数组
- this.shapes.push(this.shapeFactory.createShape(sectorSP)); // 把上一次的结束角度作为下一次的起始角度
- startAngle = endAngle;
- } // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
- // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
- this.shapesConvertToRelativeCoordinate();
- }
- }]);
- return Pie;
- }(Graph);
- /**
- * @typedef {Object} SuperMap.Feature.Theme.Pie.setting
- * @property {number} width - 专题要素(图表)宽度。
- * @property {number} height - 专题要素(图表)高度。
- * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
- * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
- * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
- * @property {Array.<number>} [dataViewBoxParameter=[0, 0, 0, 0]] - 数据视图框 dataViewBox 参数,
- * 它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
- * @property {Array.<number>} decimalNumber - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
- * @property {boolean} [useBackground=false] - 是否使用图表背景框。
- * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} backgroundStyle - 背景样式。
- * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,则 backgroundRadius 为 [r1、r2、r3、r4 ]。
- * @property {SuperMap.Feature.ShapeParameters.Sector.style} sectorStyle - 饼图中扇形的基础 style,此参数控制饼图扇形基础样式,优先级低于 sectorStyleByFields 和 sectorStyleByCodomain。
- * @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"],
- * sectorStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的饼图扇形使用 style1,字段 POP_1995 对应的饼图扇形使用 style2 ,字段 POP_1999 对应的饼图扇形使用 style3。
- * @property {Array.<Object>} sectorStyleByCodomain - 按饼图扇形代表的数据值所在值域范围控制饼图扇形样式,优先级高于 sectorStyle 和 sectorStyleByFields。
- * @property {Object} [sectorHoverStyle] 饼图扇形 hover 状态时的样式,sectorHoverAble 为 true 时有效。
- * @property {boolean} [sectorHoverAble=true] 是否允许饼图扇形使用 hover 状态。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽饼图扇形对专题图层事件的响应。
- * @property {boolean} [sectorClickAble=true] 是否允许饼图扇形被点击。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽饼图扇形对专题图层事件的响应。
- */
- SuperMap.Feature.Theme.Pie = Pie;
- ;// CONCATENATED MODULE: ./src/common/overlay/Point.js
- 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); }
- function overlay_Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function overlay_Point_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Point_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Point_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function overlay_Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Point_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- 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); }
- 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); }; }
- function overlay_Point_possibleConstructorReturn(self, call) { if (call && (overlay_Point_typeof(call) === "object" || typeof call === "function")) { return call; } return overlay_Point_assertThisInitialized(self); }
- function overlay_Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- 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); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.Theme.Point
- * @classdesc 点状图。
- * @category Visualization Theme
- * @param {SuperMap.Feature.Vector} data - 用户数据。
- * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
- * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
- * @param {SuperMap.Feature.Theme.Point.setting} setting - 图表配置对象。
- * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
- * @example
- * // pointStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
- * // start: 值域值下限(包含);
- * // end: 值域值上限(不包含);
- * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Point.style> 。
- * // pointStyleByCodomain 数组形如:
- * [
- * {
- * start:0,
- * end:250,
- * style:{
- * fillColor:"#00CD00"
- * }
- * },
- * {
- * start:250,
- * end:500,
- * style:{
- * fillColor:"#00EE00"
- * }
- * },
- * {
- * start:500,
- * end:750,
- * style:{
- * fillColor:"#00FF7F"
- * }
- * },
- * {
- * start:750,
- * end:1500,
- * style:{
- * fillColor:"#00FF00"
- * }
- * }
- * ]
- *@extends {SuperMap.Feature.Theme.Graph}
- */
- var overlay_Point_Point = /*#__PURE__*/function (_Graph) {
- overlay_Point_inherits(Point, _Graph);
- var _super = overlay_Point_createSuper(Point);
- function Point(data, layer, fields, setting, lonlat, options) {
- var _this;
- overlay_Point_classCallCheck(this, Point);
- _this = _super.call(this, data, layer, fields, setting, lonlat, options);
- _this.CLASS_NAME = "SuperMap.Feature.Theme.Point";
- return _this;
- }
- /**
- * @function SuperMap.Feature.Theme.Point.prototype.destroy
- * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
- */
- overlay_Point_createClass(Point, [{
- key: "destroy",
- value: function destroy() {
- overlay_Point_get(overlay_Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.Feature.Theme.prototype.Point.assembleShapes
- * @description 装配图形(扩展接口)。
- */
- }, {
- key: "assembleShapes",
- value: function assembleShapes() {
- // 图表配置对象
- var sets = this.setting; // 默认数据视图框
- if (!sets.dataViewBoxParameter) {
- if (typeof sets.useAxis === "undefined" || sets.useAxis) {
- sets.dataViewBoxParameter = [45, 15, 15, 15];
- } else {
- sets.dataViewBoxParameter = [5, 5, 5, 5];
- }
- } // 重要步骤:初始化参数
- if (!this.initBaseParameter()) {
- return;
- }
- var dvb = this.dataViewBox; // 值域
- var codomain = this.DVBCodomain; // 重要步骤:定义图表 Bar 数据视图框中单位值的含义
- this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
- var uv = this.DVBUnitValue;
- var fv = this.dataValues; // 获取 x 轴上的图形信息
- var xShapeInfo = this.calculateXShapeInfo();
- if (!xShapeInfo) {
- return;
- } // 折线每个节点的 x 位置
- var xsLoc = xShapeInfo.xPositions; // 背景框,默认启用
- if (typeof sets.useBackground === "undefined" || sets.useBackground) {
- // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
- this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
- } // 点状图必须使用坐标轴
- this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
- var xPx; // 图形点 x 坐标
- var yPx; // 图形点 y 坐标
- for (var i = 0, len = fv.length; i < len; i++) {
- // 数据溢出值域检查
- if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
- //isDataEffective = false;
- return null;
- }
- xPx = xsLoc[i];
- yPx = dvb[1] - (fv[i] - codomain[0]) / uv; // 图形点参数对象
- var poiSP = new Point_Point(xPx, yPx); // 图形点 style
- poiSP.style = ShapeFactory.ShapeStyleTool({
- fillColor: "#ee9900"
- }, sets.pointStyle, sets.pointStyleByFields, sets.pointStyleByCodomain, i, fv[i]); // 图形点 hover 样式
- poiSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.pointHoverStyle); // 图形点 hover click
- if (typeof sets.pointHoverAble !== "undefined") {
- poiSP.hoverable = sets.pointHoverAble;
- }
- if (typeof sets.pointClickAble !== "undefined") {
- poiSP.clickable = sets.pointClickAble;
- } // 图形携带的数据信息
- poiSP.refDataID = this.data.id;
- poiSP.dataInfo = {
- field: this.fields[i],
- value: fv[i]
- }; // 创建图形点并把此图形添加到图表图形数组
- this.shapes.push(this.shapeFactory.createShape(poiSP));
- } // 数据范围检测未通过,清空图形
- // if (isDataEffective === false) {
- // this.shapes = [];
- // }
- // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
- // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
- this.shapesConvertToRelativeCoordinate();
- }
- /**
- * @function SuperMap.Feature.Theme.Point.prototype.calculateXShapeInfo
- * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
- * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
- * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
- * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
- * 本函数中图形配置对象 setting 可设属性:<br>
- * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
- * 长度为 2 的数组,第一元素表示第折线左端点与数据视图框左端的空白间距,第二个元素表示折线右端点右端与数据视图框右端端的空白间距 。
- * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:<br>
- * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
- * width - {number}表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
- */
- }, {
- key: "calculateXShapeInfo",
- value: function calculateXShapeInfo() {
- var dvb = this.dataViewBox; // 数据视图框
- var sets = this.setting; // 图表配置对象
- var fvc = this.dataValues.length; // 数组值个数
- if (fvc < 1) {
- return null;
- }
- var xBlank; // x 轴空白间隔参数
- var xShapePositions = []; // x 轴上图形的位置
- var xShapeWidth = 0; // x 轴上图形宽度(自适应)
- var dvbWidth = this.DVBWidth; // 数据视图框宽度
- var unitOffset = 0; // 单位偏移量
- // x 轴空白间隔参数处理
- if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 2) {
- xBlank = sets.xShapeBlank;
- var xsLen = dvbWidth - (xBlank[0] + xBlank[1]);
- if (xsLen <= fvc) {
- return null;
- }
- unitOffset = xsLen / (fvc - 1);
- } else {
- // 默认使用等距离空白间隔,空白间隔为图形宽度
- unitOffset = dvbWidth / (fvc + 1);
- xBlank = [unitOffset, unitOffset, unitOffset];
- } // 图形 x 轴上的位置计算
- var xOffset = 0;
- for (var i = 0; i < fvc; i++) {
- if (i == 0) {
- xOffset = xBlank[0];
- } else {
- xOffset += unitOffset;
- }
- xShapePositions.push(dvb[0] + xOffset);
- }
- return {
- "xPositions": xShapePositions,
- "width": xShapeWidth
- };
- }
- }]);
- return Point;
- }(Graph);
- /**
- * @typedef {Object} SuperMap.Feature.Theme.Point.setting
- * @property {number} width - 专题要素(图表)宽度。
- * @property {number} height - 专题要素(图表)高度。
- * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
- * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
- * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
- * @property {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,
- * 它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
- * 当使用坐标轴时 dataViewBoxParameter 的默认值为:[45, 15, 15, 15];不使用坐标轴时 dataViewBoxParameter 的默认值为:[5, 5, 5, 5]。
- * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
- * @property {boolean} [useBackground] - 是否使用图表背景框。
- * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} backgroundStyle - 背景样式。
- * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,
- * 则 backgroundRadius 为 [r1、r2、r3、r4 ]。
- * @property {Array.<number>} xShapeBlank - 水平方向上的图形空白间隔参数。
- * 长度为 2 的数组,第一个元素表示第一个(沿 x 轴方向)图形点与数据视图框左端的空白间距,第二个元素表示最后一个(沿 x 轴方向)图形点与数据视图框右端端的空白间距 。
- * @property {Object} axisStyle - 坐标轴样式。
- * @property {boolean} [axisUseArrow=false] - 坐标轴是否使用箭头。
- * @property {number} [axisYTick=0] - y 轴刻度数量。
- * @property {Array.<string>} [axisYLabels] - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
- * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisYLabelsStyle] - y 轴上的标签组样式。
- * @property {Array.<number>} [axisYLabelsOffset=0] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正;
- * 数组第二项表示 y 轴标签组纵向上的偏移量,向下为正。
- * @property {Array.<string>} [axisXLabels] - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。
- * 标签排布规则:当标签数量与 xShapeInfo 中的属性 xShapeCenter 数量相同(即标签个数与数据个数相等时), 按照 xShapeCenter 提供的位置排布标签,
- * 否则沿数据视图框下面条边等距排布标签。
- * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisXLabelsStyle] - x 轴上的标签组样式。
- * @property {Array.<number>} [axisXLabelsOffset=0] - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正,
- * 数组第二项表示 x 轴标签组纵向上的偏移量,向下为正。
- * @property {boolean} [useXReferenceLine=true] - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
- * @property {SuperMap.Feature.ShapeParameters.Line.style} [xReferenceLineStyle] - 水平参考线样式。
- * @property {SuperMap.Feature.ShapeParameters.Point.style} [pointStyle] - 点状图中图形点基础 style,此参数控制图形点基础样式,优先级低于 pointStyleByFields 和 pointStyleByCodomain。
- * @property {Array.<SuperMap.Feature.ShapeParameters.Point.style>} [pointStyleByFields] - 按专题字段 themeFields(<SuperMap.Layer.Graph.themeFields>)为图形点赋 style,此参数按字段控制图形点样式,
- * 优先级低于 pointStyleByCodomain,高于 pointStyle。此数组中的元素是样式对象。
- * 此参数中的 style 与 themeFields 中的字段一一对应 。例如: themeFields(<SuperMap.Layer.Graph.themeFields>) 为 ["POP_1992", "POP_1995", "POP_1999"],
- * pointStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的图形点使用 style1,字段 POP_1995 对应的图形点使用 style2 ,字段 POP_1999 对应的图形点使用 style3。
- * @property {Array.<Object>} pointStyleByCodomain - 按图形点代表的数据值所在值域范围控制图形点样式,优先级高于 pointStyle 和 pointStyleByFields。
- * @property {Object} [pointHoverStyle] - 图形点 hover 状态时的样式,pointHoverAble 为 true 时有效。
- * @property {Object} [pointHoverAble=true] - 是否允许图形点使用 hover 状态。同时设置 pointHoverAble 和 pointClickAble 为 false,可以直接屏蔽图形点对专题图层事件的响应。
- * @property {Object} [pointClickAble=true] - 是否允许图形点被点击。同时设置 pointHoverAble 和 pointClickAble 为 false,可以直接屏蔽图形点对专题图层事件的响应。
- */
- SuperMap.Feature.Theme.Point = overlay_Point_Point;
- ;// CONCATENATED MODULE: ./src/common/overlay/Ring.js
- 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); }
- function Ring_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Ring_createClass(Constructor, protoProps, staticProps) { if (protoProps) Ring_defineProperties(Constructor.prototype, protoProps); if (staticProps) Ring_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Ring_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Ring_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function Ring_setPrototypeOf(o, p) { Ring_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Ring_setPrototypeOf(o, p); }
- 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); }; }
- function Ring_possibleConstructorReturn(self, call) { if (call && (Ring_typeof(call) === "object" || typeof call === "function")) { return call; } return Ring_assertThisInitialized(self); }
- function Ring_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Ring_getPrototypeOf(o) { Ring_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Ring_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.Theme.Ring
- * @classdesc 环状图。
- * @category Visualization Theme
- * @description 基于路由对象计算指定点 M 值操作的参数类。通过该类提供参数信息。
-
- * @param {SuperMap.Feature.Vector} data - 用户数据。
- * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
- * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
- * @param {SuperMap.Feature.Theme.Ring.setting} setting - 图表配置对象。
- * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
- * @example
- * // sectorStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
- * // start: 值域值下限(包含);
- * // end: 值域值上限(不包含);
- * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Sector.style> 。
- * // sectorStyleByCodomain 数组形如:
- * [
- * {
- * start:0,
- * end:250,
- * style:{
- * fillColor:"#00CD00"
- * }
- * },
- * {
- * start:250,
- * end:500,
- * style:{
- * fillColor:"#00EE00"
- * }
- * },
- * {
- * start:500,
- * end:750,
- * style:{
- * fillColor:"#00FF7F"
- * }
- * },
- * {
- * start:750,
- * end:1500,
- * style:{
- * fillColor:"#00FF00"
- * }
- * }
- * ]
- * @param {Object} [sectorHoverStyle=true] - 环状图扇形 hover 状态时的样式,sectorHoverAble 为 true 时有效。
- * @param {boolean} [sectorHoverAble=true] - 是否允许环状图扇形使用 hover 状态。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽环状图扇形对专题图层事件的响应。
- * @param {boolean} [sectorClickAble=true] - 是否允许环状图扇形被点击。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽环状图扇形对专题图层事件的响应。
- *
- * @extends {SuperMap.Feature.Theme.Graph}
- */
- var Ring = /*#__PURE__*/function (_Graph) {
- Ring_inherits(Ring, _Graph);
- var _super = Ring_createSuper(Ring);
- function Ring(data, layer, fields, setting, lonlat) {
- var _this;
- Ring_classCallCheck(this, Ring);
- _this = _super.call(this, data, layer, fields, setting, lonlat);
- _this.CLASS_NAME = "SuperMap.Feature.Theme.Ring";
- return _this;
- }
- /**
- * @function SuperMap.Feature.Theme.Ring.prototype.destroy
- * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
- */
- Ring_createClass(Ring, [{
- key: "destroy",
- value: function destroy() {
- Ring_get(Ring_getPrototypeOf(Ring.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.Feature.Theme.Ring.prototype.assembleShapes
- * @description 装配图形(扩展接口)。
- */
- }, {
- key: "assembleShapes",
- value: function assembleShapes() {
- // 重要步骤:初始化参数
- if (!this.initBaseParameter()) {
- return;
- } // 一个默认 style 组
- var defaultStyleGroup = [{
- fillColor: "#ff9277"
- }, {
- fillColor: "#dddd00"
- }, {
- fillColor: "#ffc877"
- }, {
- fillColor: "#bbe3ff"
- }, {
- fillColor: "#d5ffbb"
- }, {
- fillColor: "#bbbbff"
- }, {
- fillColor: "#ddb000"
- }, {
- fillColor: "#b0dd00"
- }, {
- fillColor: "#e2bbff"
- }, {
- fillColor: "#ffbbe3"
- }, {
- fillColor: "#ff7777"
- }, {
- fillColor: "#ff9900"
- }, {
- fillColor: "#83dd00"
- }, {
- fillColor: "#77e3ff"
- }, {
- fillColor: "#778fff"
- }, {
- fillColor: "#c877ff"
- }, {
- fillColor: "#ff77ab"
- }, {
- fillColor: "#ff6600"
- }, {
- fillColor: "#aa8800"
- }, {
- fillColor: "#77c7ff"
- }, {
- fillColor: "#ad77ff"
- }, {
- fillColor: "#ff77ff"
- }, {
- fillColor: "#dd0083"
- }, {
- fillColor: "#777700"
- }, {
- fillColor: "#00aa00"
- }, {
- fillColor: "#0088aa"
- }, {
- fillColor: "#8400dd"
- }, {
- fillColor: "#aa0088"
- }, {
- fillColor: "#dd0000"
- }, {
- fillColor: "#772e00"
- }]; // 图表配置对象
- var sets = this.setting; // 背景框,默认不启用
- if (sets.useBackground) {
- this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
- } // 数据值数组
- var fv = this.dataValues;
- if (fv.length < 1) {
- return;
- } // 没有数据
- // 值域范围
- var codomain = this.DVBCodomain; // 值域范围检测
- for (var _i = 0; _i < fv.length; _i++) {
- if (fv[_i] < codomain[0] || fv[_i] > codomain[1]) {
- return;
- }
- } // 值的绝对值总和
- var valueSum = 0;
- for (var _i2 = 0; _i2 < fv.length; _i2++) {
- valueSum += Math.abs(fv[_i2]);
- } // 重要步骤:定义图表 Ring 数据视图框中单位值的含义,单位值:每度代表的数值
- this.DVBUnitValue = 360 / valueSum;
- var uv = this.DVBUnitValue;
- var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为扇心
- var startAngle = 0; // 扇形起始边角度
- var endAngle = 0; // 扇形终止边角度
- var startAngleTmp = startAngle; // 扇形临时起始边角度
- // 扇形外环(自适应)半径
- var r = this.DVBHeight < this.DVBWidth ? this.DVBHeight / 2 : this.DVBWidth / 2; // 扇形内环(自适应)半径
- var isInRange = sets.innerRingRadius >= 0 && sets.innerRingRadius < r;
- var r0 = typeof sets.innerRingRadius !== "undefined" && !isNaN(sets.innerRingRadius) && isInRange ? sets.innerRingRadius : 0;
- for (var i = 0; i < fv.length; i++) {
- var fvi = Math.abs(fv[i]); // 计算结束角度
- if (i === 0) {
- endAngle = startAngle + fvi * uv;
- } else if (i === fvi.length - 1) {
- endAngle = startAngleTmp;
- } else {
- endAngle = startAngle + fvi * uv;
- } // 扇形参数对象
- var sectorSP = new Sector(dvbCenter[0], dvbCenter[1], r, startAngle, endAngle, r0); // 扇形样式
- if (typeof sets.sectorStyleByFields === "undefined") {
- // 使用默认 style 组
- var colorIndex = i % defaultStyleGroup.length;
- sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, defaultStyleGroup, null, colorIndex);
- } else {
- sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, sets.sectorStyleByFields, sets.sectorStyleByCodomain, i, fv[i]);
- } // 扇形 hover 样式
- sectorSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.sectorHoverStyle); // 扇形 hover 与 click 设置
- if (typeof sets.sectorHoverAble !== "undefined") {
- sectorSP.hoverable = sets.sectorHoverAble;
- }
- if (typeof sets.sectorClickAble !== "undefined") {
- sectorSP.clickable = sets.sectorClickAble;
- } // 图形携带的数据信息
- sectorSP.refDataID = this.data.id;
- sectorSP.dataInfo = {
- field: this.fields[i],
- value: fv[i]
- }; // 创建扇形并把此扇形添加到图表图形数组
- this.shapes.push(this.shapeFactory.createShape(sectorSP)); // 把上一次的结束角度作为下一次的起始角度
- startAngle = endAngle;
- } // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
- // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
- this.shapesConvertToRelativeCoordinate();
- }
- }]);
- return Ring;
- }(Graph);
- /**
- * @typedef {Object} SuperMap.Feature.Theme.Ring.setting
- * @property {number} width - 专题要素(图表)宽度。
- * @property {number} height - 专题要素(图表)高度。
- * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
- * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
- * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
- * @property {Array.<number>} [dataViewBoxParameter=[0, 0, 0, 0]] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
- * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
- * @property {boolean} [useBackground=false] - 是否使用图表背景框。
- * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} [backgroundStyle] - 背景样式,此样式对象对象可设属性。
- * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,则 backgroundRadius 为 [r1、r2、r3、r4 ]。
- * @property {number} [innerRingRadius=0] - 环状图内环半径,取值范围大于 0,小于外环半径(外环半径:数据视图框长和宽中较小值的二分之一)。
- * @property {SuperMap.Feature.ShapeParameters.Sector.style} [sectorStyle] - 环状图中扇形的基础 style,此参数控制环状图扇形基础样式,优先级低于 sectorStyleByFields 和 sectorStyleByCodomain。
- * @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。
- * @property {Array.<SuperMap.Feature.ShapeParameters.Sector.style>} [sectorStyleByCodomain] - 按环状图扇形代表的数据值所在值域范围控制环状图扇形样式,优先级高于 sectorStyle 和 sectorStyleByFields。
-
- */
- SuperMap.Feature.Theme.Ring = Ring;
- ;// CONCATENATED MODULE: ./src/common/overlay/ThemeVector.js
- 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); }
- function ThemeVector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ThemeVector_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeVector_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeVector_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function ThemeVector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeVector_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function ThemeVector_setPrototypeOf(o, p) { ThemeVector_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeVector_setPrototypeOf(o, p); }
- 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); }; }
- function ThemeVector_possibleConstructorReturn(self, call) { if (call && (ThemeVector_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeVector_assertThisInitialized(self); }
- function ThemeVector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function ThemeVector_getPrototypeOf(o) { ThemeVector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeVector_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Feature.Theme.Vector
- * @classdesc 矢量专题要素类。
- * @category Visualization Theme
- * @extends SuperMap.Feature.Theme
- * @param {SuperMap.Feature.Vector} data - 用户数据,的类型为矢量数据 feature。
- * @param {SuperMap.Layer} layer - 此专题要素所在图层。
- * @param {Object} style - 样式。
- * @param {Object} options - 创建专题要素时的可选参数。
- * @param {number} [options.nodesClipPixel=2] - 节点抽稀像素距离, 单位:像素。
- * @param {boolean} [options.isHoverAble=true] - 图形是否可 hover。
- * @param {boolean} [options.isMultiHover=true] - 是否使用多图形高亮,isHoverAble 为 true 时生效。
- * @param {boolean} [options.isClickAble=true] - 图形是否可点击。
- * @param {Object} [options.highlightStyle] - 高亮样式。
- */
- var ThemeVector = /*#__PURE__*/function (_Theme) {
- ThemeVector_inherits(ThemeVector, _Theme);
- var _super = ThemeVector_createSuper(ThemeVector);
- function ThemeVector(data, layer, style, options, shapeOptions) {
- var _this;
- ThemeVector_classCallCheck(this, ThemeVector);
- _this = _super.call(this, data, layer); //数据的 geometry 属性必须存在且类型是 SuperMap.Geometry 或其子类的类型
- if (!data.geometry) {
- return ThemeVector_possibleConstructorReturn(_this);
- }
- if (!(data.geometry instanceof Geometry)) {
- return ThemeVector_possibleConstructorReturn(_this);
- }
- /**
- * @member {SuperMap.Bounds} [SuperMap.Feature.Theme.Vector.prototype.dataBounds]
- * @description 用户数据的(feature.geometry)地理范围。
- */
- _this.dataBounds = data.geometry.getBounds();
- /**
- * @member {number} [SuperMap.Feature.Theme.Vector.prototype.nodesClipPixel=2]
- * @description 节点抽稀像素距离。
- */
- _this.nodesClipPixel = 2;
- /**
- * @member {boolean} [SuperMap.Feature.Theme.Vector.prototype.isHoverAble=true]
- * @description 图形是否可 hover。
- */
- _this.isHoverAble = true;
- /**
- * @member {boolean} [SuperMap.Feature.Theme.Vector.prototype.isMultiHover=true]
- * @description 是否使用多图形高亮,isHoverAble 为 true 时生效。
- */
- _this.isMultiHover = true;
- /**
- * @member {boolean} [SuperMap.Feature.Theme.Vector.prototype.isClickAble=true]
- * @description 图形是否可点击。
- */
- _this.isClickAble = true;
- /**
- * @member {Object} [SuperMap.Feature.Theme.Vector.prototype.highlightStyle]
- * @description 高亮样式。
- */
- _this.highlightStyle = null;
- /**
- * @member {Object} [SuperMap.Feature.Theme.Vector.prototype.shapeOptions]
- * @description 添加到渲染器前修改 shape 的一些属性,非特殊情况通常不允许这么做。
- */
- _this.shapeOptions = {};
- /**
- * @member {Object} [SuperMap.Feature.Theme.Vector.prototype.style]
- * @description 可视化图形的 style。在子类中规定其对象结构和默认属性值。
- */
- _this.style = style || {};
- _this.CLASS_NAME = "SuperMap.Feature.Theme.Vector";
- _this.style = style ? style : {};
- if (options) {
- Util.copyAttributesWithClip(ThemeVector_assertThisInitialized(_this), options, ["shapeOptions", "dataBounds"]);
- }
- if (shapeOptions) {
- Util.copyAttributesWithClip(_this.shapeOptions, shapeOptions);
- } //设置基础参数 dataBounds、lonlat、location
- var geometry = data.geometry;
- _this.lonlat = _this.dataBounds.getCenterLonLat();
- _this.location = _this.getLocalXY(_this.lonlat); //将地理要素转为专题要素
- if (geometry instanceof LinearRing) {
- _this.lineToTF(geometry);
- } else if (geometry instanceof LineString) {
- _this.lineToTF(geometry);
- } else if (geometry instanceof Curve) {//独立几何体
- } else if (geometry instanceof MultiPoint) {
- _this.multiPointToTF(geometry);
- } else if (geometry instanceof MultiLineString) {
- _this.multiLineStringToTF(geometry);
- } else if (geometry instanceof MultiPolygon) {
- _this.multiPolygonToTF(geometry);
- } else if (geometry instanceof Polygon) {
- _this.polygonToTF(geometry);
- } else if (geometry instanceof Collection) {//独立几何体
- } else if (geometry instanceof Point) {
- _this.pointToTF(geometry);
- } else if (geometry instanceof Rectangle) {
- _this.rectangleToTF(geometry);
- } else if (geometry instanceof GeoText) {
- _this.geoTextToTF(geometry);
- }
- return _this;
- }
- /**
- * @function SuperMap.Feature.Theme.Vector.prototype.destroy
- * @override
- */
- ThemeVector_createClass(ThemeVector, [{
- key: "destroy",
- value: function destroy() {
- this.style = null;
- this.dataBounds = null;
- this.nodesClipPixel = null;
- this.isHoverAble = null;
- this.isMultiHover = null;
- this.isClickAble = null;
- this.highlightStyle = null;
- this.shapeOptions = null;
- ThemeVector_get(ThemeVector_getPrototypeOf(ThemeVector.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.Feature.Theme.Vector.prototype.lineToTF
- * @description 转换线和线环要素。
- * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 LineString 或 LineRing。
- */
- }, {
- key: "lineToTF",
- value: function lineToTF(geometry) {
- var components = geometry.components; //节点像素坐标
- var localLX = []; //参考位置,参考中心为
- var refLocal = [];
- var location = this.location;
- var pointList = []; //节点抽稀距离
- var nCPx = this.nodesClipPixel;
- for (var i = 0; i < components.length; i++) {
- var components_i = components[i];
- refLocal = [];
- localLX = this.getLocalXY(components_i);
- refLocal[0] = localLX[0] - location[0];
- refLocal[1] = localLX[1] - location[1]; //抽稀 - 2 px
- if (pointList.length > 0) {
- var lastLocalXY = pointList[pointList.length - 1];
- if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
- continue;
- }
- } //使用参考点
- pointList.push(refLocal);
- }
- if (pointList.length < 2) {
- return null;
- } //赋 style
- var style = new Object();
- style = Util.copyAttributesWithClip(style, this.style, ['pointList']);
- style.pointList = pointList; //创建图形
- var shape = new SmicBrokenLine({
- style: style,
- clickable: this.isClickAble,
- hoverable: this.isHoverAble
- }); //设置高亮样式
- if (this.highlightStyle) {
- shape.highlightStyle = this.highlightStyle;
- } //设置参考中心,指定图形位置
- shape.refOriginalPosition = this.location; //储存数据 id 属性,用于事件
- shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
- shape.isHoverByRefDataID = this.isMultiHover; //添加到渲染器前修改 shape 的一些属性,非特殊情况通常不允许这么做
- if (this.shapeOptions) {
- Util.copyAttributesWithClip(shape, this.shapeOptions);
- }
- this.shapes.push(shape);
- }
- /**
- * @function SuperMap.Feature.Theme.Vector.prototype.multiPointToTF
- * @description 转多点要素。
- * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiPoint。
- */
- }, {
- key: "multiPointToTF",
- value: function multiPointToTF(geometry) {
- /* //-- 不抽稀
- var components = geometry.components;
- for(var i = 0; i < components.length; i++){
- var components_i = components[i];
- this.pointToTF(components_i);
- }
- */
- var components = geometry.components; //节点像素坐标
- var localLX = []; //参考位置,参考中心为
- var refLocal = [];
- var location = this.location;
- var pointList = []; //节点抽稀距离
- var nCPx = this.nodesClipPixel;
- for (var i = 0; i < components.length; i++) {
- var components_i = components[i];
- refLocal = [];
- localLX = this.getLocalXY(components_i);
- refLocal[0] = localLX[0] - location[0];
- refLocal[1] = localLX[1] - location[1]; //抽稀
- if (pointList.length > 0) {
- var lastLocalXY = pointList[pointList.length - 1];
- if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
- continue;
- }
- } //使用参考点
- pointList.push(refLocal); //赋 style
- var style = new Object();
- style.r = 6; //防止漏设此参数,默认 6 像素
- style = Util.copyAttributesWithClip(style, this.style);
- style.x = refLocal[0];
- style.y = refLocal[1]; //创建图形
- var shape = new SmicPoint({
- style: style,
- clickable: this.isClickAble,
- hoverable: this.isHoverAble
- }); //设置高亮样式
- if (this.highlightStyle) {
- shape.highlightStyle = this.highlightStyle;
- } //设置参考中心,指定图形位置
- shape.refOriginalPosition = location; //储存数据 id 属性,用于事件
- shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
- shape.isHoverByRefDataID = this.isMultiHover; //修改一些 shape 可选属性,通常不需要这么做
- if (this.shapeOptions) {
- Util.copyAttributesWithClip(shape, this.shapeOptions);
- }
- this.shapes.push(shape);
- }
- }
- /**
- * @function SuperMap.Feature.Theme.Vector.prototype.multiLineStringToTF
- * @description 转换多线要素。
- * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiLineString。
- */
- }, {
- key: "multiLineStringToTF",
- value: function multiLineStringToTF(geometry) {
- var components = geometry.components;
- for (var i = 0; i < components.length; i++) {
- var components_i = components[i];
- this.lineToTF(components_i);
- }
- }
- /**
- * @function SuperMap.Feature.Theme.Vector.prototype.multiPolygonToTF
- * @description 转换多面要素。
- * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiPolygon。
- */
- }, {
- key: "multiPolygonToTF",
- value: function multiPolygonToTF(geometry) {
- var components = geometry.components;
- for (var i = 0; i < components.length; i++) {
- var components_i = components[i];
- this.polygonToTF(components_i);
- }
- }
- /**
- * @function SuperMap.Feature.Theme.Vector.prototype.pointToTF
- * @description 转换点要素。
- * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 Point。
- */
- }, {
- key: "pointToTF",
- value: function pointToTF(geometry) {
- //参考位置,参考中心为
- var location = this.location; //geometry 像素坐标
- var localLX = this.getLocalXY(geometry); //赋 style
- var style = new Object();
- style.r = 6; //防止漏设此参数,默认 6 像素
- style = Util.copyAttributesWithClip(style, this.style);
- style.x = localLX[0] - location[0];
- style.y = localLX[1] - location[1]; //创建图形
- var shape = new SmicPoint({
- style: style,
- clickable: this.isClickAble,
- hoverable: this.isHoverAble
- }); //设置高亮样式
- if (this.highlightStyle) {
- shape.highlightStyle = this.highlightStyle;
- } //设置参考中心,指定图形位置
- shape.refOriginalPosition = location; //储存数据 id 属性,用于事件
- shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
- shape.isHoverByRefDataID = this.isMultiHover; //修改一些 shape 可选属性,通常不需要这么做
- if (this.shapeOptions) {
- Util.copyAttributesWithClip(shape, this.shapeOptions);
- }
- this.shapes.push(shape);
- }
- /**
- * @function SuperMap.Feature.Theme.Vector.prototype.polygonToThemeFeature
- * @description 转换面要素。
- * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 Polygon。
- */
- }, {
- key: "polygonToTF",
- value: function polygonToTF(geometry) {
- var components = geometry.components; //节点像素坐标
- var localLX = []; //参考位置,参考中心为
- var refLocal = [];
- var location = this.location;
- var pointList = []; //岛洞
- var holePolygonPointList = [];
- var holePolygonPointLists = []; //节点抽稀距离
- var nCPx = this.nodesClipPixel;
- for (var i = 0; i < components.length; i++) {
- var components_i = components[i].components;
- if (i === 0) {
- // 第一个 component 正常绘制
- pointList = [];
- for (var j = 0; j < components_i.length; j++) {
- refLocal = [];
- localLX = this.getLocalXY(components_i[j]);
- refLocal[0] = localLX[0] - location[0];
- refLocal[1] = localLX[1] - location[1]; //抽稀 - 2 px
- if (pointList.length > 0) {
- var lastLocalXY = pointList[pointList.length - 1];
- if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
- continue;
- }
- } //使用参考点
- pointList.push(refLocal);
- }
- } else {
- // 其它 component 作为岛洞
- holePolygonPointList = [];
- for (var k = 0; k < components_i.length; k++) {
- refLocal = [];
- localLX = this.getLocalXY(components_i[k]);
- refLocal[0] = localLX[0] - location[0];
- refLocal[1] = localLX[1] - location[1]; //抽稀 - 2 px
- if (holePolygonPointList.length > 0) {
- var lastXY = holePolygonPointList[holePolygonPointList.length - 1];
- if (Math.abs(lastXY[0] - refLocal[0]) <= nCPx && Math.abs(lastXY[1] - refLocal[1]) <= nCPx) {
- continue;
- }
- } //使用参考点
- holePolygonPointList.push(refLocal);
- }
- }
- if (holePolygonPointList.length < 2) {
- continue;
- }
- holePolygonPointLists.push(holePolygonPointList);
- }
- if (pointList.length < 2) {
- return;
- } //赋 style
- var style = {};
- style = Util.copyAttributesWithClip(style, this.style, ['pointList']);
- style.pointList = pointList; //创建图形
- var shape = new SmicPolygon({
- style: style,
- clickable: this.isClickAble,
- hoverable: this.isHoverAble
- }); //设置高亮样式
- if (this.highlightStyle) {
- shape.highlightStyle = this.highlightStyle;
- } //设置参考中心,指定图形位置
- shape.refOriginalPosition = this.location; //储存数据 id 属性,用于事件
- shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
- shape.isHoverByRefDataID = this.isMultiHover; //岛洞面
- if (holePolygonPointLists.length > 0) {
- shape.holePolygonPointLists = holePolygonPointLists;
- } //修改一些 shape 可选属性,通常不需要这么做
- if (this.shapeOptions) {
- Util.copyAttributesWithClip(shape, this.shapeOptions);
- }
- this.shapes.push(shape);
- }
- /**
- * @function SuperMap.Feature.Theme.Vector.prototype.rectangleToTF
- * @description 转换矩形要素。
- * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 Rectangle。
- */
- }, {
- key: "rectangleToTF",
- value: function rectangleToTF(geometry) {
- //参考位置,参考中心为
- var location = this.location;
- var ll = new LonLat(geometry.x, geometry.y); //地图分辨率
- var res = this.layer.map.getResolution(); //geometry 像素坐标
- var localLX = this.getLocalXY(ll); //赋 style
- var style = new Object();
- style.r = 6; //防止漏设此参数,默认 6 像素
- style = Util.copyAttributesWithClip(style, this.style);
- style.x = localLX[0] - location[0]; // SuperMap.Geometry.Rectangle 使用左下角定位, SmicRectangle 使用左上角定位,需要转换
- style.y = localLX[1] - location[1] - 2 * geometry.width / res;
- style.width = geometry.width / res;
- style.height = geometry.height / res; //创建图形
- var shape = new SmicRectangle({
- style: style,
- clickable: this.isClickAble,
- hoverable: this.isHoverAble
- }); //设置高亮样式
- if (this.highlightStyle) {
- shape.highlightStyle = this.highlightStyle;
- } //设置参考中心,指定图形位置
- shape.refOriginalPosition = location; //储存数据 id 属性,用于事件
- shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
- shape.isHoverByRefDataID = this.isMultiHover; //修改一些 shape 可选属性,通常不需要这么做
- if (this.shapeOptions) {
- Util.copyAttributesWithClip(shape, this.shapeOptions);
- }
- this.shapes.push(shape);
- }
- /**
- * @function SuperMap.Feature.Theme.Vector.prototype.geoTextToTF
- * @description 转换文本要素。
- * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 GeoText。
- */
- }, {
- key: "geoTextToTF",
- value: function geoTextToTF(geometry) {
- //参考位置,参考中心为
- var location = this.location; //geometry 像素坐标
- var localLX = this.getLocalXY(geometry); //赋 style
- var style = new Object();
- style.r = 6; //防止漏设此参数,默认 6 像素
- style = Util.copyAttributesWithClip(style, this.style, ["x", "y", "text"]);
- style.x = localLX[0] - location[0];
- style.y = localLX[1] - location[1];
- style.text = geometry.text; //创建图形
- var shape = new SmicText({
- style: style,
- clickable: this.isClickAble,
- hoverable: this.isHoverAble
- }); //设置高亮样式
- if (this.highlightStyle) {
- shape.highlightStyle = this.highlightStyle;
- } //设置参考中心,指定图形位置
- shape.refOriginalPosition = location; //储存数据 id 属性,用于事件
- shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
- shape.isHoverByRefDataID = this.isMultiHover; //修改一些 shape 可选属性,通常不需要这么做
- if (this.shapeOptions) {
- Util.copyAttributesWithClip(shape, this.shapeOptions);
- }
- this.shapes.push(shape);
- }
- /**
- * @function SuperMap.Feature.Theme.Vector.prototype.updateAndAddShapes
- * @description 修改位置,针对地图平移操作,地图漫游操作后调用此函数。
- */
- }, {
- key: "updateAndAddShapes",
- value: function updateAndAddShapes() {
- var newLocalLX = this.getLocalXY(this.lonlat);
- this.location = newLocalLX;
- var render = this.layer.renderer;
- for (var i = 0, len = this.shapes.length; i < len; i++) {
- var shape = this.shapes[i]; //设置参考中心,指定图形位置
- shape.refOriginalPosition = newLocalLX;
- render.addShape(shape);
- }
- }
- /**
- * @function SuperMap.Feature.Theme.Vector.prototype.getShapesCount
- * @description 获得专题要素中可视化图形的数量。
- * @returns {number} 可视化图形的数量。
- */
- }, {
- key: "getShapesCount",
- value: function getShapesCount() {
- return this.shapes.length;
- }
- /**
- * @function SuperMap.Feature.Theme.Vector.prototype.getLocalXY
- * @description 地理坐标转为像素坐标。
- * @param {SuperMap.LonLat} lonlat - 专题要素地理位置。
- */
- }, {
- key: "getLocalXY",
- value: function getLocalXY(lonlat) {
- return this.layer.getLocalXY(lonlat);
- }
- }]);
- return ThemeVector;
- }(Theme_Theme);
- SuperMap.Feature.Theme.ThemeVector = ThemeVector;
- ;// CONCATENATED MODULE: ./src/common/overlay/feature/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Group.js
- 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); }
- function Group_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Group_createClass(Constructor, protoProps, staticProps) { if (protoProps) Group_defineProperties(Constructor.prototype, protoProps); if (staticProps) Group_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Group_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Group_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function Group_setPrototypeOf(o, p) { Group_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Group_setPrototypeOf(o, p); }
- 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); }; }
- function Group_possibleConstructorReturn(self, call) { if (call && (Group_typeof(call) === "object" || typeof call === "function")) { return call; } return Group_assertThisInitialized(self); }
- function Group_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Group_getPrototypeOf(o) { Group_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Group_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.LevelRenderer.Group
- * @category Visualization Theme
- * @private
- * @classdesc Group 是一个容器,可以插入子节点,Group 的变换也会被应用到子节点上。
- * @extends {SuperMap.LevelRenderer.Transformable}
- * (code)
- * var g = new SuperMap.LevelRenderer.Group();
- * var Circle = new SuperMap.LevelRenderer.Shape.Circle();
- * g.position[0] = 100;
- * g.position[1] = 100;
- * g.addChild(new Circle({
- * style: {
- * x: 100,
- * y: 100,
- * r: 20,
- * brushType: 'fill'
- * }
- * }));
- * LR.addGroup(g);
- * (end)
- */
- var Group = /*#__PURE__*/function (_SuperMap$mixin) {
- Group_inherits(Group, _SuperMap$mixin);
- var _super = Group_createSuper(Group);
- /**
- * @function SuperMap.LevelRenderer.Group.prototype.constructor
- * @description 构造函数。
- * @param {Array} options - Group 的配置(options)项,可以是 Group 的自有属性,也可以是自定义的属性。
- */
- function Group(options) {
- var _this;
- Group_classCallCheck(this, Group);
- _this = _super.call(this, options);
- options = options || {};
- /**
- * @member {string} SuperMap.LevelRenderer.Group.prototype.id
- * @description Group 的唯一标识。
- */
- _this.id = null;
- /**
- * @readonly
- * @member {string} [SuperMap.LevelRenderer.Group.prototype.type='group']
- * @description 类型。
- */
- _this.type = 'group'; //http://www.w3.org/TR/2dcontext/#clipping-region
- /**
- * @member {string} SuperMap.LevelRenderer.Group.prototype.clipShape
- * @description 用于裁剪的图形(shape),所有 Group 内的图形在绘制时都会被这个图形裁剪,该图形会继承 Group 的变换。
- */
- _this.clipShape = null;
- /**
- * @member {Array} SuperMap.LevelRenderer.Group.prototype._children
- * @description _children。
- */
- _this._children = [];
- /**
- * @member {Array} SuperMap.LevelRenderer.Group.prototype._storage
- * @description _storage。
- */
- _this._storage = null;
- /**
- * @member {boolean} [SuperMap.LevelRenderer.Group.prototype.__dirty=true]
- * @description __dirty。
- */
- _this.__dirty = true;
- /**
- * @member {boolean} [SuperMap.LevelRenderer.Group.prototype.ignore=false]
- * @description 是否忽略该 Group 及其所有子节点。
- */
- _this.ignore = false;
- Util.extend(Group_assertThisInitialized(_this), options);
- _this.id = _this.id || Util.createUniqueID("smShapeGroup_");
- _this.CLASS_NAME = "SuperMap.LevelRenderer.Group";
- return _this;
- }
- /**
- * @function SuperMap.LevelRenderer.Group.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- Group_createClass(Group, [{
- key: "destroy",
- value: function destroy() {
- this.id = null;
- this.type = null;
- this.clipShape = null;
- this._children = null;
- this._storage = null;
- this.__dirty = null;
- this.ignore = null;
- Group_get(Group_getPrototypeOf(Group.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.LevelRenderer.Group.prototype.children
- * @description 复制并返回一份新的包含所有儿子节点的数组。
- * @returns {Array.<SuperMap.LevelRenderer.Shape>} 图形数组。
- */
- }, {
- key: "children",
- value: function children() {
- return this._children.slice();
- }
- /**
- * @function SuperMap.LevelRenderer.Group.prototype.childAt
- * @description 获取指定 index 的儿子节点
- * @param {number} idx - 节点索引。
- * @returns {SuperMap.LevelRenderer.Shape} 图形。
- */
- }, {
- key: "childAt",
- value: function childAt(idx) {
- return this._children[idx];
- }
- /**
- * @function SuperMap.LevelRenderer.Group.prototype.addChild
- * @description 添加子节点,可以是 Shape 或者 Group。
- * @param {(SuperMap.LevelRenderer.Shape|SuperMap.LevelRenderer.Group)} child - 节点图形。
- */
- // TODO Type Check
- }, {
- key: "addChild",
- value: function addChild(child) {
- if (child == this) {
- return;
- }
- if (child.parent == this) {
- return;
- }
- if (child.parent) {
- child.parent.removeChild(child);
- }
- this._children.push(child);
- child.parent = this;
- if (this._storage && this._storage !== child._storage) {
- this._storage.addToMap(child);
- if (child instanceof Group) {
- child.addChildrenToStorage(this._storage);
- }
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Group.prototype.removeChild
- * @description 移除子节点。
- * @param {SuperMap.LevelRenderer.Shape} child - 需要移除的子节点图形。
- */
- }, {
- key: "removeChild",
- value: function removeChild(child) {
- var idx = Util.indexOf(this._children, child);
- this._children.splice(idx, 1);
- child.parent = null;
- if (this._storage) {
- this._storage.delFromMap(child.id);
- if (child instanceof Group) {
- child.delChildrenFromStorage(this._storage);
- }
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Group.prototype.eachChild
- * @description 遍历所有子节点。
- * @param {function} cb - 回调函数。
- * @param {Object} context - 上下文。
- */
- }, {
- key: "eachChild",
- value: function eachChild(cb, context) {
- var haveContext = !!context;
- for (var i = 0; i < this._children.length; i++) {
- var child = this._children[i];
- if (haveContext) {
- cb.call(context, child);
- } else {
- cb(child);
- }
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Group.prototype.traverse
- * @description 深度优先遍历所有子孙节点。
- * @param {function} cb - 回调函数。
- * @param {Object} context - 上下文。
- */
- }, {
- key: "traverse",
- value: function traverse(cb, context) {
- var haveContext = !!context;
- for (var i = 0; i < this._children.length; i++) {
- var child = this._children[i];
- if (haveContext) {
- cb.call(context, child);
- } else {
- cb(child);
- }
- if (child.type === 'group') {
- child.traverse(cb, context);
- }
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Group.prototype.addChildrenToStorage
- * @description 把子图形添加到仓库。
- * @param {SuperMap.LevelRenderer.Storage} storage - 图形仓库。
- */
- }, {
- key: "addChildrenToStorage",
- value: function addChildrenToStorage(storage) {
- for (var i = 0; i < this._children.length; i++) {
- var child = this._children[i];
- storage.addToMap(child);
- if (child.type === 'group') {
- child.addChildrenToStorage(storage);
- }
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Group.prototype.delChildrenFromStorage
- * @description 从仓库把子图形删除。
- * @param {SuperMap.LevelRenderer.Storage} storage - 图形仓库。
- */
- }, {
- key: "delChildrenFromStorage",
- value: function delChildrenFromStorage(storage) {
- for (var i = 0; i < this._children.length; i++) {
- var child = this._children[i];
- storage.delFromMap(child.id);
- if (child.type === 'group') {
- child.delChildrenFromStorage(storage);
- }
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Group.prototype.modSelf
- * @description 是否修改。
- */
- }, {
- key: "modSelf",
- value: function modSelf() {
- this.__dirty = true;
- }
- }]);
- return Group;
- }(SuperMap.mixin(Eventful, Transformable));
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Storage.js
- function Storage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Storage_createClass(Constructor, protoProps, staticProps) { if (protoProps) Storage_defineProperties(Constructor.prototype, protoProps); if (staticProps) Storage_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Storage
- * @category Visualization Theme
- * @classdesc 内容(图像)仓库 (M) 。
- */
- var Storage = /*#__PURE__*/function () {
- /**
- * @function SuperMap.LevelRenderer.Storage.constructor
- * @description 构造函数。
- */
- function Storage() {
- Storage_classCallCheck(this, Storage);
- /**
- * @member {Object} SuperMap.LevelRenderer.Storage.prototype._elements
- * @description 所有常规形状,id 索引的 map。
- */
- this._elements = {};
- /**
- * @member {Array} SuperMap.LevelRenderer.Storage.prototype._hoverElements
- * @description 高亮层形状,不稳定,动态增删,数组位置也是 z 轴方向,靠前显示在下方。
- *
- */
- this._hoverElements = [];
- /**
- * @member {Array} SuperMap.LevelRenderer.Storage.prototype._roots
- * @description _roots。
- *
- */
- this._roots = [];
- /**
- * @member {Array} SuperMap.LevelRenderer.Storage.prototype._shapeList
- * @description _shapeList。
- *
- */
- this._shapeList = [];
- /**
- * @member {number} SuperMap.LevelRenderer.Storage.prototype._shapeListOffset
- * @description _shapeListOffset。默认值:0。
- *
- */
- this._shapeListOffset = 0;
- this.CLASS_NAME = "SuperMap.LevelRenderer.Storage";
- }
- /**
- * @function SuperMap.LevelRenderer.Storage.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- Storage_createClass(Storage, [{
- key: "destroy",
- value: function destroy() {
- this.dispose();
- this._shapeList = null;
- this._shapeListOffset = null;
- }
- /**
- * @function SuperMap.LevelRenderer.Storage.prototype.iterShape
- * @description 遍历迭代器。
- *
- * @param {Function} fun - 迭代回调函数,return true终止迭代。
- * @param {Object} option - 迭代参数,缺省为仅降序遍历普通层图形。
- * @param {boolean} [hover=true] - 是否是高亮层图形。
- * @param {string} [normal='down'] - 是否是普通层图形,迭代时是否指定及z轴顺序。可设值:'down' ,'up'。
- * @param {boolean} [update=false] - 是否在迭代前更新形状列表。
- * @return {SuperMap.LevelRenderer.Storage} this。
- */
- }, {
- key: "iterShape",
- value: function iterShape(fun, option) {
- if (!option) {
- var defaultIterateOption = {
- hover: false,
- normal: 'down',
- update: false
- };
- option = defaultIterateOption;
- }
- if (option.hover) {
- // 高亮层数据遍历
- for (var i = 0, l = this._hoverElements.length; i < l; i++) {
- var el = this._hoverElements[i];
- el.updateTransform();
- if (fun(el)) {
- return this;
- }
- }
- }
- if (option.update) {
- this.updateShapeList();
- } // 遍历: 'down' | 'up'
- switch (option.normal) {
- case 'down':
- {
- // 降序遍历,高层优先
- var _l = this._shapeList.length;
- while (_l--) {
- if (fun(this._shapeList[_l])) {
- return this;
- }
- }
- break;
- }
- // case 'up':
- default:
- {
- // 升序遍历,底层优先
- for (var _i = 0, _l2 = this._shapeList.length; _i < _l2; _i++) {
- if (fun(this._shapeList[_i])) {
- return this;
- }
- }
- break;
- }
- }
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Storage.prototype.getHoverShapes
- * @param {boolean} [update=false] - 是否在返回前更新图形的变换。
- * @return {Array.<SuperMap.LevelRenderer.Shape>} 图形数组。
- */
- }, {
- key: "getHoverShapes",
- value: function getHoverShapes(update) {
- // hoverConnect
- var hoverElements = [],
- len = this._hoverElements.length;
- for (var i = 0; i < len; i++) {
- hoverElements.push(this._hoverElements[i]);
- var target = this._hoverElements[i].hoverConnect;
- if (target) {
- var shape;
- target = target instanceof Array ? target : [target];
- for (var j = 0, k = target.length; j < k; j++) {
- shape = target[j].id ? target[j] : this.get(target[j]);
- if (shape) {
- hoverElements.push(shape);
- }
- }
- }
- }
- hoverElements.sort(Storage.shapeCompareFunc);
- if (update) {
- for (var _i2 = 0, l = hoverElements.length; _i2 < l; _i2++) {
- hoverElements[_i2].updateTransform();
- }
- }
- return hoverElements;
- }
- /**
- * @function SuperMap.LevelRenderer.Storage.prototype.getShapeList
- * @description 返回所有图形的绘制队列。
- *
- * @param {boolean} [update=false] - 是否在返回前更新该数组。 详见:<SuperMap.LevelRenderer.Shape> updateShapeList。
- * @return {SuperMap.LevelRenderer.Shape} 图形。
- */
- }, {
- key: "getShapeList",
- value: function getShapeList(update) {
- if (update) {
- this.updateShapeList();
- }
- return this._shapeList;
- }
- /**
- * @function SuperMap.LevelRenderer.Storage.prototype.updateShapeList
- * @description 更新图形的绘制队列。每次绘制前都会调用,该方法会先深度优先遍历整个树,更新所有Group和Shape的变换并且把所有可见的Shape保存到数组中,最后根据绘制的优先级(zlevel > z > 插入顺序)排序得到绘制队列。
- */
- }, {
- key: "updateShapeList",
- value: function updateShapeList() {
- this._shapeListOffset = 0;
- var rootsLen = this._roots.length;
- for (var i = 0; i < rootsLen; i++) {
- var root = this._roots[i];
- this._updateAndAddShape(root);
- }
- this._shapeList.length = this._shapeListOffset;
- var shapeListLen = this._shapeList.length;
- for (var _i3 = 0; _i3 < shapeListLen; _i3++) {
- this._shapeList[_i3].__renderidx = _i3;
- }
- this._shapeList.sort(Storage.shapeCompareFunc);
- }
- /**
- * @function SuperMap.LevelRenderer.Storage.prototype._updateAndAddShape
- * @description 更新并添加图形。
- *
- */
- }, {
- key: "_updateAndAddShape",
- value: function _updateAndAddShape(el, clipShapes) {
- if (el.ignore) {
- return;
- }
- el.updateTransform();
- if (el.type == 'group') {
- if (el.clipShape) {
- // clipShape 的变换是基于 group 的变换
- el.clipShape.parent = el;
- el.clipShape.updateTransform(); // PENDING 效率影响
- if (clipShapes) {
- clipShapes = clipShapes.slice();
- clipShapes.push(el.clipShape);
- } else {
- clipShapes = [el.clipShape];
- }
- }
- for (var i = 0; i < el._children.length; i++) {
- var child = el._children[i]; // Force to mark as dirty if group is dirty
- child.__dirty = el.__dirty || child.__dirty;
- this._updateAndAddShape(child, clipShapes);
- } // Mark group clean here
- el.__dirty = false;
- } else {
- el.__clipShapes = clipShapes;
- this._shapeList[this._shapeListOffset++] = el;
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Storage.prototype.mod
- * @description 修改图形(Shape)或者组(Group)。
- *
- * @param {string} elId - 唯一标识。
- * @param {Object} params - 参数。
- * @return {SuperMap.LevelRenderer.Storage} this。
- */
- }, {
- key: "mod",
- value: function mod(elId, params) {
- var el = this._elements[elId];
- if (el) {
- el.modSelf();
- if (params) {
- // 如果第二个参数直接使用 shape
- // parent, _storage, __startClip 三个属性会有循环引用
- // 主要为了向 1.x 版本兼容,2.x 版本不建议使用第二个参数
- if (params.parent || params._storage || params.__startClip) {
- var target = {};
- for (var name in params) {
- if (name == 'parent' || name == '_storage' || name == '__startClip') {
- continue;
- }
- if (params.hasOwnProperty(name)) {
- target[name] = params[name];
- }
- }
- new Util_Util().merge(el, target, true);
- } else {
- new Util_Util().merge(el, params, true);
- }
- }
- }
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Storage.prototype.drift
- * @description 移动指定的图形(Shape)的位置。
- * @param {string} shapeId - 唯一标识。
- * @param {number} dx
- * @param {number} dy
- * @return {SuperMap.LevelRenderer.Storage} this。
- */
- }, {
- key: "drift",
- value: function drift(shapeId, dx, dy) {
- var shape = this._elements[shapeId];
- if (shape) {
- shape.needTransform = true;
- if (shape.draggable === 'horizontal') {
- dy = 0;
- } else if (shape.draggable === 'vertical') {
- dx = 0;
- }
- if (!shape.ondrift // ondrift
- // 有onbrush并且调用执行返回false或undefined则继续
- || shape.ondrift && !shape.ondrift(dx, dy)) {
- shape.drift(dx, dy);
- }
- }
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Storage.prototype.addHover
- * @description 添加高亮层数据。
- * @param {SuperMap.LevelRenderer.Shape} shape - 图形。
- * @return {SuperMap.LevelRenderer.Storage} this。
- */
- }, {
- key: "addHover",
- value: function addHover(shape) {
- shape.updateNeedTransform();
- this._hoverElements.push(shape);
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Storage.prototype.delHover
- * @description 清空高亮层数据。
- * @return {SuperMap.LevelRenderer.Storage} this。
- */
- }, {
- key: "delHover",
- value: function delHover() {
- this._hoverElements = [];
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Storage.prototype.hasHoverShape
- * @description 是否有图形在高亮层里。
- * @return {boolean} 是否有图形在高亮层里。
- */
- }, {
- key: "hasHoverShape",
- value: function hasHoverShape() {
- return this._hoverElements.length > 0;
- }
- /**
- * @function SuperMap.LevelRenderer.Storage.prototype.addRoot
- * @description 添加图形(Shape)或者组(Group)到根节点。
- *
- * @param {(SuperMap.LevelRenderer.Shape/SuperMap.LevelRenderer.Group)} el - 图形。
- *
- */
- }, {
- key: "addRoot",
- value: function addRoot(el) {
- if (el instanceof Group) {
- el.addChildrenToStorage(this);
- }
- this.addToMap(el);
- this._roots.push(el);
- }
- /**
- * @function SuperMap.LevelRenderer.Storage.prototype.delRoot
- * @description 删除指定的图形(Shape)或者组(Group)。
- *
- * @param {Array.<string>} elId - 删除图形(Shape)或者组(Group)的 id 数组。如果为空清空整个Storage。
- *
- */
- }, {
- key: "delRoot",
- value: function delRoot(elId) {
- if (typeof elId == 'undefined') {
- // 不指定elId清空
- for (var i = 0; i < this._roots.length; i++) {
- var root = this._roots[i];
- if (root instanceof Group) {
- root.delChildrenFromStorage(this);
- }
- }
- this._elements = {};
- this._hoverElements = [];
- this._roots = [];
- return;
- }
- if (elId instanceof Array) {
- var elIdLen = elId.length;
- for (var _i4 = 0; _i4 < elIdLen; _i4++) {
- this.delRoot(elId[_i4]);
- }
- return;
- }
- var el;
- if (typeof elId == 'string') {
- el = this._elements[elId];
- } else {
- el = elId;
- }
- var idx = new Util_Util().indexOf(this._roots, el);
- if (idx >= 0) {
- this.delFromMap(el.id);
- this._roots.splice(idx, 1);
- if (el instanceof Group) {
- el.delChildrenFromStorage(this);
- }
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Storage.prototype.addToMap
- * @description 添加图形到 map。
- *
- * @param {SuperMap.LevelRenderer.Shape} el - 图形。
- * @return {SuperMap.LevelRenderer.Storage} this。
- */
- }, {
- key: "addToMap",
- value: function addToMap(el) {
- if (el instanceof Group) {
- el._storage = this;
- }
- el.modSelf();
- this._elements[el.id] = el;
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Storage.prototype.get
- * @description 获取指定图形。
- *
- * @param {string} elId - 图形 id。
- * @return {SuperMap.LevelRenderer.Shape} 图形。
- */
- }, {
- key: "get",
- value: function get(elId) {
- return this._elements[elId];
- }
- /**
- * @function SuperMap.LevelRenderer.Storage.prototype.delFromMap
- * @description 从 map 中删除指定图形。
- *
- * @param {string} elId - 图形id。
- * @return {SuperMap.LevelRenderer.Storage} this。
- */
- }, {
- key: "delFromMap",
- value: function delFromMap(elId) {
- var el = this._elements[elId];
- if (el) {
- delete this._elements[elId];
- if (el instanceof Group) {
- el._storage = null;
- }
- }
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Storage.prototype.dispose
- * @description 清空并且释放 Storage。
- */
- }, {
- key: "dispose",
- value: function dispose() {
- this._elements = null; // this._renderList = null;
- this._roots = null;
- this._hoverElements = null;
- }
- }], [{
- key: "shapeCompareFunc",
- value: function shapeCompareFunc(a, b) {
- if (a.zlevel == b.zlevel) {
- if (a.z == b.z) {
- return a.__renderidx - b.__renderidx;
- }
- return a.z - b.z;
- }
- return a.zlevel - b.zlevel;
- }
- }]);
- return Storage;
- }();
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Painter.js
- 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); }
- 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); }
- function Painter_setPrototypeOf(o, p) { Painter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Painter_setPrototypeOf(o, p); }
- 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); }; }
- function Painter_possibleConstructorReturn(self, call) { if (call && (Painter_typeof(call) === "object" || typeof call === "function")) { return call; } return Painter_assertThisInitialized(self); }
- function Painter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Painter_getPrototypeOf(o) { Painter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Painter_getPrototypeOf(o); }
- function Painter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Painter_createClass(Constructor, protoProps, staticProps) { if (protoProps) Painter_defineProperties(Constructor.prototype, protoProps); if (staticProps) Painter_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Painter
- * @category Visualization Theme
- * @classdesc Painter 绘图模块。
- */
- var Painter = /*#__PURE__*/function () {
- /**
- * @function SuperMap.LevelRenderer.Painter.constructor
- * @description 构造函数。
- *
- * @param {HTMLElement} root - 绘图区域(DIV)。
- * @param {SuperMap.LevelRenderer.Storage} storage - Storage 实例。
- *
- */
- function Painter(root, storage) {
- Painter_classCallCheck(this, Painter);
- /**
- * @member {HTMLElement} SuperMap.LevelRenderer.Painter.prototype.root
- * @description 绘图容器。
- *
- */
- this.root = root;
- /**
- * @member {Array} SuperMap.LevelRenderer.Painter.prototype.storage
- * @description 图形仓库。
- *
- */
- this.storage = storage;
- /**
- * @member {HTMLElement} SuperMap.LevelRenderer.Painter.prototype._domRoot
- * @description 容器根 dom 对象。
- *
- */
- this._domRoot = null;
- /**
- * @member {Object} SuperMap.LevelRenderer.Painter.prototype._layers
- * @description 绘制层对象。
- *
- */
- this._layers = {};
- /**
- * @member {Array} SuperMap.LevelRenderer.Painter.prototype._zlevelList
- * @description 层列表。
- *
- */
- this._zlevelList = [];
- /**
- * @member {Object} SuperMap.LevelRenderer.Painter.prototype._layerConfig
- * @description 绘制层配置对象。
- *
- */
- this._layerConfig = {};
- /**
- * @member {Object} SuperMap.LevelRenderer.Painter.prototype._bgDom
- * @description 背景层 Canvas (Dom)。
- *
- */
- this._bgDom = null;
- /**
- * @member {Function} SuperMap.LevelRenderer.Painter.prototype.shapeToImage
- * @description 形状转图像函数。
- *
- */
- this.shapeToImage = null; // retina 屏幕优化
- Painter.devicePixelRatio = Math.max(window.devicePixelRatio || 1, 1);
- this.CLASS_NAME = "SuperMap.LevelRenderer.Painter";
- this.root.innerHTML = '';
- this._width = this._getWidth(); // 宽,缓存记录
- this._height = this._getHeight(); // 高,缓存记录
- var domRoot = document.createElement('div');
- this._domRoot = domRoot; // domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬
- domRoot.style.position = 'relative';
- domRoot.style.overflow = 'hidden';
- domRoot.style.width = this._width + 'px';
- domRoot.style.height = this._height + 'px';
- this.root.appendChild(domRoot);
- this.shapeToImage = this._createShapeToImageProcessor(); // 创建各层canvas
- // 背景
- //this._bgDom = Painter.createDom('bg', 'div', this);
- this._bgDom = Painter.createDom(Util.createUniqueID("SuperMap.Theme_background_"), 'div', this);
- domRoot.appendChild(this._bgDom);
- this._bgDom.onselectstart = returnFalse;
- this._bgDom.style['-webkit-user-select'] = 'none';
- this._bgDom.style['user-select'] = 'none';
- this._bgDom.style['-webkit-touch-callout'] = 'none'; // 高亮
- //var hoverLayer = new PaintLayer('_hoverLayer_', this);
- var hoverLayer = new PaintLayer(Util.createUniqueID("_highLightLayer_"), this);
- this._layers['hover'] = hoverLayer;
- domRoot.appendChild(hoverLayer.dom);
- hoverLayer.initContext();
- hoverLayer.dom.onselectstart = returnFalse;
- hoverLayer.dom.style['-webkit-user-select'] = 'none';
- hoverLayer.dom.style['user-select'] = 'none';
- hoverLayer.dom.style['-webkit-touch-callout'] = 'none';
- var me = this;
- this.updatePainter = function (shapeList, callback) {
- me.refreshShapes(shapeList, callback);
- }; // 返回false的方法,用于避免页面被选中
- function returnFalse() {
- return false;
- }
- /* eslint-disable */
- // 什么都不干的空方法
- function doNothing() {//NOSONAR
- }
- /* eslint-enable */
- }
- /**
- * @function SuperMap.LevelRenderer.Painter.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- Painter_createClass(Painter, [{
- key: "destroy",
- value: function destroy() {
- this.dispose();
- this._zlevelList = null;
- this._layerConfig = null;
- this._bgDom = null;
- this.shapeToImage = null;
- }
- /**
- * @function SuperMap.LevelRenderer.Painter.prototype.render
- * @description 渲染。首次绘图,创建各种 dom 和 context。
- *
- * @param {Function} callback - 绘画结束后的回调函数。
- * @return {SuperMap.LevelRenderer.Painter} this。
- */
- }, {
- key: "render",
- value: function render(callback) {
- // TODO
- this.refresh(callback, true);
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Painter.prototype.refresh
- * @description 刷新。
- *
- * @param {Function} callback - 刷新结束后的回调函数。
- * @param {boolean} paintAll - 强制绘制所有 shape。
- * @return {SuperMap.LevelRenderer.Painter} this。
- */
- }, {
- key: "refresh",
- value: function refresh(callback, paintAll) {
- var list = this.storage.getShapeList(true);
- this._paintList(list, paintAll);
- if (typeof callback == 'function') {
- callback();
- }
- return this;
- }
- /**
- * Method: _paintList
- * 按列表绘制图形。
- */
- }, {
- key: "_paintList",
- value: function _paintList(list, paintAll) {
- if (typeof paintAll == 'undefined') {
- paintAll = false;
- }
- this._updateLayerStatus(list);
- var currentLayer;
- var currentZLevel;
- var ctx;
- for (var id in this._layers) {
- if (id !== 'hover') {
- this._layers[id].unusedCount++;
- this._layers[id].updateTransform();
- }
- }
- var invTransform = [];
- for (var i = 0, l = list.length; i < l; i++) {
- var shape = list[i];
- if (currentZLevel !== shape.zlevel) {
- if (currentLayer && currentLayer.needTransform) {
- ctx.restore();
- }
- currentLayer = this.getLayer(shape.zlevel);
- ctx = currentLayer.ctx;
- currentZLevel = shape.zlevel; // Reset the count
- currentLayer.unusedCount = 0;
- if (currentLayer.dirty || paintAll) {
- currentLayer.clear();
- }
- if (currentLayer.needTransform) {
- ctx.save();
- currentLayer.setTransform(ctx);
- }
- } // Start group clipping
- if (ctx && shape.__startClip) {
- var clipShape = shape.__startClip;
- ctx.save(); // Set transform
- if (clipShape.needTransform) {
- var m = clipShape.transform;
- SUtil_SUtil.Util_matrix.invert(invTransform, m);
- ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
- }
- ctx.beginPath();
- clipShape.buildPath(ctx, clipShape.style);
- ctx.clip(); // Transform back
- if (clipShape.needTransform) {
- var _m = invTransform;
- ctx.transform(_m[0], _m[1], _m[2], _m[3], _m[4], _m[5]);
- }
- }
- if ((currentLayer && currentLayer.dirty || paintAll) && !shape.invisible) {
- if (!shape.onbrush || shape.onbrush && !shape.onbrush(ctx, false)) {
- if (Config.catchBrushException) {
- try {
- shape.brush(ctx, false, this.updatePainter);
- } catch (error) {
- SUtil_SUtil.Util_log(error, 'brush error of ' + shape.type, shape);
- }
- } else {
- shape.brush(ctx, false, this.updatePainter);
- }
- }
- } // Stop group clipping
- if (ctx && shape.__stopClip) {
- ctx.restore();
- }
- shape.__dirty = false;
- }
- if (ctx && currentLayer && currentLayer.needTransform) {
- ctx.restore();
- }
- for (var _id in this._layers) {
- if (_id !== 'hover') {
- var layer = this._layers[_id];
- layer.dirty = false; // 删除过期的层
- // PENDING
- // if (layer.unusedCount >= 500) {
- // this.delLayer(id);
- // }
- if (layer.unusedCount == 1) {
- layer.clear();
- }
- }
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Painter.prototype.getLayer
- * @description 获取 zlevel 所在层,如果不存在则会创建一个新的层。
- *
- * @param {number} zlevel - zlevel。
- * @return {SuperMap.LevelRenderer.Painter} this。
- */
- }, {
- key: "getLayer",
- value: function getLayer(zlevel) {
- // Change draw layer
- var currentLayer = this._layers[zlevel];
- if (!currentLayer) {
- var len = this._zlevelList.length;
- var prevLayer = null;
- var i = -1;
- if (len > 0 && zlevel > this._zlevelList[0]) {
- for (i = 0; i < len - 1; i++) {
- if (this._zlevelList[i] < zlevel && this._zlevelList[i + 1] > zlevel) {
- break;
- }
- }
- prevLayer = this._layers[this._zlevelList[i]];
- }
- this._zlevelList.splice(i + 1, 0, zlevel); // Create a new layer
- //currentLayer = new PaintLayer(zlevel, this);
- currentLayer = new PaintLayer(Util.createUniqueID("_levelLayer_" + zlevel), this);
- var prevDom = prevLayer ? prevLayer.dom : this._bgDom;
- if (prevDom.nextSibling) {
- prevDom.parentNode.insertBefore(currentLayer.dom, prevDom.nextSibling);
- } else {
- prevDom.parentNode.appendChild(currentLayer.dom);
- }
- currentLayer.initContext();
- this._layers[zlevel] = currentLayer;
- if (this._layerConfig[zlevel]) {
- new Util_Util().merge(currentLayer, this._layerConfig[zlevel], true);
- }
- currentLayer.updateTransform();
- }
- return currentLayer;
- }
- /**
- * @function SuperMap.LevelRenderer.Painter.prototype.getLayers
- * @description 获取所有已创建的层。
- * @return {Array.<Painter.Layer>} 已创建的层
- */
- }, {
- key: "getLayers",
- value: function getLayers() {
- return this._layers;
- }
- /**
- * Method: _updateLayerStatus
- * 更新绘制层状态。
- */
- }, {
- key: "_updateLayerStatus",
- value: function _updateLayerStatus(list) {
- var layers = this._layers;
- var elCounts = {};
- for (var z in layers) {
- if (z !== 'hover') {
- elCounts[z] = layers[z].elCount;
- layers[z].elCount = 0;
- }
- }
- for (var i = 0; i < list.length; i++) {
- var shape = list[i];
- var zlevel = shape.zlevel;
- var layer = layers[zlevel];
- if (layer) {
- layer.elCount++; // 已经被标记为需要刷新
- if (layer.dirty) {
- continue;
- }
- layer.dirty = shape.__dirty;
- }
- } // 层中的元素数量有发生变化
- for (var _z in layers) {
- if (_z !== 'hover') {
- if (elCounts[_z] !== layers[_z].elCount) {
- layers[_z].dirty = true;
- }
- }
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Painter.prototype.refreshShapes
- * @description 更新的图形元素列表。
- *
- * @param {number} shapeList - 需要更新的图形元素列表。
- * @param {number} callback - 视图更新后回调函数。
- * @return {SuperMap.LevelRenderer.Painter} this。
- */
- }, {
- key: "refreshShapes",
- value: function refreshShapes(shapeList, callback) {
- for (var i = 0, l = shapeList.length; i < l; i++) {
- var shape = shapeList[i];
- this.storage.mod(shape.id);
- }
- this.refresh(callback);
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Painter.prototype.clear
- * @description 清除 hover 层外所有内容。
- * @return {SuperMap.LevelRenderer.Painter} this。
- */
- }, {
- key: "clear",
- value: function clear() {
- for (var k in this._layers) {
- if (k == 'hover') {
- continue;
- }
- this._layers[k].clear();
- }
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Painter.prototype.modLayer
- * @description 修改指定 zlevel 的绘制参数。
- *
- * @param {string} zlevel - zlevel。
- * @param {Object} config - 配置对象。
- * @param {string} [config.clearColor=0] - 每次清空画布的颜色。
- * @param {boolean} [config.motionBlur=false] - 是否开启动态模糊。
- * @param {number} [config.lastFrameAlpha=0.7] - 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显。默认值:0.7。
- * @param {Array.<number>} config.position - 层的平移。
- * @param {Array.<number>} config.rotation - 层的旋转。
- * @param {Array.<number>} config.scale - 层的缩放。
- * @param {boolean} config.zoomable - 层是否支持鼠标缩放操作。默认值:false。
- * @param {boolean} config.panable - 层是否支持鼠标平移操作。默认值:false。
- *
- */
- }, {
- key: "modLayer",
- value: function modLayer(zlevel, config) {
- if (config) {
- if (!this._layerConfig[zlevel]) {
- this._layerConfig[zlevel] = config;
- } else {
- new Util_Util().merge(this._layerConfig[zlevel], config, true);
- }
- var layer = this._layers[zlevel];
- if (layer) {
- new Util_Util().merge(layer, this._layerConfig[zlevel], true);
- }
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Painter.prototype.delLayer
- * @description 删除指定层。
- *
- * @param {string} zlevel - 层所在的 zlevel。
- */
- }, {
- key: "delLayer",
- value: function delLayer(zlevel) {
- var layer = this._layers[zlevel];
- if (!layer) {
- return;
- } // Save config
- this.modLayer(zlevel, {
- position: layer.position,
- rotation: layer.rotation,
- scale: layer.scale
- });
- layer.dom.parentNode.removeChild(layer.dom);
- delete this._layers[zlevel];
- this._zlevelList.splice(new Util_Util().indexOf(this._zlevelList, zlevel), 1);
- }
- /**
- * @function SuperMap.LevelRenderer.Painter.prototype.refreshHover
- * @description 刷新 hover 层。
- * @return {SuperMap.LevelRenderer.Painter} this。
- */
- }, {
- key: "refreshHover",
- value: function refreshHover() {
- this.clearHover();
- var list = this.storage.getHoverShapes(true);
- for (var i = 0, l = list.length; i < l; i++) {
- this._brushHover(list[i]);
- }
- this.storage.delHover();
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Painter.prototype.clearHover
- * @description 清除 hover 层所有内容。
- * @return {SuperMap.LevelRenderer.Painter} this。
- */
- }, {
- key: "clearHover",
- value: function clearHover() {
- var hover = this._layers.hover;
- hover && hover.clear();
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Painter.prototype.resize
- * @description 区域大小变化后重绘。
- * @return {SuperMap.LevelRenderer.Painter} this。
- */
- }, {
- key: "resize",
- value: function resize() {
- var domRoot = this._domRoot;
- domRoot.style.display = 'none';
- var width = this._getWidth();
- var height = this._getHeight();
- domRoot.style.display = ''; // 优化没有实际改变的resize
- if (this._width != width || height != this._height) {
- this._width = width;
- this._height = height;
- domRoot.style.width = width + 'px';
- domRoot.style.height = height + 'px';
- for (var id in this._layers) {
- this._layers[id].resize(width, height);
- }
- this.refresh(null, true);
- }
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Painter.prototype.clearLayer
- * @description 清除指定的一个层。
- * @param {number} zLevel - 层。
- */
- }, {
- key: "clearLayer",
- value: function clearLayer(zLevel) {
- var layer = this._layers[zLevel];
- if (layer) {
- layer.clear();
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Painter.prototype.dispose
- * @description 释放。
- *
- */
- }, {
- key: "dispose",
- value: function dispose() {
- this.root.innerHTML = '';
- this.root = null;
- this.storage = null;
- this._domRoot = null;
- this._layers = null;
- }
- /**
- * @function SuperMap.LevelRenderer.Painter.prototype.getDomHover
- * @description 获取 Hover 层的 Dom。
- */
- }, {
- key: "getDomHover",
- value: function getDomHover() {
- return this._layers.hover.dom;
- }
- /**
- * @function SuperMap.LevelRenderer.Painter.prototype.toDataURL
- * @description 图像导出。
- * @param {string} type - 图片类型。
- * @param {string} backgroundColor - 背景色。默认值:'#fff'。
- * @param {Object} args
- * @return {string} 图片的Base64 url。
- */
- }, {
- key: "toDataURL",
- value: function toDataURL(type, backgroundColor, args) {
- //var imageDom = Painter.createDom('image', 'canvas', this);
- var imageDom = Painter.createDom(Util.createUniqueID("SuperMap.Theme.image_"), 'canvas', this);
- this._bgDom.appendChild(imageDom);
- var ctx = imageDom.getContext('2d');
- Painter.devicePixelRatio != 1 && ctx.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
- ctx.fillStyle = backgroundColor || '#fff';
- ctx.rect(0, 0, this._width * Painter.devicePixelRatio, this._height * Painter.devicePixelRatio);
- ctx.fill();
- var self = this; // 升序遍历,shape上的zlevel指定绘画图层的z轴层叠
- this.storage.iterShape(function (shape) {
- if (!shape.invisible) {
- if (!shape.onbrush // 没有onbrush
- // 有onbrush并且调用执行返回false或undefined则继续粉刷
- || shape.onbrush && !shape.onbrush(ctx, false)) {
- if (Config.catchBrushException) {
- try {
- shape.brush(ctx, false, self.updatePainter);
- } catch (error) {
- SUtil_SUtil.Util_log(error, 'brush error of ' + shape.type, shape);
- }
- } else {
- shape.brush(ctx, false, self.updatePainter);
- }
- }
- }
- }, {
- normal: 'up',
- update: true
- });
- var image = imageDom.toDataURL(type, args);
- ctx = null;
- this._bgDom.removeChild(imageDom);
- return image;
- }
- /**
- * @function SuperMap.LevelRenderer.Painter.prototype.getWidth
- * @description 获取绘图区域宽度。
- * @return {number} 绘图区域宽度。
- */
- }, {
- key: "getWidth",
- value: function getWidth() {
- return this._width;
- }
- /**
- * @function SuperMap.LevelRenderer.Painter.prototype.getHeight
- * @description 获取绘图区域高度。
- * @return {number} 绘图区域高度。
- */
- }, {
- key: "getHeight",
- value: function getHeight() {
- return this._height;
- }
- /**
- * Method: _getWidth
- *
- */
- }, {
- key: "_getWidth",
- value: function _getWidth() {
- var root = this.root;
- var stl = root.currentStyle || document.defaultView.getComputedStyle(root);
- return ((root.clientWidth || parseInt(stl.width, 10)) - parseInt(stl.paddingLeft, 10) // 请原谅我这比较粗暴
- - parseInt(stl.paddingRight, 10)).toFixed(0) - 0;
- }
- /**
- * Method: _getHeight
- *
- */
- }, {
- key: "_getHeight",
- value: function _getHeight() {
- var root = this.root;
- var stl = root.currentStyle || document.defaultView.getComputedStyle(root);
- return ((root.clientHeight || parseInt(stl.height, 10)) - parseInt(stl.paddingTop, 10) // 请原谅我这比较粗暴
- - parseInt(stl.paddingBottom, 10)).toFixed(0) - 0;
- }
- /**
- * Method: _brushHover
- *
- */
- }, {
- key: "_brushHover",
- value: function _brushHover(shape) {
- var ctx = this._layers.hover.ctx;
- if (!shape.onbrush // 没有onbrush
- // 有onbrush并且调用执行返回false或undefined则继续粉刷
- || shape.onbrush && !shape.onbrush(ctx, true)) {
- var layer = this.getLayer(shape.zlevel);
- if (layer.needTransform) {
- ctx.save();
- layer.setTransform(ctx);
- } // Retina 优化
- if (Config.catchBrushException) {
- try {
- shape.brush(ctx, true, this.updatePainter);
- } catch (error) {
- SUtil_SUtil.Util_log(error, 'hoverBrush error of ' + shape.type, shape);
- }
- } else {
- shape.brush(ctx, true, this.updatePainter);
- }
- if (layer.needTransform) {
- ctx.restore();
- }
- }
- }
- /**
- * Method: _shapeToImage
- *
- */
- }, {
- key: "_shapeToImage",
- value: function _shapeToImage(id, shape, width, height, devicePixelRatio) {
- var canvas = document.createElement('canvas');
- var ctx = canvas.getContext('2d');
- var _devicePixelRatio = devicePixelRatio || window.devicePixelRatio || 1;
- canvas.style.width = width + 'px';
- canvas.style.height = height + 'px';
- canvas.setAttribute('width', width * _devicePixelRatio);
- canvas.setAttribute('height', height * _devicePixelRatio);
- ctx.clearRect(0, 0, width * _devicePixelRatio, height * _devicePixelRatio);
- var shapeTransform = {
- position: shape.position,
- rotation: shape.rotation,
- scale: shape.scale
- };
- shape.position = [0, 0, 0];
- shape.rotation = 0;
- shape.scale = [1, 1];
- if (shape) {
- shape.brush(ctx, false);
- }
- var imgShape = new SmicImage({
- id: id,
- style: {
- x: 0,
- y: 0,
- image: canvas
- }
- });
- if (shapeTransform.position != null) {
- imgShape.position = shape.position = shapeTransform.position;
- }
- if (shapeTransform.rotation != null) {
- imgShape.rotation = shape.rotation = shapeTransform.rotation;
- }
- if (shapeTransform.scale != null) {
- imgShape.scale = shape.scale = shapeTransform.scale;
- }
- return imgShape;
- }
- /**
- * Method: _createShapeToImageProcessor
- *
- */
- }, {
- key: "_createShapeToImageProcessor",
- value: function _createShapeToImageProcessor() {
- var me = this;
- return function (id, e, width, height) {
- return me._shapeToImage(id, e, width, height, Painter.devicePixelRatio);
- };
- } // SMIC-方法扩展 - start
- /**
- * @function SuperMap.LevelRenderer.Painter.prototype.updateHoverLayer
- * @description 更新设置显示高亮图层。
- * @param {Array} shapes - 图形数组。
- */
- }, {
- key: "updateHoverLayer",
- value: function updateHoverLayer(shapes) {
- if (!(shapes instanceof Array)) {
- return this;
- } //清除高亮
- this.clearHover();
- this.storage.delHover();
- for (var i = 0; i < shapes.length; i++) {
- this.storage.addHover(shapes[i]);
- this._brushHover(shapes[i]);
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Painter.prototype.createDom
- * @description 创建 Dom。
- *
- * @param {string} id - Dom id
- * @param {string} type - Dom type
- * @param {SuperMap.LevelRenderer.Painter} painter - Painter 实例。
- * @return {Object} Dom
- */
- }], [{
- key: "createDom",
- value: function createDom(id, type, painter) {
- var newDom = document.createElement(type);
- var width = painter._width;
- var height = painter._height; // 没append呢,请原谅我这样写,清晰~
- newDom.style.position = 'absolute';
- newDom.style.left = 0;
- newDom.style.top = 0;
- newDom.style.width = width + 'px';
- newDom.style.height = height + 'px';
- newDom.setAttribute('width', width * Painter.devicePixelRatio);
- newDom.setAttribute('height', height * Painter.devicePixelRatio); // id不作为索引用,避免可能造成的重名,定义为私有属性
- //newDom.setAttribute('data-zr-dom-id', id);
- newDom.setAttribute('id', id);
- return newDom;
- }
- }]);
- return Painter;
- }();
- /**
- * @private
- * @class Painter.Layer
- * @classdesc 绘制层类。
- * @extends SuperMap.LevelRenderer.Transformable
- */
- var PaintLayer = /*#__PURE__*/function (_Transformable) {
- Painter_inherits(PaintLayer, _Transformable);
- var _super = Painter_createSuper(PaintLayer);
- /**
- * @function Painter.Layer.constructor
- * @description 构造函数。
- *
- * @param {string} id - id。
- * @param {SuperMap.LevelRenderer.Painter} painter - Painter 实例。
- *
- */
- function PaintLayer(id, painter) {
- var _this;
- Painter_classCallCheck(this, PaintLayer);
- _this = _super.call(this, id, painter);
- /**
- * @member {Object} Painter.Layer.prototype.dom
- * @description dom。
- */
- _this.dom = null;
- /**
- * @member {Object} Painter.Layer.prototype.domBack
- * @description domBack。
- */
- _this.domBack = null;
- /**
- * @member {Object} Painter.Layer.prototype.ctxBack
- * @description ctxBack。
- */
- _this.ctxBack = null;
- /**
- * @member {SuperMap.LevelRenderer.Painter} Painter.Layer.prototype.painter
- * @description painter。
- */
- _this.painter = painter;
- /**
- * @member {number} Painter.Layer.prototype.unusedCount
- * @description unusedCount。
- */
- _this.unusedCount = 0;
- /**
- * @member {Object} Painter.Layer.prototype.config
- * @description config。
- */
- _this.config = null;
- /**
- * @member {boolean} Painter.Layer.prototype.dirty
- * @description dirty。
- */
- _this.dirty = true;
- /**
- * @member {number} Painter.Layer.prototype.elCount
- * @description elCount。
- */
- _this.elCount = 0; // Configs
- /**
- * @member {string} Painter.Layer.prototype.clearColor
- * @description 每次清空画布的颜色。默认值:0;
- */
- _this.clearColor = 0;
- /**
- * @member {boolean} Painter.Layer.prototype.motionBlur
- * @description 是否开启动态模糊。默认值:false;
- */
- _this.motionBlur = false;
- /**
- * @member {number} Painter.Layer.prototype.lastFrameAlpha
- * @description 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显
- */
- _this.lastFrameAlpha = 0.7;
- /**
- * @member {boolean} Painter.Layer.prototype.zoomable
- * @description 层是否支持鼠标平移操作。默认值:false;
- */
- _this.zoomable = false;
- /**
- * @member {boolean} Painter.Layer.prototype.panable
- * @description 层是否支持鼠标缩放操作。默认值:false;
- */
- _this.panable = false;
- /**
- * @member {number} Painter.Layer.prototype.maxZoom
- * @description maxZoom。默认值:Infinity。
- */
- _this.maxZoom = Infinity;
- /**
- * @member {number} Painter.Layer.prototype.minZoom
- * @description minZoom。默认值:0。
- */
- _this.minZoom = 0;
- /**
- * @member {number} Painter.Layer.prototype.ctx
- * @description Canvas 上下文。
- */
- _this.ctx = null;
- _this.dom = Painter.createDom(Util.createUniqueID("SuperMap.Theme" + id), 'canvas', painter);
- _this.dom.onselectstart = returnFalse; // 避免页面选中的尴尬
- _this.dom.style['-webkit-user-select'] = 'none';
- _this.dom.style['user-select'] = 'none';
- _this.dom.style['-webkit-touch-callout'] = 'none'; // Function
- // 返回false的方法,用于避免页面被选中
- function returnFalse() {
- return false;
- }
- _this.CLASS_NAME = "SuperMap.LevelRenderer.Painter.Layer";
- return _this;
- }
- /**
- * @function Painter.Layer.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- Painter_createClass(PaintLayer, [{
- key: "destroy",
- value: function destroy() {
- this.dom = null;
- this.domBack = null;
- this.ctxBack = null;
- this.painter = null;
- this.unusedCount = null;
- this.config = null;
- this.dirty = null;
- this.elCount = null;
- this.clearColor = null;
- this.motionBlur = null;
- this.lastFrameAlpha = null;
- this.zoomable = null;
- this.panable = null;
- this.maxZoom = null;
- this.minZoom = null;
- this.ctx = null;
- Transformable.destroy.apply(this, arguments);
- }
- /**
- * @function Painter.Layer.prototype.initContext
- * @description 初始化 Canvan 2D 上下文。
- */
- }, {
- key: "initContext",
- value: function initContext() {
- this.ctx = this.dom.getContext('2d');
- if (Painter.devicePixelRatio != 1) {
- this.ctx.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
- }
- }
- /**
- * @function Painter.Layer.prototype.createBackBuffer
- * @description 创建备份缓冲。
- */
- }, {
- key: "createBackBuffer",
- value: function createBackBuffer() {
- this.domBack = Painter.createDom(Util.createUniqueID("SuperMap.Theme.back-" + this.id), 'canvas', this.painter);
- this.ctxBack = this.domBack.getContext('2d');
- if (Painter.devicePixelRatio != 1) {
- this.ctxBack.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
- }
- }
- /**
- * @function Painter.Layer.prototype.resize
- * @description 改变大小。
- *
- * @param {number} width - 宽。
- * @param {number} height - 高。
- */
- }, {
- key: "resize",
- value: function resize(width, height) {
- this.dom.style.width = width + 'px';
- this.dom.style.height = height + 'px';
- this.dom.setAttribute('width', width * Painter.devicePixelRatio);
- this.dom.setAttribute('height', height * Painter.devicePixelRatio);
- if (Painter.devicePixelRatio != 1) {
- this.ctx.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
- }
- if (this.domBack) {
- this.domBack.setAttribute('width', width * Painter.devicePixelRatio);
- this.domBack.setAttribute('height', height * Painter.devicePixelRatio);
- if (Painter.devicePixelRatio != 1) {
- this.ctxBack.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
- }
- }
- }
- /**
- * @function Painter.Layer.prototype.clear
- * @description 清空该层画布。
- */
- }, {
- key: "clear",
- value: function clear() {
- var dom = this.dom;
- var ctx = this.ctx;
- var width = dom.width;
- var height = dom.height;
- var haveClearColor = this.clearColor;
- var haveMotionBLur = this.motionBlur;
- var lastFrameAlpha = this.lastFrameAlpha;
- if (haveMotionBLur) {
- if (!this.domBack) {
- this.createBackBuffer();
- }
- this.ctxBack.globalCompositeOperation = 'copy';
- this.ctxBack.drawImage(dom, 0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
- }
- if (haveClearColor) {
- ctx.save();
- ctx.fillStyle = this.config.clearColor;
- ctx.fillRect(0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
- ctx.restore();
- } else {
- ctx.clearRect(0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
- }
- if (haveMotionBLur) {
- var domBack = this.domBack;
- ctx.save();
- ctx.globalAlpha = lastFrameAlpha;
- ctx.drawImage(domBack, 0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
- ctx.restore();
- }
- }
- }]);
- return PaintLayer;
- }(Transformable);
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Handler.js
- 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); }
- function Handler_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Handler_createClass(Constructor, protoProps, staticProps) { if (protoProps) Handler_defineProperties(Constructor.prototype, protoProps); if (staticProps) Handler_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Handler_setPrototypeOf(o, p) { Handler_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Handler_setPrototypeOf(o, p); }
- 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); }; }
- function Handler_possibleConstructorReturn(self, call) { if (call && (Handler_typeof(call) === "object" || typeof call === "function")) { return call; } return Handler_assertThisInitialized(self); }
- function Handler_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Handler_getPrototypeOf(o) { Handler_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Handler_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Handler
- * @category Visualization Theme
- * @classdesc Handler控制模块。
- * @extends {SuperMap.LevelRenderer.Eventful}
- */
- var Handler = /*#__PURE__*/function (_Eventful) {
- Handler_inherits(Handler, _Eventful);
- var _super = Handler_createSuper(Handler);
- /**
- * @function SuperMap.LevelRenderer.Handler.constructor
- * @description 构造函数。
- * @param {HTMLElement} root - 绘图区域。
- * @param {SuperMap.LevelRenderer.Storage} storage - Storage 实例。
- * @param {SuperMap.LevelRenderer.Painter} painter - Painter 实例。
- */
- function Handler(root, storage, painter) {
- var _this;
- Handler_classCallCheck(this, Handler);
- _this = _super.call(this, root, storage, painter);
- /**
- * @member {HTMLElement} SuperMap.LevelRenderer.Handler.prototype.root
- * @description 绘图区域
- */
- _this.root = root;
- /**
- * @member {SuperMap.LevelRenderer.Storage} SuperMap.LevelRenderer.Handler.prototype.storage
- * @description Storage 实例
- */
- _this.storage = storage;
- /**
- * @member {SuperMap.LevelRenderer.Painter} SuperMap.LevelRenderer.Handler.prototype.Painter
- * @description Painter 实例
- */
- _this.painter = painter;
- /**
- * @member {number} [SuperMap.LevelRenderer.Handler.prototype._lastX=0]
- * @description 上一次鼠标位置x坐标值
- */
- _this._lastX = 0;
- /**
- * @member {number} [SuperMap.LevelRenderer.Handler.prototype._lastY=0]
- * @description 上一次鼠标位置y坐标值
- */
- _this._lastY = 0;
- /**
- * @member {number} [SuperMap.LevelRenderer.Handler.prototype._mouseX=0]
- * @description 当前鼠标位置x坐标值
- */
- _this._mouseX = 0;
- /**
- * @member {number} [SuperMap.LevelRenderer.Handler.prototype._mouseY=0]
- * @description 当前鼠标位置y坐标值
- */
- _this._mouseY = 0;
- /**
- * @member {Function} SuperMap.LevelRenderer.Handler.prototype._findHover
- * @description 查找 Hover 图形
- */
- _this._findHover = null;
- /**
- * @member {Object} SuperMap.LevelRenderer.Handler.prototype._domHover
- * @description 高亮 DOM
- */
- _this._domHover = null; // 各种事件标识的私有变量
- // this._hasfound = false; // 是否找到 hover 图形元素
- // this._lastHover = null; // 最后一个 hover 图形元素
- // this._mouseDownTarget = null;
- // this._draggingTarget = null; // 当前被拖拽的图形元素
- // this._isMouseDown = false;
- // this._isDragging = false;
- // this._lastMouseDownMoment;
- // this._lastTouchMoment;
- // this._lastDownButton;
- _this._findHover = bind3Arg(findHover, Handler_assertThisInitialized(_this));
- _this._domHover = painter.getDomHover();
- _this.CLASS_NAME = "SuperMap.LevelRenderer.Handler";
- var domHandlers = {
- /**
- * Method: resize
- * 窗口大小改变响应函数。
- *
- * Parameters:
- * event - {Event} event。
- *
- */
- resize: function resize(event) {
- event = event || window.event;
- this._lastHover = null;
- this._isMouseDown = 0; // 分发SuperMap.LevelRenderer.Config.EVENT.RESIZE事件,global
- this.dispatch(Config.EVENT.RESIZE, event);
- },
- /**
- * Method: click
- * 点击响应函数。
- *
- * Parameters:
- * event - {Event} event。
- *
- */
- click: function click(event) {
- event = this._zrenderEventFixed(event); // 分发SuperMap.LevelRenderer.Config.EVENT.CLICK事件
- var _lastHover = this._lastHover;
- if (_lastHover && _lastHover.clickable || !_lastHover) {
- // 判断没有发生拖拽才触发click事件
- if (this._clickThreshold < 10) {
- this._dispatchAgency(_lastHover, Config.EVENT.CLICK, event);
- }
- }
- this._mousemoveHandler(event);
- },
- /**
- * Method: dblclick
- * 双击响应函数。
- *
- * Parameters:
- * event - {Event} event。
- *
- */
- dblclick: function dblclick(event) {
- event = event || window.event;
- event = this._zrenderEventFixed(event); // 分发SuperMap.LevelRenderer.Config.EVENT.DBLCLICK事件
- var _lastHover = this._lastHover;
- if (_lastHover && _lastHover.clickable || !_lastHover) {
- // 判断没有发生拖拽才触发dblclick事件
- if (this._clickThreshold < 5) {
- this._dispatchAgency(_lastHover, Config.EVENT.DBLCLICK, event);
- }
- }
- this._mousemoveHandler(event);
- },
- /**
- * Method: mousewheel
- * 鼠标滚轮响应函数。
- *
- * Parameters:
- * event - {Event} event。
- *
- */
- mousewheel: function mousewheel(event) {
- event = this._zrenderEventFixed(event); // http://www.sitepoint.com/html5-javascript-mouse-wheel/
- // https://developer.mozilla.org/en-US/docs/DOM/DOM_event_reference/mousewheel
- var delta = event.wheelDelta // Webkit
- || -event.detail; // Firefox
- var scale = delta > 0 ? 1.1 : 1 / 1.1;
- var layers = this.painter.getLayers();
- var needsRefresh = false;
- for (var z in layers) {
- if (z !== 'hover') {
- var layer = layers[z];
- var pos = layer.position;
- if (layer.zoomable) {
- layer.__zoom = layer.__zoom || 1;
- var newZoom = layer.__zoom;
- newZoom *= scale;
- newZoom = Math.max(Math.min(layer.maxZoom, newZoom), layer.minZoom);
- scale = newZoom / layer.__zoom;
- layer.__zoom = newZoom; // Keep the mouse center when scaling
- pos[0] -= (this._mouseX - pos[0]) * (scale - 1);
- pos[1] -= (this._mouseY - pos[1]) * (scale - 1);
- layer.scale[0] *= scale;
- layer.scale[1] *= scale;
- layer.dirty = true;
- needsRefresh = true;
- }
- }
- }
- if (needsRefresh) {
- this.painter.refresh();
- } // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEWHEEL事件
- this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEWHEEL, event);
- this._mousemoveHandler(event);
- },
- /**
- * Method: mousemove
- * 鼠标(手指)移动响应函数。
- *
- * Parameters:
- * event - {Event} event。
- *
- */
- mousemove: function mousemove(event) {
- // 拖拽不触发click事件
- this._clickThreshold++;
- event = this._zrenderEventFixed(event);
- this._lastX = this._mouseX;
- this._lastY = this._mouseY;
- this._mouseX = SUtil_SUtil.Util_event.getX(event);
- this._mouseY = SUtil_SUtil.Util_event.getY(event);
- var dx = this._mouseX - this._lastX;
- var dy = this._mouseY - this._lastY; // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGSTART事件
- // 避免手抖点击误认为拖拽
- // if (this._mouseX - this._lastX > 1 || this._mouseY - this._lastY > 1) {
- this._processDragStart(event); // }
- this._hasfound = 0;
- this._event = event;
- this._iterateAndFindHover(); // 找到的在迭代函数里做了处理,没找到得在迭代完后处理
- if (!this._hasfound) {
- // 过滤首次拖拽产生的mouseout和dragLeave
- if (!this._draggingTarget || this._lastHover && this._lastHover != this._draggingTarget) {
- // 可能出现SuperMap.LevelRenderer.Config.EVENT.MOUSEOUT事件
- this._processOutShape(event); // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
- this._processDragLeave(event);
- }
- this._lastHover = null;
- this.storage.delHover();
- this.painter.clearHover();
- } // set cursor for root element
- var cursor = ''; // 如果存在拖拽中元素,被拖拽的图形元素最后addHover
- if (this._draggingTarget) {
- this.storage.drift(this._draggingTarget.id, dx, dy);
- this._draggingTarget.modSelf();
- this.storage.addHover(this._draggingTarget);
- } else if (this._isMouseDown) {
- // Layer dragging
- var layers = this.painter.getLayers();
- var needsRefresh = false;
- for (var z in layers) {
- if (z !== 'hover') {
- var layer = layers[z];
- if (layer.panable) {
- // PENDING
- cursor = 'move'; // Keep the mouse center when scaling
- layer.position[0] += dx;
- layer.position[1] += dy;
- needsRefresh = true;
- layer.dirty = true;
- }
- }
- }
- if (needsRefresh) {
- this.painter.refresh();
- }
- }
- if (this._draggingTarget || this._hasfound && this._lastHover.draggable) {
- cursor = 'move';
- } else if (this._hasfound && this._lastHover.clickable) {
- cursor = 'pointer';
- }
- this.root.style.cursor = cursor; // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEMOVE事件
- this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEMOVE, event);
- if (this._draggingTarget || this._hasfound || this.storage.hasHoverShape()) {
- this.painter.refreshHover();
- }
- },
- /**
- * Method: mouseout
- * 鼠标(手指)离开响应函数。
- *
- * Parameters:
- * event - {Event} event。
- *
- */
- mouseout: function mouseout(event) {
- event = this._zrenderEventFixed(event);
- var element = event.toElement || event.relatedTarget;
- if (element != this.root) {
- while (element && element.nodeType != 9) {
- // 忽略包含在root中的dom引起的mouseOut
- if (element == this.root) {
- this._mousemoveHandler(event);
- return;
- }
- element = element.parentNode;
- }
- }
- event.zrenderX = this._lastX;
- event.zrenderY = this._lastY;
- this.root.style.cursor = '';
- this._isMouseDown = 0;
- this._processOutShape(event);
- this._processDrop(event);
- this._processDragEnd(event);
- this.painter.refreshHover();
- this.dispatch(Config.EVENT.GLOBALOUT, event);
- },
- /**
- * Method: mousedown
- * 鼠标(手指)按下响应函数。
- *
- * Parameters:
- * event - {Event} event。
- *
- */
- mousedown: function mousedown(event) {
- // 重置 clickThreshold
- this._clickThreshold = 0;
- if (this._lastDownButton == 2) {
- this._lastDownButton = event.button;
- this._mouseDownTarget = null; // 仅作为关闭右键菜单使用
- return;
- }
- this._lastMouseDownMoment = new Date();
- event = this._zrenderEventFixed(event);
- this._isMouseDown = 1; // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEDOWN事件
- this._mouseDownTarget = this._lastHover;
- this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEDOWN, event);
- this._lastDownButton = event.button;
- },
- /**
- * Method: mouseup
- * 鼠标(手指)抬起响应函数。
- *
- * Parameters:
- * event - {Event} event。
- *
- */
- mouseup: function mouseup(event) {
- event = this._zrenderEventFixed(event);
- this.root.style.cursor = '';
- this._isMouseDown = 0;
- this._mouseDownTarget = null; // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEUP事件
- this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEUP, event);
- this._processDrop(event);
- this._processDragEnd(event);
- },
- /**
- * Method: touchstart
- * Touch 开始响应函数。
- *
- * Parameters:
- * event - {Event} event。
- *
- */
- touchstart: function touchstart(event) {
- // SUtil.Util_event.stop(event);// 阻止浏览器默认事件,重要
- event = this._zrenderEventFixed(event, true);
- this._lastTouchMoment = new Date(); // 平板补充一次findHover
- this._mobildFindFixed(event);
- this._mousedownHandler(event);
- },
- /**
- * Method: touchmove
- * Touch 移动响应函数。
- *
- * Parameters:
- * event - {Event} event。
- *
- */
- touchmove: function touchmove(event) {
- event = this._zrenderEventFixed(event, true);
- this._mousemoveHandler(event);
- if (this._isDragging) {
- SUtil_SUtil.Util_event.stop(event); // 阻止浏览器默认事件,重要
- }
- },
- /**
- * Method: touchend
- * Touch 结束响应函数。
- *
- * Parameters:
- * event - {Event} event。
- *
- */
- touchend: function touchend(event) {
- // SUtil.Util_event.stop(event);// 阻止浏览器默认事件,重要
- event = this._zrenderEventFixed(event, true);
- this._mouseupHandler(event);
- var now = new Date();
- if (now - this._lastTouchMoment < Config.EVENT.touchClickDelay) {
- this._mobildFindFixed(event);
- this._clickHandler(event);
- if (now - this._lastClickMoment < Config.EVENT.touchClickDelay / 2) {
- this._dblclickHandler(event);
- if (this._lastHover && this._lastHover.clickable) {
- SUtil_SUtil.Util_event.stop(event); // 阻止浏览器默认事件,重要
- }
- }
- this._lastClickMoment = now;
- }
- this.painter.clearHover();
- }
- };
- initDomHandler(Handler_assertThisInitialized(_this)); // 初始化,事件绑定,支持的所有事件都由如下原生事件计算得来
- if (window.addEventListener) {
- window.addEventListener('resize', _this._resizeHandler);
- if (SUtil_SUtil.Util_env.os.tablet || SUtil_SUtil.Util_env.os.phone) {
- // mobile支持
- root.addEventListener('touchstart', _this._touchstartHandler);
- root.addEventListener('touchmove', _this._touchmoveHandler);
- root.addEventListener('touchend', _this._touchendHandler);
- } else {
- // mobile的click/move/up/down自己模拟
- root.addEventListener('click', _this._clickHandler);
- root.addEventListener('dblclick', _this._dblclickHandler);
- root.addEventListener('mousewheel', _this._mousewheelHandler);
- root.addEventListener('mousemove', _this._mousemoveHandler);
- root.addEventListener('mousedown', _this._mousedownHandler);
- root.addEventListener('mouseup', _this._mouseupHandler);
- }
- root.addEventListener('DOMMouseScroll', _this._mousewheelHandler);
- root.addEventListener('mouseout', _this._mouseoutHandler);
- } else {
- window.attachEvent('onresize', _this._resizeHandler);
- root.attachEvent('onclick', _this._clickHandler); //root.attachEvent('ondblclick ', this._dblclickHandler);
- root.ondblclick = _this._dblclickHandler;
- root.attachEvent('onmousewheel', _this._mousewheelHandler);
- root.attachEvent('onmousemove', _this._mousemoveHandler);
- root.attachEvent('onmouseout', _this._mouseoutHandler);
- root.attachEvent('onmousedown', _this._mousedownHandler);
- root.attachEvent('onmouseup', _this._mouseupHandler);
- } // 辅助函数 start
- /**
- * Method: bind1Arg
- * bind 一个参数的 function。
- *
- * Parameters:
- * handler - {Function} 要 bind 的 function。
- * context - {Object} 运行时 this 环境。
- *
- * Returns:
- * {Function}
- */
- function bind1Arg(handler, context) {
- return function (e) {
- return handler.call(context, e);
- };
- }
- /*
- // bind 两个参数的 function
- function bind2Arg(handler, context) {
- return function (arg1, arg2) {
- return handler.call(context, arg1, arg2);
- };
- }
- */
- // bind 三个参数的 function
- function bind3Arg(handler, context) {
- return function (arg1, arg2, arg3) {
- return handler.call(context, arg1, arg2, arg3);
- };
- }
- /**
- * Method: initDomHandler
- * 为控制类实例初始化 dom 事件处理函数。
- *
- * Parameters:
- * instance - {<SuperMap.LevelRenderer.Handler>} 控制类实例 。
- *
- * Returns:
- * {Function}
- */
- function initDomHandler(instance) {
- var domHandlerNames = ['resize', 'click', 'dblclick', 'mousewheel', 'mousemove', 'mouseout', 'mouseup', 'mousedown', 'touchstart', 'touchend', 'touchmove'];
- var len = domHandlerNames.length;
- while (len--) {
- var name = domHandlerNames[len];
- instance['_' + name + 'Handler'] = bind1Arg(domHandlers[name], instance);
- }
- }
- /**
- * Method: findHover
- * 迭代函数,查找 hover 到的图形元素并即时做些事件分发。
- *
- * Parameters:
- * shape - {Object} 图形。
- * x - {number} 鼠标 x。
- * y - {number} 鼠标 y。
- *
- * Returns:
- * {boolean} 是否找到图形。
- *
- */
- function findHover(shape, x, y) {
- var me = this;
- if (me._draggingTarget && me._draggingTarget.id == shape.id || // 迭代到当前拖拽的图形上
- shape.isSilent() // 打酱油的路过,啥都不响应的shape~
- ) {
- return false;
- }
- var event = me._event;
- if (shape.isCover(x, y)) {
- if (shape.hoverable) {
- // SMIC-修改 - start
- if (shape.isHoverByRefDataID && shape.isHoverByRefDataID === true) {
- if (shape.refDataID) {
- var fid = shape.refDataID; //me.painter.clearHover();
- //me.storage.delHover();
- var hoverGroup = null;
- if (shape.refDataHoverGroup) {
- hoverGroup = shape.refDataHoverGroup;
- } //查找同一个用户数据 feature 的所有图形
- var shapeList = me.storage._shapeList;
- for (var i = 0, len = shapeList.length; i < len; i++) {
- var si = shapeList[i];
- if (si.refDataID && fid === si.refDataID) {
- if (hoverGroup) {
- if (si.refDataHoverGroup && hoverGroup === si.refDataHoverGroup) {
- me.storage.addHover(si);
- }
- } else {
- me.storage.addHover(si);
- }
- }
- }
- }
- } else {
- me.storage.addHover(shape);
- } //初始代码:
- // me.storage.addHover(shape);
- // SMIC-修改 - end
- } // 查找是否在 clipShape 中
- var p = shape.parent;
- while (p) {
- if (p.clipShape && !p.clipShape.isCover(me._mouseX, me._mouseY)) {
- // 已经被祖先 clip 掉了
- return false;
- }
- p = p.parent;
- }
- if (me._lastHover != shape) {
- me._processOutShape(event); // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
- me._processDragLeave(event);
- me._lastHover = shape; // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGENTER事件
- me._processDragEnter(event);
- }
- me._processOverShape(event); // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGOVER
- me._processDragOver(event);
- me._hasfound = 1;
- return true; // 找到则中断迭代查找
- }
- return false;
- } // 辅助函数 end
- return _this;
- }
- /**
- * @function SuperMap.LevelRenderer.Handler.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为null。
- */
- Handler_createClass(Handler, [{
- key: "destroy",
- value: function destroy() {
- this.dispose();
- this._lastX = null;
- this._lastY = null;
- this._mouseX = null;
- this._mouseY = null;
- this._findHover = null;
- Eventful.prototype.destroy.apply(this, arguments);
- }
- /**
- * @function SuperMap.LevelRenderer.Handler.prototype.on
- * @description 自定义事件绑定。
- * @param {string} eventName - 事件名称,resize、hover、drag等。
- * @param {function} handler - 响应函数。
- * @returns {SuperMap.LevelRenderer.Handler} this。
- */
- }, {
- key: "on",
- value: function on(eventName, handler) {
- this.bind(eventName, handler);
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Handler.prototype.un
- * @description 自定义事件解除绑定。
- * @param {string} eventName - 事件名称,resize、hover、drag等。
- * @param {function} handler - 响应函数。
- * @returns {SuperMap.LevelRenderer.Handler} this。
- */
- }, {
- key: "un",
- value: function un(eventName, handler) {
- this.unbind(eventName, handler);
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Handler.prototype.trigger
- * @description 事件触发。
- * @param {string} eventName - 事件名称,resize、hover、drag等。
- * @param {event} eventArgs - dom事件对象。
- */
- }, {
- key: "trigger",
- value: function trigger(eventName, eventArgs) {
- var EVENT = Config.EVENT;
- switch (eventName) {
- case EVENT.RESIZE:
- case EVENT.CLICK:
- case EVENT.DBLCLICK:
- case EVENT.MOUSEWHEEL:
- case EVENT.MOUSEMOVE:
- case EVENT.MOUSEDOWN:
- case EVENT.MOUSEUP:
- case EVENT.MOUSEOUT:
- this['_' + eventName + 'Handler'](eventArgs);
- break;
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Handler.prototype.dispose
- * @description 释放,解绑所有事件。
- */
- }, {
- key: "dispose",
- value: function dispose() {
- var root = this.root;
- if (window.removeEventListener) {
- window.removeEventListener('resize', this._resizeHandler);
- if (SUtil_SUtil.Util_env.os.tablet || SUtil_SUtil.Util_env.os.phone) {
- // mobile支持
- root.removeEventListener('touchstart', this._touchstartHandler);
- root.removeEventListener('touchmove', this._touchmoveHandler);
- root.removeEventListener('touchend', this._touchendHandler);
- } else {
- // mobile的click自己模拟
- root.removeEventListener('click', this._clickHandler);
- root.removeEventListener('dblclick', this._dblclickHandler);
- root.removeEventListener('mousewheel', this._mousewheelHandler);
- root.removeEventListener('mousemove', this._mousemoveHandler);
- root.removeEventListener('mousedown', this._mousedownHandler);
- root.removeEventListener('mouseup', this._mouseupHandler);
- }
- root.removeEventListener('DOMMouseScroll', this._mousewheelHandler);
- root.removeEventListener('mouseout', this._mouseoutHandler);
- } else {
- window.detachEvent('onresize', this._resizeHandler);
- root.detachEvent('onclick', this._clickHandler);
- root.detachEvent('dblclick', this._dblclickHandler);
- root.detachEvent('onmousewheel', this._mousewheelHandler);
- root.detachEvent('onmousemove', this._mousemoveHandler);
- root.detachEvent('onmouseout', this._mouseoutHandler);
- root.detachEvent('onmousedown', this._mousedownHandler);
- root.detachEvent('onmouseup', this._mouseupHandler);
- }
- this.root = null;
- this._domHover = null;
- this.storage = null;
- this.painter = null;
- this.un();
- }
- /**
- * Method: _processDragStart
- * 拖拽开始。
- *
- * Parameters:
- * event - {Object} 事件对象。
- *
- */
- }, {
- key: "_processDragStart",
- value: function _processDragStart(event) {
- var _lastHover = this._lastHover;
- if (this._isMouseDown && _lastHover && _lastHover.draggable && !this._draggingTarget && this._mouseDownTarget == _lastHover) {
- // 拖拽点击生效时长阀门,某些场景需要降低拖拽敏感度
- if (_lastHover.dragEnableTime && new Date() - this._lastMouseDownMoment < _lastHover.dragEnableTime) {
- return;
- }
- var _draggingTarget = _lastHover;
- this._draggingTarget = _draggingTarget;
- this._isDragging = 1;
- _draggingTarget.invisible = true;
- this.storage.mod(_draggingTarget.id); // 分发 Config.EVENT.DRAGSTART事件
- this._dispatchAgency(_draggingTarget, Config.EVENT.DRAGSTART, event);
- this.painter.refresh();
- }
- }
- /**
- * Method: _processDragEnter
- * 拖拽进入目标元素。
- *
- * Parameters:
- * event - {Object} 事件对象。
- *
- */
- }, {
- key: "_processDragEnter",
- value: function _processDragEnter(event) {
- if (this._draggingTarget) {
- // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGENTER事件
- this._dispatchAgency(this._lastHover, Config.EVENT.DRAGENTER, event, this._draggingTarget);
- }
- }
- /**
- * Method: _processDragOver
- * 拖拽在目标元素上移动。
- *
- * Parameters:
- * event - {Object} 事件对象。
- *
- */
- }, {
- key: "_processDragOver",
- value: function _processDragOver(event) {
- if (this._draggingTarget) {
- // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGOVER事件
- this._dispatchAgency(this._lastHover, Config.EVENT.DRAGOVER, event, this._draggingTarget);
- }
- }
- /**
- * Method: _processDragLeave
- * 拖拽离开目标元素。
- *
- * Parameters:
- * event - {Object} 事件对象。
- *
- */
- }, {
- key: "_processDragLeave",
- value: function _processDragLeave(event) {
- if (this._draggingTarget) {
- // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
- this._dispatchAgency(this._lastHover, Config.EVENT.DRAGLEAVE, event, this._draggingTarget);
- }
- }
- /**
- * Method: _processDrop
- * 拖拽在目标元素上完成。
- *
- * Parameters:
- * event - {Object} 事件对象。
- *
- */
- }, {
- key: "_processDrop",
- value: function _processDrop(event) {
- if (this._draggingTarget) {
- this._draggingTarget.invisible = false;
- this.storage.mod(this._draggingTarget.id);
- this.painter.refresh(); // 分发SuperMap.LevelRenderer.Config.EVENT.DROP事件
- this._dispatchAgency(this._lastHover, Config.EVENT.DROP, event, this._draggingTarget);
- }
- }
- /**
- * Method: _processDragEnd
- * 拖拽结束。
- *
- * Parameters:
- * event - {Object} 事件对象。
- *
- */
- }, {
- key: "_processDragEnd",
- value: function _processDragEnd(event) {
- if (this._draggingTarget) {
- // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGEND事件
- this._dispatchAgency(this._draggingTarget, Config.EVENT.DRAGEND, event);
- this._lastHover = null;
- }
- this._isDragging = 0;
- this._draggingTarget = null;
- }
- /**
- * Method: _processOverShape
- * 鼠标在某个图形元素上移动。
- *
- * Parameters:
- * event - {Object} 事件对象。
- *
- */
- }, {
- key: "_processOverShape",
- value: function _processOverShape(event) {
- // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEOVER事件
- this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEOVER, event);
- }
- /**
- * Method: _processOutShape
- * 鼠标离开某个图形元素。
- *
- * Parameters:
- * event - {Object} 事件对象。
- *
- */
- }, {
- key: "_processOutShape",
- value: function _processOutShape(event) {
- // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEOUT事件
- this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEOUT, event);
- }
- /**
- * Method: _dispatchAgency
- * 鼠标离开某个图形元素。
- *
- * Parameters:
- * targetShape - {Object} 目标图形元素。
- * eventName - {Object} 事件名称。
- * event - {Object} 事件对象。
- * draggedShape - {Object} 拖拽事件特有,当前被拖拽图形元素。
- *
- */
- }, {
- key: "_dispatchAgency",
- value: function _dispatchAgency(targetShape, eventName, event, draggedShape) {
- var eventHandler = 'on' + eventName;
- var eventPacket = {
- type: eventName,
- event: event,
- target: targetShape,
- cancelBubble: false
- };
- var el = targetShape;
- if (draggedShape) {
- eventPacket.dragged = draggedShape;
- }
- while (el) {
- el[eventHandler] && (eventPacket.cancelBubble = el[eventHandler](eventPacket));
- el.dispatch(eventName, eventPacket);
- el = el.parent;
- if (eventPacket.cancelBubble) {
- break;
- }
- }
- if (targetShape) {
- // 冒泡到顶级 zrender 对象
- if (!eventPacket.cancelBubble) {
- this.dispatch(eventName, eventPacket);
- }
- } else if (!draggedShape) {
- // 无hover目标,无拖拽对象,原生事件分发
- this.dispatch(eventName, {
- type: eventName,
- event: event
- });
- }
- }
- /**
- * Method: _iterateAndFindHover
- * 迭代寻找 hover shape。
- *
- */
- }, {
- key: "_iterateAndFindHover",
- value: function _iterateAndFindHover() {
- var invTransform = SUtil_SUtil.Util_matrix.create();
- var list = this.storage.getShapeList();
- var currentZLevel;
- var currentLayer;
- var tmp = [0, 0];
- for (var i = list.length - 1; i >= 0; i--) {
- var shape = list[i];
- if (currentZLevel !== shape.zlevel) {
- currentLayer = this.painter.getLayer(shape.zlevel, currentLayer);
- tmp[0] = this._mouseX;
- tmp[1] = this._mouseY;
- if (currentLayer.needTransform) {
- SUtil_SUtil.Util_matrix.invert(invTransform, currentLayer.transform);
- SUtil_SUtil.Util_vector.applyTransform(tmp, tmp, invTransform);
- }
- }
- if (this._findHover(shape, tmp[0], tmp[1])) {
- break;
- }
- }
- }
- /**
- * Method: _mobildFindFixed
- * touch 有指尖错觉,四向尝试,让touch上的点击更好触发事件。
- *
- * Parameters:
- * event - {Object} 事件对象。
- *
- */
- }, {
- key: "_mobildFindFixed",
- value: function _mobildFindFixed(event) {
- // touch指尖错觉的尝试偏移量配置
- var MOBILE_TOUCH_OFFSETS = [{
- x: 10
- }, {
- x: -20
- }, {
- x: 10,
- y: 10
- }, {
- y: -20
- }];
- this._lastHover = null;
- this._mouseX = event.zrenderX;
- this._mouseY = event.zrenderY;
- this._event = event;
- this._iterateAndFindHover();
- for (var i = 0; !this._lastHover && i < MOBILE_TOUCH_OFFSETS.length; i++) {
- var offset = MOBILE_TOUCH_OFFSETS[i];
- offset.x && (this._mouseX += offset.x);
- offset.y && (this._mouseX += offset.y);
- this._iterateAndFindHover();
- }
- if (this._lastHover) {
- event.zrenderX = this._mouseX;
- event.zrenderY = this._mouseY;
- }
- }
- /**
- * Method: _zrenderEventFixed
- * 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标 。
- *
- * Parameters:
- * event - {Object} 事件。
- * isTouch - {boolean} 是否触摸。
- *
- */
- }, {
- key: "_zrenderEventFixed",
- value: function _zrenderEventFixed(event, isTouch) {
- if (event.zrenderFixed) {
- return event;
- }
- if (!isTouch) {
- event = event || window.event; // 进入对象优先~
- var target = event.toElement || event.relatedTarget || event.srcElement || event.target;
- if (target && target != this._domHover) {
- event.zrenderX = (typeof event.offsetX != 'undefined' ? event.offsetX : event.layerX) + target.offsetLeft;
- event.zrenderY = (typeof event.offsetY != 'undefined' ? event.offsetY : event.layerY) + target.offsetTop;
- }
- } else {
- var touch = event.type != 'touchend' ? event.targetTouches[0] : event.changedTouches[0];
- if (touch) {
- var rBounding = this.root.getBoundingClientRect(); // touch事件坐标是全屏的~
- event.zrenderX = touch.clientX - rBounding.left;
- event.zrenderY = touch.clientY - rBounding.top;
- }
- }
- event.zrenderFixed = 1;
- return event;
- } // SMIC-方法扩展 - start
- /**
- * @function SuperMap.LevelRenderer.Handler.prototype.getLastHoverOne
- * @description 获取单个高亮图形
- */
- }, {
- key: "getLastHoverOne",
- value: function getLastHoverOne() {
- if (this._lastHover) {
- return this._lastHover;
- }
- return null;
- } // SMIC-方法扩展 - end
- }]);
- return Handler;
- }(Eventful);
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Easing.js
- function Easing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Easing_createClass(Constructor, protoProps, staticProps) { if (protoProps) Easing_defineProperties(Constructor.prototype, protoProps); if (staticProps) Easing_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.LevelRenderer.Animation.easing
- * @category Visualization Theme
- * @classdesc 缓动
- * @private
- */
- // 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js
- // http://sole.github.io/tween.js/examples/03_graphs.html
- var Easing = /*#__PURE__*/function () {
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.constructor
- * @description 构造函数。
- */
- function Easing() {
- Easing_classCallCheck(this, Easing);
- this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.easing";
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- Easing_createClass(Easing, [{
- key: "destroy",
- value: function destroy() {}
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.Linear
- * @description 线性缓动
- * @param {number} k - 参数
- * @return {number} 输入值
- */
- }, {
- key: "Linear",
- value: function Linear(k) {
- return k;
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.QuadraticIn
- * @description 二次方的缓动(t^2)
- * @param {number} k - 参数
- * @return {number} 二次方的缓动的值
- */
- }, {
- key: "QuadraticIn",
- value: function QuadraticIn(k) {
- return k * k;
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.QuadraticOut
- * @description 返回按二次方缓动退出的值
- * @param {number} k - 参数
- * @return {number} 按二次方缓动退出的值
- */
- }, {
- key: "QuadraticOut",
- value: function QuadraticOut(k) {
- return k * (2 - k);
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.QuadraticInOut
- * @description 返回按二次方缓动进入和退出的值
- * @param {number} k - 参数
- * @return {number} 按二次方缓动进入和退出的值
- */
- }, {
- key: "QuadraticInOut",
- value: function QuadraticInOut(k) {
- if ((k *= 2) < 1) {
- return 0.5 * k * k;
- }
- return -0.5 * (--k * (k - 2) - 1);
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.CubicIn
- * @description 三次方的缓动(t^3)
- * @param {number} k - 参数
- * @return {number} 按三次方缓动的值
- */
- }, {
- key: "CubicIn",
- value: function CubicIn(k) {
- return k * k * k;
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.CubicOut
- * @description 返回按三次方缓动退出的值
- * @param {number} k - 参数
- * @return {number} 按三次方缓动退出的值
- */
- }, {
- key: "CubicOut",
- value: function CubicOut(k) {
- return --k * k * k + 1;
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.CubicInOut
- * @description 返回按三次方缓动进入退出的值
- * @param {number} k - 参数
- * @return {number} 按三次方缓动进入退出的值
- */
- }, {
- key: "CubicInOut",
- value: function CubicInOut(k) {
- if ((k *= 2) < 1) {
- return 0.5 * k * k * k;
- }
- return 0.5 * ((k -= 2) * k * k + 2);
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.QuarticIn
- * @description 返回按四次方缓动进入的值
- * @param {number} k - 参数
- * @return {number} 按四次方缓动进入的值
- */
- }, {
- key: "QuarticIn",
- value: function QuarticIn(k) {
- return k * k * k * k;
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.QuarticOut
- * @description 返回按四次方缓动退出的值
- * @param {number} k - 参数
- * @return {number} 按四次方缓动退出的值
- */
- }, {
- key: "QuarticOut",
- value: function QuarticOut(k) {
- return 1 - --k * k * k * k;
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.QuarticInOut
- * @description 返回按四次方缓动进入退出的值
- * @param {number} k - 参数
- * @return {number} 按四次方缓动进入退出的值
- */
- }, {
- key: "QuarticInOut",
- value: function QuarticInOut(k) {
- if ((k *= 2) < 1) {
- return 0.5 * k * k * k * k;
- }
- return -0.5 * ((k -= 2) * k * k * k - 2);
- } // 五次方的缓动(t^5)
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.QuinticIn
- * @description 返回按五次方缓动的值
- * @param {number} k - 参数
- * @return {number} 按五次方缓动的值
- */
- }, {
- key: "QuinticIn",
- value: function QuinticIn(k) {
- return k * k * k * k * k;
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.QuinticOut
- * @description 返回按五次方缓动退出的值
- * @param {number} k - 参数
- * @return {number} 按五次方缓动退出的值
- */
- }, {
- key: "QuinticOut",
- value: function QuinticOut(k) {
- return --k * k * k * k * k + 1;
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.QuinticInOut
- * @description 返回按五次方缓动进入退出的值
- * @param {number} k - 参数
- * @return {number} 按五次方缓动进入退出的值
- */
- }, {
- key: "QuinticInOut",
- value: function QuinticInOut(k) {
- if ((k *= 2) < 1) {
- return 0.5 * k * k * k * k * k;
- }
- return 0.5 * ((k -= 2) * k * k * k * k + 2);
- } // 正弦曲线的缓动(sin(t))
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.SinusoidalIn
- * @description 返回按正弦曲线的缓动进入的值
- * @param {number} k - 参数
- * @return {number} 按正弦曲线的缓动进入的值
- */
- }, {
- key: "SinusoidalIn",
- value: function SinusoidalIn(k) {
- return 1 - Math.cos(k * Math.PI / 2);
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.SinusoidalOut
- * @description 返回按正弦曲线的缓动退出的值
- * @param {number} k - 参数
- * @return {number} 按正弦曲线的缓动退出的值
- */
- }, {
- key: "SinusoidalOut",
- value: function SinusoidalOut(k) {
- return Math.sin(k * Math.PI / 2);
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.SinusoidalInOut
- * @description 返回按正弦曲线的缓动进入退出的值
- * @param {number} k - 参数
- * @return {number} 按正弦曲线的缓动进入退出的值
- */
- }, {
- key: "SinusoidalInOut",
- value: function SinusoidalInOut(k) {
- return 0.5 * (1 - Math.cos(Math.PI * k));
- } // 指数曲线的缓动(2^t)
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.ExponentialIn
- * @description 返回按指数曲线的缓动进入的值
- * @param {number} k - 参数
- * @return {number} 按指数曲线的缓动进入的值
- */
- }, {
- key: "ExponentialIn",
- value: function ExponentialIn(k) {
- return k === 0 ? 0 : Math.pow(1024, k - 1);
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.ExponentialOut
- * @description 返回按指数曲线的缓动退出的值
- * @param {number} k - 参数
- * @return {number} 按指数曲线的缓动退出的值
- */
- }, {
- key: "ExponentialOut",
- value: function ExponentialOut(k) {
- return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.ExponentialInOut
- * @description 返回按指数曲线的缓动进入退出的值
- * @param {number} k - 参数
- * @return {number} 按指数曲线的缓动进入退出的值
- */
- }, {
- key: "ExponentialInOut",
- value: function ExponentialInOut(k) {
- if (k === 0) {
- return 0;
- }
- if (k === 1) {
- return 1;
- }
- if ((k *= 2) < 1) {
- return 0.5 * Math.pow(1024, k - 1);
- }
- return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);
- } // 圆形曲线的缓动(sqrt(1-t^2))
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.CircularIn
- * @description 返回按圆形曲线的缓动进入的值
- * @param {number} k - 参数
- * @return {number} 按圆形曲线的缓动进入的值
- */
- }, {
- key: "CircularIn",
- value: function CircularIn(k) {
- return 1 - Math.sqrt(1 - k * k);
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.CircularOut
- * @description 返回按圆形曲线的缓动退出的值
- * @param {number} k - 参数
- * @return {number} 按圆形曲线的缓动退出的值
- */
- }, {
- key: "CircularOut",
- value: function CircularOut(k) {
- return Math.sqrt(1 - --k * k);
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.CircularInOut
- * @description 返回按圆形曲线的缓动进入退出的值
- * @param {number} k - 参数
- * @return {number} 按圆形曲线的缓动进入退出的值
- */
- }, {
- key: "CircularInOut",
- value: function CircularInOut(k) {
- if ((k *= 2) < 1) {
- return -0.5 * (Math.sqrt(1 - k * k) - 1);
- }
- return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);
- } // 创建类似于弹簧在停止前来回振荡的动画
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.ElasticIn
- * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动进入的值
- * @param {number} k - 参数
- * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动进入的值
- */
- }, {
- key: "ElasticIn",
- value: function ElasticIn(k) {
- var s;
- var a = 0.1;
- var p = 0.4;
- if (k === 0) {
- return 0;
- }
- if (k === 1) {
- return 1;
- }
- if (a < 1) {
- a = 1;
- s = p / 4;
- } else {
- s = p * Math.asin(1 / a) / (2 * Math.PI);
- }
- return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.ElasticOut
- * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动退出的值
- * @param {number} k - 参数
- * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动退出的值
- */
- }, {
- key: "ElasticOut",
- value: function ElasticOut(k) {
- var s;
- var a = 0.1;
- var p = 0.4;
- if (k === 0) {
- return 0;
- }
- if (k === 1) {
- return 1;
- }
- if (a < 1) {
- a = 1;
- s = p / 4;
- } else {
- s = p * Math.asin(1 / a) / (2 * Math.PI);
- }
- return a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1;
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.ElasticInOut
- * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动进入退出的值
- * @param {number} k - 参数
- * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动进入退出的值
- */
- }, {
- key: "ElasticInOut",
- value: function ElasticInOut(k) {
- var s;
- var a = 0.1;
- var p = 0.4;
- if (k === 0) {
- return 0;
- }
- if (k === 1) {
- return 1;
- }
- if (a < 1) {
- a = 1;
- s = p / 4;
- } else {
- s = p * Math.asin(1 / a) / (2 * Math.PI);
- }
- if ((k *= 2) < 1) {
- return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));
- }
- return a * Math.pow(2, -10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;
- } // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.BackIn
- * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入的值
- * @param {number} k - 参数
- * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入的值
- */
- }, {
- key: "BackIn",
- value: function BackIn(k) {
- var s = 1.70158;
- return k * k * ((s + 1) * k - s);
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.BackOut
- * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动退出的值
- * @param {number} k - 参数
- * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动退出的值
- */
- }, {
- key: "BackOut",
- value: function BackOut(k) {
- var s = 1.70158;
- return --k * k * ((s + 1) * k + s) + 1;
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.BackInOut
- * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入退出的值
- * @param {number} k - 参数
- * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入退出的值
- */
- }, {
- key: "BackInOut",
- value: function BackInOut(k) {
- var s = 1.70158 * 1.525;
- if ((k *= 2) < 1) {
- return 0.5 * (k * k * ((s + 1) * k - s));
- }
- return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);
- } // 创建弹跳效果
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.BounceIn
- * @description 返回按弹跳效果的缓动进入的值
- * @param {number} k - 参数
- * @return {number} 按弹跳效果的缓动进入的值
- */
- }, {
- key: "BounceIn",
- value: function BounceIn(k) {
- return 1 - this.BounceOut(1 - k);
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.BounceOut
- * @description 返回按弹跳效果的缓动退出的值
- * @param {number} k - 参数
- * @return {number} 按弹跳效果的缓动退出的值
- */
- }, {
- key: "BounceOut",
- value: function BounceOut(k) {
- if (k < 1 / 2.75) {
- return 7.5625 * k * k;
- } else if (k < 2 / 2.75) {
- return 7.5625 * (k -= 1.5 / 2.75) * k + 0.75;
- } else if (k < 2.5 / 2.75) {
- return 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375;
- } else {
- return 7.5625 * (k -= 2.625 / 2.75) * k + 0.984375;
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.easing.BounceInOut
- * @description 返回按弹跳效果的缓动进入退出的值
- * @param {number} k - 参数
- * @return {number} 按弹跳效果的缓动进入退出的值
- */
- }, {
- key: "BounceInOut",
- value: function BounceInOut(k) {
- if (k < 0.5) {
- return this.BounceIn(k * 2) * 0.5;
- }
- return this.BounceOut(k * 2 - 1) * 0.5 + 0.5;
- }
- }]);
- return Easing;
- }();
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Clip.js
- function Clip_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Clip_createClass(Constructor, protoProps, staticProps) { if (protoProps) Clip_defineProperties(Constructor.prototype, protoProps); if (staticProps) Clip_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.LevelRenderer.Animation.Clip
- * @category Visualization Theme
- * @classdec 动画片段
- * @private
- */
- var Clip = /*#__PURE__*/function () {
- /**
- * @function SuperMap.LevelRenderer.Animation.Clip.prototype.constructor
- * @description 构造函数。
- * @param {Object} options - 参数。
- * @param {Object} options.target - 动画对象,可以是数组,如果是数组的话会批量分发 onframe 等事件。
- * @param {number} [options.life=1000] - 动画时长。
- * @param {number} [options.delay=0] - 动画延迟时间。
- * @param {boolean} [options.loop=true] - 是否循环。
- * @param {number} [options.gap=0] - 循环的间隔时间。
- * @param {Object} options.onframe - 帧。
- * @param {boolean} options.easing - 是否消除。
- * @param {boolean} options.ondestroy - 是否销毁。
- * @param {boolean} options.onrestart - 是否重播。
- */
- function Clip(options) {
- Clip_classCallCheck(this, Clip);
- this._targetPool = options.target || {};
- if (!(this._targetPool instanceof Array)) {
- this._targetPool = [this._targetPool];
- } // 生命周期
- this._life = options.life || 1000; // 延时
- this._delay = options.delay || 0; // 开始时间
- this._startTime = new Date().getTime() + this._delay; // 单位毫秒
- // 结束时间
- this._endTime = this._startTime + this._life * 1000; // 是否循环
- this.loop = typeof options.loop == 'undefined' ? false : options.loop;
- this.gap = options.gap || 0;
- this.easing = options.easing || 'Linear';
- this.onframe = options.onframe;
- this.ondestroy = options.ondestroy;
- this.onrestart = options.onrestart;
- this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.Clip";
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.Clip.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- Clip_createClass(Clip, [{
- key: "destroy",
- value: function destroy() {}
- }, {
- key: "step",
- value: function step(time) {
- var easing = new Easing();
- var percent = (time - this._startTime) / this._life; // 还没开始
- if (percent < 0) {
- return;
- }
- percent = Math.min(percent, 1);
- var easingFunc = typeof this.easing == 'string' ? easing[this.easing] : this.easing;
- var schedule = typeof easingFunc === 'function' ? easingFunc(percent) : percent;
- this.fire('frame', schedule); // 结束
- if (percent == 1) {
- if (this.loop) {
- this.restart(); // 重新开始周期
- // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件
- return 'restart';
- } // 动画完成将这个控制器标识为待删除
- // 在Animation.update中进行批量删除
- this._needsRemove = true;
- return 'destroy';
- }
- return null;
- }
- }, {
- key: "restart",
- value: function restart() {
- var time = new Date().getTime();
- var remainder = (time - this._startTime) % this._life;
- this._startTime = new Date().getTime() - remainder + this.gap;
- }
- }, {
- key: "fire",
- value: function fire(eventType, arg) {
- for (var i = 0, len = this._targetPool.length; i < len; i++) {
- if (this['on' + eventType]) {
- this['on' + eventType](this._targetPool[i], arg);
- }
- }
- }
- }]);
- return Clip;
- }();
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Animation.js
- 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); }
- function Animation_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Animation_createClass(Constructor, protoProps, staticProps) { if (protoProps) Animation_defineProperties(Constructor.prototype, protoProps); if (staticProps) Animation_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Animation_setPrototypeOf(o, p) { Animation_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Animation_setPrototypeOf(o, p); }
- 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); }; }
- function Animation_possibleConstructorReturn(self, call) { if (call && (Animation_typeof(call) === "object" || typeof call === "function")) { return call; } return Animation_assertThisInitialized(self); }
- function Animation_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Animation_getPrototypeOf(o) { Animation_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Animation_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.LevelRenderer.Animation
- * @classdesc 动画主类, 调度和管理所有动画控制器
- * @category Visualization Theme
- * @extends {SuperMap.LevelRenderer.Eventful}
- * @private
- */
- var Animation = /*#__PURE__*/function (_Eventful) {
- Animation_inherits(Animation, _Eventful);
- var _super = Animation_createSuper(Animation);
- /**
- * @function SuperMap.LevelRenderer.Animation.prototype.constructor
- * @description 构造函数。
- * @param {Object} options - 动画参数。
- * @param {Object} options.onframe - onframe。
- * @param {Object} options.stage - stage。
- * (start code)
- * var animation = new SuperMap.LevelRenderer.Animation();
- * var obj = {
- * x: 100,
- * y: 100
- * };
- * animation.animate(node.position)
- * .when(1000, {
- * x: 500,
- * y: 500
- * })
- * .when(2000, {
- * x: 100,
- * y: 100
- * })
- * .start('spline');
- * (end)
- */
- function Animation(options) {
- var _this;
- Animation_classCallCheck(this, Animation);
- _this = _super.call(this, options);
- options = options || {};
- /**
- * @member {Object} SuperMap.LevelRenderer.Animation.prototype.stage
- * @description stage。
- */
- _this.stage = {};
- /**
- * @member {Object} SuperMap.LevelRenderer.Animation.prototype.onframe
- * @description onframe。
- */
- _this.onframe = function () {};
- /**
- * @member {Array} SuperMap.LevelRenderer.Animation.prototype._clips
- * @description _clips。
- */
- _this._clips = [];
- /**
- * @member {boolean} SuperMap.LevelRenderer.Animation.prototype._running
- * @description _running。
- */
- _this._running = false;
- /**
- * @member {number} SuperMap.LevelRenderer.Animation.prototype._time
- * @description _time。
- */
- _this._time = 0;
- Util.extend(Animation_assertThisInitialized(_this), options);
- _this.CLASS_NAME = "SuperMap.LevelRenderer.Animation";
- return _this;
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.prototype.add
- * @description 添加动画片段。
- * @param {SuperMap.LevelRenderer.Animation.Clip} clip - 动画片段。
- */
- Animation_createClass(Animation, [{
- key: "add",
- value: function add(clip) {
- this._clips.push(clip);
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.prototype.remove
- * @description 删除动画片段。
- * @param {SuperMap.LevelRenderer.Animation.Clip} clip - 动画片段。
- */
- }, {
- key: "remove",
- value: function remove(clip) {
- var idx = new Util_Util().indexOf(this._clips, clip);
- if (idx >= 0) {
- this._clips.splice(idx, 1);
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.prototype.update
- * @description 更新动画片段。
- */
- }, {
- key: "_update",
- value: function _update() {
- var time = new Date().getTime();
- var delta = time - this._time;
- var clips = this._clips;
- var len = clips.length;
- var deferredEvents = [];
- var deferredClips = [];
- for (var i = 0; i < len; i++) {
- var clip = clips[i];
- var e = clip.step(time); // Throw out the events need to be called after
- // stage.update, like destroy
- if (e) {
- deferredEvents.push(e);
- deferredClips.push(clip);
- }
- }
- if (this.stage.update) {
- this.stage.update();
- } // Remove the finished clip
- for (var _i = 0; _i < len;) {
- if (clips[_i]._needsRemove) {
- clips[_i] = clips[len - 1];
- clips.pop();
- len--;
- } else {
- _i++;
- }
- }
- len = deferredEvents.length;
- for (var _i2 = 0; _i2 < len; _i2++) {
- deferredClips[_i2].fire(deferredEvents[_i2]);
- }
- this._time = time;
- this.onframe(delta);
- this.dispatch('frame', delta);
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.prototype.start
- * @description 开始运行动画。
- */
- }, {
- key: "start",
- value: function start() {
- var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function (func) {
- setTimeout(func, 16);
- };
- var self = this;
- this._running = true;
- function step() {
- if (self._running) {
- self._update();
- requestAnimationFrame(step);
- }
- }
- this._time = new Date().getTime();
- requestAnimationFrame(step);
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.prototype.stop
- * @description 停止运行动画。
- */
- }, {
- key: "stop",
- value: function stop() {
- this._running = false;
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.prototype.clear
- * @description 清除所有动画片段。
- */
- }, {
- key: "clear",
- value: function clear() {
- this._clips = [];
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.prototype.animate
- * @description 对一个目标创建一个animator对象,可以指定目标中的属性使用动画。
- * @param {Object} target - 目标对象。
- * @param {Object} options - 动画参数选项。
- * @param {boolean} [options.loop=false] - 是否循环播放动画。
- * @param {function} [options.getter] - 如果指定getter函数,会通过getter函数取属性值。
- * @param {function} [options.setter] - 如果指定setter函数,会通过setter函数设置属性值。
- * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator。
- */
- }, {
- key: "animate",
- value: function animate(target, options) {
- options = options || {};
- var deferred = new Animator(target, options.loop, options.getter, options.setter);
- deferred.animation = this;
- return deferred;
- }
- }], [{
- key: "_interpolateNumber",
- value: function _interpolateNumber(p0, p1, percent) {
- return (p1 - p0) * percent + p0;
- }
- }, {
- key: "_interpolateArray",
- value: function _interpolateArray(p0, p1, percent, out, arrDim) {
- var len = p0.length;
- if (arrDim == 1) {
- for (var i = 0; i < len; i++) {
- out[i] = Animation._interpolateNumber(p0[i], p1[i], percent);
- }
- } else {
- var len2 = p0[0].length;
- for (var _i3 = 0; _i3 < len; _i3++) {
- for (var j = 0; j < len2; j++) {
- out[_i3][j] = Animation._interpolateNumber(p0[_i3][j], p1[_i3][j], percent);
- }
- }
- }
- }
- }, {
- key: "_isArrayLike",
- value: function _isArrayLike(data) {
- switch (Animation_typeof(data)) {
- case 'undefined':
- case 'string':
- return false;
- }
- return typeof data.length !== 'undefined';
- }
- }, {
- key: "_catmullRomInterpolateArray",
- value: function _catmullRomInterpolateArray(p0, p1, p2, p3, t, t2, t3, out, arrDim) {
- var len = p0.length;
- if (arrDim == 1) {
- for (var i = 0; i < len; i++) {
- out[i] = Animation._catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);
- }
- } else {
- var len2 = p0[0].length;
- for (var _i4 = 0; _i4 < len; _i4++) {
- for (var j = 0; j < len2; j++) {
- out[_i4][j] = Animation._catmullRomInterpolate(p0[_i4][j], p1[_i4][j], p2[_i4][j], p3[_i4][j], t, t2, t3);
- }
- }
- }
- }
- }, {
- key: "_catmullRomInterpolate",
- value: function _catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {
- var v0 = (p2 - p0) * 0.5;
- var v1 = (p3 - p1) * 0.5;
- return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;
- }
- }, {
- key: "_cloneValue",
- value: function _cloneValue(value) {
- var arraySlice = Array.prototype.slice;
- if (Animation._isArrayLike(value)) {
- var len = value.length;
- if (Animation._isArrayLike(value[0])) {
- var ret = [];
- for (var i = 0; i < len; i++) {
- ret.push(arraySlice.call(value[i]));
- }
- return ret;
- } else {
- return arraySlice.call(value);
- }
- } else {
- return value;
- }
- }
- }, {
- key: "rgba2String",
- value: function rgba2String(rgba) {
- rgba[0] = Math.floor(rgba[0]);
- rgba[1] = Math.floor(rgba[1]);
- rgba[2] = Math.floor(rgba[2]);
- return 'rgba(' + rgba.join(',') + ')';
- }
- }]);
- return Animation;
- }(Eventful);
- /**
- * @class SuperMap.LevelRenderer.Animation.Animator
- */
- var Animator = /*#__PURE__*/function () {
- /**
- * @function SuperMap.LevelRenderer.Animation.Animator.prototype.animate
- * @description 构造函数
- * @param {Object} target - 目标对象。
- * @param {Object} options - 动画参数选项。
- * @param {boolean} [loop=false] - 是否循环播放动画。
- * @param {function} [getterl] - 如果指定getter函数,会通过getter函数取属性值。
- * @param {function} [setter] - 如果指定setter函数,会通过setter函数设置属性值。
- */
- function Animator(target, loop, getter, setter) {
- Animation_classCallCheck(this, Animator);
- /**
- * @member {Object} SuperMap.LevelRenderer.Animation.Animator.prototype._tracks
- * @description _tracks。
- */
- this._tracks = {};
- /**
- * @member {Object} SuperMap.LevelRenderer.Animation.Animator.prototype._target
- * @description _target。
- */
- this._target = target;
- /**
- * @member {boolean} SuperMap.LevelRenderer.Animation.Animator.prototype._loop
- * @description _loop。
- */
- this._loop = loop || false;
- /**
- * @member {function} SuperMap.LevelRenderer.Animation.Animator.prototype._getter
- * @description _getter。
- */
- this._getter = getter || _defaultGetter;
- /**
- * @member {function} SuperMap.LevelRenderer.Animation.Animator.prototype._setter
- * @description _setter。
- */
- this._setter = setter || _defaultSetter;
- /**
- * @member {number} SuperMap.LevelRenderer.Animation.Animator.prototype._clipCount
- * @description _clipCount。
- */
- this._clipCount = 0;
- /**
- * @member {number} SuperMap.LevelRenderer.Animation.Animator.prototype._delay
- * @description _delay。
- */
- this._delay = 0;
- /**
- * @member {Array} SuperMap.LevelRenderer.Animation.Animator.prototype._doneList
- * @description _doneList。
- */
- this._doneList = [];
- /**
- * @member {Array} SuperMap.LevelRenderer.Animation.Animator.prototype._onframeList
- * @description _onframeList。
- */
- this._onframeList = [];
- /**
- * @member {Array} SuperMap.LevelRenderer.Animation.Animator.prototype._clipList
- * @description _clipList。
- */
- this._clipList = [];
- this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.Animator"; //Function
- function _defaultGetter(target, key) {
- return target[key];
- }
- function _defaultSetter(target, key, value) {
- target[key] = value;
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.Animator.prototype.when
- * @description 设置动画关键帧
- * @param {number} time - 关键帧时间,单位是ms
- * @param {Object} props - 关键帧的属性值,key-value表示
- * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator
- */
- Animation_createClass(Animator, [{
- key: "when",
- value: function when(time
- /* ms */
- , props) {
- for (var propName in props) {
- if (!this._tracks[propName]) {
- this._tracks[propName] = []; // If time is 0
- // Then props is given initialize value
- // Else
- // Initialize value from current prop value
- if (time !== 0) {
- this._tracks[propName].push({
- time: 0,
- value: Animation._cloneValue(this._getter(this._target, propName))
- });
- }
- }
- this._tracks[propName].push({
- time: parseInt(time, 10),
- value: props[propName]
- });
- }
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.Animator.prototype.during
- * @description 添加动画每一帧的回调函数
- * @param {RequestCallback} callback - 回调函数
- * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator
- */
- }, {
- key: "during",
- value: function during(callback) {
- this._onframeList.push(callback);
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.Animator.prototype.start
- * @description 开始执行动画
- * @param {(string|function)} easing - 动画缓动函数。详见:<{@link SuperMap.LevelRenderer.Animation.easing}>。
- * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator
- */
- }, {
- key: "start",
- value: function start(easing) {
- var self = this;
- var setter = this._setter;
- var getter = this._getter;
- var onFrameListLen = self._onframeList.length;
- var useSpline = easing === 'spline';
- var ondestroy = function ondestroy() {
- self._clipCount--;
- if (self._clipCount === 0) {
- // Clear all tracks
- self._tracks = {};
- var len = self._doneList.length;
- for (var i = 0; i < len; i++) {
- self._doneList[i].call(self);
- }
- }
- };
- var createTrackClip = function createTrackClip(keyframes, propName) {
- var trackLen = keyframes.length;
- if (!trackLen) {
- return;
- } // Guess data type
- var firstVal = keyframes[0].value;
- var isValueArray = Animation._isArrayLike(firstVal);
- var isValueColor = false; // For vertices morphing
- var arrDim = isValueArray && Animation._isArrayLike(firstVal[0]) ? 2 : 1; // Sort keyframe as ascending
- keyframes.sort(function (a, b) {
- return a.time - b.time;
- });
- var trackMaxTime = keyframes[trackLen - 1].time; // Percents of each keyframe
- var kfPercents = []; // Value of each keyframe
- var kfValues = [];
- for (var _i5 = 0; _i5 < trackLen; _i5++) {
- kfPercents.push(keyframes[_i5].time / trackMaxTime); // Assume value is a color when it is a string
- var value = keyframes[_i5].value;
- if (typeof value == 'string') {
- value = SUtil_SUtil.Util_color.toArray(value);
- if (value.length === 0) {
- // Invalid color
- value[0] = value[1] = value[2] = 0;
- value[3] = 1;
- }
- isValueColor = true;
- }
- kfValues.push(value);
- } // Cache the key of last frame to speed up when
- // animation playback is sequency
- var cacheKey = 0;
- var cachePercent = 0;
- var start;
- var i;
- var w;
- var p0;
- var p1;
- var p2;
- var p3;
- if (isValueColor) {
- var rgba = [0, 0, 0, 0];
- }
- var onframe = function onframe(target, percent) {
- // Find the range keyframes
- // kf1-----kf2---------current--------kf3
- // find kf2 and kf3 and do interpolation
- if (percent < cachePercent) {
- // Start from next key
- start = Math.min(cacheKey + 1, trackLen - 1);
- for (i = start; i >= 0; i--) {
- if (kfPercents[i] <= percent) {
- break;
- }
- }
- i = Math.min(i, trackLen - 2);
- } else {
- for (i = cacheKey; i < trackLen; i++) {
- if (kfPercents[i] > percent) {
- break;
- }
- }
- i = Math.min(i - 1, trackLen - 2);
- }
- cacheKey = i;
- cachePercent = percent;
- var range = kfPercents[i + 1] - kfPercents[i];
- if (range === 0) {
- return;
- } else {
- w = (percent - kfPercents[i]) / range;
- }
- if (useSpline) {
- p1 = kfValues[i];
- p0 = kfValues[i === 0 ? i : i - 1];
- p2 = kfValues[i > trackLen - 2 ? trackLen - 1 : i + 1];
- p3 = kfValues[i > trackLen - 3 ? trackLen - 1 : i + 2];
- if (isValueArray) {
- Animation._catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, getter(target, propName), arrDim);
- } else {
- var _value;
- if (isValueColor) {
- // value = SuperMap.LevelRenderer.Animation._catmullRomInterpolateArray(
- // p0, p1, p2, p3, w, w * w, w * w * w,
- // rgba, 1
- // );
- _value = Animation.rgba2String(rgba);
- } else {
- _value = Animation._catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);
- }
- setter(target, propName, _value);
- }
- } else {
- if (isValueArray) {
- Animation._interpolateArray(kfValues[i], kfValues[i + 1], w, getter(target, propName), arrDim);
- } else {
- var _value2;
- if (isValueColor) {
- Animation._interpolateArray(kfValues[i], kfValues[i + 1], w, rgba, 1);
- _value2 = Animation.rgba2String(rgba);
- } else {
- _value2 = Animation._interpolateNumber(kfValues[i], kfValues[i + 1], w);
- }
- setter(target, propName, _value2);
- }
- }
- for (i = 0; i < onFrameListLen; i++) {
- self._onframeList[i](target, percent);
- }
- };
- var clip = new Clip({
- target: self._target,
- life: trackMaxTime,
- loop: self._loop,
- delay: self._delay,
- onframe: onframe,
- ondestroy: ondestroy
- });
- if (easing && easing !== 'spline') {
- clip.easing = easing;
- }
- self._clipList.push(clip);
- self._clipCount++;
- self.animation.add(clip);
- };
- for (var propName in this._tracks) {
- createTrackClip(this._tracks[propName], propName);
- }
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.Animator.prototype.stop
- * @description 停止动画
- */
- }, {
- key: "stop",
- value: function stop() {
- for (var i = 0; i < this._clipList.length; i++) {
- var clip = this._clipList[i];
- this.animation.remove(clip);
- }
- this._clipList = [];
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.Animator.prototype.delay
- * @description 设置动画延迟开始的时间
- * @param {number} time - 时间,单位ms
- * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator
- */
- }, {
- key: "delay",
- value: function delay(time) {
- this._delay = time;
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Animation.Animator.prototype.done
- * @description 添加动画结束的回调
- * @param {function} cb - Function
- * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator
- */
- }, {
- key: "done",
- value: function done(cb) {
- if (cb) {
- this._doneList.push(cb);
- }
- return this;
- }
- }]);
- return Animator;
- }();
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Render.js
- function Render_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Render_createClass(Constructor, protoProps, staticProps) { if (protoProps) Render_defineProperties(Constructor.prototype, protoProps); if (staticProps) Render_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Render
- * @category Visualization Theme
- * @classdesc Render 接口类,对外可用的所有接口都在这里。内部使用非 get 接口统一返回 this 对象,支持链式调用。
- */
- var Render = /*#__PURE__*/function () {
- /**
- * @function SuperMap.LevelRenderer.Render.constructor
- * @description 构造函数。
- *
- * @param {string} id - 唯一标识。
- * @param {HTMLElement} dom - Dom 对象。
- */
- function Render(id, dom) {
- Render_classCallCheck(this, Render);
- /**
- * @member {string} SuperMap.LevelRenderer.Render.prototype.id
- * @description 唯一标识。
- */
- this.id = id;
- /**
- * @member {SuperMap.LevelRenderer.Storage} SuperMap.LevelRenderer.Render.prototype.storage
- * @description 图形仓库对象。
- */
- this.storage = new Storage();
- /**
- * @member {SuperMap.LevelRenderer.Painter} SuperMap.LevelRenderer.Render.prototype.painter
- * @description 绘制器对象。
- *
- */
- this.painter = new Painter(dom, this.storage);
- /**
- * @member {SuperMap.LevelRenderer.Handler} SuperMap.LevelRenderer.Render.prototype.handler
- * @description 事件处理对象。
- *
- */
- this.handler = new Handler(dom, this.storage, this.painter);
- /**
- * @member {Array} SuperMap.LevelRenderer.Render.prototype.animatingElements
- * @description 动画控制数组。
- *
- */
- this.animatingElements = [];
- /**
- * @member {SuperMap.LevelRenderer.animation.Animation} SuperMap.LevelRenderer.Render.prototype.animation
- * @description 动画对象。
- *
- */
- this.animation = new Animation({
- stage: {
- update: Render.getFrameCallback(this)
- }
- });
- /**
- * @member {boolean} SuperMap.LevelRenderer.Render.prototype._needsRefreshNextFrame
- * @description 是否需要刷新下一帧。
- *
- */
- this._needsRefreshNextFrame = false;
- this.animation.start();
- this.CLASS_NAME = "SuperMap.LevelRenderer.Render";
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.destory
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- Render_createClass(Render, [{
- key: "destroy",
- value: function destroy() {
- this.id = null;
- this.storage = null;
- this.painter = null;
- this.handler = null;
- this.animatingElements = null;
- this.animation = null;
- this._needsRefreshNextFrame = null;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.getId
- * @description 获取实例唯一标识。
- * @return {string} 实例唯一标识。
- */
- }, {
- key: "getId",
- value: function getId() {
- return this.id;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.addShape
- * @description 添加图形形状到根节点。
- *
- * @param {SuperMap.LevelRenderer.Shape} shape - 图形对象,可用属性全集,详见各 shape。
- * @return {SuperMap.LevelRenderer.Render} this。
- */
- }, {
- key: "addShape",
- value: function addShape(shape) {
- this.storage.addRoot(shape);
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.addGroup
- * @description 添加组到根节点。
- *
- * (code)
- * //添加组到根节点例子
- * var render = new SuperMap.LevelRenderer.Render("Render",document.getElementById('lRendertest'));
- * render.clear();
- * var g = new SuperMap.LevelRenderer.Group();
- * g.addChild(new SuperMap.LevelRenderer.Shape.Circle({
- * style: {
- * x: 100,
- * y: 100,
- * r: 20,
- * brushType: 'fill'
- * }
- * }));
- * render.addGroup(g);
- * render.render();
- * (end)
- *
- * @param {SuperMap.LevelRenderer.Group} group - 组对象。
- * @return {SuperMap.LevelRenderer.Render} this。
- */
- }, {
- key: "addGroup",
- value: function addGroup(group) {
- this.storage.addRoot(group);
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.delShape
- * @description 从根节点删除图形形状。
- *
- * @param {string} shapeId - 图形对象唯一标识。
- * @return {SuperMap.LevelRenderer.Render} this。
- */
- }, {
- key: "delShape",
- value: function delShape(shapeId) {
- this.storage.delRoot(shapeId);
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.delGroup
- * @description 从根节点删除组。
- *
- * @param {string} groupId - 组对象唯一标识。
- * @return {SuperMap.LevelRenderer.Render} this。
- */
- }, {
- key: "delGroup",
- value: function delGroup(groupId) {
- this.storage.delRoot(groupId);
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.modShape
- * @description 修改图形形状。
- *
- * @param {string} shapeId - 图形对象唯一标识。
- * @param {SuperMap.LevelRenderer.Shape} shape - 图形对象。
- * @return {SuperMap.LevelRenderer.Render} this。
- */
- }, {
- key: "modShape",
- value: function modShape(shapeId, shape) {
- this.storage.mod(shapeId, shape);
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.modGroup
- * @description 修改组。
- *
- * @param {string} groupId - 组对象唯一标识。
- * @param {SuperMap.LevelRenderer.Group} group - 组对象。
- * @return {SuperMap.LevelRenderer.Render} this。
- */
- }, {
- key: "modGroup",
- value: function modGroup(groupId, group) {
- this.storage.mod(groupId, group);
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.modLayer
- * @description 修改指定 zlevel 的绘制配置项。
- *
- * @param {string} zLevel - 组对象唯一标识。
- * @param {Object} config - 配置对象。
- * @param {string} clearColor - 每次清空画布的颜色。默认值:0。
- * @param {noolean} motionBlur - 是否开启动态模糊。默认值:false。
- * @param {number} lastFrameAlpha - 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显。默认值:0.7。
- * @param {Array.<number>} position - 层的平移。
- * @param {Array.<number>} rotation - 层的旋转。
- * @param {Array.<number>} scale - 层的缩放。
- * @param {boolean} zoomable - 层是否支持鼠标缩放操作。默认值:false。
- * @param {boolean} panable - 层是否支持鼠标平移操作。默认值:false。
- * @return {SuperMap.LevelRenderer.Render} this。
- */
- }, {
- key: "modLayer",
- value: function modLayer(zLevel, config) {
- this.painter.modLayer(zLevel, config);
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.addHoverShape
- * @description 添加额外高亮层显示,仅提供添加方法,每次刷新后高亮层图形均被清空。
- *
- * @param {SuperMap.LevelRenderer.Shape} shape - 图形对象。
- * @return {SuperMap.LevelRenderer.Render} this。
- */
- }, {
- key: "addHoverShape",
- value: function addHoverShape(shape) {
- this.storage.addHover(shape);
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.render
- * @description 渲染。
- *
- * @callback {Function} callback - 渲染结束后回调函数。
- * @return {SuperMap.LevelRenderer.Render} this。
- */
- }, {
- key: "render",
- value: function render(callback) {
- this.painter.render(callback);
- this._needsRefreshNextFrame = false;
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.refresh
- * @description 视图更新。
- *
- * @callback {Function} callback - 视图更新后回调函数。
- * @return {SuperMap.LevelRenderer.Render} this。
- */
- }, {
- key: "refresh",
- value: function refresh(callback) {
- this.painter.refresh(callback);
- this._needsRefreshNextFrame = false;
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.refreshNextFrame
- * @description 标记视图在浏览器下一帧需要绘制。
- * @return {SuperMap.LevelRenderer.Render} this。
- */
- }, {
- key: "refreshNextFrame",
- value: function refreshNextFrame() {
- this._needsRefreshNextFrame = true;
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.refreshHover
- * @description 绘制(视图更新)高亮层。
- * @callback {Function} callback - 视图更新后回调函数。
- * @return {SuperMap.LevelRenderer.Render} this。
- */
- }, {
- key: "refreshHover",
- value: function refreshHover(callback) {
- this.painter.refreshHover(callback);
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.refreshShapes
- * @description 视图更新。
- *
- * @param {Array.<SuperMap.LevelRenderer.Shape>} shapeList - 需要更新的图形列表。
- * @callback {Function} callback - 视图更新后回调函数。
- * @return {SuperMap.LevelRenderer.Render} this。
- */
- }, {
- key: "refreshShapes",
- value: function refreshShapes(shapeList, callback) {
- this.painter.refreshShapes(shapeList, callback);
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.resize
- * @description 调整视图大小。
- * @return {SuperMap.LevelRenderer.Render} this。
- */
- }, {
- key: "resize",
- value: function resize() {
- this.painter.resize();
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.animate
- * @description 动画。
- *
- * @example
- * zr.animate(circle.id, 'style', false)
- * .when(1000, {x: 10} )
- * .done(function(){ // Animation done })
- * .start()
- *
- *
- * @param {Array.<(SuperMap.LevelRenderer.Shape/SuperMap.LevelRenderer.Group)>} el - 动画对象。
- * @param {string} path - 需要添加动画的属性获取路径,可以通过 a.b.c 来获取深层的属性。若传入对象为<SuperMap.LevelRenderer.Group>,path需为空字符串。
- * @param {Function} loop - 动画是否循环。
- * @return {SuperMap.LevelRenderer.animation.Animator} Animator。
- */
- }, {
- key: "animate",
- value: function animate(el, path, loop) {
- if (typeof el === 'string') {
- el = this.storage.get(el);
- }
- if (el) {
- var target;
- if (path) {
- var pathSplitted = path.split('.');
- var prop = el;
- for (var i = 0, l = pathSplitted.length; i < l; i++) {
- if (!prop) {
- continue;
- }
- prop = prop[pathSplitted[i]];
- }
- if (prop) {
- target = prop;
- }
- } else {
- target = el;
- }
- if (!target) {
- SUtil_SUtil.Util_log('Property "' + path + '" is not existed in element ' + el.id);
- return;
- }
- var animatingElements = this.animatingElements;
- if (typeof el.__aniCount === 'undefined') {
- // 正在进行的动画记数
- el.__aniCount = 0;
- }
- if (el.__aniCount === 0) {
- animatingElements.push(el);
- }
- el.__aniCount++;
- return this.animation.animate(target, {
- loop: loop
- }).done(function () {
- el.__aniCount--;
- if (el.__aniCount === 0) {
- // 从animatingElements里移除
- var idx = new Util_Util().indexOf(animatingElements, el);
- animatingElements.splice(idx, 1);
- }
- });
- } else {
- SUtil_SUtil.Util_log('Element not existed');
- }
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.clearAnimation
- * @description 停止所有动画。
- *
- */
- }, {
- key: "clearAnimation",
- value: function clearAnimation() {
- this.animation.clear();
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.getWidth
- * @description 获取视图宽度。
- * @return {number} 视图宽度。
- */
- }, {
- key: "getWidth",
- value: function getWidth() {
- return this.painter.getWidth();
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.getHeight
- * @description 获取视图高度。
- * @return {number} 视图高度。
- */
- }, {
- key: "getHeight",
- value: function getHeight() {
- return this.painter.getHeight();
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.toDataURL
- * @description 图像导出。
- *
- * @param {string} type - 类型。
- * @param {string} backgroundColor - 背景色,默认值:"#FFFFFF"。
- * @param {string} args - 参数。
- * @return {string} 图片的 Base64 url。
- */
- }, {
- key: "toDataURL",
- value: function toDataURL(type, backgroundColor, args) {
- return this.painter.toDataURL(type, backgroundColor, args);
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.shapeToImage
- * @description 将常规 shape 转成 image shape。
- *
- * @param {SuperMap.LevelRenderer.Shape} e - 图形。
- * @param {number} width - 宽度。
- * @param {number} height - 高度。
- * @return {Object} image shape。
- */
- }, {
- key: "shapeToImage",
- value: function shapeToImage(e, width, height) {
- var id = Util.createUniqueID("SuperMap.LevelRenderer.ToImage_");
- return this.painter.shapeToImage(id, e, width, height);
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.on
- * @description 事件绑定。
- *
- * @param {string} eventName - 事件名称。
- * @param {Function} eventHandler - 响应函数。
- * @return {SuperMap.LevelRenderer.Render} this。
- */
- }, {
- key: "on",
- value: function on(eventName, eventHandler) {
- this.handler.on(eventName, eventHandler);
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.un
- * @description 事件解绑定,参数为空则解绑所有自定义事件。
- *
- * @param {string} eventName - 事件名称。
- * @param {Function} eventHandler - 响应函数。
- * @return {SuperMap.LevelRenderer.Render} this。
- */
- }, {
- key: "un",
- value: function un(eventName, eventHandler) {
- this.handler.un(eventName, eventHandler);
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.trigger
- * @description 事件触发。
- *
- * @param {string} eventName - 事件名称,resize,hover,drag,etc。
- * @param {event} event - event dom事件对象。
- * @return {SuperMap.LevelRenderer.Render} this。
- */
- }, {
- key: "trigger",
- value: function trigger(eventName, event) {
- this.handler.trigger(eventName, event);
- this.handler.dispatch(eventName, event);
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.clear
- * @description 清除当前 Render 下所有类图的数据和显示,clear 后 MVC 和已绑定事件均还存在在,Render 可用。
- * @return {SuperMap.LevelRenderer.Render} this。
- */
- }, {
- key: "clear",
- value: function clear() {
- this.storage.delRoot();
- this.painter.clear();
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.dispose
- * @description 释放当前 Render 实例(删除包括 dom,数据、显示和事件绑定),dispose后 Render 不可用。
- */
- }, {
- key: "dispose",
- value: function dispose() {
- this.animation.stop();
- this.clear();
- this.storage.dispose();
- this.painter.dispose();
- this.handler.dispose();
- this.animation = null;
- this.animatingElements = null;
- this.storage = null;
- this.painter = null;
- this.handler = null; // 释放后告诉全局删除对自己的索引,没想到啥好方法
- // zrender.delInstance(this.id);
- } // SMIC-方法扩展 - start
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.updateHoverShapes
- * @description 更新设置显示高亮图层。
- *
- * @param {Array.<SuperMap.LevelRenderer.Shape>} shapes - 图形数组。
- * @return {SuperMap.LevelRenderer.Render} this。
- */
- }, {
- key: "updateHoverShapes",
- value: function updateHoverShapes(shapes) {
- this.painter.updateHoverLayer(shapes);
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.getAllShapes
- * @description 获取所有图形。
- * @return {Array.<SuperMap.LevelRenderer.Shape>} 图形数组。
- */
- }, {
- key: "getAllShapes",
- value: function getAllShapes() {
- return this.storage._shapeList;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.clearAll
- * @description 清除高亮和图形图层。
- * @return {SuperMap.LevelRenderer.Render} this。
- */
- }, {
- key: "clearAll",
- value: function clearAll() {
- this.clear();
- this.painter.clearHover();
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.Render.prototype.getHoverOne
- * @description 获取单个高亮图形,当前鼠标对应。
- * @return {SuperMap.LevelRenderer.Shape} 高亮图形。
- */
- }, {
- key: "getHoverOne",
- value: function getHoverOne() {
- return this.handler.getLastHoverOne();
- }
- }], [{
- key: "getFrameCallback",
- value: function getFrameCallback(renderInstance) {
- return function () {
- var animatingElements = renderInstance.animatingElements; //animatingElements instanceof Array 临时解决 destory 报错
- if (animatingElements instanceof Array) {
- for (var i = 0, l = animatingElements.length; i < l; i++) {
- renderInstance.storage.mod(animatingElements[i].id);
- }
- if (animatingElements.length || renderInstance._needsRefreshNextFrame) {
- renderInstance.refresh();
- }
- }
- };
- } // SMIC-方法扩展 - end
- }]);
- return Render;
- }();
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/LevelRenderer.js
- function LevelRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function LevelRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) LevelRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) LevelRenderer_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.LevelRenderer
- * @category Visualization Theme
- * @classdesc LevelRenderer 渲染器
- * @private
- */
- var LevelRenderer = /*#__PURE__*/function () {
- /**
- * @function SuperMap.LevelRenderer.constructor
- * @description 构造函数。
- * @example
- * //在渲染器上加上图形
- * var levelRenderer = new SuperMap.LevelRenderer();
- * var zr = levelRenderer.init(document.getElementById('lRendertest'));
- * zr.clear();
- * zr.addShape(new SuperMap.LevelRenderer.Shape.Circle({
- * style:{
- * x : 100,
- * y : 100,
- * r : 50,
- * brushType: 'fill'
- * }
- * }));
- * zr.render();
- */
- function LevelRenderer() {
- LevelRenderer_classCallCheck(this, LevelRenderer);
- /**
- * @member {Object} SuperMap.LevelRenderer.prototype._instances
- * @description LevelRenderer 实例 map 索引
- */
- LevelRenderer._instances = {}; // 工具
- LevelRenderer.Tool = {};
- /**
- * @member {string} SuperMap.LevelRenderer.prototype.version
- * @description 版本。zRender(Baidu)的版本号
- * 记录当前 LevelRenderer 是在 zRender 的那个版本上构建而来。
- * 在每次完整评判和实施由 zRender(Baidu)升级带来的 LevelRenderer 升级后修改。
- */
- this.version = '2.0.4';
- this.CLASS_NAME = "SuperMap.LevelRenderer";
- }
- /**
- * @function SuperMap.LevelRenderer.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为null。
- */
- LevelRenderer_createClass(LevelRenderer, [{
- key: "destroy",
- value: function destroy() {
- this.dispose();
- this.version = null;
- }
- /**
- * @function SuperMap.LevelRenderer.prototype.init
- * @description 创建 LevelRenderer 实例。
- * @param {HTMLElement} dom - 绘图容器。
- * @returns {SuperMap.LevelRenderer} LevelRenderer 实例。
- */
- }, {
- key: "init",
- value: function init(dom) {
- var zr = new Render(Util.createUniqueID("LRenderer_"), dom);
- LevelRenderer._instances[zr.id] = zr;
- return zr;
- }
- /**
- * @function SuperMap.LevelRenderer.prototype.dispose
- * @description LevelRenderer 实例销毁。
- * 可以通过 zrender.dispose(zr) 销毁指定 SuperMap.LevelRenderer.Render 实例。
- * 也可以通过 zr.dispose() 直接销毁
- * @param {SuperMap.LevelRenderer.Render} zr - ZRender对象,不传此参数则销毁全部。
- * @returns {SuperMap.LevelRenderer} this。
- */
- }, {
- key: "dispose",
- value: function dispose(zr) {
- if (zr) {
- zr.dispose();
- this.delInstance(zr.id);
- } else {
- for (var key in LevelRenderer._instances) {
- LevelRenderer._instances[key].dispose();
- }
- LevelRenderer._instances = {};
- }
- return this;
- }
- /**
- * @function SuperMap.LevelRenderer.prototype.getInstance
- * @description 获取 SuperMap.LevelRenderer.Render 实例。
- * @param {string} id - ZRender对象索引。
- * @returns {SuperMap.LevelRenderer.Render} SuperMap.LevelRenderer.Render 实例。
- */
- }, {
- key: "getInstance",
- value: function getInstance(id) {
- return LevelRenderer._instances[id];
- }
- /**
- * @function SuperMap.LevelRenderer.prototype.delInstance
- * @description 删除 zrender 实例,SuperMap.LevelRenderer.Render 实例 dispose 时会调用,删除后 getInstance 则返回 undefined
- * @param {string} id - ZRender对象索引。
- * @param {string} id - SuperMap.LevelRenderer.Render 对象索引。
- * @returns {SuperMap.LevelRenderer} this。
- */
- }, {
- key: "delInstance",
- value: function delInstance(id) {
- delete LevelRenderer._instances[id];
- return this;
- }
- }]);
- return LevelRenderer;
- }();
- SuperMap.LevelRenderer = LevelRenderer;
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicEllipse.js
- 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); }
- function SmicEllipse_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SmicEllipse_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicEllipse_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicEllipse_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SmicEllipse_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicEllipse_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SmicEllipse_setPrototypeOf(o, p) { SmicEllipse_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicEllipse_setPrototypeOf(o, p); }
- 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); }; }
- function SmicEllipse_possibleConstructorReturn(self, call) { if (call && (SmicEllipse_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicEllipse_assertThisInitialized(self); }
- function SmicEllipse_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SmicEllipse_getPrototypeOf(o) { SmicEllipse_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicEllipse_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Shape.SmicEllipse
- * @category Visualization Theme
- * @classdesc 椭圆。
- * @extends SuperMap.LevelRenderer.Shape
- * @example
- * var shape = new SuperMap.LevelRenderer.Shape.SmicEllipse({
- * style: {
- * x: 100,
- * y: 100,
- * a: 40,
- * b: 20,
- * brushType: 'both',
- * color: 'blue',
- * strokeColor: 'red',
- * lineWidth: 3,
- * text: 'SmicEllipse'
- * }
- * });
- * levelRenderer.addShape(shape);
- *
- *
- */
- var SmicEllipse = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
- SmicEllipse_inherits(SmicEllipse, _Shape);
- var _super = SmicEllipse_createSuper(SmicEllipse);
- /**
- * @member {Object} SuperMap.LevelRenderer.Shape.SmicEllipse.style
- * @description 绘制样式。
- *
- * @param {number} style.x - 圆心 x 坐标,必设参数。
- * @param {number} style.y - 圆心 y 坐标,必设参数。
- * @param {number} style.a - 横轴半径,必设参数。
- * @param {number} style.b - 纵轴半径,必设参数。
- * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
- * @param {string} style.color - 填充颜色。默认值:"#000000'"。
- * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
- * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
- * @param {number} style.lineWidth - 描边宽度。默认值:1。
- * @param {number} style.opacity - 绘制透明度。默认值:1。
- * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
- * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
- * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
- * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
- * @param {string} style.text - 图形中的附加文本。默认值:""。
- * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
- * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
- * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
- * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
- * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
- */
- //打开接口 style
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicEllipse.constructor
- * @description 构造函数。
- *
- * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
- *
- */
- function SmicEllipse(options) {
- var _this;
- SmicEllipse_classCallCheck(this, SmicEllipse);
- _this = _super.call(this, options);
- /**
- * @member {string} SuperMap.LevelRenderer.Shape.SmicEllipse.prototype.type
- * @description 图形类型。
- */
- _this.type = 'smicellipse';
- if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
- _this.refOriginalPosition = [0, 0];
- }
- _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicEllipse";
- return _this;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicEllipse.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- SmicEllipse_createClass(SmicEllipse, [{
- key: "destroy",
- value: function destroy() {
- this.type = null;
- SmicEllipse_get(SmicEllipse_getPrototypeOf(SmicEllipse.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicEllipse.prototype.buildPath
- * @description 构建椭圆的 Path。
- *
- * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
- * @param {Object} style - style。
- *
- */
- }, {
- key: "buildPath",
- value: function buildPath(ctx, style) {
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- var k = 0.5522848;
- var x = style.x + __OP[0];
- var y = style.y + __OP[1];
- var a = style.a;
- var b = style.b;
- var ox = a * k; // 水平控制点偏移量
- var oy = b * k; // 垂直控制点偏移量
- // 从椭圆的左端点开始顺时针绘制四条三次贝塞尔曲线
- ctx.moveTo(x - a, y);
- ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);
- ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);
- ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);
- ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);
- ctx.closePath();
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicEllipse.prototype.getRect
- * @description 计算返回椭圆包围盒矩形
- *
- * @param {Object} style - style
- * @return {Object} 边框对象。包含属性:x,y,width,height。
- *
- */
- }, {
- key: "getRect",
- value: function getRect(style) {
- if (style.__rect) {
- return style.__rect;
- }
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- var lineWidth;
- if (style.brushType == 'stroke' || style.brushType == 'fill') {
- lineWidth = style.lineWidth || 1;
- } else {
- lineWidth = 0;
- }
- style.__rect = {
- x: Math.round(style.x + __OP[0] - style.a - lineWidth / 2),
- y: Math.round(style.x + __OP[1] - style.b - lineWidth / 2),
- width: style.a * 2 + lineWidth,
- height: style.b * 2 + lineWidth
- };
- return style.__rect;
- }
- }]);
- return SmicEllipse;
- }(Shape)));
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicIsogon.js
- 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); }
- function SmicIsogon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SmicIsogon_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicIsogon_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicIsogon_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SmicIsogon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicIsogon_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SmicIsogon_setPrototypeOf(o, p) { SmicIsogon_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicIsogon_setPrototypeOf(o, p); }
- 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); }; }
- function SmicIsogon_possibleConstructorReturn(self, call) { if (call && (SmicIsogon_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicIsogon_assertThisInitialized(self); }
- function SmicIsogon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SmicIsogon_getPrototypeOf(o) { SmicIsogon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicIsogon_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Shape.SmicIsogon
- * @category Visualization Theme
- * @classdesc 正多边形。
- * @extends SuperMap.LevelRenderer.Shape
- */
- var SmicIsogon = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
- SmicIsogon_inherits(SmicIsogon, _Shape);
- var _super = SmicIsogon_createSuper(SmicIsogon);
- /**
- * @member {Object} SuperMap.LevelRenderer.Shape.SmicIsogon.prototype.style
- * @description 绘制样式。
- *
- * @param {number} x - 正 n 边形外接圆心 x 坐标,必设参数。
- * @param {number} y - 正 n 边形外接圆心 y 坐标,必设参数。
- * @param {number} r - 正n边形外接圆半径,必设参数。
- * @param {number} n - 指明正几边形,必设参数(n>=3)。
- * @param {string} brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
- * @param {string} color - 填充颜色。默认值:"#000000'"。
- * @param {string} strokeColor - 描边颜色。默认值:"#000000'"。
- * @param {string} lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
- * @param {number} lineWidth - 描边宽度。默认值:1。
- * @param {number} opacity - 绘制透明度。默认值:1。
- * @param {number} shadowBlur - 阴影模糊度,大于0有效。默认值:0。
- * @param {number} shadowColor - 阴影颜色。默认值:"#000000'"。
- * @param {number} shadowOffsetX - 阴影横向偏移。默认值:0。
- * @param {number} shadowOffsetY - 阴影纵向偏移。默认值:0。
- * @param {string} text - 图形中的附加文本。默认值:""。
- * @param {string} textColor -文本颜色。默认值:"#000000'"。
- * @param {string} textFont - 附加文本样式。示例:'bold 18px verdana'。
- * @param {string} textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
- * @param {string} textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
- * @param {string} textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
- */
- //打开接口 style
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicIsogon.constructor
- * @description 构造函数。
- *
- * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
- *
- */
- function SmicIsogon(options) {
- var _this;
- SmicIsogon_classCallCheck(this, SmicIsogon);
- _this = _super.call(this, options);
- /**
- * @member {string} SuperMap.LevelRenderer.Shape.SmicIsogon.prototype.type
- * @description 图形类型。
- */
- _this.type = 'smicisogon';
- if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
- _this.refOriginalPosition = [0, 0];
- }
- _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicIsogon";
- return _this;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicIsogon.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- SmicIsogon_createClass(SmicIsogon, [{
- key: "destroy",
- value: function destroy() {
- this.type = null;
- SmicIsogon_get(SmicIsogon_getPrototypeOf(SmicIsogon.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicIsogon.prototype.buildPath
- * @description 创建n角星(n>=3)路径。
- *
- * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
- * @param {Object} style - style。
- *
- */
- }, {
- key: "buildPath",
- value: function buildPath(ctx, style) {
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- var sin = SUtil.Util_math.sin;
- var cos = SUtil.Util_math.cos;
- var PI = Math.PI;
- var n = style.n;
- if (!n || n < 2) {
- return;
- }
- var x = style.x + __OP[0];
- var y = style.y + __OP[1];
- var r = style.r;
- var dStep = 2 * PI / n;
- var deg = -PI / 2;
- var xStart = x + r * cos(deg);
- var yStart = y + r * sin(deg);
- deg += dStep; // 记录边界点,用于判断insight
- var pointList = style.pointList = [];
- pointList.push([xStart, yStart]);
- for (var i = 0, end = n - 1; i < end; i++) {
- pointList.push([x + r * cos(deg), y + r * sin(deg)]);
- deg += dStep;
- }
- pointList.push([xStart, yStart]); // 绘制
- ctx.moveTo(pointList[0][0], pointList[0][1]);
- for (var _i = 0; _i < pointList.length; _i++) {
- ctx.lineTo(pointList[_i][0], pointList[_i][1]);
- }
- ctx.closePath();
- return;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicIsogon.prototype.getRect
- * @description 计算返回正多边形的包围盒矩形。
- *
- * @param {Object} style - style
- * @return {Object} 边框对象。包含属性:x,y,width,height。
- */
- }, {
- key: "getRect",
- value: function getRect(style) {
- if (style.__rect) {
- return style.__rect;
- }
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- var lineWidth;
- if (style.brushType == 'stroke' || style.brushType == 'fill') {
- lineWidth = style.lineWidth || 1;
- } else {
- lineWidth = 0;
- }
- style.__rect = {
- x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
- y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
- width: style.r * 2 + lineWidth,
- height: style.r * 2 + lineWidth
- };
- return style.__rect;
- }
- }]);
- return SmicIsogon;
- }(Shape)));
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicRing.js
- 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); }
- function SmicRing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SmicRing_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicRing_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicRing_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SmicRing_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicRing_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SmicRing_setPrototypeOf(o, p) { SmicRing_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicRing_setPrototypeOf(o, p); }
- 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); }; }
- function SmicRing_possibleConstructorReturn(self, call) { if (call && (SmicRing_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicRing_assertThisInitialized(self); }
- function SmicRing_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SmicRing_getPrototypeOf(o) { SmicRing_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicRing_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Shape.SmicRing
- * @category Visualization Theme
- * @classdesc 圆环。
- * @extends SuperMap.LevelRenderer.Shape
- * @example
- * var shape = new SuperMap.LevelRenderer.Shape.SmicRing({
- * style: {
- * x: 100,
- * y: 100,
- * r0: 30,
- * r: 50
- * }
- * });
- * levelRenderer.addShape(shape);
- *
- */
- var SmicRing = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
- SmicRing_inherits(SmicRing, _Shape);
- var _super = SmicRing_createSuper(SmicRing);
- /**
- * @member {Object} SuperMap.LevelRenderer.Shape.SmicRing.prototype.style
- * @description 绘制样式。
- *
- * @param {number} x - 圆心 x 坐标,必设参数。
- * @param {number} y - 圆心 y 坐标,必设参数。
- * @param {number} r - 外圆半径,必设参数。
- * @param {number} r0 - 内圆半径,必设参数。
- * @param {string} brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
- * @param {string} color - 填充颜色。默认值:"#000000'"。
- * @param {string} strokeColor - 描边颜色。默认值:"#000000'"。
- * @param {string} lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
- * @param {number} lineWidth -描边宽度。默认值:1。
- * @param {number} opacity - 绘制透明度。默认值:1。
- * @param {number} shadowBlur - 阴影模糊度,大于0有效。默认值:0。
- * @param {number} shadowColor - 阴影颜色。默认值:"#000000'"。
- * @param {number} shadowOffsetX - 阴影横向偏移。默认值:0。
- * @param {number} shadowOffsetY - 阴影纵向偏移。默认值:0。
- * @param {string} text -图形中的附加文本。默认值:""。
- * @param {string} textColor - 文本颜色。默认值:"#000000'"。
- * @param {string} textFont - 附加文本样式。示例:'bold 18px verdana'。
- * @param {string} textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
- * @param {string} textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
- * @param {string} textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
- */
- //打开接口 style
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicRing.constructor
- * @description 构造函数。
- *
- * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
- */
- function SmicRing(options) {
- var _this;
- SmicRing_classCallCheck(this, SmicRing);
- _this = _super.call(this, options);
- /**
- * @member {string} SuperMap.LevelRenderer.Shape.SmicRing.prototype.type
- * @description 图形类型。
- */
- _this.type = 'smicring';
- if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
- _this.refOriginalPosition = [0, 0];
- }
- _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicRing";
- return _this;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicRing.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- SmicRing_createClass(SmicRing, [{
- key: "destroy",
- value: function destroy() {
- this.type = null;
- SmicRing_get(SmicRing_getPrototypeOf(SmicRing.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicRing.prototype.buildPath
- * @description 创建圆环路径。
- *
- * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
- * @param {Object} style - style。
- *
- */
- }, {
- key: "buildPath",
- value: function buildPath(ctx, style) {
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition; // 非零环绕填充优化
- ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r, 0, Math.PI * 2, false);
- ctx.moveTo(style.x + __OP[0] + style.r0, style.y + __OP[1]);
- ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r0, 0, Math.PI * 2, true);
- return;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicRing.prototype.getRect
- * @description 计算返回圆环包围盒矩阵
- *
- * @param {Object} style - style
- * @return {Object} 边框对象。包含属性:x,y,width,height。
- */
- }, {
- key: "getRect",
- value: function getRect(style) {
- if (style.__rect) {
- return style.__rect;
- }
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- var lineWidth;
- if (style.brushType == 'stroke' || style.brushType == 'fill') {
- lineWidth = style.lineWidth || 1;
- } else {
- lineWidth = 0;
- }
- style.__rect = {
- x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
- y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
- width: style.r * 2 + lineWidth,
- height: style.r * 2 + lineWidth
- };
- return style.__rect;
- }
- }]);
- return SmicRing;
- }(Shape)));
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicStar.js
- 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); }
- function SmicStar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function SmicStar_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicStar_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicStar_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function SmicStar_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicStar_getPrototypeOf(object); if (object === null) break; } return object; }
- 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); }
- function SmicStar_setPrototypeOf(o, p) { SmicStar_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicStar_setPrototypeOf(o, p); }
- 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); }; }
- function SmicStar_possibleConstructorReturn(self, call) { if (call && (SmicStar_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicStar_assertThisInitialized(self); }
- function SmicStar_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function SmicStar_getPrototypeOf(o) { SmicStar_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicStar_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @private
- * @class SuperMap.LevelRenderer.Shape.SmicStar
- * @category Visualization Theme
- * @classdesc n 角星(n>3)。
- * @extends SuperMap.LevelRenderer.Shape
- * @example
- * var shape = new SuperMap.LevelRenderer.Shape.SmicStar({
- * style: {
- * x: 200,
- * y: 100,
- * r: 150,
- * n: 5,
- * text: '五角星'
- * }
- * });
- * levelRenderer.addShape(shape);
- *
- *
- */
- var SmicStar = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
- SmicStar_inherits(SmicStar, _Shape);
- var _super = SmicStar_createSuper(SmicStar);
- /**
- * @member {Object} SuperMap.LevelRenderer.Shape.SmicStar.prototype.style
- * @description 绘制样式。
- *
- * @param {number} style.x - n 角星外接圆心 x 坐标,必设参数。
- * @param {number} style.y - n 角星外接圆心 y 坐标,必设参数。
- * @param {number} style.r - n 角星外接圆半径,必设参数。
- * @param {number} style.r0 - n 角星内部顶点(凹点)的外接圆半径。如果不指定此参数,则自动计算:取相隔外部顶点连线的交点作内部顶点。
- * @param {number} style.n -指明几角星,必设参数。
- * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
- * @param {string} style.color - 填充颜色。默认值:"#000000'"。
- * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
- * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
- * @param {number} style.lineWidth - 描边宽度。默认值:1。
- * @param {number} style.opacity - 绘制透明度。默认值:1。
- * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
- * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
- * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
- * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
- * @param {string} style.text - 图形中的附加文本。默认值:""。
- * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
- * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
- * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
- * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
- * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
- */
- //打开接口 style
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicStar.constructor
- * @description 构造函数。
- *
- * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
- *
- */
- function SmicStar(options) {
- var _this;
- SmicStar_classCallCheck(this, SmicStar);
- _this = _super.call(this, options);
- /**
- * @member {string} SuperMap.LevelRenderer.Shape.SmicStar.prototype.type
- * @description 图形类型。
- */
- _this.type = 'smicstar';
- if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
- _this.refOriginalPosition = [0, 0];
- }
- _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicStar";
- return _this;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicStar.prototype.destroy
- * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
- */
- SmicStar_createClass(SmicStar, [{
- key: "destroy",
- value: function destroy() {
- this.type = null;
- SmicStar_get(SmicStar_getPrototypeOf(SmicStar.prototype), "destroy", this).call(this);
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicStar.prototype.buildPath
- * @description 创建n 角星(n>3)路径。
- *
- * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
- * @param {Object} style - style。
- *
- */
- }, {
- key: "buildPath",
- value: function buildPath(ctx, style) {
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- var n = style.n;
- if (!n || n < 2) {
- return;
- }
- var sin = SUtil.Util_math.sin;
- var cos = SUtil.Util_math.cos;
- var PI = Math.PI;
- var x = style.x + __OP[0];
- var y = style.y + __OP[1];
- var r = style.r;
- var r0 = style.r0; // 如果未指定内部顶点外接圆半径,则自动计算
- if (r0 == null) {
- r0 = n > 4 // 相隔的外部顶点的连线的交点,
- // 被取为内部交点,以此计算r0
- ? r * cos(2 * PI / n) / cos(PI / n) // 二三四角星的特殊处理
- : r / 3;
- }
- var dStep = PI / n;
- var deg = -PI / 2;
- var xStart = x + r * cos(deg);
- var yStart = y + r * sin(deg);
- deg += dStep; // 记录边界点,用于判断inside
- var pointList = style.pointList = [];
- pointList.push([xStart, yStart]);
- for (var i = 0, end = n * 2 - 1, ri; i < end; i++) {
- ri = i % 2 === 0 ? r0 : r;
- pointList.push([x + ri * cos(deg), y + ri * sin(deg)]);
- deg += dStep;
- }
- pointList.push([xStart, yStart]); // 绘制
- ctx.moveTo(pointList[0][0], pointList[0][1]);
- for (var _i = 0; _i < pointList.length; _i++) {
- ctx.lineTo(pointList[_i][0], pointList[_i][1]);
- }
- ctx.closePath();
- return;
- }
- /**
- * @function SuperMap.LevelRenderer.Shape.SmicStar.prototype.getRect
- * @description 返回 n 角星包围盒矩形。
- *
- * @param {Object} style - style
- * @return {Object} 边框对象。包含属性:x,y,width,height。
- */
- }, {
- key: "getRect",
- value: function getRect(style) {
- if (style.__rect) {
- return style.__rect;
- }
- if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
- this.refOriginalPosition = [0, 0];
- }
- var __OP = this.refOriginalPosition;
- var lineWidth;
- if (style.brushType == 'stroke' || style.brushType == 'fill') {
- lineWidth = style.lineWidth || 1;
- } else {
- lineWidth = 0;
- }
- style.__rect = {
- x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
- y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
- width: style.r * 2 + lineWidth,
- height: style.r * 2 + lineWidth
- };
- return style.__rect;
- }
- }]);
- return SmicStar;
- }(Shape)));
- ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/common/overlay/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/common/components/CommonTypes.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * 该文件用于存储一些公用常量
- *
- */
- var FileTypes = {
- EXCEL: "EXCEL",
- CSV: "CSV",
- ISERVER: "ISERVER",
- GEOJSON: "GEOJSON",
- JSON: 'JSON'
- };
- var FileConfig = {
- fileMaxSize: 10 * 1024 * 1024
- };
- ;// CONCATENATED MODULE: ./src/common/components/openfile/FileModel.js
- function FileModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function FileModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) FileModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) FileModel_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.FileModel
- * @description 文件数据组件数据模型,用于存储一些文件数据或状态,todo 结构待完善
- * @category Components OpenFile
- * @private
- */
- var FileModel = /*#__PURE__*/function () {
- function FileModel(options) {
- FileModel_classCallCheck(this, FileModel);
- this.FileTypes = FileTypes;
- this.FileConfig = FileConfig;
- this.loadFileObject = options && options.loadFileObject ? options.loadFileObject : [];
- }
- /**
- * @function SuperMap.FileModel.prototype.set
- * @description 设置属性值
- * @param {string} key - 属性名称
- * @param {string|Object} value - 属性值
- */
- FileModel_createClass(FileModel, [{
- key: "set",
- value: function set(key, value) {
- this[key] = value;
- }
- /**
- * @function SuperMap.FileModel.prototype.get
- * @description 获取数据值
- * @param {string} key - 属性名称
- * @returns {string|Object} value - 返回属性值
- */
- }, {
- key: "get",
- value: function get(key) {
- return this[key];
- }
- }]);
- return FileModel;
- }();
- ;// CONCATENATED MODULE: ./src/common/components/messagebox/MessageBox.js
- function MessageBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function MessageBox_createClass(Constructor, protoProps, staticProps) { if (protoProps) MessageBox_defineProperties(Constructor.prototype, protoProps); if (staticProps) MessageBox_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Components.MessageBox
- * @version 9.1.1
- * @classdesc 组件信息提示框。
- * @category Components Common
- */
- var MessageBox = /*#__PURE__*/function () {
- function MessageBox() {
- MessageBox_classCallCheck(this, MessageBox);
- this._initView();
- }
- MessageBox_createClass(MessageBox, [{
- key: "_initView",
- value: function _initView() {
- //原生js形式
- var messageBoxContainer = document.createElement("div");
- messageBoxContainer.hidden = true;
- messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-orange"); //图标
- var iconContainer = document.createElement("div");
- iconContainer.setAttribute("class", "icon");
- this.icon = document.createElement("span");
- this.icon.setAttribute("class", "supermapol-icons-message-warning");
- iconContainer.appendChild(this.icon);
- messageBoxContainer.appendChild(iconContainer); //内容:
- var messageBox = document.createElement("div");
- messageBox.setAttribute("class", "component-messagebox");
- messageBox.innerHTML = "";
- messageBoxContainer.appendChild(messageBox);
- this.messageBox = messageBox; //关闭按钮
- var cancelContainer = document.createElement("div");
- cancelContainer.setAttribute("class", "component-messagebox__cancelbtncontainer");
- var cancelBtn = document.createElement("button");
- cancelBtn.setAttribute("class", "component-messagebox__cancelBtn");
- cancelBtn.innerHTML = "x";
- cancelBtn.onclick = this.closeView.bind(this);
- cancelContainer.appendChild(cancelBtn);
- messageBoxContainer.appendChild(cancelContainer);
- this.messageBoxContainer = messageBoxContainer;
- document.body.appendChild(this.messageBoxContainer);
- }
- /**
- * @function SuperMap.Components.MessageBox.prototype.closeView
- * @description 关闭提示框。
- */
- }, {
- key: "closeView",
- value: function closeView() {
- this.messageBoxContainer.hidden = true;
- }
- /**
- * @function SuperMap.Components.MessageBox.prototype.showView
- * @description 显示提示框。
- * @param {string} message - 提示框显示内容。
- * @param {string}[type="warring"] 提示框类型,如 "warring", "failure", "success"。
- */
- }, {
- key: "showView",
- value: function showView(message) {
- var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'warring';
- //设置提示框的样式:
- if (type === "success") {
- this.icon.setAttribute("class", "supermapol-icons-message-success");
- this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-green");
- } else if (type === "failure") {
- this.icon.setAttribute("class", "supermapol-icons-message-failure");
- this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-red");
- } else if (type === "warring") {
- this.icon.setAttribute("class", "supermapol-icons-message-warning");
- this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-orange");
- }
- this.messageBox.innerHTML = message;
- this.messageBoxContainer.hidden = false;
- }
- }]);
- return MessageBox;
- }();
- SuperMap.Components.MessageBox = MessageBox;
- ;// CONCATENATED MODULE: external "function(){try{return echarts}catch(e){return {}}}()"
- var external_function_try_return_echarts_catch_e_return_namespaceObject = function(){try{return echarts}catch(e){return {}}}();
- var external_function_try_return_echarts_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_echarts_catch_e_return_namespaceObject);
- ;// CONCATENATED MODULE: ./src/common/lang/Lang.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @name Lang
- * @memberOf SuperMap
- * @namespace
- * @category BaseTypes
- * @description 国际化的命名空间,包含多种语言和方法库来设置和获取当前的语言。
- */
- var Lang = {
- /**
- * @member {string} SuperMap.Lang.code
- * @description 当前所使用的语言类型。
- */
- code: null,
- /**
- * @member {string} [SuperMap.Lang.defaultCode='en-US']
- * @description 默认使用的语言类型。
- */
- defaultCode: "en-US",
- /**
- * @function SuperMap.Lang.getCode
- * @description 获取当前的语言代码。
- * @returns {string} 当前的语言代码。
- */
- getCode: function getCode() {
- if (!SuperMap.Lang.code) {
- SuperMap.Lang.setCode();
- }
- return SuperMap.Lang.code;
- },
- /**
- * @function SuperMap.Lang.setCode
- * @description 设置语言代码。
- * @param {string} code - 此参数遵循IETF规范。
- */
- setCode: function setCode() {
- var lang = this.getLanguageFromCookie();
- if (lang) {
- SuperMap.Lang.code = lang;
- return;
- }
- lang = SuperMap.Lang.defaultCode;
- if (navigator.appName === 'Netscape') {
- lang = navigator.language;
- } else {
- lang = navigator.browserLanguage;
- }
- if (lang.indexOf('zh') === 0) {
- lang = 'zh-CN';
- }
- if (lang.indexOf('en') === 0) {
- lang = 'en-US';
- }
- SuperMap.Lang.code = lang;
- },
- /**
- * @function SuperMap.Lang.getLanguageFromCookie
- * @description 从 cookie 中获取语言类型。
- */
- getLanguageFromCookie: function getLanguageFromCookie() {
- var name = 'language=';
- var ca = document.cookie.split(';');
- for (var i = 0; i < ca.length; i++) {
- var c = ca[i];
- while (c.charAt(0) === ' ') {
- c = c.substring(1);
- }
- if (c.indexOf(name) !== -1) {
- return c.substring(name.length, c.length);
- }
- }
- return "";
- },
- /**
- * @function SuperMap.Lang.i18n
- * @description 从当前语言字符串的字典查找 key。
- * @param {string} key - 字典中 i18n 字符串值的关键字。
- * @returns {string} 国际化的字符串。
- */
- i18n: function i18n(key) {
- var dictionary = SuperMap.Lang[SuperMap.Lang.getCode()];
- var message = dictionary && dictionary[key];
- if (!message) {
- // Message not found, fall back to message key
- message = key;
- }
- return message;
- }
- };
- SuperMap.Lang = Lang;
- SuperMap.i18n = SuperMap.Lang.i18n;
- ;// CONCATENATED MODULE: external "function(){try{return XLSX}catch(e){return {}}}()"
- var external_function_try_return_XLSX_catch_e_return_namespaceObject = function(){try{return XLSX}catch(e){return {}}}();
- var external_function_try_return_XLSX_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_XLSX_catch_e_return_namespaceObject);
- ;// CONCATENATED MODULE: ./src/common/components/util/FileReaderUtil.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Components.FileReaderUtil
- * @classdesc 组件读取文件工具类。
- * @version 9.1.1
- * @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(*, *=))}}
- */
- var FileReaderUtil = {
- rABS: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsBinaryString,
- rABF: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsArrayBuffer,
- rAT: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsText,
- /**
- * @function SuperMap.Components.FileReaderUtil.prototype.readFile
- * @description 读取文件
- * @param {string} fileType - 当前读取的文件类型
- *
- * @param {Object} file - 读取回来的文件内容对象
- * @param {function} success - 读取文件成功回调函数
- * @param {function} failed - 读取文件失败回调函数
- * @param {Object} context - 回调重定向对象
- */
- readFile: function readFile(fileType, file, success, failed, context) {
- if (FileTypes.JSON === fileType || FileTypes.GEOJSON === fileType) {
- this.readTextFile(file, success, failed, context);
- } else if (FileTypes.EXCEL === fileType || FileTypes.CSV === fileType) {
- this.readXLSXFile(file, success, failed, context);
- }
- },
- /**
- * 读取文本文件
- * @param file
- * @param success
- * @param failed
- * @param {Object} context - 回调重定向对象
- */
- readTextFile: function readTextFile(file, success, failed, context) {
- var reader = new FileReader();
- reader.onloadend = function (evt) {
- success && success.call(context, evt.target.result);
- };
- reader.onerror = function (error) {
- failed && failed.call(context, error);
- };
- this.rAT ? reader.readAsText(file.file, 'utf-8') : reader.readAsBinaryString(file.file);
- },
- /**
- * 读取excel或csv文件
- * @param file
- * @param success
- * @param failed
- * @param {Object} context - 回调重定向对象
- */
- readXLSXFile: function readXLSXFile(file, success, failed, context) {
- var reader = new FileReader();
- reader.onloadend = function (evt) {
- var xLSXData = new Uint8Array(evt.target.result);
- var workbook = external_function_try_return_XLSX_catch_e_return_default().read(xLSXData, {
- type: "array"
- });
- try {
- if (workbook && workbook.SheetNames && workbook.SheetNames.length > 0) {
- //暂时只读取第一个sheets的内容
- var sheetName = workbook.SheetNames[0];
- var xLSXCSVString = external_function_try_return_XLSX_catch_e_return_default().utils.sheet_to_csv(workbook.Sheets[sheetName]);
- success && success.call(context, xLSXCSVString);
- }
- } catch (error) {
- failed && failed.call(context, error);
- }
- };
- reader.onerror = function (error) {
- failed && failed.call(context, error);
- };
- this.rABF && reader.readAsArrayBuffer(file.file);
- },
- /**
- * @function SuperMap.Components.FileReaderUtil.prototype.processDataToGeoJson
- * @description 将读取回来得数据统一处理为 GeoJSON 格式
- * @param {string} type - 文件类型
- * @param {Object} data - 读取返回的数据对象
- * @param {function} success - 数据处理成功的回调
- * @param {function} failed - 数据处理失败的回调
- * @param {Object} context - 回调重定向对象
- * @returns {GeoJSONObject} 返回标准 GeoJSON 规范格式数据
- * @private
- */
- processDataToGeoJson: function processDataToGeoJson(type, data, success, failed, context) {
- var geojson = null;
- if (type === "EXCEL" || type === "CSV") {
- geojson = this.processExcelDataToGeoJson(data);
- success && success.call(context, geojson);
- } else if (type === 'JSON' || type === 'GEOJSON') {
- var result = data; //geojson、json未知,通过类容来判断
- if (typeof result === "string") {
- result = JSON.parse(result);
- }
- if (result.type === 'ISERVER') {
- geojson = result.data.recordsets[0].features;
- } else if (result.type === 'FeatureCollection') {
- //geojson
- geojson = result;
- } else {
- //不支持数据
- failed && failed.call(context, Lang.i18n('msg_dataInWrongGeoJSONFormat'));
- }
- success && success.call(context, geojson);
- } else {
- failed && failed.call(context, Lang.i18n('msg_dataInWrongFormat'));
- }
- },
- /**
- * @function SuperMap.Components.FileReaderUtil.prototype.processExcelDataToGeoJson
- * @description 表格文件数据处理
- * @param {Object} data - 读取的表格文件数据
- * @returns {GeoJSONObject} 返回标准 GeoJSON 规范格式数据
- * @private
- */
- processExcelDataToGeoJson: function processExcelDataToGeoJson(data) {
- //处理为对象格式转化
- var dataContent = this.string2Csv(data);
- var fieldCaptions = dataContent.colTitles; //位置属性处理
- var xfieldIndex = -1,
- yfieldIndex = -1;
- for (var i = 0, len = fieldCaptions.length; i < len; i++) {
- if (this.isXField(fieldCaptions[i])) {
- xfieldIndex = i;
- }
- if (this.isYField(fieldCaptions[i])) {
- yfieldIndex = i;
- }
- } // feature 构建后期支持坐标系 4326/3857
- var features = [];
- for (var _i = 0, _len = dataContent.rows.length; _i < _len; _i++) {
- var row = dataContent.rows[_i]; //if (featureFrom === "LonLat") {
- var x = Number(row[xfieldIndex]),
- y = Number(row[yfieldIndex]); //属性信息
- var attributes = {};
- for (var index in dataContent.colTitles) {
- var key = dataContent.colTitles[index];
- attributes[key] = dataContent.rows[_i][index];
- } //目前csv 只支持处理点,所以先生成点类型的 geojson
- var feature = {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [x, y]
- },
- "properties": attributes
- };
- features.push(feature);
- }
- return features;
- },
- /**
- * 判断是否地理X坐标
- * @param data
- */
- isXField: function isXField(data) {
- var lowerdata = data.toLowerCase();
- return lowerdata === "x" || lowerdata === "smx" || lowerdata === "jd" || lowerdata === "经度" || lowerdata === "东经" || lowerdata === "longitude" || lowerdata === "lot" || lowerdata === "lon" || lowerdata === "lng" || lowerdata === "x坐标";
- },
- /**
- * 判断是否地理Y坐标
- * @param data
- */
- isYField: function isYField(data) {
- var lowerdata = data.toLowerCase();
- return lowerdata === "y" || lowerdata === "smy" || lowerdata === "wd" || lowerdata === "纬度" || lowerdata === "北纬" || lowerdata === "latitude" || lowerdata === "lat" || lowerdata === "y坐标";
- },
- /**
- * 字符串转为dataEditor 支持的csv格式数据
- * @param string
- * @param withoutTitle
- */
- string2Csv: function string2Csv(string, withoutTitle) {
- // let rows = string.split('\r\n');
- var rows = string.split('\n');
- var result = {};
- if (!withoutTitle) {
- result["colTitles"] = rows[0].split(',');
- } else {
- result["colTitles"] = [];
- }
- result['rows'] = [];
- for (var i = withoutTitle ? 0 : 1; i < rows.length; i++) {
- rows[i] && result['rows'].push(rows[i].split(','));
- }
- return result;
- }
- };
- SuperMap.Components.FileReaderUtil = FileReaderUtil;
- ;// CONCATENATED MODULE: ./src/common/components/chart/ChartModel.js
- function ChartModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ChartModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartModel_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Components.ChartModel
- * @classdesc 图表组件数据模型
- * @private
- * @param {Object} datasets - 数据来源。
- * @category Components Chart
- * @fires SuperMap.Components.ChartModel#getdatafailed
- */
- var ChartModel = /*#__PURE__*/function () {
- function ChartModel(datasets) {
- ChartModel_classCallCheck(this, ChartModel);
- this.datasets = datasets;
- this.EVENT_TYPES = ['getdatafailed'];
- this.events = new Events(this, null, this.EVENT_TYPES);
- }
- /**
- * @private
- * @function SuperMap.Components.ChartModel.prototype.getDatasetInfo
- * @description 获得数据集数据。
- * @param {string} datasetUrl - 数据集资源地址。
- */
- ChartModel_createClass(ChartModel, [{
- key: "getDatasetInfo",
- value: function getDatasetInfo(success) {
- var datasetUrl = this.datasets.url;
- var me = this;
- FetchRequest.get(datasetUrl).then(function (response) {
- return response.json();
- }).then(function (results) {
- if (results.datasetInfo) {
- var datasetInfo = results.datasetInfo;
- me.datasetsInfo = {
- dataSourceName: datasetInfo.dataSourceName,
- datasetName: datasetInfo.name,
- mapName: results.name
- };
- success({
- result: me.datasetsInfo
- });
- }
- })["catch"](function (error) {
- console.log(error);
- me._fireFailedEvent(error);
- });
- }
- /**
- * @private
- * @function SuperMap.Components.ChartModel.prototype.getDataFeatures
- * @description 请求数据集的数据信息
- * @param {Object} results - 数据集信息。
- * @param {function} success - 成功回调函数。
- */
- }, {
- key: "getDataFeatures",
- value: function getDataFeatures(results, success) {
- var datasetsInfo = results.result;
- var getFeatureParam, getFeatureBySQLParams, getFeatureBySQLService;
- var params = {
- name: datasetsInfo.datasetName + '@' + datasetsInfo.dataSourceName
- };
- Object.assign(params, this.datasets.queryInfo);
- getFeatureParam = new SuperMap.FilterParameter(params);
- getFeatureBySQLParams = new SuperMap.GetFeaturesBySQLParameters({
- queryParameter: getFeatureParam,
- datasetNames: [datasetsInfo.dataSourceName + ':' + datasetsInfo.datasetName],
- fromIndex: 0,
- toIndex: 100000
- });
- getFeatureBySQLService = new SuperMap.GetFeaturesBySQLService(datasetsInfo.dataUrl, {
- eventListeners: {
- processCompleted: success,
- processFailed: function processFailed() {}
- }
- });
- getFeatureBySQLService.processAsync(getFeatureBySQLParams);
- }
- /**
- * @private
- * @function SuperMap.Components.ChartModel.prototype.getLayerFeatures
- * @description 请求图层要素的数据信息
- * @param {Object} results - 数据集信息。
- * @param {Callbacks} success - 成功回调函数。
- */
- }, {
- key: "getLayerFeatures",
- value: function getLayerFeatures(results, success) {
- var datasetsInfo = results.result;
- var queryParam, queryBySQLParams, queryBySQLService;
- var params = {
- name: datasetsInfo.mapName
- };
- Object.assign(params, this.datasets.queryInfo);
- queryParam = new SuperMap.FilterParameter(params);
- queryBySQLParams = new SuperMap.QueryBySQLParameters({
- queryParams: [queryParam],
- expectCount: 100000
- });
- queryBySQLService = new SuperMap.QueryBySQLService(datasetsInfo.dataUrl, {
- eventListeners: {
- processCompleted: success,
- processFailed: function processFailed() {}
- }
- });
- queryBySQLService.processAsync(queryBySQLParams);
- }
- /**
- * @private
- * @function SuperMap.Components.ChartModel.prototype.getDataInfoByIptl
- * @description 用dataId获取iportal的数据。
- * @param {Callbacks} success - getdatachart。
- *
- */
- }, {
- key: "getDataInfoByIptl",
- value: function getDataInfoByIptl(success) {
- // success是chart的回调
- this.getServiceInfo(this.datasets.url, success);
- }
- /**
- * @private
- * @function SuperMap.Components.ChartModel.prototype.getServiceInfo
- * @description 用iportal获取dataItemServices。
- * @param {String} url
- * @param {Callbacks} success - getdatachart。
- * */
- }, {
- key: "getServiceInfo",
- value: function getServiceInfo(url, success) {
- var me = this;
- FetchRequest.get(url, null, {
- withCredentials: this.datasets.withCredentials
- }).then(function (response) {
- return response.json();
- }).then(function (data) {
- if (data.succeed === false) {
- //请求失败
- me._fireFailedEvent(data);
- return;
- } // 是否有rest服务
- if (data.dataItemServices && data.dataItemServices.length > 0) {
- var dataItemServices = data.dataItemServices,
- resultData;
- dataItemServices.forEach(function (item) {
- // 如果有restdata并且发布成功,就请求restdata服务
- // 如果有restmap并且发布成功,就请求restmap服务
- // 其他情况就请求iportal/content.json
- if (item.serviceType === 'RESTDATA' && item.serviceStatus === 'PUBLISHED') {
- resultData = item;
- } else if (item.serviceType === 'RESTMAP' && item.serviceStatus === 'PUBLISHED') {
- resultData = item;
- } else {
- me.getDatafromContent(url, success);
- return;
- }
- }); // 如果有服务,获取数据源和数据集, 然后请求rest服务
- resultData && me.getDatafromRest(resultData.serviceType, resultData.address, success);
- } else {
- me.getDatafromContent(url, success);
- return;
- }
- })["catch"](function (error) {
- console.log(error);
- me._fireFailedEvent(error);
- });
- }
- /**
- * @private
- * @function SuperMap.Components.ChartModel.prototype.getDatafromURL
- * @description 用iportal获取数据。(通过固定的url来请求,但是不能请求工作空间的数据)
- * @param {String} url
- * @param {Callbacks} success - getdatachart。
- */
- }, {
- key: "getDatafromContent",
- value: function getDatafromContent(url, success) {
- var _this = this;
- // 成功回调传入的results
- var results = {
- result: {}
- },
- me = this;
- url += '/content.json?pageSize=9999999¤tPage=1'; // 获取图层数据
- FetchRequest.get(url, null, {
- withCredentials: this.datasets.withCredentials
- }).then(function (response) {
- return response.json();
- }).then(function (data) {
- if (data.succeed === false) {
- //请求失败
- me._fireFailedEvent(data);
- return;
- }
- if (data.type) {
- if (data.type === 'JSON' || data.type === 'GEOJSON') {
- // 将字符串转换成json
- data.content = JSON.parse(data.content.trim()); // 如果是json文件 data.content = {type:'fco', features},格式不固定
- if (!data.content.features) {
- //json格式解析失败
- console.log(Lang.i18n('msg_jsonResolveFiled'));
- return;
- }
- var features = _this._formatGeoJSON(data.content);
- results.result.features = {
- type: data.content.type,
- features: features
- };
- } else if (data.type === 'EXCEL' || data.type === 'CSV') {
- var _features = _this._excelData2Feature(data.content);
- results.result.features = {
- type: 'FeatureCollection',
- features: _features
- };
- }
- success(results, 'content');
- }
- }, this)["catch"](function (error) {
- console.log(error);
- me._fireFailedEvent(error);
- });
- }
- /**
- * @private
- * @function SuperMap.Components.ChartModel.prototype._getDataSource
- * @description 获取数据源名和数据集名。
- * @param {string} serviceType 服务类型
- * @param {string} address 地址
- * @param {Callbacks} success - getdatachart。
- * @return{array} [数据源名:数据集名]
- * @return{string} 图层名
- */
- }, {
- key: "getDatafromRest",
- value: function getDatafromRest(serviceType, address, success) {
- var me = this,
- withCredentials = this.datasets.withCredentials;
- if (serviceType === 'RESTDATA') {
- var url = "".concat(address, "/data/datasources"),
- sourceName,
- datasetName; // 请求获取数据源名
- FetchRequest.get(url, null, {
- withCredentials: withCredentials
- }).then(function (response) {
- return response.json();
- }).then(function (data) {
- sourceName = data.datasourceNames[0];
- url = "".concat(address, "/data/datasources/").concat(sourceName, "/datasets"); // 请求获取数据集名
- FetchRequest.get(url, null, {
- withCredentials: withCredentials
- }).then(function (response) {
- return response.json();
- }).then(function (data) {
- datasetName = data.datasetNames[0]; // 请求restdata服务
- me.getDatafromRestData("".concat(address, "/data"), [sourceName + ':' + datasetName], success);
- return [sourceName + ':' + datasetName];
- })["catch"](function (error) {
- me._fireFailedEvent(error);
- });
- })["catch"](function (error) {
- me._fireFailedEvent(error);
- });
- } else {
- // 如果是地图服务
- var _url = "".concat(address, "/maps"),
- mapName,
- layerName,
- path; // 请求获取地图名
- FetchRequest.get(_url, null, {
- withCredentials: withCredentials
- }).then(function (response) {
- return response.json();
- }).then(function (data) {
- mapName = data[0].name;
- path = data[0].path;
- _url = _url = "".concat(address, "/maps/").concat(mapName, "/layers"); // 请求获取图层名
- FetchRequest.get(_url, null, {
- withCredentials: withCredentials
- }).then(function (response) {
- return response.json();
- }).then(function (data) {
- layerName = data[0].subLayers.layers[0].caption; // 请求restmap服务
- me.getDatafromRestMap(layerName, path, success);
- return layerName;
- })["catch"](function (error) {
- me._fireFailedEvent(error);
- });
- })["catch"](function (error) {
- me._fireFailedEvent(error);
- });
- }
- }
- /**
- * @private
- * @function SuperMap.Components.ChartModel.prototype.getDatafromRestData
- * @description 请求restdata服务
- * @param {String} url
- * @param {Array<string>} dataSource [数据源名:数据集名]
- * @param {Callbacks} success - getdatachart。
- */
- }, {
- key: "getDatafromRestData",
- value: function getDatafromRestData(url, dataSource, success) {
- var me = this;
- this.datasets.queryInfo.attributeFilter = this.datasets.queryInfo.attributeFilter || 'SmID>0';
- this._getFeatureBySQL(url, dataSource, this.datasets.queryInfo, function (results) {
- // 此时的features已经处理成geojson了
- success(results, 'RESTDATA');
- }, function (error) {
- console.log(error);
- me._fireFailedEvent(error);
- });
- }
- /**
- * @private
- * @function SuperMap.Components.ChartModel.prototype.getDatafromRestMap
- * @description 请求restmap服务
- * @param {String} dataSource layerName
- * @param {String} path - map服务地址。
- * @param {Callbacks} success - getdatachart。
- */
- }, {
- key: "getDatafromRestMap",
- value: function getDatafromRestMap(dataSource, path, success) {
- var me = this;
- this.datasets.queryInfo.attributeFilter = this.datasets.queryInfo.attributeFilter || 'smid=1';
- this._queryFeatureBySQL(path, dataSource, this.datasets.queryInfo, null, null, function (results) {
- // let features = result.result.recordsets[0].features;
- success(results, 'RESTMAP');
- }, function (error) {
- console.log(error);
- me._fireFailedEvent(error);
- });
- }
- /**
- * @private
- * @function SuperMap.Components.ChartModel.prototype._getFeatureBySQL
- * @description 通过 sql 方式查询数据。
- */
- }, {
- key: "_getFeatureBySQL",
- value: function _getFeatureBySQL(url, datasetNames, queryInfo, _processCompleted, processFaild) {
- var getFeatureParam, getFeatureBySQLService, getFeatureBySQLParams;
- var params = {
- name: datasetNames.join().replace(':', '@')
- };
- Object.assign(params, queryInfo);
- getFeatureParam = new FilterParameter(params);
- getFeatureBySQLParams = new GetFeaturesBySQLParameters({
- queryParameter: getFeatureParam,
- datasetNames: datasetNames,
- fromIndex: 0,
- toIndex: 100000,
- returnContent: true
- });
- var options = {
- eventListeners: {
- processCompleted: function processCompleted(getFeaturesEventArgs) {
- _processCompleted && _processCompleted(getFeaturesEventArgs);
- },
- processFailed: function processFailed(e) {
- processFaild && processFaild(e);
- }
- }
- };
- getFeatureBySQLService = new GetFeaturesBySQLService(url, options);
- getFeatureBySQLService.processAsync(getFeatureBySQLParams);
- }
- /**
- * @private
- * @function SuperMap.Components.ChartModel.prototype._queryFeatureBySQL
- * @description 通过 sql 方式查询数据。
- */
- }, {
- key: "_queryFeatureBySQL",
- value: function _queryFeatureBySQL(url, layerName, queryInfo, fields, epsgCode, processCompleted, processFaild, startRecord, recordLength, onlyAttribute) {
- var queryParam, queryBySQLParams;
- var filterParams = {
- name: layerName
- };
- Object.assign(filterParams, queryInfo);
- queryParam = new FilterParameter(filterParams);
- if (fields) {
- queryParam.fields = fields;
- }
- var params = {
- queryParams: [queryParam]
- };
- if (onlyAttribute) {
- params.queryOption = QueryOption.ATTRIBUTE;
- }
- startRecord && (params.startRecord = startRecord);
- recordLength && (params.expectCount = recordLength);
- if (epsgCode) {
- params.prjCoordSys = {
- epsgCode: epsgCode
- };
- }
- queryBySQLParams = new QueryBySQLParameters(params);
- this._queryBySQL(url, queryBySQLParams, function (data) {
- data.type === 'processCompleted' ? processCompleted(data) : processFaild(data);
- });
- }
- /**
- * @function SuperMap.Components.ChartModel.prototype._queryBySQL
- * @description SQL 查询服务。
- * @param {SuperMap.QueryBySQLParameters} params - SQL 查询相关参数类。
- * @param {RequestCallback} callback - 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
- */
- }, {
- key: "_queryBySQL",
- value: function _queryBySQL(url, params, callback, resultFormat) {
- var me = this;
- var queryBySQLService = new QueryBySQLService(url, {
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- queryBySQLService.processAsync(params);
- }
- /**
- * @function SuperMap.Components.ChartModel.prototype._processFormat
- * @description 将数据转换成geojson。
- * @param {object} resultFormat - 返回结果集。
- * @return {object} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
- */
- }, {
- key: "_processFormat",
- value: function _processFormat(resultFormat) {
- return resultFormat ? resultFormat : DataFormat.GEOJSON;
- }
- /**
- * @private
- * @function SuperMap.Components.ChartModel.prototype._formatGeoJSON
- * @description 格式 GeoJSON。
- * @param {GeoJSON} data - GeoJSON 数据。
- */
- }, {
- key: "_formatGeoJSON",
- value: function _formatGeoJSON(data) {
- var features = data.features;
- features.forEach(function (row, index) {
- row.properties['index'] = index;
- });
- return features;
- }
- /**
- * @private
- * @description 将 csv 和 xls 文件内容转换成 geojson
- * @function SuperMap.Components.ChartModel.prototype._excelData2Feature
- * @param content 文件内容
- * @param layerInfo 图层信息
- * @returns {Array} feature的数组集合
- */
- }, {
- key: "_excelData2Feature",
- value: function _excelData2Feature(dataContent) {
- var fieldCaptions = dataContent.colTitles; //位置属性处理
- var xfieldIndex = -1,
- yfieldIndex = -1;
- for (var i = 0, len = fieldCaptions.length; i < len; i++) {
- if (FileReaderUtil.isXField(fieldCaptions[i])) {
- xfieldIndex = i;
- }
- if (FileReaderUtil.isYField(fieldCaptions[i])) {
- yfieldIndex = i;
- }
- } // feature 构建后期支持坐标系 4326/3857
- var features = [];
- for (var _i = 0, _len = dataContent.rows.length; _i < _len; _i++) {
- var row = dataContent.rows[_i];
- var x = Number(row[xfieldIndex]),
- y = Number(row[yfieldIndex]); //属性信息
- var attributes = {};
- for (var index in dataContent.colTitles) {
- var key = dataContent.colTitles[index];
- attributes[key] = dataContent.rows[_i][index];
- }
- attributes['index'] = _i + ''; //目前csv 只支持处理点,所以先生成点类型的 geojson
- var feature = {
- type: 'Feature',
- geometry: {
- type: 'Point',
- coordinates: [x, y]
- },
- properties: attributes
- };
- features.push(feature);
- }
- return features;
- }
- /**
- * @private
- * @description 请求数据失败的事件
- * @function SuperMap.Components.ChartModel.prototype._fireFailedEvent
- * @param {object} error 错误信息
- */
- }, {
- key: "_fireFailedEvent",
- value: function _fireFailedEvent(error) {
- var errorData = error ? {
- error: error,
- message: Lang.i18n('msg_getdatafailed')
- } : {
- message: Lang.i18n('msg_getdatafailed')
- };
- /**
- * @event SuperMap.Components.Chart#getdatafailed
- * @description 监听到获取数据失败事件后触发
- * @property {Object} error - 事件对象。
- */
- this.events.triggerEvent('getdatafailed', errorData);
- }
- }]);
- return ChartModel;
- }();
- ;// CONCATENATED MODULE: ./src/common/components/chart/ChartViewModel.js
- 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; } } }; }
- 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); }
- 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; }
- function ChartViewModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ChartViewModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartViewModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartViewModel_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Components.ChartViewModel
- * @classdesc 图表组件功能类
- * @category Components Chart
- * @version 10.0.0
- * @param {Object} options - 可选参数。
- * @param {string} options.type - 图表类型。
- * @param {SuperMap.Components.Chart.Datasets} options.datasets - 数据来源。
- * @param {Array.<Object>} options.chartOptions - 图表可选参数。
- * @param {Array.<Object>} options.chartOptions.xAxis - 图表X轴。
- * @param {string} options.chartOptions.xAxis.field - 图表X轴字段名。
- * @param {string} options.chartOptions.xAxis.name - 图表X轴名称。
- * @param {Array.<Object>} options.chartOptions.yAxis - 图表Y轴。
- * @param {string} options.chartOptions.yAxis.field - 图表Y轴字段名。
- * @param {string} options.chartOptions.yAxis.name - 图表Y轴名称。
- * @fires SuperMap.Components.ChartViewModel#getdatafailed
- */
- var ChartViewModel = /*#__PURE__*/function () {
- function ChartViewModel(options) {
- ChartViewModel_classCallCheck(this, ChartViewModel);
- this.datasets = options.datasets;
- this.xField = [];
- this.yField = [];
- this.grid = {
- top: "50px",
- bottom: "50px",
- left: "50px",
- right: "60px"
- };
- this.chartType = options.type || "bar";
- this._initXYField(options.chartOptions);
- this.EVENT_TYPES = ["getdatafailed"];
- this.events = new Events(this, null, this.EVENT_TYPES);
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype._initXYField
- * @description 初始化XY字段。
- * @private
- * @param {Object} chartOptions - options里的图表参数
- */
- ChartViewModel_createClass(ChartViewModel, [{
- key: "_initXYField",
- value: function _initXYField(chartOptions) {
- var me = this;
- if (chartOptions && chartOptions.length > 0) {
- chartOptions.forEach(function (option) {
- if (option.xAxis) {
- me.xField.push({
- field: option.xAxis.field,
- name: option.xAxis.name
- });
- }
- if (option.yAxis) {
- me.yField.push({
- field: option.yAxis.field,
- name: option.yAxis.name
- });
- }
- });
- }
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype.getDatasetInfo
- * @description 获得数据集数据。
- * @param {function} success - 成功回调函数
- */
- }, {
- key: "getDatasetInfo",
- value: function getDatasetInfo(success) {
- var _this = this;
- this.createChart = success;
- if (this.datasets && this._checkUrl(this.datasets.url)) {
- this.chartModel = new ChartModel(this.datasets);
- if (this.datasets.type === 'iServer') {
- this.chartModel.getDatasetInfo(this._getDatasetInfoSuccess.bind(this));
- } else if (this.datasets.type === 'iPortal') {
- this.chartModel.getDataInfoByIptl(this._getDataInfoSuccess.bind(this));
- }
- /**
- * @event SuperMap.Components.ChartViewModel#getdatafailed
- * @description 监听到获取数据失败事件后触发
- * @property {Object} error - 事件对象。
- */
- this.chartModel.events.on({
- "getdatafailed": function getdatafailed(error) {
- _this.events.triggerEvent("getdatafailed", error);
- }
- });
- }
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype._getDatasetInfoSuccess
- * @description 成功回调函数。
- * @private
- * @param {Object} results - 数据集信息
- */
- }, {
- key: "_getDatasetInfoSuccess",
- value: function _getDatasetInfoSuccess(results) {
- var datasetUrl = this.datasets.url; //判断服务为地图服务 或者 数据服务
- var restIndex = datasetUrl.indexOf("rest");
- if (restIndex > 0) {
- var index = datasetUrl.indexOf("/", restIndex + 5);
- var type = datasetUrl.substring(restIndex + 5, index);
- var dataUrl = datasetUrl.substring(0, restIndex + 4) + "/data";
- if (type === "maps") {
- var mapIndex = datasetUrl.indexOf("/", index + 1);
- var mapName = datasetUrl.substring(index + 1, mapIndex);
- dataUrl = datasetUrl.substring(0, restIndex + 4) + "/maps/" + mapName;
- results.result.dataUrl = dataUrl;
- this._getLayerFeatures(results);
- } else if (type === "data") {
- results.result.dataUrl = dataUrl;
- this._getDataFeatures(results);
- }
- }
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype._getDataInfoSuccess
- * @description 请求iportal数据成功之后的回调
- * @private
- */
- }, {
- key: "_getDataInfoSuccess",
- value: function _getDataInfoSuccess(results, type) {
- var me = this;
- if (type === 'RESTMAP') {
- me._getChartDatasFromLayer(results);
- } else {
- me._getChartDatas(results);
- }
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype._getDataFeatures
- * @description 请求数据集的数据信息
- * @private
- * @param {Object} results - 数据集信息
- */
- }, {
- key: "_getDataFeatures",
- value: function _getDataFeatures(results) {
- this.chartModel.getDataFeatures(results, this._getChartDatas.bind(this));
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype._getLayerFeatures
- * @description 请求图层的数据信息
- * @private
- * @param {Object} results - 数据集信息
- */
- }, {
- key: "_getLayerFeatures",
- value: function _getLayerFeatures(results) {
- this.chartModel.getLayerFeatures(results, this._getChartDatasFromLayer.bind(this));
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype._getChartDatas
- * @description 将请求回来的数据转换为图表所需的数据格式
- * @private
- * @param {Object} results - 数据要素信息
- */
- }, {
- key: "_getChartDatas",
- value: function _getChartDatas(results) {
- if (results) {
- // 数据来自restdata---results.result.features
- this.features = results.result.features;
- var features = this.features.features;
- var data = {};
- if (features.length) {
- var feature = features[0];
- var attrFields = [],
- itemTypes = [];
- for (var attr in feature.properties) {
- attrFields.push(attr);
- itemTypes.push(this._getDataType(feature.properties[attr]));
- }
- data = {
- features: features,
- fieldCaptions: attrFields,
- fieldTypes: itemTypes,
- fieldValues: []
- };
- for (var m in itemTypes) {
- var fieldValue = [];
- for (var j in features) {
- var _feature = features[j];
- var caption = data.fieldCaptions[m];
- var value = _feature.properties[caption];
- fieldValue.push(value);
- }
- data.fieldValues.push(fieldValue);
- }
- this.createChart(data);
- }
- }
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype._getChartDatasFromLayer
- * @description 将请求回来的数据转换为图表所需的数据格式
- * @private
- * @param {Object} results - 图层数据要素信息
- */
- }, {
- key: "_getChartDatasFromLayer",
- value: function _getChartDatasFromLayer(results) {
- if (results.result.recordsets) {
- var recordsets = results.result.recordsets[0];
- var features = recordsets.features.features;
- this.features = recordsets.features;
- var data = {};
- if (features.length) {
- data = {
- features: recordsets.features,
- fieldCaptions: recordsets.fieldCaptions,
- fieldTypes: recordsets.fieldTypes,
- fieldValues: []
- };
- for (var m in data.fieldCaptions) {
- var fieldValue = [];
- for (var j in features) {
- var feature = features[j];
- var caption = data.fieldCaptions[m];
- var value = feature.properties[caption];
- fieldValue.push(value);
- }
- data.fieldValues.push(fieldValue);
- }
- this.createChart(data);
- }
- }
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype._createChartOptions
- * @description 创建图表所需参数
- * @private
- * @param {Object} data - 图表数据
- */
- }, {
- key: "_createChartOptions",
- value: function _createChartOptions(data) {
- this.calculatedData = this._createChartDatas(data);
- return this.updateChartOptions(this.chartType);
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype.changeType
- * @description 改变图表类型
- * @param {string} type - 图表类型
- */
- }, {
- key: "changeType",
- value: function changeType(type) {
- if (type !== this.chartType) {
- this.chartType = type;
- return this.updateChartOptions(this.chartType);
- }
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype.updateData
- * @description 改变图表类型
- * @param {SuperMap.Components.Chart.Datasets} datasets - 数据来源
- * @param {function} success 成功回调函数
- */
- }, {
- key: "updateData",
- value: function updateData(datasets, chartOption, success) {
- this.updateChart = success;
- this.xField = [];
- this.yField = [];
- this._initXYField(chartOption); // type的设置默认值
- datasets.type = datasets.type || 'iServer'; // withCredentials的设置默认值
- datasets.withCredentials = datasets.withCredentials || false;
- this.datasets = datasets;
- this.getDatasetInfo(this._updateDataSuccess.bind(this));
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype._updateDataSuccess
- * @description 改变图表类型
- * @private
- * @param {Object} data - 图表数据
- */
- }, {
- key: "_updateDataSuccess",
- value: function _updateDataSuccess(data) {
- var options = this._createChartOptions(data);
- this.updateChart(options);
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype.updateChartOptions
- * @description 更新图表所需参数
- * @param {string} type - 图表类型
- * @param {Object} style - 图表样式
- */
- }, {
- key: "updateChartOptions",
- value: function updateChartOptions(type, style) {
- if (this.calculatedData) {
- var grid = this.grid;
- var series = this._createChartSeries(this.calculatedData, type);
- var datas = [];
- for (var i in this.calculatedData.XData) {
- datas.push({
- value: this.calculatedData.XData[i].fieldsData
- });
- }
- var xAxis = {
- type: "category",
- name: this.xField[0].name || "X",
- data: datas,
- nameTextStyle: {
- color: '#fff',
- fontSize: 14
- },
- splitLine: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#eee'
- }
- }
- };
- var yAxis = {
- type: "value",
- name: this.yFieldName || "Y",
- data: {},
- nameTextStyle: {
- color: '#fff',
- fontSize: 14
- },
- splitLine: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#eee'
- }
- }
- };
- var tooltip = {
- formatter: '{b0}: {c0}'
- };
- var backgroundColor = '#404a59';
- if (style) {
- if (style.grid) {
- grid = style.grid;
- }
- if (style.tooltip) {
- tooltip = style.tooltip;
- }
- if (style.backgroundColor) {
- backgroundColor = style.backgroundColor;
- }
- }
- return {
- backgroundColor: backgroundColor,
- grid: grid,
- series: series,
- xAxis: xAxis,
- yAxis: yAxis,
- tooltip: tooltip
- };
- }
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype._createChartDatas
- * @description 构建图表数据
- * @private
- * @param {Object} data - 源数据
- */
- }, {
- key: "_createChartDatas",
- value: function _createChartDatas(data) {
- var fieldIndex = 0,
- yfieldIndexs = [];
- var fieldCaptions = data.fieldCaptions;
- var me = this; //X
- fieldCaptions.forEach(function (field, index) {
- if (me.xField[0] && field === me.xField[0].field) {
- fieldIndex = index;
- }
- }); //Y
- this.yFieldName = "";
- this.yField.forEach(function (value, index) {
- if (index !== 0) {
- me.yFieldName = me.yFieldName + ",";
- }
- me.yFieldName = me.yFieldName + value.name;
- fieldCaptions.forEach(function (field, index) {
- if (field === value.field) {
- yfieldIndexs.push(index);
- }
- });
- });
- var datas = this._getAttrData(data, fieldIndex);
- var yDatas = [];
- if (yfieldIndexs.length > 0) {
- yfieldIndexs.forEach(function (yfieldIndex) {
- var yData = [];
- for (var i in data.fieldValues[yfieldIndex]) {
- yData.push({
- value: data.fieldValues[yfieldIndex][i]
- });
- }
- yDatas.push(yData);
- });
- } else {
- //未指定Y字段时,y轴计数
- var YData = [],
- XData = [],
- len = datas.length; //计算X轴,Y轴数据,并去重
- for (var i = 0; i < len; i++) {
- var isSame = false;
- for (var j = 0, leng = XData.length; j < leng; j++) {
- if (datas[i].fieldsData === XData[j].fieldsData) {
- YData[j].value++;
- XData[j].recordIndexs.push(i);
- isSame = true;
- break;
- }
- }
- if (!isSame) {
- if (datas[i].fieldsData) {
- XData.push({
- fieldsData: datas[i].fieldsData,
- recordIndexs: [i]
- });
- YData.push({
- value: 1
- });
- }
- }
- }
- datas = XData;
- yDatas = [YData];
- }
- return {
- XData: datas,
- YData: yDatas
- };
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype._getAttrData
- * @description 选中字段数据
- * @private
- * @param {Object} datacontent - 图表数据
- * @param {number} index - 字段索引
- */
- }, {
- key: "_getAttrData",
- value: function _getAttrData(datacontent, index) {
- if (index === 0) {
- this.xField = [{
- field: datacontent.fieldCaptions[index],
- name: datacontent.fieldCaptions[index]
- }];
- }
- var fieldsDatas = [];
- for (var i = 0, len = datacontent.fieldValues[index].length; i < len; i++) {
- var value = datacontent.fieldValues[index][i];
- fieldsDatas.push({
- recordIndexs: i,
- fieldsData: value
- });
- }
- return fieldsDatas;
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype._createChartSeries
- * @description 图表数据
- * @private
- * @param {Object} calculatedData - 图表数据
- * @param {string} chartType - 图表类型
- */
- }, {
- key: "_createChartSeries",
- value: function _createChartSeries(calculatedData, chartType) {
- var series = [];
- var yDatas = calculatedData.YData;
- yDatas.forEach(function (yData) {
- var value = 0;
- var serieData = [];
- var _iterator = _createForOfIteratorHelper(yData),
- _step;
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- var data = _step.value;
- value = data.value;
- serieData.push({
- value: value
- });
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- var serie = {
- type: chartType,
- data: serieData,
- name: "y"
- };
- series.push(serie);
- });
- return series;
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype._isDate
- * @description 判断是否为日期
- * @private
- * @param {string} data - 字符串
- */
- }, {
- key: "_isDate",
- value: function _isDate(data) {
- 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;
- return reg.test(data);
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype._isNumber
- * @description 判断是否为数值
- * @private
- * @param {string} data - 字符串
- */
- }, {
- key: "_isNumber",
- value: function _isNumber(data) {
- var mdata = Number(data);
- if (mdata === 0) {
- return true;
- }
- return !isNaN(mdata);
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype._getDataType
- * @description 判断数据的类型
- * @private
- * @param {string} data - 字符串
- */
- }, {
- key: "_getDataType",
- value: function _getDataType(data) {
- if (data !== null && data !== undefined && data !== '') {
- if (this._isDate(data)) {
- return "DATE";
- }
- if (this._isNumber(data)) {
- return "NUMBER";
- }
- }
- return "STRING";
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype._checkUrl
- * @description 检查url是否符合要求
- * @private
- * @param {string} url
- */
- }, {
- key: "_checkUrl",
- value: function _checkUrl(url) {
- var match;
- if (url === '' || !this._isMatchUrl(url)) {
- match = false;
- } else if (/^http[s]?:\/\/localhost/.test(url) || /^http[s]?:\/\/127.0.0.1/.test(url)) {
- //不是实际域名
- match = false;
- } else {
- match = true;
- }
- return match;
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype._isMatchUrl
- * @description 判断输入的地址是否符合地址格式
- * @private
- * @param {string} str - url
- */
- }, {
- key: "_isMatchUrl",
- value: function _isMatchUrl(str) {
- var reg = new RegExp('(https?|http|file|ftp)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]');
- return reg.test(str);
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype.getStyle
- * @description 获取图表样式。
- */
- }, {
- key: "getStyle",
- value: function getStyle() {
- var style = {
- grid: this.grid,
- tooltip: this.tooltip,
- backgroundColor: this.backgroundColor
- };
- return style;
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype.getFeatures
- * @description 获取地图服务,数据服务请求返回的数据。
- */
- }, {
- key: "getFeatures",
- value: function getFeatures() {
- return this.features;
- }
- /**
- * @function SuperMap.Components.ChartViewModel.prototype.setStyle
- * @description 设置图表样式。
- * @param {Object} style - 图表样式
- */
- }, {
- key: "setStyle",
- value: function setStyle(style) {
- return this.updateChartOptions(this.chartType, style);
- }
- }]);
- return ChartViewModel;
- }();
- SuperMap.Components.ChartViewModel = ChartViewModel;
- ;// CONCATENATED MODULE: ./src/common/components/chart/ChartView.js
- function ChartView_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function ChartView_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartView_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartView_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Components.Chart
- * @classdesc 图表组件
- * @version 9.1.2
- * @param {string} domID - 图表dom元素ID。
- * @param {Object} options - 可选参数。
- * @param {string} options.type - 图表类型。
- * @param {SuperMap.Components.Chart.Datasets} options.datasets - 数据来源
- * @param {Array.<Object>} options.chartOptions - 图表可选参数。
- * @param {Array.<Object>} options.chartOptions.xAxis - 图表X轴。
- * @param {string} options.chartOptions.xAxis.field - 图表X轴字段名。
- * @param {string} options.chartOptions.xAxis.name - 图表X轴名称。
- * @param {Array.<Object>} options.chartOptions.yAxis - 图表Y轴。
- * @param {string} options.chartOptions.yAxis.field - 图表Y轴字段名。
- * @param {string} options.chartOptions.yAxis.name - 图表Y轴名称。
- * @category Components Chart
- */
- /**
- * @typedef {Object} SuperMap.Components.Chart.Datasets - 数据来源
- * @property {string} [type = 'iServer'] - 服务类型 iServer, iPortal。
- * @property {string} url - 服务url地址。
- * @property {boolean} [withCredentials = false] - 设置请求是否带cookie
- * @property {SuperMap.FilterParameter} queryInfo - 查询条件
- */
- var ChartView = /*#__PURE__*/function () {
- function ChartView(domID, options) {
- ChartView_classCallCheck(this, ChartView);
- this.domID = domID;
- this.chartType = options.type || "bar"; // 设置options.datasets.type的默认值是iServer
- options.datasets.type = options.datasets.type || 'iServer'; // 设置withCredentials的默认值为false
- options.datasets.withCredentials = options.datasets.withCredentials || false;
- this.viewModel = new ChartViewModel(options); //添加控件。
- this._fillDataToView();
- }
- /**
- * @function SuperMap.Components.Chart.prototype.onAdd
- * @description 创建图表之后成功回调
- * @param {function} addChart - 回调函数
- */
- ChartView_createClass(ChartView, [{
- key: "onAdd",
- value: function onAdd(addChart) {
- this.addChart = addChart;
- }
- /**
- * @function SuperMap.Components.Chart.prototype._fillDataToView
- * @description 填充数据到 view。
- * @private
- */
- }, {
- key: "_fillDataToView",
- value: function _fillDataToView() {
- var messageboxs = new MessageBox(); //iclient 绑定createChart事件成功回调
- this.viewModel.getDatasetInfo(this._createChart.bind(this));
- this.viewModel.events.on({
- "getdatafailed": function getdatafailed(error) {
- messageboxs.showView(error.message);
- }
- });
- }
- /**
- * @function SuperMap.Components.Chart.prototype.getStyle
- * @description 获取图表样式。
- */
- }, {
- key: "getStyle",
- value: function getStyle() {
- return this.viewModel.getStyle();
- }
- /**
- * @function SuperMap.Components.Chart.prototype.getFeatures
- * @description 获取地图服务,数据服务请求返回的数据。
- */
- }, {
- key: "getFeatures",
- value: function getFeatures() {
- return this.viewModel.getFeatures();
- }
- /**
- * @function SuperMap.Components.Chart.prototype.setStyle
- * @description 设置图表样式。
- * @param {Object} style - 图表样式 参考Echarts-options样式设置
- */
- }, {
- key: "setStyle",
- value: function setStyle(style) {
- var newOptions = this.viewModel.setStyle(style);
- this._updateChart(newOptions);
- }
- /**
- * @function SuperMap.Components.Chart.prototype.changeType
- * @description 改变图表类型
- * @param {string} type - 图表类型
- */
- }, {
- key: "changeType",
- value: function changeType(type) {
- if (this.chartType !== type) {
- this.chartType = type;
- var newOptions = this.viewModel.changeType(type);
- this._updateChart(newOptions);
- }
- }
- /**
- * @function SuperMap.Components.Chart.prototype.updateData
- * @description 更新图表数据
- * @param {SuperMap.Components.Chart.Datasets} datasets - 数据来源
- * @param {Object} chartOption - X,Y轴信息
- */
- }, {
- key: "updateData",
- value: function updateData(datasets, chartOption) {
- var me = this;
- this.viewModel.updateData(datasets, chartOption, function (options) {
- me._updateChart(options);
- if (me.addChart) {
- me.addChart();
- }
- });
- }
- /**
- * @function SuperMap.Components.Chart.prototype._createChart
- * @description 创建图表
- * @private
- * @param {Object} data - 图表数据
- */
- }, {
- key: "_createChart",
- value: function _createChart(data) {
- this.echart = external_function_try_return_echarts_catch_e_return_default().init(document.getElementById(this.domID), null, {
- renderer: "canvas"
- });
- var options = this.viewModel._createChartOptions(data);
- this.echart.setOption(options);
- if (this.addChart) {
- this.addChart();
- }
- }
- /**
- * @function SuperMap.Components.Chart.prototype._updateChart
- * @description 更新图表
- * @private
- * @param {Object} options - 图表参数
- */
- }, {
- key: "_updateChart",
- value: function _updateChart(options) {
- if (this.echart) {
- this.echart.clear();
- this.echart.setOption(options);
- }
- }
- }]);
- return ChartView;
- }();
- SuperMap.Components.Chart = ChartView;
- ;// CONCATENATED MODULE: ./src/common/components/templates/TemplateBase.js
- function TemplateBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function TemplateBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) TemplateBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) TemplateBase_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Components.TemplateBase
- * @classdesc 组件公用组件父类,用于约束统一封装的公用组件结构。
- * @version 9.1.1
- * @param {Object} options - 组件配置参数。
- * @param {string} options.id - 组件 dom 元素 id。
- * @category Components Common
- */
- var TemplateBase = /*#__PURE__*/function () {
- function TemplateBase(options) {
- TemplateBase_classCallCheck(this, TemplateBase);
- options = options ? options : {};
- /**
- * @member {string} [SuperMap.Components.TemplateBase.prototype.id=null]
- * @description 组件 dom 元素 id。
- */
- this.id = options.id ? options.id : null;
- /**
- * @member {Element} [SuperMap.Components.TemplateBase.prototype.rootContainer=null]
- * @description 组件 dom 元素对象。
- */
- this.rootContainer = null;
- }
- /**
- * @function SuperMap.Components.TemplateBase.prototype.getElement
- * @description 获取当前组件元素对象。
- * @return {Element}
- */
- TemplateBase_createClass(TemplateBase, [{
- key: "getElement",
- value: function getElement() {
- //todo 其实感觉再这里给组件设置不太合理
- if (this.id) {
- this.rootContainer.id = this.id;
- }
- return this.rootContainer;
- }
- /**
- * @function SuperMap.Components.TemplateBase.prototype._initView
- * @private
- * @description 初始化模板。
- */
- }, {
- key: "_initView",
- value: function _initView() {//子类实现此方法
- }
- /**
- * @function SuperMap.Components.TemplateBase.prototype.showView
- * @description 显示组件。
- */
- }, {
- key: "showView",
- value: function showView() {
- this.rootContainer.hidden = false;
- }
- /**
- * @function SuperMap.Components.TemplateBase.prototype.closeView
- * @description 隐藏组件。
- */
- }, {
- key: "closeView",
- value: function closeView() {
- this.rootContainer.hidden = true;
- }
- }]);
- return TemplateBase;
- }();
- SuperMap.Components.TemplateBase = TemplateBase;
- ;// CONCATENATED MODULE: ./src/common/components/templates/CommonContainer.js
- 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); }
- function CommonContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function CommonContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) CommonContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) CommonContainer_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function CommonContainer_setPrototypeOf(o, p) { CommonContainer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return CommonContainer_setPrototypeOf(o, p); }
- 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); }; }
- function CommonContainer_possibleConstructorReturn(self, call) { if (call && (CommonContainer_typeof(call) === "object" || typeof call === "function")) { return call; } return CommonContainer_assertThisInitialized(self); }
- function CommonContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function CommonContainer_getPrototypeOf(o) { CommonContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return CommonContainer_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Components.CommonContainer
- * @classdesc 组件统一外框。
- * @version 9.1.1
- * @param {Object} options - 组件可选参数。
- * @param {string} options.id - 组件 dom 元素 id。
- * @param {string} options.title - 标题。
- * @category Components Common
- * @extends {SuperMap.Components.TemplateBase}
- */
- var CommonContainer = /*#__PURE__*/function (_TemplateBase) {
- CommonContainer_inherits(CommonContainer, _TemplateBase);
- var _super = CommonContainer_createSuper(CommonContainer);
- function CommonContainer(options) {
- var _this;
- CommonContainer_classCallCheck(this, CommonContainer);
- _this = _super.call(this, options);
- var title = options.title ? options.title : "";
- _this._initView(title);
- return _this;
- }
- /**
- * @private
- * @override
- */
- CommonContainer_createClass(CommonContainer, [{
- key: "_initView",
- value: function _initView(title) {
- var container = document.createElement("div");
- container.setAttribute("class", "component-container"); //title
- var titleContainer = document.createElement("div");
- titleContainer.setAttribute("class", "component-title");
- var titleContent = document.createElement("div");
- titleContent.innerHTML = title;
- titleContainer.appendChild(titleContent);
- container.appendChild(titleContainer); //container
- var componentContent = document.createElement("div");
- componentContent.setAttribute("class", "component-content");
- container.appendChild(componentContent);
- this.content = componentContent;
- this.rootContainer = container;
- return container;
- }
- /**
- * @function SuperMap.Components.CommonContainer.prototype.getContentElement
- * @description 获取内容元素容器
- */
- }, {
- key: "getContentElement",
- value: function getContentElement() {
- return this.content;
- }
- /**
- * @function SuperMap.Components.CommonContainer.prototype.appendContent
- * @description 填充内容元素
- */
- }, {
- key: "appendContent",
- value: function appendContent(element) {
- this.content.appendChild(element);
- }
- }]);
- return CommonContainer;
- }(TemplateBase);
- SuperMap.Components.CommonContainer = CommonContainer;
- ;// CONCATENATED MODULE: ./src/common/components/templates/Select.js
- 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); }
- function Select_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function Select_createClass(Constructor, protoProps, staticProps) { if (protoProps) Select_defineProperties(Constructor.prototype, protoProps); if (staticProps) Select_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function Select_setPrototypeOf(o, p) { Select_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Select_setPrototypeOf(o, p); }
- 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); }; }
- function Select_possibleConstructorReturn(self, call) { if (call && (Select_typeof(call) === "object" || typeof call === "function")) { return call; } return Select_assertThisInitialized(self); }
- function Select_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function Select_getPrototypeOf(o) { Select_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Select_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Components.Select
- * @classdesc 组件统一的文字下拉框。
- * @version 9.1.1
- * @param {Array.<string|Array>} options - 需要创建的 Select 数据数组。
- * @param {string} options.id - 组件 dom 元素 id。
- * @param {string} [options.labelName] - label 名称。
- * @param {Array.<string>} options.optionsArr - 需要创建的 option 数据数组。
- * @param {Function} [options.optionsClickCb] - option 点击事件回调函数。
- * @extends {SuperMap.Components.TemplateBase}
- * @category Components Common
- */
- var Select = /*#__PURE__*/function (_TemplateBase) {
- Select_inherits(Select, _TemplateBase);
- var _super = Select_createSuper(Select);
- function Select(options) {
- var _this;
- Select_classCallCheck(this, Select);
- _this = _super.call(this, options);
- _this._initView(options);
- return _this;
- }
- Select_createClass(Select, [{
- key: "_initView",
- value: function _initView(options) {
- var selectTool = this._createElement('div', "component-selecttool");
- if (options.labelName) {
- var label = this._createElement('label', 'component-selecttool__lable--describe', selectTool);
- label.innerHTML = options.labelName;
- }
- var chartSelect = this._createElement('div', 'component-selecttool--chart', selectTool);
- chartSelect.setAttribute('tabindex', '1');
- var selectName = this._createElement('div', "component-selecttool__name", chartSelect);
- selectName.title = options.optionsArr[0];
- selectName.innerHTML = options.optionsArr[0];
- var chartTriangleBtn = this._createElement('div', 'component-selecttool__trianglebtn--chart', chartSelect);
- var triangleBtn = this._createElement('div', 'component-triangle-down-img', chartTriangleBtn);
- var selectContent = this._createElement('div', 'component-selecttool__content', chartSelect);
- var scrollarea = this._createElement('div', 'component-selecttool__content--chart', selectContent);
- var scrollareaContent = this._createElement('div', 'component-selecttool__scrollarea__content', scrollarea);
- scrollareaContent.setAttribute('tabindex', '1');
- this.createOptions(scrollareaContent, options.optionsArr);
- this.optionClickEvent(scrollareaContent, selectName, options.optionsClickCb); // 下拉框显示 & 隐藏事件
- this._selectClickEvent(chartSelect, selectContent, triangleBtn);
- this.rootContainer = selectTool;
- }
- /**
- * @function SuperMap.Components.Select.prototype.createOptions
- * @description 创建所属下拉框选项。
- */
- }, {
- key: "createOptions",
- value: function createOptions(container, optionsArr) {
- for (var i in optionsArr) {
- var option = this._createElement('div', 'component-selecttool__option', container);
- option.title = optionsArr[i];
- option.innerHTML = optionsArr[i];
- }
- }
- /**
- * @function SuperMap.Components.Select.prototype._selectClickEvent
- * @description select 点击显示&隐藏事件。
- * @private
- */
- }, {
- key: "_selectClickEvent",
- value: function _selectClickEvent(eventElement, contentElement, triangleBtn) {
- eventElement.onclick = function (e) {
- if (contentElement.style.display === "block") {
- contentElement.style.display = "none";
- triangleBtn.className = "component-triangle-down-img";
- } else {
- contentElement.style.display = "block";
- triangleBtn.className = "triangle-up-img";
- }
- e.preventDefault();
- e.stopPropagation();
- };
- eventElement.onmousedown = function (evt) {
- //console.log('dropdownbox onmousedown '+evt.target.className);
- if (evt.target !== this) {
- this.focus();
- evt.preventDefault();
- evt.stopPropagation();
- }
- };
- eventElement.onblur = function () {
- contentElement.style.display = "none";
- triangleBtn.className = "component-triangle-down-img";
- };
- }
- /**
- * @function Select.prototype._createElement
- * @description 通用创建元素。
- * @private
- */
- }, {
- key: "_createElement",
- value: function _createElement(tagName, className, parentEle) {
- var ele = document.createElement(tagName || 'div');
- className && (ele.className = className);
- parentEle && parentEle.appendChild(ele);
- return ele;
- }
- /**
- * @function SuperMap.Components.Select.prototype.optionClickEvent
- * @description 下拉框的 option 的点击事件。
- */
- }, {
- key: "optionClickEvent",
- value: function optionClickEvent(optionEleArr, selectNameEle, optionsClickCb) {
- var _loop = function _loop(i) {
- var childEle = optionEleArr.children[i];
- childEle.onclick = function () {
- selectNameEle.innerHTML = childEle.innerHTML;
- selectNameEle.title = childEle.title;
- if (childEle.getAttribute('data-value')) {
- selectNameEle.setAttribute('data-value', childEle.getAttribute('data-value'));
- }
- optionsClickCb && optionsClickCb(childEle);
- };
- };
- for (var i = 0; i < optionEleArr.children.length; i++) {
- _loop(i);
- }
- }
- }]);
- return Select;
- }(TemplateBase);
- SuperMap.Components.Select = Select;
- ;// CONCATENATED MODULE: ./src/common/components/templates/DropDownBox.js
- 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); }
- function DropDownBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function DropDownBox_createClass(Constructor, protoProps, staticProps) { if (protoProps) DropDownBox_defineProperties(Constructor.prototype, protoProps); if (staticProps) DropDownBox_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function DropDownBox_setPrototypeOf(o, p) { DropDownBox_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DropDownBox_setPrototypeOf(o, p); }
- 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); }; }
- function DropDownBox_possibleConstructorReturn(self, call) { if (call && (DropDownBox_typeof(call) === "object" || typeof call === "function")) { return call; } return DropDownBox_assertThisInitialized(self); }
- function DropDownBox_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function DropDownBox_getPrototypeOf(o) { DropDownBox_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DropDownBox_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Components.DropDownBox
- * @classdesc 组件统一的图片下拉框。
- * @version 9.1.1
- * @param {Array.<Object>} optionsArr - 需要创建的 option 数据数组。
- * @param {string} optionsArr.id - 组件 dom 元素 id。
- * @param {string} optionsArr.title - 下拉框 title。
- * @param {string} optionsArr.remark - 下拉框解释标记文本。
- * @param {string} optionsArr.icon - 下拉框图标。
- * @param {string} [optionsArr.dataValue] - 下拉框 attribute 名为 data-value 的值 。
- * @param {string} [optionsArr.icon.className] - 下拉框图标类名。
- * @param {string} [optionsArr.icon.background] - 下拉框图标背景 url。
- * @category Components Common
- * @extends {SuperMap.Components.TemplateBase}
- */
- var DropDownBox = /*#__PURE__*/function (_TemplateBase) {
- DropDownBox_inherits(DropDownBox, _TemplateBase);
- var _super = DropDownBox_createSuper(DropDownBox);
- function DropDownBox(optionsArr) {
- var _this;
- DropDownBox_classCallCheck(this, DropDownBox);
- _this = _super.call(this, optionsArr);
- _this._initView(optionsArr);
- return _this;
- }
- /**
- * @function SuperMap.Components.DropDownBox.prototype._initView
- * @description 初始化下拉框。
- * @private
- * @override
- */
- DropDownBox_createClass(DropDownBox, [{
- key: "_initView",
- value: function _initView(optionsArr) {
- var dropDownContainer = document.createElement('div');
- dropDownContainer.className = 'component-dropdownbox--container';
- var dropDownBox = document.createElement('div');
- dropDownBox.setAttribute('tabindex', '1');
- dropDownBox.className = "component-dropdownbox";
- dropDownContainer.appendChild(dropDownBox);
- var dropDownTopContainer = document.createElement('div');
- dropDownBox.appendChild(dropDownTopContainer);
- this._createDropDownOption(optionsArr[0], dropDownTopContainer);
- var triangleBtnContainer = document.createElement('div');
- triangleBtnContainer.className = 'component-dropdownbox__triangle-btn';
- dropDownBox.appendChild(triangleBtnContainer);
- var triangleBtn = document.createElement('div');
- triangleBtn.className = 'component-triangle-down-img';
- triangleBtnContainer.appendChild(triangleBtn);
- var createDropDownBoxParam = {
- "parentEle": dropDownBox,
- "dropDownContent": ['component-dropdownbox__content component-dropdownbox__content--chart', 'dropDownContent'],
- "scrollareaContent": 'component-selecttool__scrollarea__content',
- "optionsArr": optionsArr,
- "triangleBtn": triangleBtn,
- "dropDownTopContainer": dropDownTopContainer
- };
- this._createDropDownBox(createDropDownBoxParam);
- this.rootContainer = dropDownContainer;
- }
- /**
- * @function SuperMap.Components.DropDownBox.prototype._createDropDownBox
- * @description 创建下拉框。
- * @private
- */
- }, {
- key: "_createDropDownBox",
- value: function _createDropDownBox(createDropDownBoxParam) {
- var dropDownBox = createDropDownBoxParam.parentEle;
- var dropDownTopContainer = createDropDownBoxParam.dropDownTopContainer;
- var dropDownContent = document.createElement('div');
- dropDownContent.className = createDropDownBoxParam.dropDownContent[0];
- dropDownBox.appendChild(dropDownContent);
- var scrollareaContent = document.createElement('div');
- scrollareaContent.className = createDropDownBoxParam.scrollareaContent;
- dropDownContent.appendChild(scrollareaContent);
- var optionsArr = createDropDownBoxParam.optionsArr;
- for (var i = 0; i < optionsArr.length; i++) {
- this._createDropDownOption(optionsArr[i], scrollareaContent);
- } // 下拉框显示 & 隐藏事件
- var triangleBtn = createDropDownBoxParam.triangleBtn;
- this._dropDownClickEvent(dropDownBox, dropDownContent, triangleBtn);
- this._eleOnblur(dropDownBox, dropDownContent, triangleBtn); // 下拉框 options 点击事件
- var scrollareaOptions = scrollareaContent.children;
- var _loop = function _loop(_i) {
- scrollareaOptions[_i].onclick = function () {
- dropDownTopContainer.innerHTML = scrollareaOptions[_i].outerHTML; //evt.stopPropagation();
- };
- };
- for (var _i = 0; _i < scrollareaOptions.length; _i++) {
- _loop(_i);
- }
- }
- /**
- * @function SuperMap.Components.DropDownBox.prototype._createDropDownOption
- * @description 创建下拉框子元素。
- * @private
- */
- }, {
- key: "_createDropDownOption",
- value: function _createDropDownOption(data, parentElement) {
- var ele = document.createElement('div');
- ele.className = 'component-dropdownbox__item';
- var dataItem = data;
- if (dataItem['dataValue']) {
- ele.setAttribute('data-value', dataItem['dataValue']);
- }
- parentElement.appendChild(ele);
- var imgContainer = document.createElement('div');
- imgContainer.className = 'component-dropdownbox__item__img';
- ele.appendChild(imgContainer);
- var img = document.createElement('div');
- if (dataItem.icon.className) {
- img.className = dataItem.icon.className;
- }
- if (dataItem.icon.background) {
- img.style.background = dataItem.icon.background;
- }
- imgContainer.appendChild(img);
- var title = document.createElement('div');
- title.className = 'component-dropdownbox__item__title';
- title.title = dataItem.title;
- title.innerHTML = dataItem.title;
- ele.appendChild(title);
- var remark = document.createElement('div');
- remark.className = 'component-dropdownbox__item__remark';
- remark.title = dataItem.remark;
- remark.innerHTML = dataItem.remark;
- ele.appendChild(remark);
- }
- /**
- * @function SuperMap.Components.DropDownBox.prototype._dropDownClickEvent
- * @description 下拉框点击事件。
- * @private
- */
- }, {
- key: "_dropDownClickEvent",
- value: function _dropDownClickEvent(eventElement, contentElement, triangleBtn) {
- eventElement.onclick = function (e) {
- if (contentElement.style.display === "block") {
- contentElement.style.display = "none";
- triangleBtn.className = "component-triangle-down-img";
- } else {
- contentElement.style.display = "block";
- triangleBtn.className = "triangle-up-img";
- }
- e.preventDefault();
- e.stopPropagation();
- };
- eventElement.onmousedown = function (evt) {
- //console.log('dropdownbox onmousedown '+evt.target.className);
- if (evt.target !== this) {
- this.focus();
- evt.preventDefault();
- evt.stopPropagation();
- }
- };
- }
- /**
- * @function SuperMap.Components.DropDownBox.prototype._eleOnblur
- * @description 下拉框失焦事件。
- * @private
- */
- }, {
- key: "_eleOnblur",
- value: function _eleOnblur(eventElement, contentElement, triangleBtn) {
- eventElement.onblur = function () {
- contentElement.style.display = "none";
- triangleBtn.className = "component-triangle-down-img";
- };
- }
- /**
- * @function SuperMap.Components.DropDownBox.prototype._createElement
- * @description 通用创建元素。
- * @private
- */
- }, {
- key: "_createElement",
- value: function _createElement(tagName, className, parentEle) {
- var ele = document.createElement(tagName || 'div');
- className && (ele.className = className);
- parentEle && parentEle.appendChild(ele);
- return ele;
- }
- }]);
- return DropDownBox;
- }(TemplateBase);
- SuperMap.Components.DropDownBox = DropDownBox;
- ;// CONCATENATED MODULE: ./src/common/components/templates/PopContainer.js
- 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); }
- function PopContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function PopContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) PopContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) PopContainer_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function PopContainer_setPrototypeOf(o, p) { PopContainer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return PopContainer_setPrototypeOf(o, p); }
- 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); }; }
- function PopContainer_possibleConstructorReturn(self, call) { if (call && (PopContainer_typeof(call) === "object" || typeof call === "function")) { return call; } return PopContainer_assertThisInitialized(self); }
- function PopContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function PopContainer_getPrototypeOf(o) { PopContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PopContainer_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Components.PopContainer
- * @classdesc 弹框组件。
- * @version 9.1.1
- * @param {Object} options - 组件配置参数。
- * @param {string} options.id - 组件 dom 元素 id。
- * @param {string} options.title - 弹框组件名称。
- * @extends {SuperMap.Components.TemplateBase}
- * @category Components Common
- */
- var PopContainer = /*#__PURE__*/function (_TemplateBase) {
- PopContainer_inherits(PopContainer, _TemplateBase);
- var _super = PopContainer_createSuper(PopContainer);
- function PopContainer(options) {
- var _this;
- PopContainer_classCallCheck(this, PopContainer);
- options = options ? options : {};
- _this = _super.call(this, options);
- options.title = options.title ? options.title : "";
- _this._initView(options.title);
- return _this;
- }
- /**
- * @private
- * @override
- */
- PopContainer_createClass(PopContainer, [{
- key: "_initView",
- value: function _initView(titile) {
- var container = document.createElement("div");
- container.setAttribute("class", "component-popcontainer"); //header
- var header = document.createElement("div");
- header.setAttribute("class", "component-popcontainer__header");
- var title = document.createElement("label");
- title.setAttribute("class", "component-popcontainer__header__title");
- title.innerHTML = titile;
- header.appendChild(title);
- var closeBtn = document.createElement("span");
- closeBtn.setAttribute("class", "supermapol-icons-clear component-popcontainer__header__close");
- closeBtn.onclick = this.closeView.bind(this);
- container.appendChild(closeBtn);
- container.appendChild(header); //content
- var content = document.createElement("div");
- content.setAttribute("class", "component-popcontainer__content");
- this.content = content;
- container.appendChild(content);
- this.rootContainer = container;
- }
- /**
- * @function SuperMap.Components.PopContainer.prototype.appendContent
- * @description 追加内容。
- * @param {Element} dom - 内容元素。
- */
- }, {
- key: "appendContent",
- value: function appendContent(dom) {
- this.content.appendChild(dom);
- }
- }]);
- return PopContainer;
- }(TemplateBase);
- SuperMap.Components.PopContainer = PopContainer;
- ;// CONCATENATED MODULE: ./src/common/components/templates/AttributesPopContainer.js
- 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); }
- function AttributesPopContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function AttributesPopContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) AttributesPopContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) AttributesPopContainer_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function AttributesPopContainer_setPrototypeOf(o, p) { AttributesPopContainer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AttributesPopContainer_setPrototypeOf(o, p); }
- 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); }; }
- function AttributesPopContainer_possibleConstructorReturn(self, call) { if (call && (AttributesPopContainer_typeof(call) === "object" || typeof call === "function")) { return call; } return AttributesPopContainer_assertThisInitialized(self); }
- function AttributesPopContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function AttributesPopContainer_getPrototypeOf(o) { AttributesPopContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AttributesPopContainer_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Components.AttributesPopContainer
- * @classdesc 属性弹框组件
- * @version 9.1.1
- * @param {Object} options - 组件配置参数。
- * @param {string} options.id - 组件 dom 元素 id。
- * @param {Object} options.title - 属性弹框组件名称。
- * @param {Object} options.attributes - 组件需要显示的属性内容。
- * @extends {SuperMap.Components.PopContainer}
- * @category Components Common
- */
- var AttributesPopContainer = /*#__PURE__*/function (_PopContainer) {
- AttributesPopContainer_inherits(AttributesPopContainer, _PopContainer);
- var _super = AttributesPopContainer_createSuper(AttributesPopContainer);
- function AttributesPopContainer(options) {
- var _this;
- AttributesPopContainer_classCallCheck(this, AttributesPopContainer);
- //默认为属性:
- options.title = options.title ? options.title : "属性";
- _this = _super.call(this, options);
- _this.rootContainer.firstChild.hidden = true;
- options.attributes = options.attributes ? options.attributes : [];
- _this._createAttributesTable(options.attributes);
- return _this;
- }
- AttributesPopContainer_createClass(AttributesPopContainer, [{
- key: "_createAttributesTable",
- value: function _createAttributesTable(attributes) {
- var table = document.createElement("table");
- table.setAttribute("class", "component-popcontainer__content__table");
- var tbody = document.createElement("tbody");
- var single = true;
- for (var name in attributes) {
- var tr = document.createElement("tr");
- if (single) {
- tr.setAttribute("class", "component-popcontainer__content__td--color");
- }
- var title = document.createElement("td");
- var titleSpan = document.createElement("Span");
- titleSpan.innerHTML = name;
- title.appendChild(titleSpan);
- var value = document.createElement("td");
- value.innerHTML = attributes[name];
- tr.appendChild(title);
- tr.appendChild(value);
- tbody.appendChild(tr);
- single = !single;
- }
- table.appendChild(tbody);
- this.appendContent(table);
- }
- }]);
- return AttributesPopContainer;
- }(PopContainer);
- SuperMap.Components.AttributesPopContainer = AttributesPopContainer;
- ;// CONCATENATED MODULE: ./src/common/components/templates/IndexTabsPageContainer.js
- 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); }
- function IndexTabsPageContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function IndexTabsPageContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) IndexTabsPageContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) IndexTabsPageContainer_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function IndexTabsPageContainer_setPrototypeOf(o, p) { IndexTabsPageContainer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return IndexTabsPageContainer_setPrototypeOf(o, p); }
- 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); }; }
- function IndexTabsPageContainer_possibleConstructorReturn(self, call) { if (call && (IndexTabsPageContainer_typeof(call) === "object" || typeof call === "function")) { return call; } return IndexTabsPageContainer_assertThisInitialized(self); }
- function IndexTabsPageContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function IndexTabsPageContainer_getPrototypeOf(o) { IndexTabsPageContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return IndexTabsPageContainer_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Components.IndexTabsPageContainer
- * @description 标签索引组件。
- * @version 9.1.1
- * @param {Object} options - 可选参数。
- * @param {string} options.id - 组件 dom 元素 id。
- * @category Components Common
- * @extends {SuperMap.Components.TemplateBase}
- */
- var IndexTabsPageContainer = /*#__PURE__*/function (_TemplateBase) {
- IndexTabsPageContainer_inherits(IndexTabsPageContainer, _TemplateBase);
- var _super = IndexTabsPageContainer_createSuper(IndexTabsPageContainer);
- function IndexTabsPageContainer(options) {
- var _this;
- IndexTabsPageContainer_classCallCheck(this, IndexTabsPageContainer);
- _this = _super.call(this, options);
- _this._initView();
- return _this;
- }
- /**
- * @private
- * @override
- */
- IndexTabsPageContainer_createClass(IndexTabsPageContainer, [{
- key: "_initView",
- value: function _initView() {
- var container = document.createElement("div");
- container.setAttribute("class", "component-tabpage");
- var header = document.createElement("ul");
- this.header = header;
- var content = document.createElement("div");
- content.setAttribute("class", "component-tabpage__content");
- this.content = content;
- container.appendChild(header);
- container.appendChild(content);
- this.rootContainer = container;
- }
- /**
- * @function SuperMap.Components.IndexTabsPageContainer.prototype.setTabs
- * @description 设置标签元素。
- * @param {Array.<Element>} tabs
- */
- }, {
- key: "setTabs",
- value: function setTabs(tabs) {
- this.removeAllTabs();
- this.appendTabs(tabs);
- }
- /**
- * @function SuperMap.Components.IndexTabsPageContainer.prototype.appendTabs
- * @description 追加标签元素。
- * @param {Array.<Element>} tabs
- */
- }, {
- key: "appendTabs",
- value: function appendTabs(tabs) {
- for (var i = 0; i < tabs.length; i++) {
- var title = document.createElement("span");
- title.index = i;
- title.appendChild(document.createTextNode(tabs[i].title)); //绑定标签切换对应页面:
- title.onclick = this._changeTabsPage.bind(this);
- var content = tabs[i].content;
- content.index = i;
- content.hidden = true;
- this.header.appendChild(title);
- this.content.appendChild(content);
- } //todo 确认是否两个子元素的 index 相互对应
- //默认显示第一个标签对象
- this.header.firstChild.setAttribute("class", "on");
- this.content.firstChild.hidden = false;
- }
- /**
- * @function SuperMap.Components.IndexTabsPageContainer.prototype.removeTab
- * @description 删除某个标签页面。
- * @param {number} index - 标签索引号。
- */
- }, {
- key: "removeTab",
- value: function removeTab(index) {
- this.header.removeChild(this.header.children[index]);
- this.content.removeChild(this.content.children[index]);
- }
- /**
- * @function SuperMap.Components.IndexTabsPageContainer.prototype.removeAllTabs
- * @description 删除所有标签。
- */
- }, {
- key: "removeAllTabs",
- value: function removeAllTabs() {
- for (var i = this.header.children.length; i > 0; i--) {
- this.header.removeChild(this.header.children[i]);
- this.content.removeChild(this.content.children[i]);
- }
- }
- }, {
- key: "_changeTabsPage",
- value: function _changeTabsPage(e) {
- var index = e.target.index;
- for (var i = 0; i < this.header.children.length; i++) {
- this.header.children[i].setAttribute("class", "");
- this.content.children[i].hidden = true;
- if (i === index) {
- this.header.children[i].setAttribute("class", "on");
- this.content.children[i].hidden = false;
- }
- }
- }
- }]);
- return IndexTabsPageContainer;
- }(TemplateBase);
- SuperMap.Components.IndexTabsPageContainer = IndexTabsPageContainer;
- ;// CONCATENATED MODULE: ./src/common/components/templates/CityTabsPage.js
- 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); }
- function CityTabsPage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function CityTabsPage_createClass(Constructor, protoProps, staticProps) { if (protoProps) CityTabsPage_defineProperties(Constructor.prototype, protoProps); if (staticProps) CityTabsPage_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function CityTabsPage_setPrototypeOf(o, p) { CityTabsPage_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return CityTabsPage_setPrototypeOf(o, p); }
- 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); }; }
- function CityTabsPage_possibleConstructorReturn(self, call) { if (call && (CityTabsPage_typeof(call) === "object" || typeof call === "function")) { return call; } return CityTabsPage_assertThisInitialized(self); }
- function CityTabsPage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function CityTabsPage_getPrototypeOf(o) { CityTabsPage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return CityTabsPage_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Components.CityTabsPage
- * @classdesc 城市地址匹配组件模板
- * @version 9.1.1
- * @param {Object} options - 组件配置参数。
- * @param {string} options.id - 组件 dom 元素 id。
- * @param {Object|Array.<string>} options.config - 城市名称配置列表,支持两种格式:{key1:{A:[],B:[]}, key2:{C:[],D:[]}} 或
- * ["成都市","北京市"],用户可根据自己的项目需求进行配置
- * @extends {SuperMap.Components.IndexTabsPageContainer}
- * @category Components Common
- */
- var CityTabsPage = /*#__PURE__*/function (_IndexTabsPageContain) {
- CityTabsPage_inherits(CityTabsPage, _IndexTabsPageContain);
- var _super = CityTabsPage_createSuper(CityTabsPage);
- function CityTabsPage(options) {
- var _this;
- CityTabsPage_classCallCheck(this, CityTabsPage);
- _this = _super.call(this, options); //去掉默认的边框阴影样式:
- _this.rootContainer.classList.add("component-citytabpage--noneBoxShadow");
- _this.config = options.config; //header,若 config为城市名称数组,则直接加载内容
- if (Util.isArray(_this.config)) {
- _this.header.hidden = true;
- _this._createCityItem("城市", _this.config);
- _this.content.style.border = "none";
- } else {
- _this._createTabs();
- _this.header.onclick = function (e) {
- //关闭所有元素 是否有更简化的写法?
- for (var i = 0; i < _this.header.children.length; i++) {
- _this.header.children[i].setAttribute("class", "");
- } //打开点击内容元素
- e.target.setAttribute("class", "on");
- _this._createCityContent(e.target.innerHTML);
- };
- }
- return _this;
- }
- /**
- * @function SuperMap.Components.CityTabsPage.prototype._createTabs
- * @description 创建 Tabs
- * @private
- */
- CityTabsPage_createClass(CityTabsPage, [{
- key: "_createTabs",
- value: function _createTabs() {
- //header
- if (Util.isArray(this.config)) {
- for (var i = 0; i < this.config.length; i++) {
- var innerHTML = "";
- for (var key in this.config[i]) {
- innerHTML += key;
- }
- var li = document.createElement("li");
- li.innerHTML = innerHTML;
- this.header.appendChild(li);
- }
- } else {
- for (var _key in this.config) {
- var _li = document.createElement("li");
- _li.innerHTML = _key;
- this.header.appendChild(_li);
- }
- }
- this.header.firstChild.setAttribute("class", "on");
- this._createCityContent(this.header.firstChild.innerHTML);
- }
- /**
- * @function SuperMap.Components.CityTabsPage.prototype._createCityContent
- * @description 创建列表容器
- * @private
- */
- }, {
- key: "_createCityContent",
- value: function _createCityContent(keyName) {
- //清除元素:
- for (var i = this.content.children.length; i > 0; i--) {
- this.content.removeChild(this.content.children[i - 1]);
- } //创建对应元素
- var cities = this.config[keyName];
- for (var key in cities) {
- this._createCityItem(key, cities[key]);
- }
- }
- /**
- * @function SuperMap.Components.CityTabsPage.prototype._createCityContent
- * @description 创建列表容器
- * @private
- */
- }, {
- key: "_createCityItem",
- value: function _createCityItem(key, cities) {
- var city = document.createElement("div");
- var cityClass = document.createElement("div");
- cityClass.setAttribute("class", "component-citytabpag__py-key");
- cityClass.innerHTML = key;
- city.appendChild(cityClass);
- var cityContent = document.createElement("div");
- cityContent.setAttribute("class", "component-citytabpag__content");
- for (var i = 0; i < cities.length; i++) {
- var span = document.createElement("span");
- span.innerHTML = cities[i];
- cityContent.appendChild(span);
- } //HOT 元素长度单独微调:
- if (key === "HOT") {
- cityContent.style.width = "428px";
- }
- city.appendChild(cityContent);
- this.content.appendChild(city);
- }
- }]);
- return CityTabsPage;
- }(IndexTabsPageContainer);
- SuperMap.Components.CityTabsPage = CityTabsPage;
- ;// CONCATENATED MODULE: ./src/common/components/templates/NavTabsPage.js
- 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); }
- function NavTabsPage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function NavTabsPage_createClass(Constructor, protoProps, staticProps) { if (protoProps) NavTabsPage_defineProperties(Constructor.prototype, protoProps); if (staticProps) NavTabsPage_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function NavTabsPage_setPrototypeOf(o, p) { NavTabsPage_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NavTabsPage_setPrototypeOf(o, p); }
- 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); }; }
- function NavTabsPage_possibleConstructorReturn(self, call) { if (call && (NavTabsPage_typeof(call) === "object" || typeof call === "function")) { return call; } return NavTabsPage_assertThisInitialized(self); }
- function NavTabsPage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function NavTabsPage_getPrototypeOf(o) { NavTabsPage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NavTabsPage_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Components.NavTabsPage
- * @classdesc 标签页面组件。
- * @version 9.1.1
- * @param {Object} options - 组件配置参数。
- * @param {string} optionsArr.id - 组件 dom 元素 id。
- * @param {Array.<Object>} [options.tabs=[]] - 标签对象数组,形如:[{title: "",content: HTMLElement}],初始时,传入则创建页面。
- * @extends {SuperMap.Components.TemplateBase}
- * @category Components Common
- */
- // todo 思考拆分的控件应该以哪种方式使用
- var NavTabsPage = /*#__PURE__*/function (_TemplateBase) {
- NavTabsPage_inherits(NavTabsPage, _TemplateBase);
- var _super = NavTabsPage_createSuper(NavTabsPage);
- function NavTabsPage(options) {
- var _this;
- NavTabsPage_classCallCheck(this, NavTabsPage);
- _this = _super.call(this, options);
- _this.navTabsTitle = null;
- _this.navTabsContent = null;
- options.tabs = options.tabs ? options.tabs : [];
- _this._initView(options.tabs);
- return _this;
- }
- /**
- * @override
- * @private
- */
- NavTabsPage_createClass(NavTabsPage, [{
- key: "_initView",
- value: function _initView(tabs) {
- var navTabsPage = document.createElement("div");
- navTabsPage.setAttribute("class", "component-navtabspage"); //关闭按钮
- var closeBtn = document.createElement("span");
- closeBtn.setAttribute("class", "supermapol-icons-close");
- closeBtn.onclick = this.closeView.bind(this);
- navTabsPage.appendChild(closeBtn); //标签
- var navTabsTitle = document.createElement("div");
- this.navTabsTitle = navTabsTitle;
- navTabsTitle.setAttribute("class", "component-navtabspage__title");
- navTabsPage.appendChild(navTabsTitle); //内容
- var navTabsContent = document.createElement("div");
- this.navTabsContent = navTabsContent;
- navTabsContent.setAttribute("class", "component-navtabspage__content");
- navTabsPage.appendChild(navTabsContent); //若 tabs 初始传入值,则
- if (tabs.length > 0) {
- this.appendTabs(tabs);
- }
- this.rootContainer = navTabsPage;
- }
- /**
- * @function SuperMap.Components.NavTabsPage.prototype.setTabs
- * @description 设置标签。
- * @param {Array.<Object>} tabs - 标签对象数组,形如:[{title: "",content: {}}]。
- */
- }, {
- key: "setTabs",
- value: function setTabs(tabs) {
- this.removeAllTabs();
- this.appendTabs(tabs);
- }
- /**
- * @function SuperMap.Components.NavTabsPage.prototype.appendTabs
- * @description 添加标签页面。
- * @param {Array.<Object>} tabs - 标签对象数组,形如:[{title: "",content: {}}]。
- */
- }, {
- key: "appendTabs",
- value: function appendTabs(tabs) {
- for (var i = 0; i < tabs.length; i++) {
- var title = document.createElement("span");
- title.index = i;
- title.appendChild(document.createTextNode(tabs[i].title)); //绑定标签切换对应页面:
- title.onclick = this._changeTabsPage.bind(this);
- var content = tabs[i].content;
- content.index = i;
- content.hidden = true;
- this.navTabsTitle.appendChild(title);
- this.navTabsContent.appendChild(content);
- } //todo 确认是否两个子元素的 index 相互对应
- //默认显示第一个标签对象
- this.navTabsTitle.firstChild.setAttribute("class", "component-navtabspage__tabs--select");
- this.navTabsContent.firstChild.hidden = false;
- }
- /**
- * @function SuperMap.Components.NavTabsPage.prototype.removeTab
- * @description 删除某个标签页面。
- * @param {number} index - 标签索引号。
- */
- }, {
- key: "removeTab",
- value: function removeTab(index) {
- this.navTabsTitle.removeChild(this.navTabsTitle.children[index]);
- this.navTabsContent.removeChild(this.navTabsContent.children[index]);
- }
- /**
- * @function SuperMap.Components.NavTabsPage.prototype.removeAllTabs
- * @description 删除所有标签。
- */
- }, {
- key: "removeAllTabs",
- value: function removeAllTabs() {
- for (var i = this.navTabsTitle.children.length; i > 0; i--) {
- this.navTabsTitle.removeChild(this.navTabsTitle.children[i]);
- this.navTabsContent.removeChild(this.navTabsContent.children[i]);
- }
- }
- }, {
- key: "_changeTabsPage",
- value: function _changeTabsPage(e) {
- var index = e.target.index;
- for (var i = 0; i < this.navTabsTitle.children.length; i++) {
- this.navTabsTitle.children[i].setAttribute("class", "");
- this.navTabsContent.children[i].hidden = true;
- if (i === index) {
- this.navTabsTitle.children[i].setAttribute("class", "component-navtabspage__tabs--select");
- this.navTabsContent.children[i].hidden = false;
- }
- }
- }
- }]);
- return NavTabsPage;
- }(TemplateBase);
- SuperMap.Components.NavTabsPage = NavTabsPage;
- ;// CONCATENATED MODULE: ./src/common/components/templates/PaginationContainer.js
- 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); }
- function PaginationContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function PaginationContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) PaginationContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) PaginationContainer_defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function PaginationContainer_setPrototypeOf(o, p) { PaginationContainer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return PaginationContainer_setPrototypeOf(o, p); }
- 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); }; }
- function PaginationContainer_possibleConstructorReturn(self, call) { if (call && (PaginationContainer_typeof(call) === "object" || typeof call === "function")) { return call; } return PaginationContainer_assertThisInitialized(self); }
- function PaginationContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function PaginationContainer_getPrototypeOf(o) { PaginationContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PaginationContainer_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class SuperMap.Components.PaginationContainer
- * @classdesc 分页组件模板。
- * @version 9.1.1
- * @param {Object} options - 组件配置参数。
- * @param {string} optionsArr.id - 组件 dom 元素 id。
- * @param {HTMLElement} options.contents - 页面填充的 DOM 元素对象。
- * @param {number} options.pageCounts - 页数。
- * @extends {SuperMap.Components.TemplateBase}
- * @category Components Common
- */
- var PaginationContainer = /*#__PURE__*/function (_TemplateBase) {
- PaginationContainer_inherits(PaginationContainer, _TemplateBase);
- var _super = PaginationContainer_createSuper(PaginationContainer);
- function PaginationContainer(options) {
- var _this;
- PaginationContainer_classCallCheck(this, PaginationContainer);
- options = options ? options : {};
- _this = _super.call(this, options);
- _this.currentPage = 0;
- _this.pageNumberLis = [];
- _this.currentPageNumberLis = [];
- _this.linkageEvent = null;
- options.contents = options.contents ? options.contents : null;
- options.pageCounts = options.pageCounts ? options.pageCounts : 0;
- _this._initView(options.contents, options.pageCounts);
- return _this;
- }
- /**
- * @function SuperMap.Components.PaginationContainer.prototype.setLinkageEvent
- * @description 设置页面联动方法。
- * @param {function} linkageEvent - 联动方法,实现指定功能。
- */
- PaginationContainer_createClass(PaginationContainer, [{
- key: "setLinkageEvent",
- value: function setLinkageEvent(linkageEvent) {
- this.linkageEvent = linkageEvent;
- }
- /**
- * @private
- * @override
- */
- }, {
- key: "_initView",
- value: function _initView(contents, pageCounts) {
- var container = document.createElement("div");
- container.setAttribute("class", "component-pagination"); //content
- var content = document.createElement("div");
- content.setAttribute("class", "component-pagination__content");
- container.appendChild(content);
- this.content = content; //link
- var link = document.createElement("ul");
- link.setAttribute("class", "component-pagination__link");
- link.onclick = this._changePageEvent.bind(this);
- container.appendChild(link);
- this._createLink(link);
- this.link = link; //填充内容:
- if (contents) {
- this.setContent(contents);
- }
- if (pageCounts !== 0) {
- this.setPageLink(pageCounts);
- }
- this.rootContainer = container;
- }
- /**---------以下是页面相关操作 **/
- /**
- * @function SuperMap.Components.PaginationContainer.prototype.setContent
- * @description 设置页面内容。
- * @param {Element} element - 页面内容元素。
- */
- }, {
- key: "setContent",
- value: function setContent(element) {
- this.clearContent();
- this.appendContent(element);
- }
- /**
- * @function SuperMap.Components.PaginationContainer.prototype.appendContent
- * @description 追加内容。
- * @param {Element} element - 页面内容元素。
- */
- }, {
- key: "appendContent",
- value: function appendContent(element) {
- this.content.appendChild(element);
- }
- /**
- * @function SuperMap.Components.PaginationContainer.prototype.clearContent
- * @description 清空内容元素。
- */
- }, {
- key: "clearContent",
- value: function clearContent() {
- for (var i = this.content.children.length - 1; i >= 0; i--) {
- this.content.removeChild(this.content.children[i]);
- }
- }
- /** -----以下是页码相关的操作:**/
- /**
- * @function SuperMap.Components.PaginationContainer.prototype.setPageLink
- * @description 设置页码数。
- * @param {number} pageNumber - 页码数。
- */
- }, {
- key: "setPageLink",
- value: function setPageLink(pageNumber) {
- //清空当前页码
- this.pageNumberLis = [];
- this.currentPageNumberLis = [];
- this.clearPageLink(); //创建页码
- this._createPageLi(pageNumber); //添加页码到页码列表
- this._appendPageLink();
- }
- /**
- * @description 创建页码。
- * @param pageNumber
- * @private
- */
- }, {
- key: "_createPageLi",
- value: function _createPageLi(pageNumber) {
- for (var i = 0; i < pageNumber; i++) {
- var pageLi = document.createElement("li");
- pageLi.innerHTML = i + 1;
- /*const liContent = document.createElement("span");
- liContent.innerHTML = i + 1;*/
- // pageLi.appendChild(liContent);
- this.pageNumberLis.push(pageLi);
- }
- this.pageNumberLis[0].setAttribute("class", "active");
- this.currentPage = 1;
- if (pageNumber < 5) {
- this.currentPageNumberLis = this.pageNumberLis;
- } else {
- for (var _i = 0; _i < 5; _i++) {
- this.currentPageNumberLis.push(this.pageNumberLis[_i]);
- }
- }
- }
- /**
- * @description 添加页码到页码列表。
- * @private
- */
- }, {
- key: "_appendPageLink",
- value: function _appendPageLink() {
- //todo 如何插入中间
- for (var i = 0; i < this.currentPageNumberLis.length; i++) {
- this.link.insertBefore(this.currentPageNumberLis[i], this.link.childNodes[this.link.children.length - 2]);
- }
- for (var _i2 = 0; _i2 < this.currentPageNumberLis.length; _i2++) {
- //清空 active 状态
- this.currentPageNumberLis[_i2].setAttribute("class", ""); //给当前选中的 li 赋值 active 状态
- if (Number(this.currentPageNumberLis[_i2].innerHTML) === this.currentPage) {
- this.currentPageNumberLis[_i2].setAttribute("class", "active");
- }
- } //根据 currentPage 改变按钮状态
- this._changeDisableState();
- if (this.linkageEvent) {
- this.linkageEvent(this.currentPage);
- }
- }
- /**
- * @function SuperMap.Components.PaginationContainer.prototype.clearPageLink
- * @description 清除页码列表。
- */
- }, {
- key: "clearPageLink",
- value: function clearPageLink() {
- for (var i = this.link.children.length - 3; i > 1; i--) {
- this.link.removeChild(this.link.children[i]);
- }
- }
- /**
- * @description 创建页码按钮。
- * @param ul
- * @private
- */
- }, {
- key: "_createLink",
- value: function _createLink(ul) {
- for (var i = 0; i < 4; i++) {
- var li = document.createElement("li");
- li.setAttribute("class", "disable");
- var liContent = document.createElement("span");
- li.appendChild(liContent);
- if (i === 0) {
- liContent.id = "first";
- liContent.setAttribute("class", "supermapol-icons-first");
- } else if (i === 1) {
- liContent.id = "prev";
- liContent.setAttribute("class", "supermapol-icons-prev");
- } else if (i === 2) {
- liContent.id = "next";
- liContent.setAttribute("class", "supermapol-icons-next");
- } else if (i === 3) {
- liContent.id = "last";
- liContent.setAttribute("class", "supermapol-icons-last");
- }
- ul.appendChild(li);
- }
- }
- /**
- * @description 点击页码事件。
- * @param e
- * @private
- */
- }, {
- key: "_changePageEvent",
- value: function _changePageEvent(e) {
- //todo
- var trigger = e.target; //若列表禁用,点击无效
- if (trigger.parentElement.classList[0] === "disable") {
- return;
- }
- var targetLi;
- if (trigger.id) {
- targetLi = trigger.id;
- } else if (Number(trigger.innerHTML)) {
- targetLi = Number(trigger.innerHTML);
- } else {
- return;
- } //页码预处理:
- this._prePageNum(targetLi); //根据 currentPageNumberLis 创建页码列表
- this.clearPageLink();
- this._appendPageLink();
- }
- /**
- * @description 根据 currentPage 改变按钮状态。
- * @private
- */
- }, {
- key: "_changeDisableState",
- value: function _changeDisableState() {
- this.link.children[0].setAttribute("class", "");
- this.link.children[1].setAttribute("class", "");
- this.link.children[this.link.children.length - 1].setAttribute("class", "");
- this.link.children[this.link.children.length - 2].setAttribute("class", "");
- if (this.currentPage === 1) {
- this.link.children[0].setAttribute("class", "disable");
- this.link.children[1].setAttribute("class", "disable");
- }
- if (this.currentPage === this.pageNumberLis.length) {
- this.link.children[this.link.children.length - 1].setAttribute("class", "disable");
- this.link.children[this.link.children.length - 2].setAttribute("class", "disable");
- }
- }
- /**
- * @description 根据点击页码列表事件准备需展现的页码列表。
- * @param {string|number} targetLi - 被点击的列表对象 id 或 被点击的页码值。
- * @private
- */
- }, {
- key: "_prePageNum",
- value: function _prePageNum(targetLi) {
- var currentPageNumberLis = [];
- if (targetLi === "first") {
- this.currentPage = 1;
- } else if (targetLi === "last") {
- this.currentPage = this.pageNumberLis.length;
- } else if (targetLi === "prev") {
- this.currentPage = this.currentPage - 1;
- } else if (targetLi === "next") {
- this.currentPage = this.currentPage + 1;
- } else {
- this.currentPage = targetLi;
- }
- if (this.pageNumberLis.length <= 5) {
- for (var i = 0; i < this.pageNumberLis.length; i++) {
- currentPageNumberLis.push(this.pageNumberLis[i]);
- }
- } else {
- //当前点击前三,都取前五
- if (this.currentPage <= 3) {
- for (var _i3 = 0; _i3 < 5; _i3++) {
- currentPageNumberLis.push(this.pageNumberLis[_i3]);
- }
- } else if (this.currentPage >= this.pageNumberLis.length - 3) {
- //点击后三,都取后5
- for (var _i4 = this.pageNumberLis.length - 5; _i4 < this.pageNumberLis.length; _i4++) {
- currentPageNumberLis.push(this.pageNumberLis[_i4]);
- }
- } else {
- //其他,取中间:
- for (var _i5 = this.currentPage - 3; _i5 <= this.currentPage + 1; _i5++) {
- currentPageNumberLis.push(this.pageNumberLis[_i5]);
- }
- }
- }
- if (currentPageNumberLis.length > 0) {
- this.currentPageNumberLis = currentPageNumberLis;
- }
- }
- }]);
- return PaginationContainer;
- }(TemplateBase);
- SuperMap.Components.PaginationContainer = PaginationContainer;
- ;// CONCATENATED MODULE: ./src/common/components/util/Util.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- var ComponentsUtil = {
- /**
- * 获取上传文件类型
- * @param fileName
- */
- getFileType: function getFileType(fileName) {
- var regCSV = /^.*\.(?:csv)$/i;
- var regExcel = /^.*\.(?:xls|xlsx)$/i; //文件名可以带空格
- var regGeojson = /^.*\.(?:geojson|json)$/i;
- if (regExcel.test(fileName)) {
- //校验不通过
- return FileTypes.EXCEL;
- } else if (regCSV.test(fileName)) {
- return FileTypes.CSV;
- } else if (regGeojson.test(fileName)) {
- return FileTypes.GEOJSON;
- }
- return null;
- }
- };
- ;// CONCATENATED MODULE: ./src/common/components/util/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/common/components/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- //数据
- //组件
- //提示框组件
- //图表组件
- //公用模板:
- //工具类
- ;// CONCATENATED MODULE: ./src/common/lang/locales/en-US.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * Namespace: SuperMap.Lang["en"]
- * Dictionary for English. Keys for entries are used in calls to
- * <SuperMap.Lang.translate>. Entry bodies are normal strings or
- * strings formatted for use with <SuperMap.String.format> calls.
- */
- var en = {
- 'title_dataFlowService': 'Data Flow Service',
- 'title_distributedAnalysis': 'Distributed Analysis',
- 'title_clientComputing': 'Client Computing',
- 'title_dataServiceQuery': 'Data Service Query',
- 'title_searchCity': 'Search city',
- 'title_searchLayer': ' Search layer',
- 'text_input_value_inputDataFlowUrl': 'Please enter the data stream service address such as: ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe',
- 'text_displayFeaturesInfo': 'Display feature information',
- 'text_subscribe': 'subscribe',
- 'text_cancelSubscribe': 'unsubscribe',
- 'text_densityAnalysis': 'Density Analysis',
- 'text_CalculateTheValuePerUnitArea': 'Calculate the value per unit area within the neighborhood shape',
- 'text_option_selectDataset': 'Please select a dataset',
- 'text_label_dataset': 'Dataset',
- 'text_option_simplePointDensityAnalysis': 'Simple point density analysis',
- 'text_option_nuclearDensityAnalysis': 'Nuclear density analysis',
- 'text_label_analyticalMethod': 'Analytical method',
- 'text_option_quadrilateral': 'Quadrilateral',
- 'text_option_hexagon': 'hexagon',
- 'text_label_meshType': 'Mesh type',
- 'text_option_notSet': 'Not set',
- 'text_label_weightField': 'Weight field',
- 'text_label_gridSizeInMeters': 'Grid size',
- 'text_label_searchRadius': 'Search radius',
- 'text_label_queryRange': 'Scope of analysis',
- 'text_label_areaUnit': 'Area unit',
- 'text_option_equidistantSegmentation': 'Equidistant segmentation',
- 'text_option_logarithm': 'Logarithm',
- 'text_option_equalCountingSegment': 'Equal counting segment',
- 'text_option_squareRootSegmentation': 'Square root segmentation',
- 'text_label_thematicMapSegmentationMode': 'Thematic map segmentation mode',
- 'text_label_thematicMapSegmentationParameters': 'Thematic map segmentation parameters',
- 'text_option_greenOrangePurpleGradient': 'Green orange purple gradient',
- 'text_option_greenOrangeRedGradient': 'Green orange red gradient',
- 'text_option_rainbowGradient': 'Rainbow gradient',
- 'text_option_spectralGradient': 'Spectral gradient',
- 'text_option_terrainGradient': 'Terrain gradient',
- 'text_label_thematicMapColorGradientMode': 'Thematic map color gradient mode',
- 'text_label_resultLayerName': 'Result layer name',
- 'text_chooseFile': 'Open File',
- 'text_isoline': 'Isoline',
- 'text_extractDiscreteValue': 'Extract discrete value generation curve',
- 'text_buffer': 'Buffer',
- 'text_specifyTheDistance': 'Specify the distance to create the surrounding area',
- 'text_label_analysisLayer': 'Analysis layer',
- 'text_label_extractField': 'Extract field',
- 'text_label_extractedValue': 'Extracted value',
- 'text_label_distanceAttenuation': 'Distance attenuation',
- 'text_label_gridSize': 'gridSize',
- 'text_label_bufferRadius': 'Buffer radius',
- 'text_label_defaultkilometers': 'Default 10 kilometers',
- 'text_label_kilometer': 'kilometer',
- 'text_label_unit': 'unit',
- 'text_retainOriginal': 'Retain original object field',
- 'text_mergeBuffer': 'Merge buffer',
- 'text_label_color': 'Color',
- 'text_label_buffer': '[Buffer]',
- 'text_label_isolines': '[Isolines]',
- 'text_label_queryRangeTips': 'The default is the full range of input data. Example: -74.050, 40.650, -73.850, 40.850',
- 'text_label_queryModel': 'Query mode',
- 'text_label_IDArrayOfFeatures': 'ID array of features',
- 'text_label_maxFeatures': 'The maximum number of features that can be returned',
- 'text_label_bufferDistance': 'Buffer distance',
- 'text_label_queryRange1': 'Query range',
- 'text_label_spatialQueryMode': 'Spatial query mode',
- 'text_label_featureFilter': 'Feature filter',
- 'text_label_geometricObject': 'Geometric object',
- 'text_label_queryMode': 'Query mode',
- 'text_label_searchTips': 'Search for city locations or layer features',
- 'text_label_chooseSearchLayers': 'Select a query layer',
- 'text_loadSearchCriteria': 'Load search criteria',
- 'text_saveSearchCriteria': 'Save search criteria',
- "btn_analyze": "Analyze",
- "btn_analyzing": "Analyzing",
- "btn_emptyTheAnalysisLayer": "Empty the analysis layer",
- "btn_cancelAnalysis": "Cancel",
- "btn_query": "Query",
- "btn_querying": "Querying",
- "btn_emptyTheRresultLayer": "Clear all result layers",
- 'msg_dataReturnedIsEmpty.': 'The request is successful and the data returned by the query is empty.',
- 'msg_dataFlowServiceHasBeenSubscribed': 'The data stream service has been subscribed to.',
- 'msg_inputDataFlowUrlFirst': 'Please enter the data stream service address first.',
- 'msg_datasetOrMethodUnsupport': 'This dataset does not support this analysis type. Please reselect the dataset.',
- 'msg_selectDataset': 'Please select a data set!',
- 'msg_setTheWeightField': 'Please set the weight field!',
- 'msg_theFieldNotSupportAnalysis': 'The field you currently select does not support analysis!',
- 'msg_resultIsEmpty': 'The result of the analysis is empty!',
- 'msg_openFileFail': 'Failed to open file!',
- 'msg_fileTypeUnsupported': 'File format is not supported!',
- 'msg_fileSizeExceeded': 'File size exceeded! The file size should not exceed 10M!',
- 'msg_dataInWrongGeoJSONFormat': 'Wrong data format! Non standard GEOJSON format data!',
- 'msg_dataInWrongFormat': 'Wrong data format! Non standard EXCEL, CSV or GEOJSON format data!',
- 'msg_searchKeywords': "Search keywords cannot be empty. Please enter your search criteria.",
- 'msg_searchGeocodeField': "Did not match the address matching service data!",
- 'msg_cityGeocodeField': "The address matching service of the current city is not configured.",
- 'msg_getFeatureField': "No related vector features found!",
- 'msg_dataflowservicesubscribed': 'The data stream service has been subscribed to.',
- 'msg_subscribesucceeded': 'The data stream service subscription was successful.',
- 'msg_crsunsupport': 'Does not support the coordinate system of the current map',
- 'msg_tilematrixsetunsupport': 'Incoming TileMatrixSet is not supported',
- 'msg_jsonResolveFiled': 'JSON format parsing failure!',
- 'msg_requestContentFiled': 'Failed to request data through iportal!',
- 'msg_getdatafailed': 'Failed to get data!'
- };
- SuperMap.Lang["en-US"] = en;
- ;// CONCATENATED MODULE: ./src/common/lang/locales/zh-CN.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * Namespace: SuperMap.Lang["zh-CN"]
- * Dictionary for Simplified Chinese. Keys for entries are used in calls to
- * <SuperMap.Lang.translate>. Entry bodies are normal strings or
- * strings formatted for use with <SuperMap.String.format> calls.
- */
- var zh = {
- 'title_dataFlowService': '数据流服务',
- 'title_distributedAnalysis': '分布式分析',
- 'title_clientComputing': '客户端计算',
- 'title_dataServiceQuery': '数据服务查询',
- 'title_searchCity': '搜索城市',
- 'title_searchLayer': '搜索图层',
- 'text_input_value_inputDataFlowUrl': '请输入数据流服务地址如:ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe',
- 'text_displayFeaturesInfo': '显示要素信息',
- 'text_subscribe': '订阅',
- 'text_cancelSubscribe': '取消订阅',
- 'text_densityAnalysis': '密度分析',
- 'text_CalculateTheValuePerUnitArea': '计算点指定邻域形状内的每单位面积量值',
- 'text_option_selectDataset': '请选择数据集',
- 'text_label_dataset': '数据集',
- 'text_option_simplePointDensityAnalysis': '简单点密度分析',
- 'text_option_nuclearDensityAnalysis': '核密度分析',
- 'text_label_analyticalMethod': '分析方法',
- 'text_option_quadrilateral': '四边形',
- 'text_option_hexagon': '六边形',
- 'text_label_meshType': '网格面类型',
- 'text_option_notSet': '未设置',
- 'text_label_weightField': '权重字段',
- 'text_label_gridSizeInMeters': '网格大小',
- 'text_label_searchRadius': '搜索半径',
- 'text_label_queryRange': '分析范围',
- 'text_label_areaUnit': '面积单位',
- 'text_option_equidistantSegmentation': '等距离分段',
- 'text_option_logarithm': '对数',
- 'text_option_equalCountingSegment': '等计数分段',
- 'text_option_squareRootSegmentation': '平方根分段',
- 'text_label_thematicMapSegmentationMode': '专题图分段模式',
- 'text_label_thematicMapSegmentationParameters': '专题图分段参数',
- 'text_option_greenOrangePurpleGradient': '绿橙紫渐变',
- 'text_option_greenOrangeRedGradient': '绿橙红渐变',
- 'text_option_rainbowGradient': '彩虹渐变',
- 'text_option_spectralGradient': '光谱渐变',
- 'text_option_terrainGradient': '地形渐变',
- 'text_label_thematicMapColorGradientMode': '专题图颜色渐变模式',
- 'text_label_resultLayerName': '结果图层名称',
- 'text_chooseFile': '选择文件',
- 'text_isoline': '等值线',
- 'text_extractDiscreteValue': '提取离散值生成曲线',
- 'text_buffer': '缓冲区',
- 'text_specifyTheDistance': '指定距离创建周边区域',
- 'text_label_analysisLayer': '分析图层',
- 'text_label_extractField': '提取字段',
- 'text_label_extractedValue': '提取值',
- 'text_label_distanceAttenuation': '距离衰减',
- 'text_label_gridSize': '栅格大小',
- 'text_label_bufferRadius': '缓冲半径',
- 'text_label_defaultkilometers': '默认10千米',
- 'text_option_kilometer': '千米',
- 'text_label_unit': '单位',
- 'text_retainOriginal': '保留原对象字段属性',
- 'text_mergeBuffer': '合并缓冲区',
- 'text_label_color': '颜色',
- 'text_label_buffer': '[缓冲区]',
- 'text_label_isolines': '[等值线]',
- 'text_label_queryRangeTips': '默认为输入数据的全幅范围。范例:-74.050,40.650,-73.850,40.850',
- 'text_label_IDArrayOfFeatures': '要素 ID 数组',
- 'text_label_maxFeatures': '最多可返回的要素数量',
- 'text_label_bufferDistance': '缓冲区距离',
- 'text_label_queryRange1': '查询范围',
- 'text_label_spatialQueryMode': '空间查询模式',
- 'text_label_featureFilter': '要素过滤器',
- 'text_label_geometricObject': '几何对象',
- 'text_label_queryMode': '查询模式',
- 'text_label_searchTips': '搜索城市地点或图层要素',
- 'text_label_chooseSearchLayers': '选择查询图层',
- 'text_loadSearchCriteria': '加载搜索条件',
- 'text_saveSearchCriteria': '保存搜索条件',
- "btn_analyze": "分析",
- "btn_analyzing": "分析中",
- "btn_emptyTheAnalysisLayer": "清空分析图层",
- "btn_cancelAnalysis": "取消",
- "btn_query": "查询",
- "btn_querying": "查询中",
- "btn_emptyTheRresultLayer": "清除所有结果图层",
- 'msg_dataFlowServiceHasBeenSubscribed': '已订阅该数据流服务。',
- 'msg_inputDataFlowUrlFirst': '请先输入数据流服务地址。',
- 'msg_datasetOrMethodUnsupport': '该数据集不支持本分析类型,请重新选择数据集',
- 'msg_selectDataset': '请选择数据集!',
- 'msg_setTheWeightField': '请设置权重字段!',
- 'msg_theFieldNotSupportAnalysis': '您当前选择的字段不支持分析!',
- 'msg_resultIsEmpty': '分析的结果为空!',
- 'msg_dataReturnedIsEmpty': '请求成功,查询返回的数据为空。',
- 'msg_openFileFail': '打开文件失败!',
- 'msg_fileTypeUnsupported': '不支持该文件格式!',
- 'msg_fileSizeExceeded': '文件大小超限!文件大小不得超过 10M!',
- 'msg_dataInWrongGeoJSONFormat': '数据格式错误!非标准的 GEOJSON 格式数据!',
- 'msg_dataInWrongFormat': '数据格式错误!非标准的 EXCEL, CSV 或 GEOJSON 格式数据!',
- 'msg_searchKeywords': "搜索关键字不能为空,请输入搜索条件。",
- 'msg_searchGeocodeField': "未匹配到地址匹配服务数据!",
- 'msg_cityGeocodeField': "未配置当前城市的地址匹配服务。",
- 'msg_getFeatureField': "未查找到相关矢量要素!",
- 'msg_dataflowservicesubscribed': '已订阅该数据流服务。',
- 'msg_subscribesucceeded': '数据流服务订阅成功。',
- 'msg_crsunsupport': '不支持当前地图的坐标系',
- 'msg_tilematrixsetunsupport': '不支持传入的TileMatrixSet',
- 'msg_jsonResolveFiled': 'json格式解析失败!',
- 'msg_requestContentFiled': '通过iportal请求数据失败!',
- 'msg_getdatafailed': '获取数据失败!'
- };
- SuperMap.Lang["zh-CN"] = zh;
- ;// CONCATENATED MODULE: ./src/common/lang/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/common/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: external "L"
- var external_L_namespaceObject = L;
- var external_L_default = /*#__PURE__*/__webpack_require__.n(external_L_namespaceObject);
- ;// CONCATENATED MODULE: ./src/leaflet/core/NonEarthCRS.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- (external_L_default()).Projection = {};
- /**
- * @private
- * @class L.Projection.NonProjection
- * @classdesc 平面无投影对象。
- * @category BaseTypes Projection
- * @extends {L.Class}
- * @param {L.bounds} bounds - 坐标范围
- */
- var NonProjection = external_L_default().Class.extend({
- initialize: function initialize(bounds) {
- this.bounds = bounds;
- },
- project: function project(latlng) {
- return new (external_L_default()).Point(latlng.lng, latlng.lat);
- },
- unproject: function unproject(point) {
- return new (external_L_default()).LatLng(point.y, point.x);
- }
- });
- var nonProjection = function nonProjection(bounds) {
- return new NonProjection(bounds);
- };
- /**
- * @class L.CRS.NonEarthCRS
- * @classdesc 平面无投影坐标类。
- * @category BaseTypes Projection
- * @extends {L.Class}
- * @param {Object} options - 构建平面无投影坐标对象参数。
- * @param {Object} options.origin - 原点。
- * @param {L.bounds} options.bounds - 范围。
- * @param {Array.<number>} [options.resolutions] - 分辨率。
- */
- var NonEarthCRS = external_L_default().Class.extend({
- /**
- * @member {Object} [L.CRS.NonEarthCRS.prototype.includes=L.CRS]
- * @description 包含的坐标对象。
- */
- includes: (external_L_default()).CRS,
- initialize: function initialize(options) {
- if (options.origin) {
- this.transformation = new (external_L_default()).Transformation(1, -options.origin.x, -1, options.origin.y);
- }
- this.projection = external_L_default().Projection.NonProjection(options.bounds);
- this.bounds = options.bounds;
- this.origin = options.origin;
- this.resolutions = options.resolutions;
- },
- /**
- * @function L.CRS.NonEarthCRS.prototype.scale
- * @description 通过缩放级别计算比例尺。
- * @param {number} zoom - 缩放级别。
- * @returns {number} 得到的比例尺。
- */
- scale: function scale(zoom) {
- var defaultScale;
- if (!this.resolutions || this.resolutions.length === 0) {
- var width = Math.max(this.bounds.getSize().x, this.bounds.getSize().y);
- defaultScale = 1.0 / (width / 256);
- } else {
- defaultScale = 1.0 / this.resolutions[0];
- }
- return defaultScale * Math.pow(2, zoom);
- },
- /**
- * @function L.CRS.NonEarthCRS.prototype.zoom
- * @description 通过比例尺计算范围。
- * @param {number} scale - 比例尺。
- * @returns {number} 返回空间范围值。
- */
- zoom: function zoom(scale) {
- var defaultScale;
- if (!this.resolutions || this.resolutions.length === 0) {
- var width = Math.max(this.bounds.getSize().x, this.bounds.getSize().y);
- defaultScale = 1.0 / (width / 256);
- } else {
- defaultScale = 1.0 / this.resolutions[0];
- }
- return Math.log(scale / defaultScale) / Math.LN2;
- },
- /**
- * @function L.CRS.NonEarthCRS.prototype.distance
- * @description 通过两个坐标点计算之间的距离。
- * @param {L.latLng} latlng1 - 坐标点1。
- * @param {L.latLng} latlng2 - 坐标点2。
- * @returns {number} 返回距离长度。
- */
- distance: function distance(latlng1, latlng2) {
- var dx = latlng2.lng - latlng1.lng,
- dy = latlng2.lat - latlng1.lat;
- return Math.sqrt(dx * dx + dy * dy);
- },
- infinite: false
- });
- var nonEarthCRS = function nonEarthCRS(options) {
- return new NonEarthCRS(options);
- };
- (external_L_default()).Projection.NonProjection = nonProjection;
- (external_L_default()).CRS.NonEarthCRS = nonEarthCRS;
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/global.js
- /* harmony default export */ function global(defs) {
- defs('EPSG:4326', "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees");
- defs('EPSG:4269', "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees");
- 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");
- defs.WGS84 = defs['EPSG:4326'];
- defs['EPSG:3785'] = defs['EPSG:3857']; // maintain backward compat, official code is 3857
- defs.GOOGLE = defs['EPSG:3857'];
- defs['EPSG:900913'] = defs['EPSG:3857'];
- defs['EPSG:102113'] = defs['EPSG:3857'];
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/constants/values.js
- var PJD_3PARAM = 1;
- var PJD_7PARAM = 2;
- var PJD_WGS84 = 4; // WGS84 or equivalent
- var PJD_NODATUM = 5; // WGS84 or equivalent
- var SEC_TO_RAD = 4.84813681109535993589914102357e-6;
- var HALF_PI = Math.PI / 2; // ellipoid pj_set_ell.c
- var SIXTH = 0.1666666666666666667;
- /* 1/6 */
- var RA4 = 0.04722222222222222222;
- /* 17/360 */
- var RA6 = 0.02215608465608465608;
- var EPSLN = 1.0e-10; // you'd think you could use Number.EPSILON above but that makes
- // Mollweide get into an infinate loop.
- var D2R = 0.01745329251994329577;
- var R2D = 57.29577951308232088;
- var FORTPI = Math.PI / 4;
- var TWO_PI = Math.PI * 2; // SPI is slightly greater than Math.PI, so values that exceed the -180..180
- // degree range by a tiny amount don't get wrapped. This prevents points that
- // have drifted from their original location along the 180th meridian (due to
- // floating point error) from changing their sign.
- var SPI = 3.14159265359;
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/constants/PrimeMeridian.js
- var PrimeMeridian_exports = {};
- PrimeMeridian_exports.greenwich = 0.0; //"0dE",
- PrimeMeridian_exports.lisbon = -9.131906111111; //"9d07'54.862\"W",
- PrimeMeridian_exports.paris = 2.337229166667; //"2d20'14.025\"E",
- PrimeMeridian_exports.bogota = -74.080916666667; //"74d04'51.3\"W",
- PrimeMeridian_exports.madrid = -3.687938888889; //"3d41'16.58\"W",
- PrimeMeridian_exports.rome = 12.452333333333; //"12d27'8.4\"E",
- PrimeMeridian_exports.bern = 7.439583333333; //"7d26'22.5\"E",
- PrimeMeridian_exports.jakarta = 106.807719444444; //"106d48'27.79\"E",
- PrimeMeridian_exports.ferro = -17.666666666667; //"17d40'W",
- PrimeMeridian_exports.brussels = 4.367975; //"4d22'4.71\"E",
- PrimeMeridian_exports.stockholm = 18.058277777778; //"18d3'29.8\"E",
- PrimeMeridian_exports.athens = 23.7163375; //"23d42'58.815\"E",
- PrimeMeridian_exports.oslo = 10.722916666667; //"10d43'22.5\"E"
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/constants/units.js
- /* harmony default export */ var constants_units = ({
- ft: {
- to_meter: 0.3048
- },
- 'us-ft': {
- to_meter: 1200 / 3937
- }
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/match.js
- var ignoredChar = /[\s_\-\/\(\)]/g;
- function match(obj, key) {
- if (obj[key]) {
- return obj[key];
- }
- var keys = Object.keys(obj);
- var lkey = key.toLowerCase().replace(ignoredChar, '');
- var i = -1;
- var testkey, processedKey;
- while (++i < keys.length) {
- testkey = keys[i];
- processedKey = testkey.toLowerCase().replace(ignoredChar, '');
- if (processedKey === lkey) {
- return obj[testkey];
- }
- }
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projString.js
- /* harmony default export */ function projString(defData) {
- var self = {};
- var paramObj = defData.split('+').map(function (v) {
- return v.trim();
- }).filter(function (a) {
- return a;
- }).reduce(function (p, a) {
- var split = a.split('=');
- split.push(true);
- p[split[0].toLowerCase()] = split[1];
- return p;
- }, {});
- var paramName, paramVal, paramOutname;
- var params = {
- proj: 'projName',
- datum: 'datumCode',
- rf: function rf(v) {
- self.rf = parseFloat(v);
- },
- lat_0: function lat_0(v) {
- self.lat0 = v * D2R;
- },
- lat_1: function lat_1(v) {
- self.lat1 = v * D2R;
- },
- lat_2: function lat_2(v) {
- self.lat2 = v * D2R;
- },
- lat_ts: function lat_ts(v) {
- self.lat_ts = v * D2R;
- },
- lon_0: function lon_0(v) {
- self.long0 = v * D2R;
- },
- lon_1: function lon_1(v) {
- self.long1 = v * D2R;
- },
- lon_2: function lon_2(v) {
- self.long2 = v * D2R;
- },
- alpha: function alpha(v) {
- self.alpha = parseFloat(v) * D2R;
- },
- lonc: function lonc(v) {
- self.longc = v * D2R;
- },
- x_0: function x_0(v) {
- self.x0 = parseFloat(v);
- },
- y_0: function y_0(v) {
- self.y0 = parseFloat(v);
- },
- k_0: function k_0(v) {
- self.k0 = parseFloat(v);
- },
- k: function k(v) {
- self.k0 = parseFloat(v);
- },
- a: function a(v) {
- self.a = parseFloat(v);
- },
- b: function b(v) {
- self.b = parseFloat(v);
- },
- r_a: function r_a() {
- self.R_A = true;
- },
- zone: function zone(v) {
- self.zone = parseInt(v, 10);
- },
- south: function south() {
- self.utmSouth = true;
- },
- towgs84: function towgs84(v) {
- self.datum_params = v.split(",").map(function (a) {
- return parseFloat(a);
- });
- },
- to_meter: function to_meter(v) {
- self.to_meter = parseFloat(v);
- },
- units: function units(v) {
- self.units = v;
- var unit = match(constants_units, v);
- if (unit) {
- self.to_meter = unit.to_meter;
- }
- },
- from_greenwich: function from_greenwich(v) {
- self.from_greenwich = v * D2R;
- },
- pm: function pm(v) {
- var pm = match(PrimeMeridian_exports, v);
- self.from_greenwich = (pm ? pm : parseFloat(v)) * D2R;
- },
- nadgrids: function nadgrids(v) {
- if (v === '@null') {
- self.datumCode = 'none';
- } else {
- self.nadgrids = v;
- }
- },
- axis: function axis(v) {
- var legalAxis = "ewnsud";
- 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) {
- self.axis = v;
- }
- }
- };
- for (paramName in paramObj) {
- paramVal = paramObj[paramName];
- if (paramName in params) {
- paramOutname = params[paramName];
- if (typeof paramOutname === 'function') {
- paramOutname(paramVal);
- } else {
- self[paramOutname] = paramVal;
- }
- } else {
- self[paramName] = paramVal;
- }
- }
- if (typeof self.datumCode === 'string' && self.datumCode !== "WGS84") {
- self.datumCode = self.datumCode.toLowerCase();
- }
- return self;
- }
- ;// CONCATENATED MODULE: ./node_modules/wkt-parser/parser.js
- /* harmony default export */ var parser = (parseString);
- var NEUTRAL = 1;
- var KEYWORD = 2;
- var NUMBER = 3;
- var QUOTED = 4;
- var AFTERQUOTE = 5;
- var ENDED = -1;
- var whitespace = /\s/;
- var latin = /[A-Za-z]/;
- var keyword = /[A-Za-z84]/;
- var endThings = /[,\]]/;
- var digets = /[\d\.E\-\+]/; // const ignoredChar = /[\s_\-\/\(\)]/g;
- function Parser(text) {
- if (typeof text !== 'string') {
- throw new Error('not a string');
- }
- this.text = text.trim();
- this.level = 0;
- this.place = 0;
- this.root = null;
- this.stack = [];
- this.currentObject = null;
- this.state = NEUTRAL;
- }
- Parser.prototype.readCharicter = function () {
- var _char = this.text[this.place++];
- if (this.state !== QUOTED) {
- while (whitespace.test(_char)) {
- if (this.place >= this.text.length) {
- return;
- }
- _char = this.text[this.place++];
- }
- }
- switch (this.state) {
- case NEUTRAL:
- return this.neutral(_char);
- case KEYWORD:
- return this.keyword(_char);
- case QUOTED:
- return this.quoted(_char);
- case AFTERQUOTE:
- return this.afterquote(_char);
- case NUMBER:
- return this.number(_char);
- case ENDED:
- return;
- }
- };
- Parser.prototype.afterquote = function (_char2) {
- if (_char2 === '"') {
- this.word += '"';
- this.state = QUOTED;
- return;
- }
- if (endThings.test(_char2)) {
- this.word = this.word.trim();
- this.afterItem(_char2);
- return;
- }
- throw new Error('havn\'t handled "' + _char2 + '" in afterquote yet, index ' + this.place);
- };
- Parser.prototype.afterItem = function (_char3) {
- if (_char3 === ',') {
- if (this.word !== null) {
- this.currentObject.push(this.word);
- }
- this.word = null;
- this.state = NEUTRAL;
- return;
- }
- if (_char3 === ']') {
- this.level--;
- if (this.word !== null) {
- this.currentObject.push(this.word);
- this.word = null;
- }
- this.state = NEUTRAL;
- this.currentObject = this.stack.pop();
- if (!this.currentObject) {
- this.state = ENDED;
- }
- return;
- }
- };
- Parser.prototype.number = function (_char4) {
- if (digets.test(_char4)) {
- this.word += _char4;
- return;
- }
- if (endThings.test(_char4)) {
- this.word = parseFloat(this.word);
- this.afterItem(_char4);
- return;
- }
- throw new Error('havn\'t handled "' + _char4 + '" in number yet, index ' + this.place);
- };
- Parser.prototype.quoted = function (_char5) {
- if (_char5 === '"') {
- this.state = AFTERQUOTE;
- return;
- }
- this.word += _char5;
- return;
- };
- Parser.prototype.keyword = function (_char6) {
- if (keyword.test(_char6)) {
- this.word += _char6;
- return;
- }
- if (_char6 === '[') {
- var newObjects = [];
- newObjects.push(this.word);
- this.level++;
- if (this.root === null) {
- this.root = newObjects;
- } else {
- this.currentObject.push(newObjects);
- }
- this.stack.push(this.currentObject);
- this.currentObject = newObjects;
- this.state = NEUTRAL;
- return;
- }
- if (endThings.test(_char6)) {
- this.afterItem(_char6);
- return;
- }
- throw new Error('havn\'t handled "' + _char6 + '" in keyword yet, index ' + this.place);
- };
- Parser.prototype.neutral = function (_char7) {
- if (latin.test(_char7)) {
- this.word = _char7;
- this.state = KEYWORD;
- return;
- }
- if (_char7 === '"') {
- this.word = '';
- this.state = QUOTED;
- return;
- }
- if (digets.test(_char7)) {
- this.word = _char7;
- this.state = NUMBER;
- return;
- }
- if (endThings.test(_char7)) {
- this.afterItem(_char7);
- return;
- }
- throw new Error('havn\'t handled "' + _char7 + '" in neutral yet, index ' + this.place);
- };
- Parser.prototype.output = function () {
- while (this.place < this.text.length) {
- this.readCharicter();
- }
- if (this.state === ENDED) {
- return this.root;
- }
- throw new Error('unable to parse string "' + this.text + '". State is ' + this.state);
- };
- function parseString(txt) {
- var parser = new Parser(txt);
- return parser.output();
- }
- ;// CONCATENATED MODULE: ./node_modules/wkt-parser/process.js
- function mapit(obj, key, value) {
- if (Array.isArray(key)) {
- value.unshift(key);
- key = null;
- }
- var thing = key ? {} : obj;
- var out = value.reduce(function (newObj, item) {
- sExpr(item, newObj);
- return newObj;
- }, thing);
- if (key) {
- obj[key] = out;
- }
- }
- function sExpr(v, obj) {
- if (!Array.isArray(v)) {
- obj[v] = true;
- return;
- }
- var key = v.shift();
- if (key === 'PARAMETER') {
- key = v.shift();
- }
- if (v.length === 1) {
- if (Array.isArray(v[0])) {
- obj[key] = {};
- sExpr(v[0], obj[key]);
- return;
- }
- obj[key] = v[0];
- return;
- }
- if (!v.length) {
- obj[key] = true;
- return;
- }
- if (key === 'TOWGS84') {
- obj[key] = v;
- return;
- }
- if (key === 'AXIS') {
- if (!(key in obj)) {
- obj[key] = [];
- }
- obj[key].push(v);
- return;
- }
- if (!Array.isArray(key)) {
- obj[key] = {};
- }
- var i;
- switch (key) {
- case 'UNIT':
- case 'PRIMEM':
- case 'VERT_DATUM':
- obj[key] = {
- name: v[0].toLowerCase(),
- convert: v[1]
- };
- if (v.length === 3) {
- sExpr(v[2], obj[key]);
- }
- return;
- case 'SPHEROID':
- case 'ELLIPSOID':
- obj[key] = {
- name: v[0],
- a: v[1],
- rf: v[2]
- };
- if (v.length === 4) {
- sExpr(v[3], obj[key]);
- }
- return;
- case 'PROJECTEDCRS':
- case 'PROJCRS':
- case 'GEOGCS':
- case 'GEOCCS':
- case 'PROJCS':
- case 'LOCAL_CS':
- case 'GEODCRS':
- case 'GEODETICCRS':
- case 'GEODETICDATUM':
- case 'EDATUM':
- case 'ENGINEERINGDATUM':
- case 'VERT_CS':
- case 'VERTCRS':
- case 'VERTICALCRS':
- case 'COMPD_CS':
- case 'COMPOUNDCRS':
- case 'ENGINEERINGCRS':
- case 'ENGCRS':
- case 'FITTED_CS':
- case 'LOCAL_DATUM':
- case 'DATUM':
- v[0] = ['name', v[0]];
- mapit(obj, key, v);
- return;
- default:
- i = -1;
- while (++i < v.length) {
- if (!Array.isArray(v[i])) {
- return sExpr(v, obj[key]);
- }
- }
- return mapit(obj, key, v);
- }
- }
- ;// CONCATENATED MODULE: ./node_modules/wkt-parser/index.js
- 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); }
- var wkt_parser_D2R = 0.01745329251994329577;
- function rename(obj, params) {
- var outName = params[0];
- var inName = params[1];
- if (!(outName in obj) && inName in obj) {
- obj[outName] = obj[inName];
- if (params.length === 3) {
- obj[outName] = params[2](obj[outName]);
- }
- }
- }
- function d2r(input) {
- return input * wkt_parser_D2R;
- }
- function cleanWKT(wkt) {
- if (wkt.type === 'GEOGCS') {
- wkt.projName = 'longlat';
- } else if (wkt.type === 'LOCAL_CS') {
- wkt.projName = 'identity';
- wkt.local = true;
- } else {
- if (wkt_parser_typeof(wkt.PROJECTION) === 'object') {
- wkt.projName = Object.keys(wkt.PROJECTION)[0];
- } else {
- wkt.projName = wkt.PROJECTION;
- }
- }
- if (wkt.AXIS) {
- var axisOrder = '';
- for (var i = 0, ii = wkt.AXIS.length; i < ii; ++i) {
- var axis = wkt.AXIS[i];
- var descriptor = axis[0].toLowerCase();
- if (descriptor.indexOf('north') !== -1) {
- axisOrder += 'n';
- } else if (descriptor.indexOf('south') !== -1) {
- axisOrder += 's';
- } else if (descriptor.indexOf('east') !== -1) {
- axisOrder += 'e';
- } else if (descriptor.indexOf('west') !== -1) {
- axisOrder += 'w';
- }
- }
- if (axisOrder.length === 2) {
- axisOrder += 'u';
- }
- if (axisOrder.length === 3) {
- wkt.axis = axisOrder;
- }
- }
- if (wkt.UNIT) {
- wkt.units = wkt.UNIT.name.toLowerCase();
- if (wkt.units === 'metre') {
- wkt.units = 'meter';
- }
- if (wkt.UNIT.convert) {
- if (wkt.type === 'GEOGCS') {
- if (wkt.DATUM && wkt.DATUM.SPHEROID) {
- wkt.to_meter = wkt.UNIT.convert * wkt.DATUM.SPHEROID.a;
- }
- } else {
- wkt.to_meter = wkt.UNIT.convert;
- }
- }
- }
- var geogcs = wkt.GEOGCS;
- if (wkt.type === 'GEOGCS') {
- geogcs = wkt;
- }
- if (geogcs) {
- //if(wkt.GEOGCS.PRIMEM&&wkt.GEOGCS.PRIMEM.convert){
- // wkt.from_greenwich=wkt.GEOGCS.PRIMEM.convert*D2R;
- //}
- if (geogcs.DATUM) {
- wkt.datumCode = geogcs.DATUM.name.toLowerCase();
- } else {
- wkt.datumCode = geogcs.name.toLowerCase();
- }
- if (wkt.datumCode.slice(0, 2) === 'd_') {
- wkt.datumCode = wkt.datumCode.slice(2);
- }
- if (wkt.datumCode === 'new_zealand_geodetic_datum_1949' || wkt.datumCode === 'new_zealand_1949') {
- wkt.datumCode = 'nzgd49';
- }
- if (wkt.datumCode === 'wgs_1984' || wkt.datumCode === 'world_geodetic_system_1984') {
- if (wkt.PROJECTION === 'Mercator_Auxiliary_Sphere') {
- wkt.sphere = true;
- }
- wkt.datumCode = 'wgs84';
- }
- if (wkt.datumCode.slice(-6) === '_ferro') {
- wkt.datumCode = wkt.datumCode.slice(0, -6);
- }
- if (wkt.datumCode.slice(-8) === '_jakarta') {
- wkt.datumCode = wkt.datumCode.slice(0, -8);
- }
- if (~wkt.datumCode.indexOf('belge')) {
- wkt.datumCode = 'rnb72';
- }
- if (geogcs.DATUM && geogcs.DATUM.SPHEROID) {
- wkt.ellps = geogcs.DATUM.SPHEROID.name.replace('_19', '').replace(/[Cc]larke\_18/, 'clrk');
- if (wkt.ellps.toLowerCase().slice(0, 13) === 'international') {
- wkt.ellps = 'intl';
- }
- wkt.a = geogcs.DATUM.SPHEROID.a;
- wkt.rf = parseFloat(geogcs.DATUM.SPHEROID.rf, 10);
- }
- if (geogcs.DATUM && geogcs.DATUM.TOWGS84) {
- wkt.datum_params = geogcs.DATUM.TOWGS84;
- }
- if (~wkt.datumCode.indexOf('osgb_1936')) {
- wkt.datumCode = 'osgb36';
- }
- if (~wkt.datumCode.indexOf('osni_1952')) {
- wkt.datumCode = 'osni52';
- }
- if (~wkt.datumCode.indexOf('tm65') || ~wkt.datumCode.indexOf('geodetic_datum_of_1965')) {
- wkt.datumCode = 'ire65';
- }
- if (wkt.datumCode === 'ch1903+') {
- wkt.datumCode = 'ch1903';
- }
- if (~wkt.datumCode.indexOf('israel')) {
- wkt.datumCode = 'isr93';
- }
- }
- if (wkt.b && !isFinite(wkt.b)) {
- wkt.b = wkt.a;
- }
- function toMeter(input) {
- var ratio = wkt.to_meter || 1;
- return input * ratio;
- }
- var renamer = function renamer(a) {
- return rename(wkt, a);
- };
- 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']];
- list.forEach(renamer);
- if (!wkt.long0 && wkt.longc && (wkt.projName === 'Albers_Conic_Equal_Area' || wkt.projName === 'Lambert_Azimuthal_Equal_Area')) {
- wkt.long0 = wkt.longc;
- }
- if (!wkt.lat_ts && wkt.lat1 && (wkt.projName === 'Stereographic_South_Pole' || wkt.projName === 'Polar Stereographic (variant B)')) {
- wkt.lat0 = d2r(wkt.lat1 > 0 ? 90 : -90);
- wkt.lat_ts = wkt.lat1;
- }
- }
- /* harmony default export */ function wkt_parser(wkt) {
- var lisp = parser(wkt);
- var type = lisp.shift();
- var name = lisp.shift();
- lisp.unshift(['name', name]);
- lisp.unshift(['type', type]);
- var obj = {};
- sExpr(lisp, obj);
- cleanWKT(obj);
- return obj;
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/defs.js
- function defs(name) {
- /*global console*/
- var that = this;
- if (arguments.length === 2) {
- var def = arguments[1];
- if (typeof def === 'string') {
- if (def.charAt(0) === '+') {
- defs[name] = projString(arguments[1]);
- } else {
- defs[name] = wkt_parser(arguments[1]);
- }
- } else {
- defs[name] = def;
- }
- } else if (arguments.length === 1) {
- if (Array.isArray(name)) {
- return name.map(function (v) {
- if (Array.isArray(v)) {
- defs.apply(that, v);
- } else {
- defs(v);
- }
- });
- } else if (typeof name === 'string') {
- if (name in defs) {
- return defs[name];
- }
- } else if ('EPSG' in name) {
- defs['EPSG:' + name.EPSG] = name;
- } else if ('ESRI' in name) {
- defs['ESRI:' + name.ESRI] = name;
- } else if ('IAU2000' in name) {
- defs['IAU2000:' + name.IAU2000] = name;
- } else {
- console.log(name);
- }
- return;
- }
- }
- global(defs);
- /* harmony default export */ var lib_defs = (defs);
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/parseCode.js
- function testObj(code) {
- return typeof code === 'string';
- }
- function testDef(code) {
- return code in lib_defs;
- }
- var codeWords = ['PROJECTEDCRS', 'PROJCRS', 'GEOGCS', 'GEOCCS', 'PROJCS', 'LOCAL_CS', 'GEODCRS', 'GEODETICCRS', 'GEODETICDATUM', 'ENGCRS', 'ENGINEERINGCRS'];
- function testWKT(code) {
- return codeWords.some(function (word) {
- return code.indexOf(word) > -1;
- });
- }
- var codes = ['3857', '900913', '3785', '102113'];
- function checkMercator(item) {
- var auth = match(item, 'authority');
- if (!auth) {
- return;
- }
- var code = match(auth, 'epsg');
- return code && codes.indexOf(code) > -1;
- }
- function checkProjStr(item) {
- var ext = match(item, 'extension');
- if (!ext) {
- return;
- }
- return match(ext, 'proj4');
- }
- function testProj(code) {
- return code[0] === '+';
- }
- function parse(code) {
- if (testObj(code)) {
- //check to see if this is a WKT string
- if (testDef(code)) {
- return lib_defs[code];
- }
- if (testWKT(code)) {
- var out = wkt_parser(code); // test of spetial case, due to this being a very common and often malformed
- if (checkMercator(out)) {
- return lib_defs["EPSG:3857"];
- }
- var maybeProjStr = checkProjStr(out);
- if (maybeProjStr) {
- return projString(maybeProjStr);
- }
- return out;
- }
- if (testProj(code)) {
- return projString(code);
- }
- } else {
- return code;
- }
- }
- /* harmony default export */ var parseCode = (parse);
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/extend.js
- /* harmony default export */ function extend(destination, source) {
- destination = destination || {};
- var value, property;
- if (!source) {
- return destination;
- }
- for (property in source) {
- value = source[property];
- if (value !== undefined) {
- destination[property] = value;
- }
- }
- return destination;
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/msfnz.js
- /* harmony default export */ function msfnz(eccent, sinphi, cosphi) {
- var con = eccent * sinphi;
- return cosphi / Math.sqrt(1 - con * con);
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/sign.js
- /* harmony default export */ function sign(x) {
- return x < 0 ? -1 : 1;
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/adjust_lon.js
- /* harmony default export */ function adjust_lon(x) {
- return Math.abs(x) <= SPI ? x : x - sign(x) * TWO_PI;
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/tsfnz.js
- /* harmony default export */ function tsfnz(eccent, phi, sinphi) {
- var con = eccent * sinphi;
- var com = 0.5 * eccent;
- con = Math.pow((1 - con) / (1 + con), com);
- return Math.tan(0.5 * (HALF_PI - phi)) / con;
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/phi2z.js
- /* harmony default export */ function phi2z(eccent, ts) {
- var eccnth = 0.5 * eccent;
- var con, dphi;
- var phi = HALF_PI - 2 * Math.atan(ts);
- for (var i = 0; i <= 15; i++) {
- con = eccent * Math.sin(phi);
- dphi = HALF_PI - 2 * Math.atan(ts * Math.pow((1 - con) / (1 + con), eccnth)) - phi;
- phi += dphi;
- if (Math.abs(dphi) <= 0.0000000001) {
- return phi;
- }
- } //console.log("phi2z has NoConvergence");
- return -9999;
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/merc.js
- function init() {
- var con = this.b / this.a;
- this.es = 1 - con * con;
- if (!('x0' in this)) {
- this.x0 = 0;
- }
- if (!('y0' in this)) {
- this.y0 = 0;
- }
- this.e = Math.sqrt(this.es);
- if (this.lat_ts) {
- if (this.sphere) {
- this.k0 = Math.cos(this.lat_ts);
- } else {
- this.k0 = msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));
- }
- } else {
- if (!this.k0) {
- if (this.k) {
- this.k0 = this.k;
- } else {
- this.k0 = 1;
- }
- }
- }
- }
- /* Mercator forward equations--mapping lat,long to x,y
- --------------------------------------------------*/
- function forward(p) {
- var lon = p.x;
- var lat = p.y; // convert to radians
- if (lat * R2D > 90 && lat * R2D < -90 && lon * R2D > 180 && lon * R2D < -180) {
- return null;
- }
- var x, y;
- if (Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN) {
- return null;
- } else {
- if (this.sphere) {
- x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0);
- y = this.y0 + this.a * this.k0 * Math.log(Math.tan(FORTPI + 0.5 * lat));
- } else {
- var sinphi = Math.sin(lat);
- var ts = tsfnz(this.e, lat, sinphi);
- x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0);
- y = this.y0 - this.a * this.k0 * Math.log(ts);
- }
- p.x = x;
- p.y = y;
- return p;
- }
- }
- /* Mercator inverse equations--mapping x,y to lat/long
- --------------------------------------------------*/
- function inverse(p) {
- var x = p.x - this.x0;
- var y = p.y - this.y0;
- var lon, lat;
- if (this.sphere) {
- lat = HALF_PI - 2 * Math.atan(Math.exp(-y / (this.a * this.k0)));
- } else {
- var ts = Math.exp(-y / (this.a * this.k0));
- lat = phi2z(this.e, ts);
- if (lat === -9999) {
- return null;
- }
- }
- lon = adjust_lon(this.long0 + x / (this.a * this.k0));
- p.x = lon;
- p.y = lat;
- return p;
- }
- var names = ["Mercator", "Popular Visualisation Pseudo Mercator", "Mercator_1SP", "Mercator_Auxiliary_Sphere", "merc"];
- /* harmony default export */ var merc = ({
- init: init,
- forward: forward,
- inverse: inverse,
- names: names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/longlat.js
- function longlat_init() {//no-op for longlat
- }
- function identity(pt) {
- return pt;
- }
- var longlat_names = ["longlat", "identity"];
- /* harmony default export */ var longlat = ({
- init: longlat_init,
- forward: identity,
- inverse: identity,
- names: longlat_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections.js
- var projs = [merc, longlat];
- var projections_names = {};
- var projStore = [];
- function add(proj, i) {
- var len = projStore.length;
- if (!proj.names) {
- console.log(i);
- return true;
- }
- projStore[len] = proj;
- proj.names.forEach(function (n) {
- projections_names[n.toLowerCase()] = len;
- });
- return this;
- }
- function get(name) {
- if (!name) {
- return false;
- }
- var n = name.toLowerCase();
- if (typeof projections_names[n] !== 'undefined' && projStore[projections_names[n]]) {
- return projStore[projections_names[n]];
- }
- }
- function start() {
- projs.forEach(add);
- }
- /* harmony default export */ var projections = ({
- start: start,
- add: add,
- get: get
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/constants/Ellipsoid.js
- var Ellipsoid_exports = {};
- Ellipsoid_exports.MERIT = {
- a: 6378137.0,
- rf: 298.257,
- ellipseName: "MERIT 1983"
- };
- Ellipsoid_exports.SGS85 = {
- a: 6378136.0,
- rf: 298.257,
- ellipseName: "Soviet Geodetic System 85"
- };
- Ellipsoid_exports.GRS80 = {
- a: 6378137.0,
- rf: 298.257222101,
- ellipseName: "GRS 1980(IUGG, 1980)"
- };
- Ellipsoid_exports.IAU76 = {
- a: 6378140.0,
- rf: 298.257,
- ellipseName: "IAU 1976"
- };
- Ellipsoid_exports.airy = {
- a: 6377563.396,
- b: 6356256.910,
- ellipseName: "Airy 1830"
- };
- Ellipsoid_exports.APL4 = {
- a: 6378137,
- rf: 298.25,
- ellipseName: "Appl. Physics. 1965"
- };
- Ellipsoid_exports.NWL9D = {
- a: 6378145.0,
- rf: 298.25,
- ellipseName: "Naval Weapons Lab., 1965"
- };
- Ellipsoid_exports.mod_airy = {
- a: 6377340.189,
- b: 6356034.446,
- ellipseName: "Modified Airy"
- };
- Ellipsoid_exports.andrae = {
- a: 6377104.43,
- rf: 300.0,
- ellipseName: "Andrae 1876 (Den., Iclnd.)"
- };
- Ellipsoid_exports.aust_SA = {
- a: 6378160.0,
- rf: 298.25,
- ellipseName: "Australian Natl & S. Amer. 1969"
- };
- Ellipsoid_exports.GRS67 = {
- a: 6378160.0,
- rf: 298.2471674270,
- ellipseName: "GRS 67(IUGG 1967)"
- };
- Ellipsoid_exports.bessel = {
- a: 6377397.155,
- rf: 299.1528128,
- ellipseName: "Bessel 1841"
- };
- Ellipsoid_exports.bess_nam = {
- a: 6377483.865,
- rf: 299.1528128,
- ellipseName: "Bessel 1841 (Namibia)"
- };
- Ellipsoid_exports.clrk66 = {
- a: 6378206.4,
- b: 6356583.8,
- ellipseName: "Clarke 1866"
- };
- Ellipsoid_exports.clrk80 = {
- a: 6378249.145,
- rf: 293.4663,
- ellipseName: "Clarke 1880 mod."
- };
- Ellipsoid_exports.clrk58 = {
- a: 6378293.645208759,
- rf: 294.2606763692654,
- ellipseName: "Clarke 1858"
- };
- Ellipsoid_exports.CPM = {
- a: 6375738.7,
- rf: 334.29,
- ellipseName: "Comm. des Poids et Mesures 1799"
- };
- Ellipsoid_exports.delmbr = {
- a: 6376428.0,
- rf: 311.5,
- ellipseName: "Delambre 1810 (Belgium)"
- };
- Ellipsoid_exports.engelis = {
- a: 6378136.05,
- rf: 298.2566,
- ellipseName: "Engelis 1985"
- };
- Ellipsoid_exports.evrst30 = {
- a: 6377276.345,
- rf: 300.8017,
- ellipseName: "Everest 1830"
- };
- Ellipsoid_exports.evrst48 = {
- a: 6377304.063,
- rf: 300.8017,
- ellipseName: "Everest 1948"
- };
- Ellipsoid_exports.evrst56 = {
- a: 6377301.243,
- rf: 300.8017,
- ellipseName: "Everest 1956"
- };
- Ellipsoid_exports.evrst69 = {
- a: 6377295.664,
- rf: 300.8017,
- ellipseName: "Everest 1969"
- };
- Ellipsoid_exports.evrstSS = {
- a: 6377298.556,
- rf: 300.8017,
- ellipseName: "Everest (Sabah & Sarawak)"
- };
- Ellipsoid_exports.fschr60 = {
- a: 6378166.0,
- rf: 298.3,
- ellipseName: "Fischer (Mercury Datum) 1960"
- };
- Ellipsoid_exports.fschr60m = {
- a: 6378155.0,
- rf: 298.3,
- ellipseName: "Fischer 1960"
- };
- Ellipsoid_exports.fschr68 = {
- a: 6378150.0,
- rf: 298.3,
- ellipseName: "Fischer 1968"
- };
- Ellipsoid_exports.helmert = {
- a: 6378200.0,
- rf: 298.3,
- ellipseName: "Helmert 1906"
- };
- Ellipsoid_exports.hough = {
- a: 6378270.0,
- rf: 297.0,
- ellipseName: "Hough"
- };
- Ellipsoid_exports.intl = {
- a: 6378388.0,
- rf: 297.0,
- ellipseName: "International 1909 (Hayford)"
- };
- Ellipsoid_exports.kaula = {
- a: 6378163.0,
- rf: 298.24,
- ellipseName: "Kaula 1961"
- };
- Ellipsoid_exports.lerch = {
- a: 6378139.0,
- rf: 298.257,
- ellipseName: "Lerch 1979"
- };
- Ellipsoid_exports.mprts = {
- a: 6397300.0,
- rf: 191.0,
- ellipseName: "Maupertius 1738"
- };
- Ellipsoid_exports.new_intl = {
- a: 6378157.5,
- b: 6356772.2,
- ellipseName: "New International 1967"
- };
- Ellipsoid_exports.plessis = {
- a: 6376523.0,
- rf: 6355863.0,
- ellipseName: "Plessis 1817 (France)"
- };
- Ellipsoid_exports.krass = {
- a: 6378245.0,
- rf: 298.3,
- ellipseName: "Krassovsky, 1942"
- };
- Ellipsoid_exports.SEasia = {
- a: 6378155.0,
- b: 6356773.3205,
- ellipseName: "Southeast Asia"
- };
- Ellipsoid_exports.walbeck = {
- a: 6376896.0,
- b: 6355834.8467,
- ellipseName: "Walbeck"
- };
- Ellipsoid_exports.WGS60 = {
- a: 6378165.0,
- rf: 298.3,
- ellipseName: "WGS 60"
- };
- Ellipsoid_exports.WGS66 = {
- a: 6378145.0,
- rf: 298.25,
- ellipseName: "WGS 66"
- };
- Ellipsoid_exports.WGS7 = {
- a: 6378135.0,
- rf: 298.26,
- ellipseName: "WGS 72"
- };
- var WGS84 = Ellipsoid_exports.WGS84 = {
- a: 6378137.0,
- rf: 298.257223563,
- ellipseName: "WGS 84"
- };
- Ellipsoid_exports.sphere = {
- a: 6370997.0,
- b: 6370997.0,
- ellipseName: "Normal Sphere (r=6370997)"
- };
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/deriveConstants.js
- function eccentricity(a, b, rf, R_A) {
- var a2 = a * a; // used in geocentric
- var b2 = b * b; // used in geocentric
- var es = (a2 - b2) / a2; // e ^ 2
- var e = 0;
- if (R_A) {
- a *= 1 - es * (SIXTH + es * (RA4 + es * RA6));
- a2 = a * a;
- es = 0;
- } else {
- e = Math.sqrt(es); // eccentricity
- }
- var ep2 = (a2 - b2) / b2; // used in geocentric
- return {
- es: es,
- e: e,
- ep2: ep2
- };
- }
- function sphere(a, b, rf, ellps, sphere) {
- if (!a) {
- // do we have an ellipsoid?
- var ellipse = match(Ellipsoid_exports, ellps);
- if (!ellipse) {
- ellipse = WGS84;
- }
- a = ellipse.a;
- b = ellipse.b;
- rf = ellipse.rf;
- }
- if (rf && !b) {
- b = (1.0 - 1.0 / rf) * a;
- }
- if (rf === 0 || Math.abs(a - b) < EPSLN) {
- sphere = true;
- b = a;
- }
- return {
- a: a,
- b: b,
- rf: rf,
- sphere: sphere
- };
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/constants/Datum.js
- var Datum_exports = {};
- Datum_exports.wgs84 = {
- towgs84: "0,0,0",
- ellipse: "WGS84",
- datumName: "WGS84"
- };
- Datum_exports.ch1903 = {
- towgs84: "674.374,15.056,405.346",
- ellipse: "bessel",
- datumName: "swiss"
- };
- Datum_exports.ggrs87 = {
- towgs84: "-199.87,74.79,246.62",
- ellipse: "GRS80",
- datumName: "Greek_Geodetic_Reference_System_1987"
- };
- Datum_exports.nad83 = {
- towgs84: "0,0,0",
- ellipse: "GRS80",
- datumName: "North_American_Datum_1983"
- };
- Datum_exports.nad27 = {
- nadgrids: "@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",
- ellipse: "clrk66",
- datumName: "North_American_Datum_1927"
- };
- Datum_exports.potsdam = {
- towgs84: "606.0,23.0,413.0",
- ellipse: "bessel",
- datumName: "Potsdam Rauenberg 1950 DHDN"
- };
- Datum_exports.carthage = {
- towgs84: "-263.0,6.0,431.0",
- ellipse: "clark80",
- datumName: "Carthage 1934 Tunisia"
- };
- Datum_exports.hermannskogel = {
- towgs84: "653.0,-212.0,449.0",
- ellipse: "bessel",
- datumName: "Hermannskogel"
- };
- Datum_exports.osni52 = {
- towgs84: "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",
- ellipse: "airy",
- datumName: "Irish National"
- };
- Datum_exports.ire65 = {
- towgs84: "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",
- ellipse: "mod_airy",
- datumName: "Ireland 1965"
- };
- Datum_exports.rassadiran = {
- towgs84: "-133.63,-157.5,-158.62",
- ellipse: "intl",
- datumName: "Rassadiran"
- };
- Datum_exports.nzgd49 = {
- towgs84: "59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",
- ellipse: "intl",
- datumName: "New Zealand Geodetic Datum 1949"
- };
- Datum_exports.osgb36 = {
- towgs84: "446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",
- ellipse: "airy",
- datumName: "Airy 1830"
- };
- Datum_exports.s_jtsk = {
- towgs84: "589,76,480",
- ellipse: 'bessel',
- datumName: 'S-JTSK (Ferro)'
- };
- Datum_exports.beduaram = {
- towgs84: '-106,-87,188',
- ellipse: 'clrk80',
- datumName: 'Beduaram'
- };
- Datum_exports.gunung_segara = {
- towgs84: '-403,684,41',
- ellipse: 'bessel',
- datumName: 'Gunung Segara Jakarta'
- };
- Datum_exports.rnb72 = {
- towgs84: "106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",
- ellipse: "intl",
- datumName: "Reseau National Belge 1972"
- };
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/datum.js
- function datum(datumCode, datum_params, a, b, es, ep2) {
- var out = {};
- if (datumCode === undefined || datumCode === 'none') {
- out.datum_type = PJD_NODATUM;
- } else {
- out.datum_type = PJD_WGS84;
- }
- if (datum_params) {
- out.datum_params = datum_params.map(parseFloat);
- if (out.datum_params[0] !== 0 || out.datum_params[1] !== 0 || out.datum_params[2] !== 0) {
- out.datum_type = PJD_3PARAM;
- }
- if (out.datum_params.length > 3) {
- if (out.datum_params[3] !== 0 || out.datum_params[4] !== 0 || out.datum_params[5] !== 0 || out.datum_params[6] !== 0) {
- out.datum_type = PJD_7PARAM;
- out.datum_params[3] *= SEC_TO_RAD;
- out.datum_params[4] *= SEC_TO_RAD;
- out.datum_params[5] *= SEC_TO_RAD;
- out.datum_params[6] = out.datum_params[6] / 1000000.0 + 1.0;
- }
- }
- }
- out.a = a; //datum object also uses these values
- out.b = b;
- out.es = es;
- out.ep2 = ep2;
- return out;
- }
- /* harmony default export */ var lib_datum = (datum);
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/Proj.js
- 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); }
- function Projection(srsCode, callback) {
- if (!(this instanceof Projection)) {
- return new Projection(srsCode);
- }
- callback = callback || function (error) {
- if (error) {
- throw error;
- }
- };
- var json = parseCode(srsCode);
- if (Proj_typeof(json) !== 'object') {
- callback(srsCode);
- return;
- }
- var ourProj = Projection.projections.get(json.projName);
- if (!ourProj) {
- callback(srsCode);
- return;
- }
- if (json.datumCode && json.datumCode !== 'none') {
- var datumDef = match(Datum_exports, json.datumCode);
- if (datumDef) {
- json.datum_params = datumDef.towgs84 ? datumDef.towgs84.split(',') : null;
- json.ellps = datumDef.ellipse;
- json.datumName = datumDef.datumName ? datumDef.datumName : json.datumCode;
- }
- }
- json.k0 = json.k0 || 1.0;
- json.axis = json.axis || 'enu';
- json.ellps = json.ellps || 'wgs84';
- var sphere_ = sphere(json.a, json.b, json.rf, json.ellps, json.sphere);
- var ecc = eccentricity(sphere_.a, sphere_.b, sphere_.rf, json.R_A);
- var datumObj = json.datum || lib_datum(json.datumCode, json.datum_params, sphere_.a, sphere_.b, ecc.es, ecc.ep2);
- extend(this, json); // transfer everything over from the projection because we don't know what we'll need
- extend(this, ourProj); // transfer all the methods from the projection
- // copy the 4 things over we calulated in deriveConstants.sphere
- this.a = sphere_.a;
- this.b = sphere_.b;
- this.rf = sphere_.rf;
- this.sphere = sphere_.sphere; // copy the 3 things we calculated in deriveConstants.eccentricity
- this.es = ecc.es;
- this.e = ecc.e;
- this.ep2 = ecc.ep2; // add in the datum object
- this.datum = datumObj; // init the projection
- this.init(); // legecy callback from back in the day when it went to spatialreference.org
- callback(null, this);
- }
- Projection.projections = projections;
- Projection.projections.start();
- /* harmony default export */ var Proj = (Projection);
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/datumUtils.js
- function compareDatums(source, dest) {
- if (source.datum_type !== dest.datum_type) {
- return false; // false, datums are not equal
- } else if (source.a !== dest.a || Math.abs(source.es - dest.es) > 0.000000000050) {
- // the tolerance for es is to ensure that GRS80 and WGS84
- // are considered identical
- return false;
- } else if (source.datum_type === PJD_3PARAM) {
- 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];
- } else if (source.datum_type === PJD_7PARAM) {
- 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];
- } else {
- return true; // datums are equal
- }
- } // cs_compare_datums()
- /*
- * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates
- * (latitude, longitude, and height) to geocentric coordinates (X, Y, Z),
- * according to the current ellipsoid parameters.
- *
- * Latitude : Geodetic latitude in radians (input)
- * Longitude : Geodetic longitude in radians (input)
- * Height : Geodetic height, in meters (input)
- * X : Calculated Geocentric X coordinate, in meters (output)
- * Y : Calculated Geocentric Y coordinate, in meters (output)
- * Z : Calculated Geocentric Z coordinate, in meters (output)
- *
- */
- function geodeticToGeocentric(p, es, a) {
- var Longitude = p.x;
- var Latitude = p.y;
- var Height = p.z ? p.z : 0; //Z value not always supplied
- var Rn;
- /* Earth radius at location */
- var Sin_Lat;
- /* Math.sin(Latitude) */
- var Sin2_Lat;
- /* Square of Math.sin(Latitude) */
- var Cos_Lat;
- /* Math.cos(Latitude) */
- /*
- ** Don't blow up if Latitude is just a little out of the value
- ** range as it may just be a rounding issue. Also removed longitude
- ** test, it should be wrapped by Math.cos() and Math.sin(). NFW for PROJ.4, Sep/2001.
- */
- if (Latitude < -HALF_PI && Latitude > -1.001 * HALF_PI) {
- Latitude = -HALF_PI;
- } else if (Latitude > HALF_PI && Latitude < 1.001 * HALF_PI) {
- Latitude = HALF_PI;
- } else if (Latitude < -HALF_PI) {
- /* Latitude out of range */
- //..reportError('geocent:lat out of range:' + Latitude);
- return {
- x: -Infinity,
- y: -Infinity,
- z: p.z
- };
- } else if (Latitude > HALF_PI) {
- /* Latitude out of range */
- return {
- x: Infinity,
- y: Infinity,
- z: p.z
- };
- }
- if (Longitude > Math.PI) {
- Longitude -= 2 * Math.PI;
- }
- Sin_Lat = Math.sin(Latitude);
- Cos_Lat = Math.cos(Latitude);
- Sin2_Lat = Sin_Lat * Sin_Lat;
- Rn = a / Math.sqrt(1.0e0 - es * Sin2_Lat);
- return {
- x: (Rn + Height) * Cos_Lat * Math.cos(Longitude),
- y: (Rn + Height) * Cos_Lat * Math.sin(Longitude),
- z: (Rn * (1 - es) + Height) * Sin_Lat
- };
- } // cs_geodetic_to_geocentric()
- function geocentricToGeodetic(p, es, a, b) {
- /* local defintions and variables */
- /* end-criterium of loop, accuracy of sin(Latitude) */
- var genau = 1e-12;
- var genau2 = genau * genau;
- var maxiter = 30;
- var P;
- /* distance between semi-minor axis and location */
- var RR;
- /* distance between center and location */
- var CT;
- /* sin of geocentric latitude */
- var ST;
- /* cos of geocentric latitude */
- var RX;
- var RK;
- var RN;
- /* Earth radius at location */
- var CPHI0;
- /* cos of start or old geodetic latitude in iterations */
- var SPHI0;
- /* sin of start or old geodetic latitude in iterations */
- var CPHI;
- /* cos of searched geodetic latitude */
- var SPHI;
- /* sin of searched geodetic latitude */
- var SDPHI;
- /* end-criterium: addition-theorem of sin(Latitude(iter)-Latitude(iter-1)) */
- var iter;
- /* # of continous iteration, max. 30 is always enough (s.a.) */
- var X = p.x;
- var Y = p.y;
- var Z = p.z ? p.z : 0.0; //Z value not always supplied
- var Longitude;
- var Latitude;
- var Height;
- P = Math.sqrt(X * X + Y * Y);
- RR = Math.sqrt(X * X + Y * Y + Z * Z);
- /* special cases for latitude and longitude */
- if (P / a < genau) {
- /* special case, if P=0. (X=0., Y=0.) */
- Longitude = 0.0;
- /* if (X,Y,Z)=(0.,0.,0.) then Height becomes semi-minor axis
- * of ellipsoid (=center of mass), Latitude becomes PI/2 */
- if (RR / a < genau) {
- Latitude = HALF_PI;
- Height = -b;
- return {
- x: p.x,
- y: p.y,
- z: p.z
- };
- }
- } else {
- /* ellipsoidal (geodetic) longitude
- * interval: -PI < Longitude <= +PI */
- Longitude = Math.atan2(Y, X);
- }
- /* --------------------------------------------------------------
- * Following iterative algorithm was developped by
- * "Institut for Erdmessung", University of Hannover, July 1988.
- * Internet: www.ife.uni-hannover.de
- * Iterative computation of CPHI,SPHI and Height.
- * Iteration of CPHI and SPHI to 10**-12 radian resp.
- * 2*10**-7 arcsec.
- * --------------------------------------------------------------
- */
- CT = Z / RR;
- ST = P / RR;
- RX = 1.0 / Math.sqrt(1.0 - es * (2.0 - es) * ST * ST);
- CPHI0 = ST * (1.0 - es) * RX;
- SPHI0 = CT * RX;
- iter = 0;
- /* loop to find sin(Latitude) resp. Latitude
- * until |sin(Latitude(iter)-Latitude(iter-1))| < genau */
- do {
- iter++;
- RN = a / Math.sqrt(1.0 - es * SPHI0 * SPHI0);
- /* ellipsoidal (geodetic) height */
- Height = P * CPHI0 + Z * SPHI0 - RN * (1.0 - es * SPHI0 * SPHI0);
- RK = es * RN / (RN + Height);
- RX = 1.0 / Math.sqrt(1.0 - RK * (2.0 - RK) * ST * ST);
- CPHI = ST * (1.0 - RK) * RX;
- SPHI = CT * RX;
- SDPHI = SPHI * CPHI0 - CPHI * SPHI0;
- CPHI0 = CPHI;
- SPHI0 = SPHI;
- } while (SDPHI * SDPHI > genau2 && iter < maxiter);
- /* ellipsoidal (geodetic) latitude */
- Latitude = Math.atan(SPHI / Math.abs(CPHI));
- return {
- x: Longitude,
- y: Latitude,
- z: Height
- };
- } // cs_geocentric_to_geodetic()
- /****************************************************************/
- // pj_geocentic_to_wgs84( p )
- // p = point to transform in geocentric coordinates (x,y,z)
- /** point object, nothing fancy, just allows values to be
- passed back and forth by reference rather than by value.
- Other point classes may be used as long as they have
- x and y properties, which will get modified in the transform method.
- */
- function geocentricToWgs84(p, datum_type, datum_params) {
- if (datum_type === PJD_3PARAM) {
- // if( x[io] === HUGE_VAL )
- // continue;
- return {
- x: p.x + datum_params[0],
- y: p.y + datum_params[1],
- z: p.z + datum_params[2]
- };
- } else if (datum_type === PJD_7PARAM) {
- var Dx_BF = datum_params[0];
- var Dy_BF = datum_params[1];
- var Dz_BF = datum_params[2];
- var Rx_BF = datum_params[3];
- var Ry_BF = datum_params[4];
- var Rz_BF = datum_params[5];
- var M_BF = datum_params[6]; // if( x[io] === HUGE_VAL )
- // continue;
- return {
- x: M_BF * (p.x - Rz_BF * p.y + Ry_BF * p.z) + Dx_BF,
- y: M_BF * (Rz_BF * p.x + p.y - Rx_BF * p.z) + Dy_BF,
- z: M_BF * (-Ry_BF * p.x + Rx_BF * p.y + p.z) + Dz_BF
- };
- }
- } // cs_geocentric_to_wgs84
- /****************************************************************/
- // pj_geocentic_from_wgs84()
- // coordinate system definition,
- // point to transform in geocentric coordinates (x,y,z)
- function geocentricFromWgs84(p, datum_type, datum_params) {
- if (datum_type === PJD_3PARAM) {
- //if( x[io] === HUGE_VAL )
- // continue;
- return {
- x: p.x - datum_params[0],
- y: p.y - datum_params[1],
- z: p.z - datum_params[2]
- };
- } else if (datum_type === PJD_7PARAM) {
- var Dx_BF = datum_params[0];
- var Dy_BF = datum_params[1];
- var Dz_BF = datum_params[2];
- var Rx_BF = datum_params[3];
- var Ry_BF = datum_params[4];
- var Rz_BF = datum_params[5];
- var M_BF = datum_params[6];
- var x_tmp = (p.x - Dx_BF) / M_BF;
- var y_tmp = (p.y - Dy_BF) / M_BF;
- var z_tmp = (p.z - Dz_BF) / M_BF; //if( x[io] === HUGE_VAL )
- // continue;
- return {
- x: x_tmp + Rz_BF * y_tmp - Ry_BF * z_tmp,
- y: -Rz_BF * x_tmp + y_tmp + Rx_BF * z_tmp,
- z: Ry_BF * x_tmp - Rx_BF * y_tmp + z_tmp
- };
- } //cs_geocentric_from_wgs84()
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/datum_transform.js
- function checkParams(type) {
- return type === PJD_3PARAM || type === PJD_7PARAM;
- }
- /* harmony default export */ function datum_transform(source, dest, point) {
- // Short cut if the datums are identical.
- if (compareDatums(source, dest)) {
- return point; // in this case, zero is sucess,
- // whereas cs_compare_datums returns 1 to indicate TRUE
- // confusing, should fix this
- } // Explicitly skip datum transform by setting 'datum=none' as parameter for either source or dest
- if (source.datum_type === PJD_NODATUM || dest.datum_type === PJD_NODATUM) {
- return point;
- } // If this datum requires grid shifts, then apply it to geodetic coordinates.
- // Do we need to go through geocentric coordinates?
- if (source.es === dest.es && source.a === dest.a && !checkParams(source.datum_type) && !checkParams(dest.datum_type)) {
- return point;
- } // Convert to geocentric coordinates.
- point = geodeticToGeocentric(point, source.es, source.a); // Convert between datums
- if (checkParams(source.datum_type)) {
- point = geocentricToWgs84(point, source.datum_type, source.datum_params);
- }
- if (checkParams(dest.datum_type)) {
- point = geocentricFromWgs84(point, dest.datum_type, dest.datum_params);
- }
- return geocentricToGeodetic(point, dest.es, dest.a, dest.b);
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/adjust_axis.js
- /* harmony default export */ function adjust_axis(crs, denorm, point) {
- var xin = point.x,
- yin = point.y,
- zin = point.z || 0.0;
- var v, t, i;
- var out = {};
- for (i = 0; i < 3; i++) {
- if (denorm && i === 2 && point.z === undefined) {
- continue;
- }
- if (i === 0) {
- v = xin;
- if ("ew".indexOf(crs.axis[i]) !== -1) {
- t = 'x';
- } else {
- t = 'y';
- }
- } else if (i === 1) {
- v = yin;
- if ("ns".indexOf(crs.axis[i]) !== -1) {
- t = 'y';
- } else {
- t = 'x';
- }
- } else {
- v = zin;
- t = 'z';
- }
- switch (crs.axis[i]) {
- case 'e':
- case 'w':
- case 'n':
- case 's':
- out[t] = v;
- break;
- case 'u':
- if (point[t] !== undefined) {
- out.z = v;
- }
- break;
- case 'd':
- if (point[t] !== undefined) {
- out.z = -v;
- }
- break;
- default:
- //console.log("ERROR: unknow axis ("+crs.axis[i]+") - check definition of "+crs.projName);
- return null;
- }
- }
- return out;
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/toPoint.js
- /* harmony default export */ function toPoint(array) {
- var out = {
- x: array[0],
- y: array[1]
- };
- if (array.length > 2) {
- out.z = array[2];
- }
- if (array.length > 3) {
- out.m = array[3];
- }
- return out;
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/checkSanity.js
- /* harmony default export */ function checkSanity(point) {
- checkCoord(point.x);
- checkCoord(point.y);
- }
- function checkCoord(num) {
- if (typeof Number.isFinite === 'function') {
- if (Number.isFinite(num)) {
- return;
- }
- throw new TypeError('coordinates must be finite numbers');
- }
- if (typeof num !== 'number' || num !== num || !isFinite(num)) {
- throw new TypeError('coordinates must be finite numbers');
- }
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/transform.js
- function checkNotWGS(source, dest) {
- 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';
- }
- function transform(source, dest, point) {
- var wgs84;
- if (Array.isArray(point)) {
- point = toPoint(point);
- }
- checkSanity(point); // Workaround for datum shifts towgs84, if either source or destination projection is not wgs84
- if (source.datum && dest.datum && checkNotWGS(source, dest)) {
- wgs84 = new Proj('WGS84');
- point = transform(source, wgs84, point);
- source = wgs84;
- } // DGR, 2010/11/12
- if (source.axis !== 'enu') {
- point = adjust_axis(source, false, point);
- } // Transform source points to long/lat, if they aren't already.
- if (source.projName === 'longlat') {
- point = {
- x: point.x * D2R,
- y: point.y * D2R,
- z: point.z || 0
- };
- } else {
- if (source.to_meter) {
- point = {
- x: point.x * source.to_meter,
- y: point.y * source.to_meter,
- z: point.z || 0
- };
- }
- point = source.inverse(point); // Convert Cartesian to longlat
- if (!point) {
- return;
- }
- } // Adjust for the prime meridian if necessary
- if (source.from_greenwich) {
- point.x += source.from_greenwich;
- } // Convert datums if needed, and if possible.
- point = datum_transform(source.datum, dest.datum, point); // Adjust for the prime meridian if necessary
- if (dest.from_greenwich) {
- point = {
- x: point.x - dest.from_greenwich,
- y: point.y,
- z: point.z || 0
- };
- }
- if (dest.projName === 'longlat') {
- // convert radians to decimal degrees
- point = {
- x: point.x * R2D,
- y: point.y * R2D,
- z: point.z || 0
- };
- } else {
- // else project
- point = dest.forward(point);
- if (dest.to_meter) {
- point = {
- x: point.x / dest.to_meter,
- y: point.y / dest.to_meter,
- z: point.z || 0
- };
- }
- } // DGR, 2010/11/12
- if (dest.axis !== 'enu') {
- return adjust_axis(dest, true, point);
- }
- return point;
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/core.js
- var wgs84 = Proj('WGS84');
- function transformer(from, to, coords) {
- var transformedArray, out, keys;
- if (Array.isArray(coords)) {
- transformedArray = transform(from, to, coords) || {
- x: NaN,
- y: NaN
- };
- if (coords.length > 2) {
- if (typeof from.name !== 'undefined' && from.name === 'geocent' || typeof to.name !== 'undefined' && to.name === 'geocent') {
- if (typeof transformedArray.z === 'number') {
- return [transformedArray.x, transformedArray.y, transformedArray.z].concat(coords.splice(3));
- } else {
- return [transformedArray.x, transformedArray.y, coords[2]].concat(coords.splice(3));
- }
- } else {
- return [transformedArray.x, transformedArray.y].concat(coords.splice(2));
- }
- } else {
- return [transformedArray.x, transformedArray.y];
- }
- } else {
- out = transform(from, to, coords);
- keys = Object.keys(coords);
- if (keys.length === 2) {
- return out;
- }
- keys.forEach(function (key) {
- if (typeof from.name !== 'undefined' && from.name === 'geocent' || typeof to.name !== 'undefined' && to.name === 'geocent') {
- if (key === 'x' || key === 'y' || key === 'z') {
- return;
- }
- } else {
- if (key === 'x' || key === 'y') {
- return;
- }
- }
- out[key] = coords[key];
- });
- return out;
- }
- }
- function checkProj(item) {
- if (item instanceof Proj) {
- return item;
- }
- if (item.oProj) {
- return item.oProj;
- }
- return Proj(item);
- }
- function proj4(fromProj, toProj, coord) {
- fromProj = checkProj(fromProj);
- var single = false;
- var obj;
- if (typeof toProj === 'undefined') {
- toProj = fromProj;
- fromProj = wgs84;
- single = true;
- } else if (typeof toProj.x !== 'undefined' || Array.isArray(toProj)) {
- coord = toProj;
- toProj = fromProj;
- fromProj = wgs84;
- single = true;
- }
- toProj = checkProj(toProj);
- if (coord) {
- return transformer(fromProj, toProj, coord);
- } else {
- obj = {
- forward: function forward(coords) {
- return transformer(fromProj, toProj, coords);
- },
- inverse: function inverse(coords) {
- return transformer(toProj, fromProj, coords);
- }
- };
- if (single) {
- obj.oProj = toProj;
- }
- return obj;
- }
- }
- /* harmony default export */ var core = (proj4);
- ;// CONCATENATED MODULE: ./node_modules/mgrs/mgrs.js
- /**
- * UTM zones are grouped, and assigned to one of a group of 6
- * sets.
- *
- * {int} @private
- */
- var NUM_100K_SETS = 6;
- /**
- * The column letters (for easting) of the lower left value, per
- * set.
- *
- * {string} @private
- */
- var SET_ORIGIN_COLUMN_LETTERS = 'AJSAJS';
- /**
- * The row letters (for northing) of the lower left value, per
- * set.
- *
- * {string} @private
- */
- var SET_ORIGIN_ROW_LETTERS = 'AFAFAF';
- var A = 65; // A
- var I = 73; // I
- var O = 79; // O
- var V = 86; // V
- var Z = 90; // Z
- /* harmony default export */ var mgrs = ({
- forward: mgrs_forward,
- inverse: mgrs_inverse,
- toPoint: mgrs_toPoint
- });
- /**
- * Conversion of lat/lon to MGRS.
- *
- * @param {object} ll Object literal with lat and lon properties on a
- * WGS84 ellipsoid.
- * @param {int} accuracy Accuracy in digits (5 for 1 m, 4 for 10 m, 3 for
- * 100 m, 2 for 1000 m or 1 for 10000 m). Optional, default is 5.
- * @return {string} the MGRS string for the given location and accuracy.
- */
- function mgrs_forward(ll, accuracy) {
- accuracy = accuracy || 5; // default accuracy 1m
- return encode(LLtoUTM({
- lat: ll[1],
- lon: ll[0]
- }), accuracy);
- }
- ;
- /**
- * Conversion of MGRS to lat/lon.
- *
- * @param {string} mgrs MGRS string.
- * @return {array} An array with left (longitude), bottom (latitude), right
- * (longitude) and top (latitude) values in WGS84, representing the
- * bounding box for the provided MGRS reference.
- */
- function mgrs_inverse(mgrs) {
- var bbox = UTMtoLL(decode(mgrs.toUpperCase()));
- if (bbox.lat && bbox.lon) {
- return [bbox.lon, bbox.lat, bbox.lon, bbox.lat];
- }
- return [bbox.left, bbox.bottom, bbox.right, bbox.top];
- }
- ;
- function mgrs_toPoint(mgrs) {
- var bbox = UTMtoLL(decode(mgrs.toUpperCase()));
- if (bbox.lat && bbox.lon) {
- return [bbox.lon, bbox.lat];
- }
- return [(bbox.left + bbox.right) / 2, (bbox.top + bbox.bottom) / 2];
- }
- ;
- /**
- * Conversion from degrees to radians.
- *
- * @private
- * @param {number} deg the angle in degrees.
- * @return {number} the angle in radians.
- */
- function degToRad(deg) {
- return deg * (Math.PI / 180.0);
- }
- /**
- * Conversion from radians to degrees.
- *
- * @private
- * @param {number} rad the angle in radians.
- * @return {number} the angle in degrees.
- */
- function radToDeg(rad) {
- return 180.0 * (rad / Math.PI);
- }
- /**
- * Converts a set of Longitude and Latitude co-ordinates to UTM
- * using the WGS84 ellipsoid.
- *
- * @private
- * @param {object} ll Object literal with lat and lon properties
- * representing the WGS84 coordinate to be converted.
- * @return {object} Object literal containing the UTM value with easting,
- * northing, zoneNumber and zoneLetter properties, and an optional
- * accuracy property in digits. Returns null if the conversion failed.
- */
- function LLtoUTM(ll) {
- var Lat = ll.lat;
- var Long = ll.lon;
- var a = 6378137.0; //ellip.radius;
- var eccSquared = 0.00669438; //ellip.eccsq;
- var k0 = 0.9996;
- var LongOrigin;
- var eccPrimeSquared;
- var N, T, C, A, M;
- var LatRad = degToRad(Lat);
- var LongRad = degToRad(Long);
- var LongOriginRad;
- var ZoneNumber; // (int)
- ZoneNumber = Math.floor((Long + 180) / 6) + 1; //Make sure the longitude 180.00 is in Zone 60
- if (Long === 180) {
- ZoneNumber = 60;
- } // Special zone for Norway
- if (Lat >= 56.0 && Lat < 64.0 && Long >= 3.0 && Long < 12.0) {
- ZoneNumber = 32;
- } // Special zones for Svalbard
- if (Lat >= 72.0 && Lat < 84.0) {
- if (Long >= 0.0 && Long < 9.0) {
- ZoneNumber = 31;
- } else if (Long >= 9.0 && Long < 21.0) {
- ZoneNumber = 33;
- } else if (Long >= 21.0 && Long < 33.0) {
- ZoneNumber = 35;
- } else if (Long >= 33.0 && Long < 42.0) {
- ZoneNumber = 37;
- }
- }
- LongOrigin = (ZoneNumber - 1) * 6 - 180 + 3; //+3 puts origin
- // in middle of
- // zone
- LongOriginRad = degToRad(LongOrigin);
- eccPrimeSquared = eccSquared / (1 - eccSquared);
- N = a / Math.sqrt(1 - eccSquared * Math.sin(LatRad) * Math.sin(LatRad));
- T = Math.tan(LatRad) * Math.tan(LatRad);
- C = eccPrimeSquared * Math.cos(LatRad) * Math.cos(LatRad);
- A = Math.cos(LatRad) * (LongRad - LongOriginRad);
- 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));
- 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;
- 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));
- if (Lat < 0.0) {
- UTMNorthing += 10000000.0; //10000000 meter offset for
- // southern hemisphere
- }
- return {
- northing: Math.round(UTMNorthing),
- easting: Math.round(UTMEasting),
- zoneNumber: ZoneNumber,
- zoneLetter: getLetterDesignator(Lat)
- };
- }
- /**
- * Converts UTM coords to lat/long, using the WGS84 ellipsoid. This is a convenience
- * class where the Zone can be specified as a single string eg."60N" which
- * is then broken down into the ZoneNumber and ZoneLetter.
- *
- * @private
- * @param {object} utm An object literal with northing, easting, zoneNumber
- * and zoneLetter properties. If an optional accuracy property is
- * provided (in meters), a bounding box will be returned instead of
- * latitude and longitude.
- * @return {object} An object literal containing either lat and lon values
- * (if no accuracy was provided), or top, right, bottom and left values
- * for the bounding box calculated according to the provided accuracy.
- * Returns null if the conversion failed.
- */
- function UTMtoLL(utm) {
- var UTMNorthing = utm.northing;
- var UTMEasting = utm.easting;
- var zoneLetter = utm.zoneLetter;
- var zoneNumber = utm.zoneNumber; // check the ZoneNummber is valid
- if (zoneNumber < 0 || zoneNumber > 60) {
- return null;
- }
- var k0 = 0.9996;
- var a = 6378137.0; //ellip.radius;
- var eccSquared = 0.00669438; //ellip.eccsq;
- var eccPrimeSquared;
- var e1 = (1 - Math.sqrt(1 - eccSquared)) / (1 + Math.sqrt(1 - eccSquared));
- var N1, T1, C1, R1, D, M;
- var LongOrigin;
- var mu, phi1Rad; // remove 500,000 meter offset for longitude
- var x = UTMEasting - 500000.0;
- var y = UTMNorthing; // We must know somehow if we are in the Northern or Southern
- // hemisphere, this is the only time we use the letter So even
- // if the Zone letter isn't exactly correct it should indicate
- // the hemisphere correctly
- if (zoneLetter < 'N') {
- y -= 10000000.0; // remove 10,000,000 meter offset used
- // for southern hemisphere
- } // There are 60 zones with zone 1 being at West -180 to -174
- LongOrigin = (zoneNumber - 1) * 6 - 180 + 3; // +3 puts origin
- // in middle of
- // zone
- eccPrimeSquared = eccSquared / (1 - eccSquared);
- M = y / k0;
- mu = M / (a * (1 - eccSquared / 4 - 3 * eccSquared * eccSquared / 64 - 5 * eccSquared * eccSquared * eccSquared / 256));
- 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);
- N1 = a / Math.sqrt(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad));
- T1 = Math.tan(phi1Rad) * Math.tan(phi1Rad);
- C1 = eccPrimeSquared * Math.cos(phi1Rad) * Math.cos(phi1Rad);
- R1 = a * (1 - eccSquared) / Math.pow(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad), 1.5);
- D = x / (N1 * k0);
- 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);
- lat = radToDeg(lat);
- 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);
- lon = LongOrigin + radToDeg(lon);
- var result;
- if (utm.accuracy) {
- var topRight = UTMtoLL({
- northing: utm.northing + utm.accuracy,
- easting: utm.easting + utm.accuracy,
- zoneLetter: utm.zoneLetter,
- zoneNumber: utm.zoneNumber
- });
- result = {
- top: topRight.lat,
- right: topRight.lon,
- bottom: lat,
- left: lon
- };
- } else {
- result = {
- lat: lat,
- lon: lon
- };
- }
- return result;
- }
- /**
- * Calculates the MGRS letter designator for the given latitude.
- *
- * @private
- * @param {number} lat The latitude in WGS84 to get the letter designator
- * for.
- * @return {char} The letter designator.
- */
- function getLetterDesignator(lat) {
- //This is here as an error flag to show that the Latitude is
- //outside MGRS limits
- var LetterDesignator = 'Z';
- if (84 >= lat && lat >= 72) {
- LetterDesignator = 'X';
- } else if (72 > lat && lat >= 64) {
- LetterDesignator = 'W';
- } else if (64 > lat && lat >= 56) {
- LetterDesignator = 'V';
- } else if (56 > lat && lat >= 48) {
- LetterDesignator = 'U';
- } else if (48 > lat && lat >= 40) {
- LetterDesignator = 'T';
- } else if (40 > lat && lat >= 32) {
- LetterDesignator = 'S';
- } else if (32 > lat && lat >= 24) {
- LetterDesignator = 'R';
- } else if (24 > lat && lat >= 16) {
- LetterDesignator = 'Q';
- } else if (16 > lat && lat >= 8) {
- LetterDesignator = 'P';
- } else if (8 > lat && lat >= 0) {
- LetterDesignator = 'N';
- } else if (0 > lat && lat >= -8) {
- LetterDesignator = 'M';
- } else if (-8 > lat && lat >= -16) {
- LetterDesignator = 'L';
- } else if (-16 > lat && lat >= -24) {
- LetterDesignator = 'K';
- } else if (-24 > lat && lat >= -32) {
- LetterDesignator = 'J';
- } else if (-32 > lat && lat >= -40) {
- LetterDesignator = 'H';
- } else if (-40 > lat && lat >= -48) {
- LetterDesignator = 'G';
- } else if (-48 > lat && lat >= -56) {
- LetterDesignator = 'F';
- } else if (-56 > lat && lat >= -64) {
- LetterDesignator = 'E';
- } else if (-64 > lat && lat >= -72) {
- LetterDesignator = 'D';
- } else if (-72 > lat && lat >= -80) {
- LetterDesignator = 'C';
- }
- return LetterDesignator;
- }
- /**
- * Encodes a UTM location as MGRS string.
- *
- * @private
- * @param {object} utm An object literal with easting, northing,
- * zoneLetter, zoneNumber
- * @param {number} accuracy Accuracy in digits (1-5).
- * @return {string} MGRS string for the given UTM location.
- */
- function encode(utm, accuracy) {
- // prepend with leading zeroes
- var seasting = "00000" + utm.easting,
- snorthing = "00000" + utm.northing;
- return utm.zoneNumber + utm.zoneLetter + get100kID(utm.easting, utm.northing, utm.zoneNumber) + seasting.substr(seasting.length - 5, accuracy) + snorthing.substr(snorthing.length - 5, accuracy);
- }
- /**
- * Get the two letter 100k designator for a given UTM easting,
- * northing and zone number value.
- *
- * @private
- * @param {number} easting
- * @param {number} northing
- * @param {number} zoneNumber
- * @return the two letter 100k designator for the given UTM location.
- */
- function get100kID(easting, northing, zoneNumber) {
- var setParm = get100kSetForZone(zoneNumber);
- var setColumn = Math.floor(easting / 100000);
- var setRow = Math.floor(northing / 100000) % 20;
- return getLetter100kID(setColumn, setRow, setParm);
- }
- /**
- * Given a UTM zone number, figure out the MGRS 100K set it is in.
- *
- * @private
- * @param {number} i An UTM zone number.
- * @return {number} the 100k set the UTM zone is in.
- */
- function get100kSetForZone(i) {
- var setParm = i % NUM_100K_SETS;
- if (setParm === 0) {
- setParm = NUM_100K_SETS;
- }
- return setParm;
- }
- /**
- * Get the two-letter MGRS 100k designator given information
- * translated from the UTM northing, easting and zone number.
- *
- * @private
- * @param {number} column the column index as it relates to the MGRS
- * 100k set spreadsheet, created from the UTM easting.
- * Values are 1-8.
- * @param {number} row the row index as it relates to the MGRS 100k set
- * spreadsheet, created from the UTM northing value. Values
- * are from 0-19.
- * @param {number} parm the set block, as it relates to the MGRS 100k set
- * spreadsheet, created from the UTM zone. Values are from
- * 1-60.
- * @return two letter MGRS 100k code.
- */
- function getLetter100kID(column, row, parm) {
- // colOrigin and rowOrigin are the letters at the origin of the set
- var index = parm - 1;
- var colOrigin = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(index);
- var rowOrigin = SET_ORIGIN_ROW_LETTERS.charCodeAt(index); // colInt and rowInt are the letters to build to return
- var colInt = colOrigin + column - 1;
- var rowInt = rowOrigin + row;
- var rollover = false;
- if (colInt > Z) {
- colInt = colInt - Z + A - 1;
- rollover = true;
- }
- if (colInt === I || colOrigin < I && colInt > I || (colInt > I || colOrigin < I) && rollover) {
- colInt++;
- }
- if (colInt === O || colOrigin < O && colInt > O || (colInt > O || colOrigin < O) && rollover) {
- colInt++;
- if (colInt === I) {
- colInt++;
- }
- }
- if (colInt > Z) {
- colInt = colInt - Z + A - 1;
- }
- if (rowInt > V) {
- rowInt = rowInt - V + A - 1;
- rollover = true;
- } else {
- rollover = false;
- }
- if (rowInt === I || rowOrigin < I && rowInt > I || (rowInt > I || rowOrigin < I) && rollover) {
- rowInt++;
- }
- if (rowInt === O || rowOrigin < O && rowInt > O || (rowInt > O || rowOrigin < O) && rollover) {
- rowInt++;
- if (rowInt === I) {
- rowInt++;
- }
- }
- if (rowInt > V) {
- rowInt = rowInt - V + A - 1;
- }
- var twoLetter = String.fromCharCode(colInt) + String.fromCharCode(rowInt);
- return twoLetter;
- }
- /**
- * Decode the UTM parameters from a MGRS string.
- *
- * @private
- * @param {string} mgrsString an UPPERCASE coordinate string is expected.
- * @return {object} An object literal with easting, northing, zoneLetter,
- * zoneNumber and accuracy (in meters) properties.
- */
- function decode(mgrsString) {
- if (mgrsString && mgrsString.length === 0) {
- throw "MGRSPoint coverting from nothing";
- }
- var length = mgrsString.length;
- var hunK = null;
- var sb = "";
- var testChar;
- var i = 0; // get Zone number
- while (!/[A-Z]/.test(testChar = mgrsString.charAt(i))) {
- if (i >= 2) {
- throw "MGRSPoint bad conversion from: " + mgrsString;
- }
- sb += testChar;
- i++;
- }
- var zoneNumber = parseInt(sb, 10);
- if (i === 0 || i + 3 > length) {
- // A good MGRS string has to be 4-5 digits long,
- // ##AAA/#AAA at least.
- throw "MGRSPoint bad conversion from: " + mgrsString;
- }
- var zoneLetter = mgrsString.charAt(i++); // Should we check the zone letter here? Why not.
- if (zoneLetter <= 'A' || zoneLetter === 'B' || zoneLetter === 'Y' || zoneLetter >= 'Z' || zoneLetter === 'I' || zoneLetter === 'O') {
- throw "MGRSPoint zone letter " + zoneLetter + " not handled: " + mgrsString;
- }
- hunK = mgrsString.substring(i, i += 2);
- var set = get100kSetForZone(zoneNumber);
- var east100k = getEastingFromChar(hunK.charAt(0), set);
- var north100k = getNorthingFromChar(hunK.charAt(1), set); // We have a bug where the northing may be 2000000 too low.
- // How
- // do we know when to roll over?
- while (north100k < getMinNorthing(zoneLetter)) {
- north100k += 2000000;
- } // calculate the char index for easting/northing separator
- var remainder = length - i;
- if (remainder % 2 !== 0) {
- 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;
- }
- var sep = remainder / 2;
- var sepEasting = 0.0;
- var sepNorthing = 0.0;
- var accuracyBonus, sepEastingString, sepNorthingString, easting, northing;
- if (sep > 0) {
- accuracyBonus = 100000.0 / Math.pow(10, sep);
- sepEastingString = mgrsString.substring(i, i + sep);
- sepEasting = parseFloat(sepEastingString) * accuracyBonus;
- sepNorthingString = mgrsString.substring(i + sep);
- sepNorthing = parseFloat(sepNorthingString) * accuracyBonus;
- }
- easting = sepEasting + east100k;
- northing = sepNorthing + north100k;
- return {
- easting: easting,
- northing: northing,
- zoneLetter: zoneLetter,
- zoneNumber: zoneNumber,
- accuracy: accuracyBonus
- };
- }
- /**
- * Given the first letter from a two-letter MGRS 100k zone, and given the
- * MGRS table set for the zone number, figure out the easting value that
- * should be added to the other, secondary easting value.
- *
- * @private
- * @param {char} e The first letter from a two-letter MGRS 100´k zone.
- * @param {number} set The MGRS table set for the zone number.
- * @return {number} The easting value for the given letter and set.
- */
- function getEastingFromChar(e, set) {
- // colOrigin is the letter at the origin of the set for the
- // column
- var curCol = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(set - 1);
- var eastingValue = 100000.0;
- var rewindMarker = false;
- while (curCol !== e.charCodeAt(0)) {
- curCol++;
- if (curCol === I) {
- curCol++;
- }
- if (curCol === O) {
- curCol++;
- }
- if (curCol > Z) {
- if (rewindMarker) {
- throw "Bad character: " + e;
- }
- curCol = A;
- rewindMarker = true;
- }
- eastingValue += 100000.0;
- }
- return eastingValue;
- }
- /**
- * Given the second letter from a two-letter MGRS 100k zone, and given the
- * MGRS table set for the zone number, figure out the northing value that
- * should be added to the other, secondary northing value. You have to
- * remember that Northings are determined from the equator, and the vertical
- * cycle of letters mean a 2000000 additional northing meters. This happens
- * approx. every 18 degrees of latitude. This method does *NOT* count any
- * additional northings. You have to figure out how many 2000000 meters need
- * to be added for the zone letter of the MGRS coordinate.
- *
- * @private
- * @param {char} n Second letter of the MGRS 100k zone
- * @param {number} set The MGRS table set number, which is dependent on the
- * UTM zone number.
- * @return {number} The northing value for the given letter and set.
- */
- function getNorthingFromChar(n, set) {
- if (n > 'V') {
- throw "MGRSPoint given invalid Northing " + n;
- } // rowOrigin is the letter at the origin of the set for the
- // column
- var curRow = SET_ORIGIN_ROW_LETTERS.charCodeAt(set - 1);
- var northingValue = 0.0;
- var rewindMarker = false;
- while (curRow !== n.charCodeAt(0)) {
- curRow++;
- if (curRow === I) {
- curRow++;
- }
- if (curRow === O) {
- curRow++;
- } // fixing a bug making whole application hang in this loop
- // when 'n' is a wrong character
- if (curRow > V) {
- if (rewindMarker) {
- // making sure that this loop ends
- throw "Bad character: " + n;
- }
- curRow = A;
- rewindMarker = true;
- }
- northingValue += 100000.0;
- }
- return northingValue;
- }
- /**
- * The function getMinNorthing returns the minimum northing value of a MGRS
- * zone.
- *
- * Ported from Geotrans' c Lattitude_Band_Value structure table.
- *
- * @private
- * @param {char} zoneLetter The MGRS zone to get the min northing for.
- * @return {number}
- */
- function getMinNorthing(zoneLetter) {
- var northing;
- switch (zoneLetter) {
- case 'C':
- northing = 1100000.0;
- break;
- case 'D':
- northing = 2000000.0;
- break;
- case 'E':
- northing = 2800000.0;
- break;
- case 'F':
- northing = 3700000.0;
- break;
- case 'G':
- northing = 4600000.0;
- break;
- case 'H':
- northing = 5500000.0;
- break;
- case 'J':
- northing = 6400000.0;
- break;
- case 'K':
- northing = 7300000.0;
- break;
- case 'L':
- northing = 8200000.0;
- break;
- case 'M':
- northing = 9100000.0;
- break;
- case 'N':
- northing = 0.0;
- break;
- case 'P':
- northing = 800000.0;
- break;
- case 'Q':
- northing = 1700000.0;
- break;
- case 'R':
- northing = 2600000.0;
- break;
- case 'S':
- northing = 3500000.0;
- break;
- case 'T':
- northing = 4400000.0;
- break;
- case 'U':
- northing = 5300000.0;
- break;
- case 'V':
- northing = 6200000.0;
- break;
- case 'W':
- northing = 7000000.0;
- break;
- case 'X':
- northing = 7900000.0;
- break;
- default:
- northing = -1.0;
- }
- if (northing >= 0.0) {
- return northing;
- } else {
- throw "Invalid zone letter: " + zoneLetter;
- }
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/Point.js
- 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); }
- function lib_Point_Point(x, y, z) {
- if (!(this instanceof lib_Point_Point)) {
- return new lib_Point_Point(x, y, z);
- }
- if (Array.isArray(x)) {
- this.x = x[0];
- this.y = x[1];
- this.z = x[2] || 0.0;
- } else if (lib_Point_typeof(x) === 'object') {
- this.x = x.x;
- this.y = x.y;
- this.z = x.z || 0.0;
- } else if (typeof x === 'string' && typeof y === 'undefined') {
- var coords = x.split(',');
- this.x = parseFloat(coords[0], 10);
- this.y = parseFloat(coords[1], 10);
- this.z = parseFloat(coords[2], 10) || 0.0;
- } else {
- this.x = x;
- this.y = y;
- this.z = z || 0.0;
- }
- console.warn('proj4.Point will be removed in version 3, use proj4.toPoint');
- }
- lib_Point_Point.fromMGRS = function (mgrsStr) {
- return new lib_Point_Point(mgrs_toPoint(mgrsStr));
- };
- lib_Point_Point.prototype.toMGRS = function (accuracy) {
- return mgrs_forward([this.x, this.y], accuracy);
- };
- /* harmony default export */ var lib_Point = (lib_Point_Point);
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/pj_enfn.js
- var C00 = 1;
- var C02 = 0.25;
- var C04 = 0.046875;
- var C06 = 0.01953125;
- var C08 = 0.01068115234375;
- var C22 = 0.75;
- var C44 = 0.46875;
- var C46 = 0.01302083333333333333;
- var C48 = 0.00712076822916666666;
- var C66 = 0.36458333333333333333;
- var C68 = 0.00569661458333333333;
- var C88 = 0.3076171875;
- /* harmony default export */ function pj_enfn(es) {
- var en = [];
- en[0] = C00 - es * (C02 + es * (C04 + es * (C06 + es * C08)));
- en[1] = es * (C22 - es * (C04 + es * (C06 + es * C08)));
- var t = es * es;
- en[2] = t * (C44 - es * (C46 + es * C48));
- t *= es;
- en[3] = t * (C66 - es * C68);
- en[4] = t * es * C88;
- return en;
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/pj_mlfn.js
- /* harmony default export */ function pj_mlfn(phi, sphi, cphi, en) {
- cphi *= sphi;
- sphi *= sphi;
- return en[0] * phi - cphi * (en[1] + sphi * (en[2] + sphi * (en[3] + sphi * en[4])));
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/pj_inv_mlfn.js
- var MAX_ITER = 20;
- /* harmony default export */ function pj_inv_mlfn(arg, es, en) {
- var k = 1 / (1 - es);
- var phi = arg;
- for (var i = MAX_ITER; i; --i) {
- /* rarely goes over 2 iterations */
- var s = Math.sin(phi);
- var t = 1 - es * s * s; //t = this.pj_mlfn(phi, s, Math.cos(phi), en) - arg;
- //phi -= t * (t * Math.sqrt(t)) * k;
- t = (pj_mlfn(phi, s, Math.cos(phi), en) - arg) * (t * Math.sqrt(t)) * k;
- phi -= t;
- if (Math.abs(t) < EPSLN) {
- return phi;
- }
- } //..reportError("cass:pj_inv_mlfn: Convergence error");
- return phi;
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/tmerc.js
- // Heavily based on this tmerc projection implementation
- // https://github.com/mbloch/mapshaper-proj/blob/master/src/projections/tmerc.js
- function tmerc_init() {
- this.x0 = this.x0 !== undefined ? this.x0 : 0;
- this.y0 = this.y0 !== undefined ? this.y0 : 0;
- this.long0 = this.long0 !== undefined ? this.long0 : 0;
- this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;
- if (this.es) {
- this.en = pj_enfn(this.es);
- this.ml0 = pj_mlfn(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en);
- }
- }
- /**
- Transverse Mercator Forward - long/lat to x/y
- long/lat in radians
- */
- function tmerc_forward(p) {
- var lon = p.x;
- var lat = p.y;
- var delta_lon = adjust_lon(lon - this.long0);
- var con;
- var x, y;
- var sin_phi = Math.sin(lat);
- var cos_phi = Math.cos(lat);
- if (!this.es) {
- var b = cos_phi * Math.sin(delta_lon);
- if (Math.abs(Math.abs(b) - 1) < EPSLN) {
- return 93;
- } else {
- x = 0.5 * this.a * this.k0 * Math.log((1 + b) / (1 - b)) + this.x0;
- y = cos_phi * Math.cos(delta_lon) / Math.sqrt(1 - Math.pow(b, 2));
- b = Math.abs(y);
- if (b >= 1) {
- if (b - 1 > EPSLN) {
- return 93;
- } else {
- y = 0;
- }
- } else {
- y = Math.acos(y);
- }
- if (lat < 0) {
- y = -y;
- }
- y = this.a * this.k0 * (y - this.lat0) + this.y0;
- }
- } else {
- var al = cos_phi * delta_lon;
- var als = Math.pow(al, 2);
- var c = this.ep2 * Math.pow(cos_phi, 2);
- var cs = Math.pow(c, 2);
- var tq = Math.abs(cos_phi) > EPSLN ? Math.tan(lat) : 0;
- var t = Math.pow(tq, 2);
- var ts = Math.pow(t, 2);
- con = 1 - this.es * Math.pow(sin_phi, 2);
- al = al / Math.sqrt(con);
- var ml = pj_mlfn(lat, sin_phi, cos_phi, this.en);
- 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;
- 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;
- }
- p.x = x;
- p.y = y;
- return p;
- }
- /**
- Transverse Mercator Inverse - x/y to long/lat
- */
- function tmerc_inverse(p) {
- var con, phi;
- var lat, lon;
- var x = (p.x - this.x0) * (1 / this.a);
- var y = (p.y - this.y0) * (1 / this.a);
- if (!this.es) {
- var f = Math.exp(x / this.k0);
- var g = 0.5 * (f - 1 / f);
- var temp = this.lat0 + y / this.k0;
- var h = Math.cos(temp);
- con = Math.sqrt((1 - Math.pow(h, 2)) / (1 + Math.pow(g, 2)));
- lat = Math.asin(con);
- if (y < 0) {
- lat = -lat;
- }
- if (g === 0 && h === 0) {
- lon = 0;
- } else {
- lon = adjust_lon(Math.atan2(g, h) + this.long0);
- }
- } else {
- // ellipsoidal form
- con = this.ml0 + y / this.k0;
- phi = pj_inv_mlfn(con, this.es, this.en);
- if (Math.abs(phi) < HALF_PI) {
- var sin_phi = Math.sin(phi);
- var cos_phi = Math.cos(phi);
- var tan_phi = Math.abs(cos_phi) > EPSLN ? Math.tan(phi) : 0;
- var c = this.ep2 * Math.pow(cos_phi, 2);
- var cs = Math.pow(c, 2);
- var t = Math.pow(tan_phi, 2);
- var ts = Math.pow(t, 2);
- con = 1 - this.es * Math.pow(sin_phi, 2);
- var d = x * Math.sqrt(con) / this.k0;
- var ds = Math.pow(d, 2);
- con = con * tan_phi;
- 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))));
- 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);
- } else {
- lat = HALF_PI * sign(y);
- lon = 0;
- }
- }
- p.x = lon;
- p.y = lat;
- return p;
- }
- var tmerc_names = ["Transverse_Mercator", "Transverse Mercator", "tmerc"];
- /* harmony default export */ var tmerc = ({
- init: tmerc_init,
- forward: tmerc_forward,
- inverse: tmerc_inverse,
- names: tmerc_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/sinh.js
- /* harmony default export */ function sinh(x) {
- var r = Math.exp(x);
- r = (r - 1 / r) / 2;
- return r;
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/hypot.js
- /* harmony default export */ function hypot(x, y) {
- x = Math.abs(x);
- y = Math.abs(y);
- var a = Math.max(x, y);
- var b = Math.min(x, y) / (a ? a : 1);
- return a * Math.sqrt(1 + Math.pow(b, 2));
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/log1py.js
- /* harmony default export */ function log1py(x) {
- var y = 1 + x;
- var z = y - 1;
- return z === 0 ? x : x * Math.log(y) / z;
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/asinhy.js
- /* harmony default export */ function asinhy(x) {
- var y = Math.abs(x);
- y = log1py(y * (1 + y / (hypot(1, y) + 1)));
- return x < 0 ? -y : y;
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/gatg.js
- /* harmony default export */ function gatg(pp, B) {
- var cos_2B = 2 * Math.cos(2 * B);
- var i = pp.length - 1;
- var h1 = pp[i];
- var h2 = 0;
- var h;
- while (--i >= 0) {
- h = -h2 + cos_2B * h1 + pp[i];
- h2 = h1;
- h1 = h;
- }
- return B + h * Math.sin(2 * B);
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/clens.js
- /* harmony default export */ function clens(pp, arg_r) {
- var r = 2 * Math.cos(arg_r);
- var i = pp.length - 1;
- var hr1 = pp[i];
- var hr2 = 0;
- var hr;
- while (--i >= 0) {
- hr = -hr2 + r * hr1 + pp[i];
- hr2 = hr1;
- hr1 = hr;
- }
- return Math.sin(arg_r) * hr;
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/cosh.js
- /* harmony default export */ function cosh(x) {
- var r = Math.exp(x);
- r = (r + 1 / r) / 2;
- return r;
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/clens_cmplx.js
- /* harmony default export */ function clens_cmplx(pp, arg_r, arg_i) {
- var sin_arg_r = Math.sin(arg_r);
- var cos_arg_r = Math.cos(arg_r);
- var sinh_arg_i = sinh(arg_i);
- var cosh_arg_i = cosh(arg_i);
- var r = 2 * cos_arg_r * cosh_arg_i;
- var i = -2 * sin_arg_r * sinh_arg_i;
- var j = pp.length - 1;
- var hr = pp[j];
- var hi1 = 0;
- var hr1 = 0;
- var hi = 0;
- var hr2;
- var hi2;
- while (--j >= 0) {
- hr2 = hr1;
- hi2 = hi1;
- hr1 = hr;
- hi1 = hi;
- hr = -hr2 + r * hr1 - i * hi1 + pp[j];
- hi = -hi2 + i * hr1 + r * hi1;
- }
- r = sin_arg_r * cosh_arg_i;
- i = cos_arg_r * sinh_arg_i;
- return [r * hr - i * hi, r * hi + i * hr];
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/etmerc.js
- // Heavily based on this etmerc projection implementation
- // https://github.com/mbloch/mapshaper-proj/blob/master/src/projections/etmerc.js
- function etmerc_init() {
- if (this.es === undefined || this.es <= 0) {
- throw new Error('incorrect elliptical usage');
- }
- this.x0 = this.x0 !== undefined ? this.x0 : 0;
- this.y0 = this.y0 !== undefined ? this.y0 : 0;
- this.long0 = this.long0 !== undefined ? this.long0 : 0;
- this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;
- this.cgb = [];
- this.cbg = [];
- this.utg = [];
- this.gtu = [];
- var f = this.es / (1 + Math.sqrt(1 - this.es));
- var n = f / (2 - f);
- var np = n;
- this.cgb[0] = n * (2 + n * (-2 / 3 + n * (-2 + n * (116 / 45 + n * (26 / 45 + n * (-2854 / 675))))));
- this.cbg[0] = n * (-2 + n * (2 / 3 + n * (4 / 3 + n * (-82 / 45 + n * (32 / 45 + n * (4642 / 4725))))));
- np = np * n;
- this.cgb[1] = np * (7 / 3 + n * (-8 / 5 + n * (-227 / 45 + n * (2704 / 315 + n * (2323 / 945)))));
- this.cbg[1] = np * (5 / 3 + n * (-16 / 15 + n * (-13 / 9 + n * (904 / 315 + n * (-1522 / 945)))));
- np = np * n;
- this.cgb[2] = np * (56 / 15 + n * (-136 / 35 + n * (-1262 / 105 + n * (73814 / 2835))));
- this.cbg[2] = np * (-26 / 15 + n * (34 / 21 + n * (8 / 5 + n * (-12686 / 2835))));
- np = np * n;
- this.cgb[3] = np * (4279 / 630 + n * (-332 / 35 + n * (-399572 / 14175)));
- this.cbg[3] = np * (1237 / 630 + n * (-12 / 5 + n * (-24832 / 14175)));
- np = np * n;
- this.cgb[4] = np * (4174 / 315 + n * (-144838 / 6237));
- this.cbg[4] = np * (-734 / 315 + n * (109598 / 31185));
- np = np * n;
- this.cgb[5] = np * (601676 / 22275);
- this.cbg[5] = np * (444337 / 155925);
- np = Math.pow(n, 2);
- this.Qn = this.k0 / (1 + n) * (1 + np * (1 / 4 + np * (1 / 64 + np / 256)));
- this.utg[0] = n * (-0.5 + n * (2 / 3 + n * (-37 / 96 + n * (1 / 360 + n * (81 / 512 + n * (-96199 / 604800))))));
- this.gtu[0] = n * (0.5 + n * (-2 / 3 + n * (5 / 16 + n * (41 / 180 + n * (-127 / 288 + n * (7891 / 37800))))));
- this.utg[1] = np * (-1 / 48 + n * (-1 / 15 + n * (437 / 1440 + n * (-46 / 105 + n * (1118711 / 3870720)))));
- this.gtu[1] = np * (13 / 48 + n * (-3 / 5 + n * (557 / 1440 + n * (281 / 630 + n * (-1983433 / 1935360)))));
- np = np * n;
- this.utg[2] = np * (-17 / 480 + n * (37 / 840 + n * (209 / 4480 + n * (-5569 / 90720))));
- this.gtu[2] = np * (61 / 240 + n * (-103 / 140 + n * (15061 / 26880 + n * (167603 / 181440))));
- np = np * n;
- this.utg[3] = np * (-4397 / 161280 + n * (11 / 504 + n * (830251 / 7257600)));
- this.gtu[3] = np * (49561 / 161280 + n * (-179 / 168 + n * (6601661 / 7257600)));
- np = np * n;
- this.utg[4] = np * (-4583 / 161280 + n * (108847 / 3991680));
- this.gtu[4] = np * (34729 / 80640 + n * (-3418889 / 1995840));
- np = np * n;
- this.utg[5] = np * (-20648693 / 638668800);
- this.gtu[5] = np * (212378941 / 319334400);
- var Z = gatg(this.cbg, this.lat0);
- this.Zb = -this.Qn * (Z + clens(this.gtu, 2 * Z));
- }
- function etmerc_forward(p) {
- var Ce = adjust_lon(p.x - this.long0);
- var Cn = p.y;
- Cn = gatg(this.cbg, Cn);
- var sin_Cn = Math.sin(Cn);
- var cos_Cn = Math.cos(Cn);
- var sin_Ce = Math.sin(Ce);
- var cos_Ce = Math.cos(Ce);
- Cn = Math.atan2(sin_Cn, cos_Ce * cos_Cn);
- Ce = Math.atan2(sin_Ce * cos_Cn, hypot(sin_Cn, cos_Cn * cos_Ce));
- Ce = asinhy(Math.tan(Ce));
- var tmp = clens_cmplx(this.gtu, 2 * Cn, 2 * Ce);
- Cn = Cn + tmp[0];
- Ce = Ce + tmp[1];
- var x;
- var y;
- if (Math.abs(Ce) <= 2.623395162778) {
- x = this.a * (this.Qn * Ce) + this.x0;
- y = this.a * (this.Qn * Cn + this.Zb) + this.y0;
- } else {
- x = Infinity;
- y = Infinity;
- }
- p.x = x;
- p.y = y;
- return p;
- }
- function etmerc_inverse(p) {
- var Ce = (p.x - this.x0) * (1 / this.a);
- var Cn = (p.y - this.y0) * (1 / this.a);
- Cn = (Cn - this.Zb) / this.Qn;
- Ce = Ce / this.Qn;
- var lon;
- var lat;
- if (Math.abs(Ce) <= 2.623395162778) {
- var tmp = clens_cmplx(this.utg, 2 * Cn, 2 * Ce);
- Cn = Cn + tmp[0];
- Ce = Ce + tmp[1];
- Ce = Math.atan(sinh(Ce));
- var sin_Cn = Math.sin(Cn);
- var cos_Cn = Math.cos(Cn);
- var sin_Ce = Math.sin(Ce);
- var cos_Ce = Math.cos(Ce);
- Cn = Math.atan2(sin_Cn * cos_Ce, hypot(sin_Ce, cos_Ce * cos_Cn));
- Ce = Math.atan2(sin_Ce, cos_Ce * cos_Cn);
- lon = adjust_lon(Ce + this.long0);
- lat = gatg(this.cgb, Cn);
- } else {
- lon = Infinity;
- lat = Infinity;
- }
- p.x = lon;
- p.y = lat;
- return p;
- }
- var etmerc_names = ["Extended_Transverse_Mercator", "Extended Transverse Mercator", "etmerc"];
- /* harmony default export */ var etmerc = ({
- init: etmerc_init,
- forward: etmerc_forward,
- inverse: etmerc_inverse,
- names: etmerc_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/adjust_zone.js
- /* harmony default export */ function adjust_zone(zone, lon) {
- if (zone === undefined) {
- zone = Math.floor((adjust_lon(lon) + Math.PI) * 30 / Math.PI) + 1;
- if (zone < 0) {
- return 0;
- } else if (zone > 60) {
- return 60;
- }
- }
- return zone;
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/utm.js
- var dependsOn = 'etmerc';
- function utm_init() {
- var zone = adjust_zone(this.zone, this.long0);
- if (zone === undefined) {
- throw new Error('unknown utm zone');
- }
- this.lat0 = 0;
- this.long0 = (6 * Math.abs(zone) - 183) * D2R;
- this.x0 = 500000;
- this.y0 = this.utmSouth ? 10000000 : 0;
- this.k0 = 0.9996;
- etmerc.init.apply(this);
- this.forward = etmerc.forward;
- this.inverse = etmerc.inverse;
- }
- var utm_names = ["Universal Transverse Mercator System", "utm"];
- /* harmony default export */ var utm = ({
- init: utm_init,
- names: utm_names,
- dependsOn: dependsOn
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/srat.js
- /* harmony default export */ function srat(esinp, exp) {
- return Math.pow((1 - esinp) / (1 + esinp), exp);
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/gauss.js
- var gauss_MAX_ITER = 20;
- function gauss_init() {
- var sphi = Math.sin(this.lat0);
- var cphi = Math.cos(this.lat0);
- cphi *= cphi;
- this.rc = Math.sqrt(1 - this.es) / (1 - this.es * sphi * sphi);
- this.C = Math.sqrt(1 + this.es * cphi * cphi / (1 - this.es));
- this.phic0 = Math.asin(sphi / this.C);
- this.ratexp = 0.5 * this.C * this.e;
- 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));
- }
- function gauss_forward(p) {
- var lon = p.x;
- var lat = p.y;
- 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;
- p.x = this.C * lon;
- return p;
- }
- function gauss_inverse(p) {
- var DEL_TOL = 1e-14;
- var lon = p.x / this.C;
- var lat = p.y;
- var num = Math.pow(Math.tan(0.5 * lat + FORTPI) / this.K, 1 / this.C);
- for (var i = gauss_MAX_ITER; i > 0; --i) {
- lat = 2 * Math.atan(num * srat(this.e * Math.sin(p.y), -0.5 * this.e)) - HALF_PI;
- if (Math.abs(lat - p.y) < DEL_TOL) {
- break;
- }
- p.y = lat;
- }
- /* convergence failed */
- if (!i) {
- return null;
- }
- p.x = lon;
- p.y = lat;
- return p;
- }
- var gauss_names = ["gauss"];
- /* harmony default export */ var gauss = ({
- init: gauss_init,
- forward: gauss_forward,
- inverse: gauss_inverse,
- names: gauss_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/sterea.js
- function sterea_init() {
- gauss.init.apply(this);
- if (!this.rc) {
- return;
- }
- this.sinc0 = Math.sin(this.phic0);
- this.cosc0 = Math.cos(this.phic0);
- this.R2 = 2 * this.rc;
- if (!this.title) {
- this.title = "Oblique Stereographic Alternative";
- }
- }
- function sterea_forward(p) {
- var sinc, cosc, cosl, k;
- p.x = adjust_lon(p.x - this.long0);
- gauss.forward.apply(this, [p]);
- sinc = Math.sin(p.y);
- cosc = Math.cos(p.y);
- cosl = Math.cos(p.x);
- k = this.k0 * this.R2 / (1 + this.sinc0 * sinc + this.cosc0 * cosc * cosl);
- p.x = k * cosc * Math.sin(p.x);
- p.y = k * (this.cosc0 * sinc - this.sinc0 * cosc * cosl);
- p.x = this.a * p.x + this.x0;
- p.y = this.a * p.y + this.y0;
- return p;
- }
- function sterea_inverse(p) {
- var sinc, cosc, lon, lat, rho;
- p.x = (p.x - this.x0) / this.a;
- p.y = (p.y - this.y0) / this.a;
- p.x /= this.k0;
- p.y /= this.k0;
- if (rho = Math.sqrt(p.x * p.x + p.y * p.y)) {
- var c = 2 * Math.atan2(rho, this.R2);
- sinc = Math.sin(c);
- cosc = Math.cos(c);
- lat = Math.asin(cosc * this.sinc0 + p.y * sinc * this.cosc0 / rho);
- lon = Math.atan2(p.x * sinc, rho * this.cosc0 * cosc - p.y * this.sinc0 * sinc);
- } else {
- lat = this.phic0;
- lon = 0;
- }
- p.x = lon;
- p.y = lat;
- gauss.inverse.apply(this, [p]);
- p.x = adjust_lon(p.x + this.long0);
- return p;
- }
- var sterea_names = ["Stereographic_North_Pole", "Oblique_Stereographic", "Polar_Stereographic", "sterea", "Oblique Stereographic Alternative", "Double_Stereographic"];
- /* harmony default export */ var sterea = ({
- init: sterea_init,
- forward: sterea_forward,
- inverse: sterea_inverse,
- names: sterea_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/stere.js
- function ssfn_(phit, sinphi, eccen) {
- sinphi *= eccen;
- return Math.tan(0.5 * (HALF_PI + phit)) * Math.pow((1 - sinphi) / (1 + sinphi), 0.5 * eccen);
- }
- function stere_init() {
- this.coslat0 = Math.cos(this.lat0);
- this.sinlat0 = Math.sin(this.lat0);
- if (this.sphere) {
- if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= EPSLN) {
- this.k0 = 0.5 * (1 + sign(this.lat0) * Math.sin(this.lat_ts));
- }
- } else {
- if (Math.abs(this.coslat0) <= EPSLN) {
- if (this.lat0 > 0) {
- //North pole
- //trace('stere:north pole');
- this.con = 1;
- } else {
- //South pole
- //trace('stere:south pole');
- this.con = -1;
- }
- }
- this.cons = Math.sqrt(Math.pow(1 + this.e, 1 + this.e) * Math.pow(1 - this.e, 1 - this.e));
- if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= EPSLN) {
- 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));
- }
- this.ms1 = msfnz(this.e, this.sinlat0, this.coslat0);
- this.X0 = 2 * Math.atan(this.ssfn_(this.lat0, this.sinlat0, this.e)) - HALF_PI;
- this.cosX0 = Math.cos(this.X0);
- this.sinX0 = Math.sin(this.X0);
- }
- } // Stereographic forward equations--mapping lat,long to x,y
- function stere_forward(p) {
- var lon = p.x;
- var lat = p.y;
- var sinlat = Math.sin(lat);
- var coslat = Math.cos(lat);
- var A, X, sinX, cosX, ts, rh;
- var dlon = adjust_lon(lon - this.long0);
- if (Math.abs(Math.abs(lon - this.long0) - Math.PI) <= EPSLN && Math.abs(lat + this.lat0) <= EPSLN) {
- //case of the origine point
- //trace('stere:this is the origin point');
- p.x = NaN;
- p.y = NaN;
- return p;
- }
- if (this.sphere) {
- //trace('stere:sphere case');
- A = 2 * this.k0 / (1 + this.sinlat0 * sinlat + this.coslat0 * coslat * Math.cos(dlon));
- p.x = this.a * A * coslat * Math.sin(dlon) + this.x0;
- p.y = this.a * A * (this.coslat0 * sinlat - this.sinlat0 * coslat * Math.cos(dlon)) + this.y0;
- return p;
- } else {
- X = 2 * Math.atan(this.ssfn_(lat, sinlat, this.e)) - HALF_PI;
- cosX = Math.cos(X);
- sinX = Math.sin(X);
- if (Math.abs(this.coslat0) <= EPSLN) {
- ts = tsfnz(this.e, lat * this.con, this.con * sinlat);
- rh = 2 * this.a * this.k0 * ts / this.cons;
- p.x = this.x0 + rh * Math.sin(lon - this.long0);
- p.y = this.y0 - this.con * rh * Math.cos(lon - this.long0); //trace(p.toString());
- return p;
- } else if (Math.abs(this.sinlat0) < EPSLN) {
- //Eq
- //trace('stere:equateur');
- A = 2 * this.a * this.k0 / (1 + cosX * Math.cos(dlon));
- p.y = A * sinX;
- } else {
- //other case
- //trace('stere:normal case');
- A = 2 * this.a * this.k0 * this.ms1 / (this.cosX0 * (1 + this.sinX0 * sinX + this.cosX0 * cosX * Math.cos(dlon)));
- p.y = A * (this.cosX0 * sinX - this.sinX0 * cosX * Math.cos(dlon)) + this.y0;
- }
- p.x = A * cosX * Math.sin(dlon) + this.x0;
- } //trace(p.toString());
- return p;
- } //* Stereographic inverse equations--mapping x,y to lat/long
- function stere_inverse(p) {
- p.x -= this.x0;
- p.y -= this.y0;
- var lon, lat, ts, ce, Chi;
- var rh = Math.sqrt(p.x * p.x + p.y * p.y);
- if (this.sphere) {
- var c = 2 * Math.atan(rh / (2 * this.a * this.k0));
- lon = this.long0;
- lat = this.lat0;
- if (rh <= EPSLN) {
- p.x = lon;
- p.y = lat;
- return p;
- }
- lat = Math.asin(Math.cos(c) * this.sinlat0 + p.y * Math.sin(c) * this.coslat0 / rh);
- if (Math.abs(this.coslat0) < EPSLN) {
- if (this.lat0 > 0) {
- lon = adjust_lon(this.long0 + Math.atan2(p.x, -1 * p.y));
- } else {
- lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y));
- }
- } else {
- 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)));
- }
- p.x = lon;
- p.y = lat;
- return p;
- } else {
- if (Math.abs(this.coslat0) <= EPSLN) {
- if (rh <= EPSLN) {
- lat = this.lat0;
- lon = this.long0;
- p.x = lon;
- p.y = lat; //trace(p.toString());
- return p;
- }
- p.x *= this.con;
- p.y *= this.con;
- ts = rh * this.cons / (2 * this.a * this.k0);
- lat = this.con * phi2z(this.e, ts);
- lon = this.con * adjust_lon(this.con * this.long0 + Math.atan2(p.x, -1 * p.y));
- } else {
- ce = 2 * Math.atan(rh * this.cosX0 / (2 * this.a * this.k0 * this.ms1));
- lon = this.long0;
- if (rh <= EPSLN) {
- Chi = this.X0;
- } else {
- Chi = Math.asin(Math.cos(ce) * this.sinX0 + p.y * Math.sin(ce) * this.cosX0 / rh);
- 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)));
- }
- lat = -1 * phi2z(this.e, Math.tan(0.5 * (HALF_PI + Chi)));
- }
- }
- p.x = lon;
- p.y = lat; //trace(p.toString());
- return p;
- }
- var stere_names = ["stere", "Stereographic_South_Pole", "Polar Stereographic (variant B)"];
- /* harmony default export */ var stere = ({
- init: stere_init,
- forward: stere_forward,
- inverse: stere_inverse,
- names: stere_names,
- ssfn_: ssfn_
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/somerc.js
- /*
- references:
- Formules et constantes pour le Calcul pour la
- projection cylindrique conforme à axe oblique et pour la transformation entre
- des systèmes de référence.
- http://www.swisstopo.admin.ch/internet/swisstopo/fr/home/topics/survey/sys/refsys/switzerland.parsysrelated1.31216.downloadList.77004.DownloadFile.tmp/swissprojectionfr.pdf
- */
- function somerc_init() {
- var phy0 = this.lat0;
- this.lambda0 = this.long0;
- var sinPhy0 = Math.sin(phy0);
- var semiMajorAxis = this.a;
- var invF = this.rf;
- var flattening = 1 / invF;
- var e2 = 2 * flattening - Math.pow(flattening, 2);
- var e = this.e = Math.sqrt(e2);
- this.R = this.k0 * semiMajorAxis * Math.sqrt(1 - e2) / (1 - e2 * Math.pow(sinPhy0, 2));
- this.alpha = Math.sqrt(1 + e2 / (1 - e2) * Math.pow(Math.cos(phy0), 4));
- this.b0 = Math.asin(sinPhy0 / this.alpha);
- var k1 = Math.log(Math.tan(Math.PI / 4 + this.b0 / 2));
- var k2 = Math.log(Math.tan(Math.PI / 4 + phy0 / 2));
- var k3 = Math.log((1 + e * sinPhy0) / (1 - e * sinPhy0));
- this.K = k1 - this.alpha * k2 + this.alpha * e / 2 * k3;
- }
- function somerc_forward(p) {
- var Sa1 = Math.log(Math.tan(Math.PI / 4 - p.y / 2));
- var Sa2 = this.e / 2 * Math.log((1 + this.e * Math.sin(p.y)) / (1 - this.e * Math.sin(p.y)));
- var S = -this.alpha * (Sa1 + Sa2) + this.K; // spheric latitude
- var b = 2 * (Math.atan(Math.exp(S)) - Math.PI / 4); // spheric longitude
- var I = this.alpha * (p.x - this.lambda0); // psoeudo equatorial rotation
- var rotI = Math.atan(Math.sin(I) / (Math.sin(this.b0) * Math.tan(b) + Math.cos(this.b0) * Math.cos(I)));
- var rotB = Math.asin(Math.cos(this.b0) * Math.sin(b) - Math.sin(this.b0) * Math.cos(b) * Math.cos(I));
- p.y = this.R / 2 * Math.log((1 + Math.sin(rotB)) / (1 - Math.sin(rotB))) + this.y0;
- p.x = this.R * rotI + this.x0;
- return p;
- }
- function somerc_inverse(p) {
- var Y = p.x - this.x0;
- var X = p.y - this.y0;
- var rotI = Y / this.R;
- var rotB = 2 * (Math.atan(Math.exp(X / this.R)) - Math.PI / 4);
- var b = Math.asin(Math.cos(this.b0) * Math.sin(rotB) + Math.sin(this.b0) * Math.cos(rotB) * Math.cos(rotI));
- var I = Math.atan(Math.sin(rotI) / (Math.cos(this.b0) * Math.cos(rotI) - Math.sin(this.b0) * Math.tan(rotB)));
- var lambda = this.lambda0 + I / this.alpha;
- var S = 0;
- var phy = b;
- var prevPhy = -1000;
- var iteration = 0;
- while (Math.abs(phy - prevPhy) > 0.0000001) {
- if (++iteration > 20) {
- //...reportError("omercFwdInfinity");
- return;
- } //S = Math.log(Math.tan(Math.PI / 4 + phy / 2));
- 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));
- prevPhy = phy;
- phy = 2 * Math.atan(Math.exp(S)) - Math.PI / 2;
- }
- p.x = lambda;
- p.y = phy;
- return p;
- }
- var somerc_names = ["somerc"];
- /* harmony default export */ var somerc = ({
- init: somerc_init,
- forward: somerc_forward,
- inverse: somerc_inverse,
- names: somerc_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/omerc.js
- /* Initialize the Oblique Mercator projection
- ------------------------------------------*/
- function omerc_init() {
- this.no_off = this.no_off || false;
- this.no_rot = this.no_rot || false;
- if (isNaN(this.k0)) {
- this.k0 = 1;
- }
- var sinlat = Math.sin(this.lat0);
- var coslat = Math.cos(this.lat0);
- var con = this.e * sinlat;
- this.bl = Math.sqrt(1 + this.es / (1 - this.es) * Math.pow(coslat, 4));
- this.al = this.a * this.bl * this.k0 * Math.sqrt(1 - this.es) / (1 - con * con);
- var t0 = tsfnz(this.e, this.lat0, sinlat);
- var dl = this.bl / coslat * Math.sqrt((1 - this.es) / (1 - con * con));
- if (dl * dl < 1) {
- dl = 1;
- }
- var fl;
- var gl;
- if (!isNaN(this.longc)) {
- //Central point and azimuth method
- if (this.lat0 >= 0) {
- fl = dl + Math.sqrt(dl * dl - 1);
- } else {
- fl = dl - Math.sqrt(dl * dl - 1);
- }
- this.el = fl * Math.pow(t0, this.bl);
- gl = 0.5 * (fl - 1 / fl);
- this.gamma0 = Math.asin(Math.sin(this.alpha) / dl);
- this.long0 = this.longc - Math.asin(gl * Math.tan(this.gamma0)) / this.bl;
- } else {
- //2 points method
- var t1 = tsfnz(this.e, this.lat1, Math.sin(this.lat1));
- var t2 = tsfnz(this.e, this.lat2, Math.sin(this.lat2));
- if (this.lat0 >= 0) {
- this.el = (dl + Math.sqrt(dl * dl - 1)) * Math.pow(t0, this.bl);
- } else {
- this.el = (dl - Math.sqrt(dl * dl - 1)) * Math.pow(t0, this.bl);
- }
- var hl = Math.pow(t1, this.bl);
- var ll = Math.pow(t2, this.bl);
- fl = this.el / hl;
- gl = 0.5 * (fl - 1 / fl);
- var jl = (this.el * this.el - ll * hl) / (this.el * this.el + ll * hl);
- var pl = (ll - hl) / (ll + hl);
- var dlon12 = adjust_lon(this.long1 - this.long2);
- this.long0 = 0.5 * (this.long1 + this.long2) - Math.atan(jl * Math.tan(0.5 * this.bl * dlon12) / pl) / this.bl;
- this.long0 = adjust_lon(this.long0);
- var dlon10 = adjust_lon(this.long1 - this.long0);
- this.gamma0 = Math.atan(Math.sin(this.bl * dlon10) / gl);
- this.alpha = Math.asin(dl * Math.sin(this.gamma0));
- }
- if (this.no_off) {
- this.uc = 0;
- } else {
- if (this.lat0 >= 0) {
- this.uc = this.al / this.bl * Math.atan2(Math.sqrt(dl * dl - 1), Math.cos(this.alpha));
- } else {
- this.uc = -1 * this.al / this.bl * Math.atan2(Math.sqrt(dl * dl - 1), Math.cos(this.alpha));
- }
- }
- }
- /* Oblique Mercator forward equations--mapping lat,long to x,y
- ----------------------------------------------------------*/
- function omerc_forward(p) {
- var lon = p.x;
- var lat = p.y;
- var dlon = adjust_lon(lon - this.long0);
- var us, vs;
- var con;
- if (Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN) {
- if (lat > 0) {
- con = -1;
- } else {
- con = 1;
- }
- vs = this.al / this.bl * Math.log(Math.tan(FORTPI + con * this.gamma0 * 0.5));
- us = -1 * con * HALF_PI * this.al / this.bl;
- } else {
- var t = tsfnz(this.e, lat, Math.sin(lat));
- var ql = this.el / Math.pow(t, this.bl);
- var sl = 0.5 * (ql - 1 / ql);
- var tl = 0.5 * (ql + 1 / ql);
- var vl = Math.sin(this.bl * dlon);
- var ul = (sl * Math.sin(this.gamma0) - vl * Math.cos(this.gamma0)) / tl;
- if (Math.abs(Math.abs(ul) - 1) <= EPSLN) {
- vs = Number.POSITIVE_INFINITY;
- } else {
- vs = 0.5 * this.al * Math.log((1 - ul) / (1 + ul)) / this.bl;
- }
- if (Math.abs(Math.cos(this.bl * dlon)) <= EPSLN) {
- us = this.al * this.bl * dlon;
- } else {
- us = this.al * Math.atan2(sl * Math.cos(this.gamma0) + vl * Math.sin(this.gamma0), Math.cos(this.bl * dlon)) / this.bl;
- }
- }
- if (this.no_rot) {
- p.x = this.x0 + us;
- p.y = this.y0 + vs;
- } else {
- us -= this.uc;
- p.x = this.x0 + vs * Math.cos(this.alpha) + us * Math.sin(this.alpha);
- p.y = this.y0 + us * Math.cos(this.alpha) - vs * Math.sin(this.alpha);
- }
- return p;
- }
- function omerc_inverse(p) {
- var us, vs;
- if (this.no_rot) {
- vs = p.y - this.y0;
- us = p.x - this.x0;
- } else {
- vs = (p.x - this.x0) * Math.cos(this.alpha) - (p.y - this.y0) * Math.sin(this.alpha);
- us = (p.y - this.y0) * Math.cos(this.alpha) + (p.x - this.x0) * Math.sin(this.alpha);
- us += this.uc;
- }
- var qp = Math.exp(-1 * this.bl * vs / this.al);
- var sp = 0.5 * (qp - 1 / qp);
- var tp = 0.5 * (qp + 1 / qp);
- var vp = Math.sin(this.bl * us / this.al);
- var up = (vp * Math.cos(this.gamma0) + sp * Math.sin(this.gamma0)) / tp;
- var ts = Math.pow(this.el / Math.sqrt((1 + up) / (1 - up)), 1 / this.bl);
- if (Math.abs(up - 1) < EPSLN) {
- p.x = this.long0;
- p.y = HALF_PI;
- } else if (Math.abs(up + 1) < EPSLN) {
- p.x = this.long0;
- p.y = -1 * HALF_PI;
- } else {
- p.y = phi2z(this.e, ts);
- 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);
- }
- return p;
- }
- var omerc_names = ["Hotine_Oblique_Mercator", "Hotine Oblique Mercator", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin", "Hotine_Oblique_Mercator_Azimuth_Center", "omerc"];
- /* harmony default export */ var omerc = ({
- init: omerc_init,
- forward: omerc_forward,
- inverse: omerc_inverse,
- names: omerc_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/lcc.js
- function lcc_init() {
- // array of: r_maj,r_min,lat1,lat2,c_lon,c_lat,false_east,false_north
- //double c_lat; /* center latitude */
- //double c_lon; /* center longitude */
- //double lat1; /* first standard parallel */
- //double lat2; /* second standard parallel */
- //double r_maj; /* major axis */
- //double r_min; /* minor axis */
- //double false_east; /* x offset in meters */
- //double false_north; /* y offset in meters */
- if (!this.lat2) {
- this.lat2 = this.lat1;
- } //if lat2 is not defined
- if (!this.k0) {
- this.k0 = 1;
- }
- this.x0 = this.x0 || 0;
- this.y0 = this.y0 || 0; // Standard Parallels cannot be equal and on opposite sides of the equator
- if (Math.abs(this.lat1 + this.lat2) < EPSLN) {
- return;
- }
- var temp = this.b / this.a;
- this.e = Math.sqrt(1 - temp * temp);
- var sin1 = Math.sin(this.lat1);
- var cos1 = Math.cos(this.lat1);
- var ms1 = msfnz(this.e, sin1, cos1);
- var ts1 = tsfnz(this.e, this.lat1, sin1);
- var sin2 = Math.sin(this.lat2);
- var cos2 = Math.cos(this.lat2);
- var ms2 = msfnz(this.e, sin2, cos2);
- var ts2 = tsfnz(this.e, this.lat2, sin2);
- var ts0 = tsfnz(this.e, this.lat0, Math.sin(this.lat0));
- if (Math.abs(this.lat1 - this.lat2) > EPSLN) {
- this.ns = Math.log(ms1 / ms2) / Math.log(ts1 / ts2);
- } else {
- this.ns = sin1;
- }
- if (isNaN(this.ns)) {
- this.ns = sin1;
- }
- this.f0 = ms1 / (this.ns * Math.pow(ts1, this.ns));
- this.rh = this.a * this.f0 * Math.pow(ts0, this.ns);
- if (!this.title) {
- this.title = "Lambert Conformal Conic";
- }
- } // Lambert Conformal conic forward equations--mapping lat,long to x,y
- // -----------------------------------------------------------------
- function lcc_forward(p) {
- var lon = p.x;
- var lat = p.y; // singular cases :
- if (Math.abs(2 * Math.abs(lat) - Math.PI) <= EPSLN) {
- lat = sign(lat) * (HALF_PI - 2 * EPSLN);
- }
- var con = Math.abs(Math.abs(lat) - HALF_PI);
- var ts, rh1;
- if (con > EPSLN) {
- ts = tsfnz(this.e, lat, Math.sin(lat));
- rh1 = this.a * this.f0 * Math.pow(ts, this.ns);
- } else {
- con = lat * this.ns;
- if (con <= 0) {
- return null;
- }
- rh1 = 0;
- }
- var theta = this.ns * adjust_lon(lon - this.long0);
- p.x = this.k0 * (rh1 * Math.sin(theta)) + this.x0;
- p.y = this.k0 * (this.rh - rh1 * Math.cos(theta)) + this.y0;
- return p;
- } // Lambert Conformal Conic inverse equations--mapping x,y to lat/long
- // -----------------------------------------------------------------
- function lcc_inverse(p) {
- var rh1, con, ts;
- var lat, lon;
- var x = (p.x - this.x0) / this.k0;
- var y = this.rh - (p.y - this.y0) / this.k0;
- if (this.ns > 0) {
- rh1 = Math.sqrt(x * x + y * y);
- con = 1;
- } else {
- rh1 = -Math.sqrt(x * x + y * y);
- con = -1;
- }
- var theta = 0;
- if (rh1 !== 0) {
- theta = Math.atan2(con * x, con * y);
- }
- if (rh1 !== 0 || this.ns > 0) {
- con = 1 / this.ns;
- ts = Math.pow(rh1 / (this.a * this.f0), con);
- lat = phi2z(this.e, ts);
- if (lat === -9999) {
- return null;
- }
- } else {
- lat = -HALF_PI;
- }
- lon = adjust_lon(theta / this.ns + this.long0);
- p.x = lon;
- p.y = lat;
- return p;
- }
- var lcc_names = ["Lambert Tangential Conformal Conic Projection", "Lambert_Conformal_Conic", "Lambert_Conformal_Conic_2SP", "lcc"];
- /* harmony default export */ var lcc = ({
- init: lcc_init,
- forward: lcc_forward,
- inverse: lcc_inverse,
- names: lcc_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/krovak.js
- function krovak_init() {
- this.a = 6377397.155;
- this.es = 0.006674372230614;
- this.e = Math.sqrt(this.es);
- if (!this.lat0) {
- this.lat0 = 0.863937979737193;
- }
- if (!this.long0) {
- this.long0 = 0.7417649320975901 - 0.308341501185665;
- }
- /* if scale not set default to 0.9999 */
- if (!this.k0) {
- this.k0 = 0.9999;
- }
- this.s45 = 0.785398163397448;
- /* 45 */
- this.s90 = 2 * this.s45;
- this.fi0 = this.lat0;
- this.e2 = this.es;
- this.e = Math.sqrt(this.e2);
- this.alfa = Math.sqrt(1 + this.e2 * Math.pow(Math.cos(this.fi0), 4) / (1 - this.e2));
- this.uq = 1.04216856380474;
- this.u0 = Math.asin(Math.sin(this.fi0) / this.alfa);
- this.g = Math.pow((1 + this.e * Math.sin(this.fi0)) / (1 - this.e * Math.sin(this.fi0)), this.alfa * this.e / 2);
- this.k = Math.tan(this.u0 / 2 + this.s45) / Math.pow(Math.tan(this.fi0 / 2 + this.s45), this.alfa) * this.g;
- this.k1 = this.k0;
- this.n0 = this.a * Math.sqrt(1 - this.e2) / (1 - this.e2 * Math.pow(Math.sin(this.fi0), 2));
- this.s0 = 1.37008346281555;
- this.n = Math.sin(this.s0);
- this.ro0 = this.k1 * this.n0 / Math.tan(this.s0);
- this.ad = this.s90 - this.uq;
- }
- /* ellipsoid */
- /* calculate xy from lat/lon */
- /* Constants, identical to inverse transform function */
- function krovak_forward(p) {
- var gfi, u, deltav, s, d, eps, ro;
- var lon = p.x;
- var lat = p.y;
- var delta_lon = adjust_lon(lon - this.long0);
- /* Transformation */
- gfi = Math.pow((1 + this.e * Math.sin(lat)) / (1 - this.e * Math.sin(lat)), this.alfa * this.e / 2);
- u = 2 * (Math.atan(this.k * Math.pow(Math.tan(lat / 2 + this.s45), this.alfa) / gfi) - this.s45);
- deltav = -delta_lon * this.alfa;
- s = Math.asin(Math.cos(this.ad) * Math.sin(u) + Math.sin(this.ad) * Math.cos(u) * Math.cos(deltav));
- d = Math.asin(Math.cos(u) * Math.sin(deltav) / Math.cos(s));
- eps = this.n * d;
- ro = this.ro0 * Math.pow(Math.tan(this.s0 / 2 + this.s45), this.n) / Math.pow(Math.tan(s / 2 + this.s45), this.n);
- p.y = ro * Math.cos(eps) / 1;
- p.x = ro * Math.sin(eps) / 1;
- if (!this.czech) {
- p.y *= -1;
- p.x *= -1;
- }
- return p;
- }
- /* calculate lat/lon from xy */
- function krovak_inverse(p) {
- var u, deltav, s, d, eps, ro, fi1;
- var ok;
- /* Transformation */
- /* revert y, x*/
- var tmp = p.x;
- p.x = p.y;
- p.y = tmp;
- if (!this.czech) {
- p.y *= -1;
- p.x *= -1;
- }
- ro = Math.sqrt(p.x * p.x + p.y * p.y);
- eps = Math.atan2(p.y, p.x);
- d = eps / Math.sin(this.s0);
- s = 2 * (Math.atan(Math.pow(this.ro0 / ro, 1 / this.n) * Math.tan(this.s0 / 2 + this.s45)) - this.s45);
- u = Math.asin(Math.cos(this.ad) * Math.sin(s) - Math.sin(this.ad) * Math.cos(s) * Math.cos(d));
- deltav = Math.asin(Math.cos(s) * Math.sin(d) / Math.cos(u));
- p.x = this.long0 - deltav / this.alfa;
- fi1 = u;
- ok = 0;
- var iter = 0;
- do {
- 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);
- if (Math.abs(fi1 - p.y) < 0.0000000001) {
- ok = 1;
- }
- fi1 = p.y;
- iter += 1;
- } while (ok === 0 && iter < 15);
- if (iter >= 15) {
- return null;
- }
- return p;
- }
- var krovak_names = ["Krovak", "krovak"];
- /* harmony default export */ var krovak = ({
- init: krovak_init,
- forward: krovak_forward,
- inverse: krovak_inverse,
- names: krovak_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/mlfn.js
- /* harmony default export */ function mlfn(e0, e1, e2, e3, phi) {
- return e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi);
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/e0fn.js
- /* harmony default export */ function e0fn(x) {
- return 1 - 0.25 * x * (1 + x / 16 * (3 + 1.25 * x));
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/e1fn.js
- /* harmony default export */ function e1fn(x) {
- return 0.375 * x * (1 + 0.25 * x * (1 + 0.46875 * x));
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/e2fn.js
- /* harmony default export */ function e2fn(x) {
- return 0.05859375 * x * x * (1 + 0.75 * x);
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/e3fn.js
- /* harmony default export */ function e3fn(x) {
- return x * x * x * (35 / 3072);
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/gN.js
- /* harmony default export */ function gN(a, e, sinphi) {
- var temp = e * sinphi;
- return a / Math.sqrt(1 - temp * temp);
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/adjust_lat.js
- /* harmony default export */ function adjust_lat(x) {
- return Math.abs(x) < HALF_PI ? x : x - sign(x) * Math.PI;
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/imlfn.js
- /* harmony default export */ function imlfn(ml, e0, e1, e2, e3) {
- var phi;
- var dphi;
- phi = ml / e0;
- for (var i = 0; i < 15; i++) {
- 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));
- phi += dphi;
- if (Math.abs(dphi) <= 0.0000000001) {
- return phi;
- }
- } //..reportError("IMLFN-CONV:Latitude failed to converge after 15 iterations");
- return NaN;
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/cass.js
- function cass_init() {
- if (!this.sphere) {
- this.e0 = e0fn(this.es);
- this.e1 = e1fn(this.es);
- this.e2 = e2fn(this.es);
- this.e3 = e3fn(this.es);
- this.ml0 = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0);
- }
- }
- /* Cassini forward equations--mapping lat,long to x,y
- -----------------------------------------------------------------------*/
- function cass_forward(p) {
- /* Forward equations
- -----------------*/
- var x, y;
- var lam = p.x;
- var phi = p.y;
- lam = adjust_lon(lam - this.long0);
- if (this.sphere) {
- x = this.a * Math.asin(Math.cos(phi) * Math.sin(lam));
- y = this.a * (Math.atan2(Math.tan(phi), Math.cos(lam)) - this.lat0);
- } else {
- //ellipsoid
- var sinphi = Math.sin(phi);
- var cosphi = Math.cos(phi);
- var nl = gN(this.a, this.e, sinphi);
- var tl = Math.tan(phi) * Math.tan(phi);
- var al = lam * Math.cos(phi);
- var asq = al * al;
- var cl = this.es * cosphi * cosphi / (1 - this.es);
- var ml = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, phi);
- x = nl * al * (1 - asq * tl * (1 / 6 - (8 - tl + 8 * cl) * asq / 120));
- y = ml - this.ml0 + nl * sinphi / cosphi * asq * (0.5 + (5 - tl + 6 * cl) * asq / 24);
- }
- p.x = x + this.x0;
- p.y = y + this.y0;
- return p;
- }
- /* Inverse equations
- -----------------*/
- function cass_inverse(p) {
- p.x -= this.x0;
- p.y -= this.y0;
- var x = p.x / this.a;
- var y = p.y / this.a;
- var phi, lam;
- if (this.sphere) {
- var dd = y + this.lat0;
- phi = Math.asin(Math.sin(dd) * Math.cos(x));
- lam = Math.atan2(Math.tan(x), Math.cos(dd));
- } else {
- /* ellipsoid */
- var ml1 = this.ml0 / this.a + y;
- var phi1 = imlfn(ml1, this.e0, this.e1, this.e2, this.e3);
- if (Math.abs(Math.abs(phi1) - HALF_PI) <= EPSLN) {
- p.x = this.long0;
- p.y = HALF_PI;
- if (y < 0) {
- p.y *= -1;
- }
- return p;
- }
- var nl1 = gN(this.a, this.e, Math.sin(phi1));
- var rl1 = nl1 * nl1 * nl1 / this.a / this.a * (1 - this.es);
- var tl1 = Math.pow(Math.tan(phi1), 2);
- var dl = x * this.a / nl1;
- var dsq = dl * dl;
- phi = phi1 - nl1 * Math.tan(phi1) / rl1 * dl * dl * (0.5 - (1 + 3 * tl1) * dl * dl / 24);
- lam = dl * (1 - dsq * (tl1 / 3 + (1 + 3 * tl1) * tl1 * dsq / 15)) / Math.cos(phi1);
- }
- p.x = adjust_lon(lam + this.long0);
- p.y = adjust_lat(phi);
- return p;
- }
- var cass_names = ["Cassini", "Cassini_Soldner", "cass"];
- /* harmony default export */ var cass = ({
- init: cass_init,
- forward: cass_forward,
- inverse: cass_inverse,
- names: cass_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/qsfnz.js
- /* harmony default export */ function qsfnz(eccent, sinphi) {
- var con;
- if (eccent > 1.0e-7) {
- con = eccent * sinphi;
- return (1 - eccent * eccent) * (sinphi / (1 - con * con) - 0.5 / eccent * Math.log((1 - con) / (1 + con)));
- } else {
- return 2 * sinphi;
- }
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/laea.js
- /*
- reference
- "New Equal-Area Map Projections for Noncircular Regions", John P. Snyder,
- The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.
- */
- var S_POLE = 1;
- var N_POLE = 2;
- var EQUIT = 3;
- var OBLIQ = 4;
- /* Initialize the Lambert Azimuthal Equal Area projection
- ------------------------------------------------------*/
- function laea_init() {
- var t = Math.abs(this.lat0);
- if (Math.abs(t - HALF_PI) < EPSLN) {
- this.mode = this.lat0 < 0 ? this.S_POLE : this.N_POLE;
- } else if (Math.abs(t) < EPSLN) {
- this.mode = this.EQUIT;
- } else {
- this.mode = this.OBLIQ;
- }
- if (this.es > 0) {
- var sinphi;
- this.qp = qsfnz(this.e, 1);
- this.mmf = 0.5 / (1 - this.es);
- this.apa = authset(this.es);
- switch (this.mode) {
- case this.N_POLE:
- this.dd = 1;
- break;
- case this.S_POLE:
- this.dd = 1;
- break;
- case this.EQUIT:
- this.rq = Math.sqrt(0.5 * this.qp);
- this.dd = 1 / this.rq;
- this.xmf = 1;
- this.ymf = 0.5 * this.qp;
- break;
- case this.OBLIQ:
- this.rq = Math.sqrt(0.5 * this.qp);
- sinphi = Math.sin(this.lat0);
- this.sinb1 = qsfnz(this.e, sinphi) / this.qp;
- this.cosb1 = Math.sqrt(1 - this.sinb1 * this.sinb1);
- this.dd = Math.cos(this.lat0) / (Math.sqrt(1 - this.es * sinphi * sinphi) * this.rq * this.cosb1);
- this.ymf = (this.xmf = this.rq) / this.dd;
- this.xmf *= this.dd;
- break;
- }
- } else {
- if (this.mode === this.OBLIQ) {
- this.sinph0 = Math.sin(this.lat0);
- this.cosph0 = Math.cos(this.lat0);
- }
- }
- }
- /* Lambert Azimuthal Equal Area forward equations--mapping lat,long to x,y
- -----------------------------------------------------------------------*/
- function laea_forward(p) {
- /* Forward equations
- -----------------*/
- var x, y, coslam, sinlam, sinphi, q, sinb, cosb, b, cosphi;
- var lam = p.x;
- var phi = p.y;
- lam = adjust_lon(lam - this.long0);
- if (this.sphere) {
- sinphi = Math.sin(phi);
- cosphi = Math.cos(phi);
- coslam = Math.cos(lam);
- if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
- y = this.mode === this.EQUIT ? 1 + cosphi * coslam : 1 + this.sinph0 * sinphi + this.cosph0 * cosphi * coslam;
- if (y <= EPSLN) {
- return null;
- }
- y = Math.sqrt(2 / y);
- x = y * cosphi * Math.sin(lam);
- y *= this.mode === this.EQUIT ? sinphi : this.cosph0 * sinphi - this.sinph0 * cosphi * coslam;
- } else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {
- if (this.mode === this.N_POLE) {
- coslam = -coslam;
- }
- if (Math.abs(phi + this.lat0) < EPSLN) {
- return null;
- }
- y = FORTPI - phi * 0.5;
- y = 2 * (this.mode === this.S_POLE ? Math.cos(y) : Math.sin(y));
- x = y * Math.sin(lam);
- y *= coslam;
- }
- } else {
- sinb = 0;
- cosb = 0;
- b = 0;
- coslam = Math.cos(lam);
- sinlam = Math.sin(lam);
- sinphi = Math.sin(phi);
- q = qsfnz(this.e, sinphi);
- if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
- sinb = q / this.qp;
- cosb = Math.sqrt(1 - sinb * sinb);
- }
- switch (this.mode) {
- case this.OBLIQ:
- b = 1 + this.sinb1 * sinb + this.cosb1 * cosb * coslam;
- break;
- case this.EQUIT:
- b = 1 + cosb * coslam;
- break;
- case this.N_POLE:
- b = HALF_PI + phi;
- q = this.qp - q;
- break;
- case this.S_POLE:
- b = phi - HALF_PI;
- q = this.qp + q;
- break;
- }
- if (Math.abs(b) < EPSLN) {
- return null;
- }
- switch (this.mode) {
- case this.OBLIQ:
- case this.EQUIT:
- b = Math.sqrt(2 / b);
- if (this.mode === this.OBLIQ) {
- y = this.ymf * b * (this.cosb1 * sinb - this.sinb1 * cosb * coslam);
- } else {
- y = (b = Math.sqrt(2 / (1 + cosb * coslam))) * sinb * this.ymf;
- }
- x = this.xmf * b * cosb * sinlam;
- break;
- case this.N_POLE:
- case this.S_POLE:
- if (q >= 0) {
- x = (b = Math.sqrt(q)) * sinlam;
- y = coslam * (this.mode === this.S_POLE ? b : -b);
- } else {
- x = y = 0;
- }
- break;
- }
- }
- p.x = this.a * x + this.x0;
- p.y = this.a * y + this.y0;
- return p;
- }
- /* Inverse equations
- -----------------*/
- function laea_inverse(p) {
- p.x -= this.x0;
- p.y -= this.y0;
- var x = p.x / this.a;
- var y = p.y / this.a;
- var lam, phi, cCe, sCe, q, rho, ab;
- if (this.sphere) {
- var cosz = 0,
- rh,
- sinz = 0;
- rh = Math.sqrt(x * x + y * y);
- phi = rh * 0.5;
- if (phi > 1) {
- return null;
- }
- phi = 2 * Math.asin(phi);
- if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
- sinz = Math.sin(phi);
- cosz = Math.cos(phi);
- }
- switch (this.mode) {
- case this.EQUIT:
- phi = Math.abs(rh) <= EPSLN ? 0 : Math.asin(y * sinz / rh);
- x *= sinz;
- y = cosz * rh;
- break;
- case this.OBLIQ:
- phi = Math.abs(rh) <= EPSLN ? this.lat0 : Math.asin(cosz * this.sinph0 + y * sinz * this.cosph0 / rh);
- x *= sinz * this.cosph0;
- y = (cosz - Math.sin(phi) * this.sinph0) * rh;
- break;
- case this.N_POLE:
- y = -y;
- phi = HALF_PI - phi;
- break;
- case this.S_POLE:
- phi -= HALF_PI;
- break;
- }
- lam = y === 0 && (this.mode === this.EQUIT || this.mode === this.OBLIQ) ? 0 : Math.atan2(x, y);
- } else {
- ab = 0;
- if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
- x /= this.dd;
- y *= this.dd;
- rho = Math.sqrt(x * x + y * y);
- if (rho < EPSLN) {
- p.x = this.long0;
- p.y = this.lat0;
- return p;
- }
- sCe = 2 * Math.asin(0.5 * rho / this.rq);
- cCe = Math.cos(sCe);
- x *= sCe = Math.sin(sCe);
- if (this.mode === this.OBLIQ) {
- ab = cCe * this.sinb1 + y * sCe * this.cosb1 / rho;
- q = this.qp * ab;
- y = rho * this.cosb1 * cCe - y * this.sinb1 * sCe;
- } else {
- ab = y * sCe / rho;
- q = this.qp * ab;
- y = rho * cCe;
- }
- } else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {
- if (this.mode === this.N_POLE) {
- y = -y;
- }
- q = x * x + y * y;
- if (!q) {
- p.x = this.long0;
- p.y = this.lat0;
- return p;
- }
- ab = 1 - q / this.qp;
- if (this.mode === this.S_POLE) {
- ab = -ab;
- }
- }
- lam = Math.atan2(x, y);
- phi = authlat(Math.asin(ab), this.apa);
- }
- p.x = adjust_lon(this.long0 + lam);
- p.y = phi;
- return p;
- }
- /* determine latitude from authalic latitude */
- var P00 = 0.33333333333333333333;
- var P01 = 0.17222222222222222222;
- var P02 = 0.10257936507936507936;
- var P10 = 0.06388888888888888888;
- var P11 = 0.06640211640211640211;
- var P20 = 0.01641501294219154443;
- function authset(es) {
- var t;
- var APA = [];
- APA[0] = es * P00;
- t = es * es;
- APA[0] += t * P01;
- APA[1] = t * P10;
- t *= es;
- APA[0] += t * P02;
- APA[1] += t * P11;
- APA[2] = t * P20;
- return APA;
- }
- function authlat(beta, APA) {
- var t = beta + beta;
- return beta + APA[0] * Math.sin(t) + APA[1] * Math.sin(t + t) + APA[2] * Math.sin(t + t + t);
- }
- var laea_names = ["Lambert Azimuthal Equal Area", "Lambert_Azimuthal_Equal_Area", "laea"];
- /* harmony default export */ var laea = ({
- init: laea_init,
- forward: laea_forward,
- inverse: laea_inverse,
- names: laea_names,
- S_POLE: S_POLE,
- N_POLE: N_POLE,
- EQUIT: EQUIT,
- OBLIQ: OBLIQ
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/asinz.js
- /* harmony default export */ function asinz(x) {
- if (Math.abs(x) > 1) {
- x = x > 1 ? 1 : -1;
- }
- return Math.asin(x);
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/aea.js
- function aea_init() {
- if (Math.abs(this.lat1 + this.lat2) < EPSLN) {
- return;
- }
- this.temp = this.b / this.a;
- this.es = 1 - Math.pow(this.temp, 2);
- this.e3 = Math.sqrt(this.es);
- this.sin_po = Math.sin(this.lat1);
- this.cos_po = Math.cos(this.lat1);
- this.t1 = this.sin_po;
- this.con = this.sin_po;
- this.ms1 = msfnz(this.e3, this.sin_po, this.cos_po);
- this.qs1 = qsfnz(this.e3, this.sin_po, this.cos_po);
- this.sin_po = Math.sin(this.lat2);
- this.cos_po = Math.cos(this.lat2);
- this.t2 = this.sin_po;
- this.ms2 = msfnz(this.e3, this.sin_po, this.cos_po);
- this.qs2 = qsfnz(this.e3, this.sin_po, this.cos_po);
- this.sin_po = Math.sin(this.lat0);
- this.cos_po = Math.cos(this.lat0);
- this.t3 = this.sin_po;
- this.qs0 = qsfnz(this.e3, this.sin_po, this.cos_po);
- if (Math.abs(this.lat1 - this.lat2) > EPSLN) {
- this.ns0 = (this.ms1 * this.ms1 - this.ms2 * this.ms2) / (this.qs2 - this.qs1);
- } else {
- this.ns0 = this.con;
- }
- this.c = this.ms1 * this.ms1 + this.ns0 * this.qs1;
- this.rh = this.a * Math.sqrt(this.c - this.ns0 * this.qs0) / this.ns0;
- }
- /* Albers Conical Equal Area forward equations--mapping lat,long to x,y
- -------------------------------------------------------------------*/
- function aea_forward(p) {
- var lon = p.x;
- var lat = p.y;
- this.sin_phi = Math.sin(lat);
- this.cos_phi = Math.cos(lat);
- var qs = qsfnz(this.e3, this.sin_phi, this.cos_phi);
- var rh1 = this.a * Math.sqrt(this.c - this.ns0 * qs) / this.ns0;
- var theta = this.ns0 * adjust_lon(lon - this.long0);
- var x = rh1 * Math.sin(theta) + this.x0;
- var y = this.rh - rh1 * Math.cos(theta) + this.y0;
- p.x = x;
- p.y = y;
- return p;
- }
- function aea_inverse(p) {
- var rh1, qs, con, theta, lon, lat;
- p.x -= this.x0;
- p.y = this.rh - p.y + this.y0;
- if (this.ns0 >= 0) {
- rh1 = Math.sqrt(p.x * p.x + p.y * p.y);
- con = 1;
- } else {
- rh1 = -Math.sqrt(p.x * p.x + p.y * p.y);
- con = -1;
- }
- theta = 0;
- if (rh1 !== 0) {
- theta = Math.atan2(con * p.x, con * p.y);
- }
- con = rh1 * this.ns0 / this.a;
- if (this.sphere) {
- lat = Math.asin((this.c - con * con) / (2 * this.ns0));
- } else {
- qs = (this.c - con * con) / this.ns0;
- lat = this.phi1z(this.e3, qs);
- }
- lon = adjust_lon(theta / this.ns0 + this.long0);
- p.x = lon;
- p.y = lat;
- return p;
- }
- /* Function to compute phi1, the latitude for the inverse of the
- Albers Conical Equal-Area projection.
- -------------------------------------------*/
- function phi1z(eccent, qs) {
- var sinphi, cosphi, con, com, dphi;
- var phi = asinz(0.5 * qs);
- if (eccent < EPSLN) {
- return phi;
- }
- var eccnts = eccent * eccent;
- for (var i = 1; i <= 25; i++) {
- sinphi = Math.sin(phi);
- cosphi = Math.cos(phi);
- con = eccent * sinphi;
- com = 1 - con * con;
- dphi = 0.5 * com * com / cosphi * (qs / (1 - eccnts) - sinphi / com + 0.5 / eccent * Math.log((1 - con) / (1 + con)));
- phi = phi + dphi;
- if (Math.abs(dphi) <= 1e-7) {
- return phi;
- }
- }
- return null;
- }
- var aea_names = ["Albers_Conic_Equal_Area", "Albers", "aea"];
- /* harmony default export */ var aea = ({
- init: aea_init,
- forward: aea_forward,
- inverse: aea_inverse,
- names: aea_names,
- phi1z: phi1z
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/gnom.js
- /*
- reference:
- Wolfram Mathworld "Gnomonic Projection"
- http://mathworld.wolfram.com/GnomonicProjection.html
- Accessed: 12th November 2009
- */
- function gnom_init() {
- /* Place parameters in static storage for common use
- -------------------------------------------------*/
- this.sin_p14 = Math.sin(this.lat0);
- this.cos_p14 = Math.cos(this.lat0); // Approximation for projecting points to the horizon (infinity)
- this.infinity_dist = 1000 * this.a;
- this.rc = 1;
- }
- /* Gnomonic forward equations--mapping lat,long to x,y
- ---------------------------------------------------*/
- function gnom_forward(p) {
- var sinphi, cosphi;
- /* sin and cos value */
- var dlon;
- /* delta longitude value */
- var coslon;
- /* cos of longitude */
- var ksp;
- /* scale factor */
- var g;
- var x, y;
- var lon = p.x;
- var lat = p.y;
- /* Forward equations
- -----------------*/
- dlon = adjust_lon(lon - this.long0);
- sinphi = Math.sin(lat);
- cosphi = Math.cos(lat);
- coslon = Math.cos(dlon);
- g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon;
- ksp = 1;
- if (g > 0 || Math.abs(g) <= EPSLN) {
- x = this.x0 + this.a * ksp * cosphi * Math.sin(dlon) / g;
- y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon) / g;
- } else {
- // Point is in the opposing hemisphere and is unprojectable
- // We still need to return a reasonable point, so we project
- // to infinity, on a bearing
- // equivalent to the northern hemisphere equivalent
- // This is a reasonable approximation for short shapes and lines that
- // straddle the horizon.
- x = this.x0 + this.infinity_dist * cosphi * Math.sin(dlon);
- y = this.y0 + this.infinity_dist * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);
- }
- p.x = x;
- p.y = y;
- return p;
- }
- function gnom_inverse(p) {
- var rh;
- /* Rho */
- var sinc, cosc;
- var c;
- var lon, lat;
- /* Inverse equations
- -----------------*/
- p.x = (p.x - this.x0) / this.a;
- p.y = (p.y - this.y0) / this.a;
- p.x /= this.k0;
- p.y /= this.k0;
- if (rh = Math.sqrt(p.x * p.x + p.y * p.y)) {
- c = Math.atan2(rh, this.rc);
- sinc = Math.sin(c);
- cosc = Math.cos(c);
- lat = asinz(cosc * this.sin_p14 + p.y * sinc * this.cos_p14 / rh);
- lon = Math.atan2(p.x * sinc, rh * this.cos_p14 * cosc - p.y * this.sin_p14 * sinc);
- lon = adjust_lon(this.long0 + lon);
- } else {
- lat = this.phic0;
- lon = 0;
- }
- p.x = lon;
- p.y = lat;
- return p;
- }
- var gnom_names = ["gnom"];
- /* harmony default export */ var gnom = ({
- init: gnom_init,
- forward: gnom_forward,
- inverse: gnom_inverse,
- names: gnom_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/iqsfnz.js
- /* harmony default export */ function iqsfnz(eccent, q) {
- var temp = 1 - (1 - eccent * eccent) / (2 * eccent) * Math.log((1 - eccent) / (1 + eccent));
- if (Math.abs(Math.abs(q) - temp) < 1.0E-6) {
- if (q < 0) {
- return -1 * HALF_PI;
- } else {
- return HALF_PI;
- }
- } //var phi = 0.5* q/(1-eccent*eccent);
- var phi = Math.asin(0.5 * q);
- var dphi;
- var sin_phi;
- var cos_phi;
- var con;
- for (var i = 0; i < 30; i++) {
- sin_phi = Math.sin(phi);
- cos_phi = Math.cos(phi);
- con = eccent * sin_phi;
- 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)));
- phi += dphi;
- if (Math.abs(dphi) <= 0.0000000001) {
- return phi;
- }
- } //console.log("IQSFN-CONV:Latitude failed to converge after 30 iterations");
- return NaN;
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/cea.js
- /*
- reference:
- "Cartographic Projection Procedures for the UNIX Environment-
- A User's Manual" by Gerald I. Evenden,
- USGS Open File Report 90-284and Release 4 Interim Reports (2003)
- */
- function cea_init() {
- //no-op
- if (!this.sphere) {
- this.k0 = msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));
- }
- }
- /* Cylindrical Equal Area forward equations--mapping lat,long to x,y
- ------------------------------------------------------------*/
- function cea_forward(p) {
- var lon = p.x;
- var lat = p.y;
- var x, y;
- /* Forward equations
- -----------------*/
- var dlon = adjust_lon(lon - this.long0);
- if (this.sphere) {
- x = this.x0 + this.a * dlon * Math.cos(this.lat_ts);
- y = this.y0 + this.a * Math.sin(lat) / Math.cos(this.lat_ts);
- } else {
- var qs = qsfnz(this.e, Math.sin(lat));
- x = this.x0 + this.a * this.k0 * dlon;
- y = this.y0 + this.a * qs * 0.5 / this.k0;
- }
- p.x = x;
- p.y = y;
- return p;
- }
- /* Cylindrical Equal Area inverse equations--mapping x,y to lat/long
- ------------------------------------------------------------*/
- function cea_inverse(p) {
- p.x -= this.x0;
- p.y -= this.y0;
- var lon, lat;
- if (this.sphere) {
- lon = adjust_lon(this.long0 + p.x / this.a / Math.cos(this.lat_ts));
- lat = Math.asin(p.y / this.a * Math.cos(this.lat_ts));
- } else {
- lat = iqsfnz(this.e, 2 * p.y * this.k0 / this.a);
- lon = adjust_lon(this.long0 + p.x / (this.a * this.k0));
- }
- p.x = lon;
- p.y = lat;
- return p;
- }
- var cea_names = ["cea"];
- /* harmony default export */ var cea = ({
- init: cea_init,
- forward: cea_forward,
- inverse: cea_inverse,
- names: cea_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/eqc.js
- function eqc_init() {
- this.x0 = this.x0 || 0;
- this.y0 = this.y0 || 0;
- this.lat0 = this.lat0 || 0;
- this.long0 = this.long0 || 0;
- this.lat_ts = this.lat_ts || 0;
- this.title = this.title || "Equidistant Cylindrical (Plate Carre)";
- this.rc = Math.cos(this.lat_ts);
- } // forward equations--mapping lat,long to x,y
- // -----------------------------------------------------------------
- function eqc_forward(p) {
- var lon = p.x;
- var lat = p.y;
- var dlon = adjust_lon(lon - this.long0);
- var dlat = adjust_lat(lat - this.lat0);
- p.x = this.x0 + this.a * dlon * this.rc;
- p.y = this.y0 + this.a * dlat;
- return p;
- } // inverse equations--mapping x,y to lat/long
- // -----------------------------------------------------------------
- function eqc_inverse(p) {
- var x = p.x;
- var y = p.y;
- p.x = adjust_lon(this.long0 + (x - this.x0) / (this.a * this.rc));
- p.y = adjust_lat(this.lat0 + (y - this.y0) / this.a);
- return p;
- }
- var eqc_names = ["Equirectangular", "Equidistant_Cylindrical", "eqc"];
- /* harmony default export */ var eqc = ({
- init: eqc_init,
- forward: eqc_forward,
- inverse: eqc_inverse,
- names: eqc_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/poly.js
- var poly_MAX_ITER = 20;
- function poly_init() {
- /* Place parameters in static storage for common use
- -------------------------------------------------*/
- this.temp = this.b / this.a;
- 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
- this.e = Math.sqrt(this.es);
- this.e0 = e0fn(this.es);
- this.e1 = e1fn(this.es);
- this.e2 = e2fn(this.es);
- this.e3 = e3fn(this.es);
- 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
- }
- /* Polyconic forward equations--mapping lat,long to x,y
- ---------------------------------------------------*/
- function poly_forward(p) {
- var lon = p.x;
- var lat = p.y;
- var x, y, el;
- var dlon = adjust_lon(lon - this.long0);
- el = dlon * Math.sin(lat);
- if (this.sphere) {
- if (Math.abs(lat) <= EPSLN) {
- x = this.a * dlon;
- y = -1 * this.a * this.lat0;
- } else {
- x = this.a * Math.sin(el) / Math.tan(lat);
- y = this.a * (adjust_lat(lat - this.lat0) + (1 - Math.cos(el)) / Math.tan(lat));
- }
- } else {
- if (Math.abs(lat) <= EPSLN) {
- x = this.a * dlon;
- y = -1 * this.ml0;
- } else {
- var nl = gN(this.a, this.e, Math.sin(lat)) / Math.tan(lat);
- x = nl * Math.sin(el);
- y = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, lat) - this.ml0 + nl * (1 - Math.cos(el));
- }
- }
- p.x = x + this.x0;
- p.y = y + this.y0;
- return p;
- }
- /* Inverse equations
- -----------------*/
- function poly_inverse(p) {
- var lon, lat, x, y, i;
- var al, bl;
- var phi, dphi;
- x = p.x - this.x0;
- y = p.y - this.y0;
- if (this.sphere) {
- if (Math.abs(y + this.a * this.lat0) <= EPSLN) {
- lon = adjust_lon(x / this.a + this.long0);
- lat = 0;
- } else {
- al = this.lat0 + y / this.a;
- bl = x * x / this.a / this.a + al * al;
- phi = al;
- var tanphi;
- for (i = poly_MAX_ITER; i; --i) {
- tanphi = Math.tan(phi);
- dphi = -1 * (al * (phi * tanphi + 1) - phi - 0.5 * (phi * phi + bl) * tanphi) / ((phi - al) / tanphi - 1);
- phi += dphi;
- if (Math.abs(dphi) <= EPSLN) {
- lat = phi;
- break;
- }
- }
- lon = adjust_lon(this.long0 + Math.asin(x * Math.tan(phi) / this.a) / Math.sin(lat));
- }
- } else {
- if (Math.abs(y + this.ml0) <= EPSLN) {
- lat = 0;
- lon = adjust_lon(this.long0 + x / this.a);
- } else {
- al = (this.ml0 + y) / this.a;
- bl = x * x / this.a / this.a + al * al;
- phi = al;
- var cl, mln, mlnp, ma;
- var con;
- for (i = poly_MAX_ITER; i; --i) {
- con = this.e * Math.sin(phi);
- cl = Math.sqrt(1 - con * con) * Math.tan(phi);
- mln = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, phi);
- mlnp = this.e0 - 2 * this.e1 * Math.cos(2 * phi) + 4 * this.e2 * Math.cos(4 * phi) - 6 * this.e3 * Math.cos(6 * phi);
- ma = mln / this.a;
- 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);
- phi -= dphi;
- if (Math.abs(dphi) <= EPSLN) {
- lat = phi;
- break;
- }
- } //lat=phi4z(this.e,this.e0,this.e1,this.e2,this.e3,al,bl,0,0);
- cl = Math.sqrt(1 - this.es * Math.pow(Math.sin(lat), 2)) * Math.tan(lat);
- lon = adjust_lon(this.long0 + Math.asin(x * cl / this.a) / Math.sin(lat));
- }
- }
- p.x = lon;
- p.y = lat;
- return p;
- }
- var poly_names = ["Polyconic", "poly"];
- /* harmony default export */ var poly = ({
- init: poly_init,
- forward: poly_forward,
- inverse: poly_inverse,
- names: poly_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/nzmg.js
- /*
- reference
- Department of Land and Survey Technical Circular 1973/32
- http://www.linz.govt.nz/docs/miscellaneous/nz-map-definition.pdf
- OSG Technical Report 4.1
- http://www.linz.govt.nz/docs/miscellaneous/nzmg.pdf
- */
- /**
- * iterations: Number of iterations to refine inverse transform.
- * 0 -> km accuracy
- * 1 -> m accuracy -- suitable for most mapping applications
- * 2 -> mm accuracy
- */
- var iterations = 1;
- function nzmg_init() {
- this.A = [];
- this.A[1] = 0.6399175073;
- this.A[2] = -0.1358797613;
- this.A[3] = 0.063294409;
- this.A[4] = -0.02526853;
- this.A[5] = 0.0117879;
- this.A[6] = -0.0055161;
- this.A[7] = 0.0026906;
- this.A[8] = -0.001333;
- this.A[9] = 0.00067;
- this.A[10] = -0.00034;
- this.B_re = [];
- this.B_im = [];
- this.B_re[1] = 0.7557853228;
- this.B_im[1] = 0;
- this.B_re[2] = 0.249204646;
- this.B_im[2] = 0.003371507;
- this.B_re[3] = -0.001541739;
- this.B_im[3] = 0.041058560;
- this.B_re[4] = -0.10162907;
- this.B_im[4] = 0.01727609;
- this.B_re[5] = -0.26623489;
- this.B_im[5] = -0.36249218;
- this.B_re[6] = -0.6870983;
- this.B_im[6] = -1.1651967;
- this.C_re = [];
- this.C_im = [];
- this.C_re[1] = 1.3231270439;
- this.C_im[1] = 0;
- this.C_re[2] = -0.577245789;
- this.C_im[2] = -0.007809598;
- this.C_re[3] = 0.508307513;
- this.C_im[3] = -0.112208952;
- this.C_re[4] = -0.15094762;
- this.C_im[4] = 0.18200602;
- this.C_re[5] = 1.01418179;
- this.C_im[5] = 1.64497696;
- this.C_re[6] = 1.9660549;
- this.C_im[6] = 2.5127645;
- this.D = [];
- this.D[1] = 1.5627014243;
- this.D[2] = 0.5185406398;
- this.D[3] = -0.03333098;
- this.D[4] = -0.1052906;
- this.D[5] = -0.0368594;
- this.D[6] = 0.007317;
- this.D[7] = 0.01220;
- this.D[8] = 0.00394;
- this.D[9] = -0.0013;
- }
- /**
- New Zealand Map Grid Forward - long/lat to x/y
- long/lat in radians
- */
- function nzmg_forward(p) {
- var n;
- var lon = p.x;
- var lat = p.y;
- var delta_lat = lat - this.lat0;
- var delta_lon = lon - this.long0; // 1. Calculate d_phi and d_psi ... // and d_lambda
- // For this algorithm, delta_latitude is in seconds of arc x 10-5, so we need to scale to those units. Longitude is radians.
- var d_phi = delta_lat / SEC_TO_RAD * 1E-5;
- var d_lambda = delta_lon;
- var d_phi_n = 1; // d_phi^0
- var d_psi = 0;
- for (n = 1; n <= 10; n++) {
- d_phi_n = d_phi_n * d_phi;
- d_psi = d_psi + this.A[n] * d_phi_n;
- } // 2. Calculate theta
- var th_re = d_psi;
- var th_im = d_lambda; // 3. Calculate z
- var th_n_re = 1;
- var th_n_im = 0; // theta^0
- var th_n_re1;
- var th_n_im1;
- var z_re = 0;
- var z_im = 0;
- for (n = 1; n <= 6; n++) {
- th_n_re1 = th_n_re * th_re - th_n_im * th_im;
- th_n_im1 = th_n_im * th_re + th_n_re * th_im;
- th_n_re = th_n_re1;
- th_n_im = th_n_im1;
- z_re = z_re + this.B_re[n] * th_n_re - this.B_im[n] * th_n_im;
- z_im = z_im + this.B_im[n] * th_n_re + this.B_re[n] * th_n_im;
- } // 4. Calculate easting and northing
- p.x = z_im * this.a + this.x0;
- p.y = z_re * this.a + this.y0;
- return p;
- }
- /**
- New Zealand Map Grid Inverse - x/y to long/lat
- */
- function nzmg_inverse(p) {
- var n;
- var x = p.x;
- var y = p.y;
- var delta_x = x - this.x0;
- var delta_y = y - this.y0; // 1. Calculate z
- var z_re = delta_y / this.a;
- var z_im = delta_x / this.a; // 2a. Calculate theta - first approximation gives km accuracy
- var z_n_re = 1;
- var z_n_im = 0; // z^0
- var z_n_re1;
- var z_n_im1;
- var th_re = 0;
- var th_im = 0;
- for (n = 1; n <= 6; n++) {
- z_n_re1 = z_n_re * z_re - z_n_im * z_im;
- z_n_im1 = z_n_im * z_re + z_n_re * z_im;
- z_n_re = z_n_re1;
- z_n_im = z_n_im1;
- th_re = th_re + this.C_re[n] * z_n_re - this.C_im[n] * z_n_im;
- th_im = th_im + this.C_im[n] * z_n_re + this.C_re[n] * z_n_im;
- } // 2b. Iterate to refine the accuracy of the calculation
- // 0 iterations gives km accuracy
- // 1 iteration gives m accuracy -- good enough for most mapping applications
- // 2 iterations bives mm accuracy
- for (var i = 0; i < this.iterations; i++) {
- var th_n_re = th_re;
- var th_n_im = th_im;
- var th_n_re1;
- var th_n_im1;
- var num_re = z_re;
- var num_im = z_im;
- for (n = 2; n <= 6; n++) {
- th_n_re1 = th_n_re * th_re - th_n_im * th_im;
- th_n_im1 = th_n_im * th_re + th_n_re * th_im;
- th_n_re = th_n_re1;
- th_n_im = th_n_im1;
- num_re = num_re + (n - 1) * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);
- num_im = num_im + (n - 1) * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);
- }
- th_n_re = 1;
- th_n_im = 0;
- var den_re = this.B_re[1];
- var den_im = this.B_im[1];
- for (n = 2; n <= 6; n++) {
- th_n_re1 = th_n_re * th_re - th_n_im * th_im;
- th_n_im1 = th_n_im * th_re + th_n_re * th_im;
- th_n_re = th_n_re1;
- th_n_im = th_n_im1;
- den_re = den_re + n * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);
- den_im = den_im + n * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);
- } // Complex division
- var den2 = den_re * den_re + den_im * den_im;
- th_re = (num_re * den_re + num_im * den_im) / den2;
- th_im = (num_im * den_re - num_re * den_im) / den2;
- } // 3. Calculate d_phi ... // and d_lambda
- var d_psi = th_re;
- var d_lambda = th_im;
- var d_psi_n = 1; // d_psi^0
- var d_phi = 0;
- for (n = 1; n <= 9; n++) {
- d_psi_n = d_psi_n * d_psi;
- d_phi = d_phi + this.D[n] * d_psi_n;
- } // 4. Calculate latitude and longitude
- // d_phi is calcuated in second of arc * 10^-5, so we need to scale back to radians. d_lambda is in radians.
- var lat = this.lat0 + d_phi * SEC_TO_RAD * 1E5;
- var lon = this.long0 + d_lambda;
- p.x = lon;
- p.y = lat;
- return p;
- }
- var nzmg_names = ["New_Zealand_Map_Grid", "nzmg"];
- /* harmony default export */ var nzmg = ({
- init: nzmg_init,
- forward: nzmg_forward,
- inverse: nzmg_inverse,
- names: nzmg_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/mill.js
- /*
- reference
- "New Equal-Area Map Projections for Noncircular Regions", John P. Snyder,
- The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.
- */
- /* Initialize the Miller Cylindrical projection
- -------------------------------------------*/
- function mill_init() {//no-op
- }
- /* Miller Cylindrical forward equations--mapping lat,long to x,y
- ------------------------------------------------------------*/
- function mill_forward(p) {
- var lon = p.x;
- var lat = p.y;
- /* Forward equations
- -----------------*/
- var dlon = adjust_lon(lon - this.long0);
- var x = this.x0 + this.a * dlon;
- var y = this.y0 + this.a * Math.log(Math.tan(Math.PI / 4 + lat / 2.5)) * 1.25;
- p.x = x;
- p.y = y;
- return p;
- }
- /* Miller Cylindrical inverse equations--mapping x,y to lat/long
- ------------------------------------------------------------*/
- function mill_inverse(p) {
- p.x -= this.x0;
- p.y -= this.y0;
- var lon = adjust_lon(this.long0 + p.x / this.a);
- var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4);
- p.x = lon;
- p.y = lat;
- return p;
- }
- var mill_names = ["Miller_Cylindrical", "mill"];
- /* harmony default export */ var mill = ({
- init: mill_init,
- forward: mill_forward,
- inverse: mill_inverse,
- names: mill_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/sinu.js
- var sinu_MAX_ITER = 20;
- function sinu_init() {
- /* Place parameters in static storage for common use
- -------------------------------------------------*/
- if (!this.sphere) {
- this.en = pj_enfn(this.es);
- } else {
- this.n = 1;
- this.m = 0;
- this.es = 0;
- this.C_y = Math.sqrt((this.m + 1) / this.n);
- this.C_x = this.C_y / (this.m + 1);
- }
- }
- /* Sinusoidal forward equations--mapping lat,long to x,y
- -----------------------------------------------------*/
- function sinu_forward(p) {
- var x, y;
- var lon = p.x;
- var lat = p.y;
- /* Forward equations
- -----------------*/
- lon = adjust_lon(lon - this.long0);
- if (this.sphere) {
- if (!this.m) {
- lat = this.n !== 1 ? Math.asin(this.n * Math.sin(lat)) : lat;
- } else {
- var k = this.n * Math.sin(lat);
- for (var i = sinu_MAX_ITER; i; --i) {
- var V = (this.m * lat + Math.sin(lat) - k) / (this.m + Math.cos(lat));
- lat -= V;
- if (Math.abs(V) < EPSLN) {
- break;
- }
- }
- }
- x = this.a * this.C_x * lon * (this.m + Math.cos(lat));
- y = this.a * this.C_y * lat;
- } else {
- var s = Math.sin(lat);
- var c = Math.cos(lat);
- y = this.a * pj_mlfn(lat, s, c, this.en);
- x = this.a * lon * c / Math.sqrt(1 - this.es * s * s);
- }
- p.x = x;
- p.y = y;
- return p;
- }
- function sinu_inverse(p) {
- var lat, temp, lon, s;
- p.x -= this.x0;
- lon = p.x / this.a;
- p.y -= this.y0;
- lat = p.y / this.a;
- if (this.sphere) {
- lat /= this.C_y;
- lon = lon / (this.C_x * (this.m + Math.cos(lat)));
- if (this.m) {
- lat = asinz((this.m * lat + Math.sin(lat)) / this.n);
- } else if (this.n !== 1) {
- lat = asinz(Math.sin(lat) / this.n);
- }
- lon = adjust_lon(lon + this.long0);
- lat = adjust_lat(lat);
- } else {
- lat = pj_inv_mlfn(p.y / this.a, this.es, this.en);
- s = Math.abs(lat);
- if (s < HALF_PI) {
- s = Math.sin(lat);
- 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));
- lon = adjust_lon(temp);
- } else if (s - EPSLN < HALF_PI) {
- lon = this.long0;
- }
- }
- p.x = lon;
- p.y = lat;
- return p;
- }
- var sinu_names = ["Sinusoidal", "sinu"];
- /* harmony default export */ var sinu = ({
- init: sinu_init,
- forward: sinu_forward,
- inverse: sinu_inverse,
- names: sinu_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/moll.js
- function moll_init() {}
- /* Mollweide forward equations--mapping lat,long to x,y
- ----------------------------------------------------*/
- function moll_forward(p) {
- /* Forward equations
- -----------------*/
- var lon = p.x;
- var lat = p.y;
- var delta_lon = adjust_lon(lon - this.long0);
- var theta = lat;
- var con = Math.PI * Math.sin(lat);
- /* Iterate using the Newton-Raphson method to find theta
- -----------------------------------------------------*/
- while (true) {
- var delta_theta = -(theta + Math.sin(theta) - con) / (1 + Math.cos(theta));
- theta += delta_theta;
- if (Math.abs(delta_theta) < EPSLN) {
- break;
- }
- }
- theta /= 2;
- /* If the latitude is 90 deg, force the x coordinate to be "0 + false easting"
- this is done here because of precision problems with "cos(theta)"
- --------------------------------------------------------------------------*/
- if (Math.PI / 2 - Math.abs(lat) < EPSLN) {
- delta_lon = 0;
- }
- var x = 0.900316316158 * this.a * delta_lon * Math.cos(theta) + this.x0;
- var y = 1.4142135623731 * this.a * Math.sin(theta) + this.y0;
- p.x = x;
- p.y = y;
- return p;
- }
- function moll_inverse(p) {
- var theta;
- var arg;
- /* Inverse equations
- -----------------*/
- p.x -= this.x0;
- p.y -= this.y0;
- arg = p.y / (1.4142135623731 * this.a);
- /* Because of division by zero problems, 'arg' can not be 1. Therefore
- a number very close to one is used instead.
- -------------------------------------------------------------------*/
- if (Math.abs(arg) > 0.999999999999) {
- arg = 0.999999999999;
- }
- theta = Math.asin(arg);
- var lon = adjust_lon(this.long0 + p.x / (0.900316316158 * this.a * Math.cos(theta)));
- if (lon < -Math.PI) {
- lon = -Math.PI;
- }
- if (lon > Math.PI) {
- lon = Math.PI;
- }
- arg = (2 * theta + Math.sin(2 * theta)) / Math.PI;
- if (Math.abs(arg) > 1) {
- arg = 1;
- }
- var lat = Math.asin(arg);
- p.x = lon;
- p.y = lat;
- return p;
- }
- var moll_names = ["Mollweide", "moll"];
- /* harmony default export */ var moll = ({
- init: moll_init,
- forward: moll_forward,
- inverse: moll_inverse,
- names: moll_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/eqdc.js
- function eqdc_init() {
- /* Place parameters in static storage for common use
- -------------------------------------------------*/
- // Standard Parallels cannot be equal and on opposite sides of the equator
- if (Math.abs(this.lat1 + this.lat2) < EPSLN) {
- return;
- }
- this.lat2 = this.lat2 || this.lat1;
- this.temp = this.b / this.a;
- this.es = 1 - Math.pow(this.temp, 2);
- this.e = Math.sqrt(this.es);
- this.e0 = e0fn(this.es);
- this.e1 = e1fn(this.es);
- this.e2 = e2fn(this.es);
- this.e3 = e3fn(this.es);
- this.sinphi = Math.sin(this.lat1);
- this.cosphi = Math.cos(this.lat1);
- this.ms1 = msfnz(this.e, this.sinphi, this.cosphi);
- this.ml1 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat1);
- if (Math.abs(this.lat1 - this.lat2) < EPSLN) {
- this.ns = this.sinphi;
- } else {
- this.sinphi = Math.sin(this.lat2);
- this.cosphi = Math.cos(this.lat2);
- this.ms2 = msfnz(this.e, this.sinphi, this.cosphi);
- this.ml2 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat2);
- this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1);
- }
- this.g = this.ml1 + this.ms1 / this.ns;
- this.ml0 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0);
- this.rh = this.a * (this.g - this.ml0);
- }
- /* Equidistant Conic forward equations--mapping lat,long to x,y
- -----------------------------------------------------------*/
- function eqdc_forward(p) {
- var lon = p.x;
- var lat = p.y;
- var rh1;
- /* Forward equations
- -----------------*/
- if (this.sphere) {
- rh1 = this.a * (this.g - lat);
- } else {
- var ml = mlfn(this.e0, this.e1, this.e2, this.e3, lat);
- rh1 = this.a * (this.g - ml);
- }
- var theta = this.ns * adjust_lon(lon - this.long0);
- var x = this.x0 + rh1 * Math.sin(theta);
- var y = this.y0 + this.rh - rh1 * Math.cos(theta);
- p.x = x;
- p.y = y;
- return p;
- }
- /* Inverse equations
- -----------------*/
- function eqdc_inverse(p) {
- p.x -= this.x0;
- p.y = this.rh - p.y + this.y0;
- var con, rh1, lat, lon;
- if (this.ns >= 0) {
- rh1 = Math.sqrt(p.x * p.x + p.y * p.y);
- con = 1;
- } else {
- rh1 = -Math.sqrt(p.x * p.x + p.y * p.y);
- con = -1;
- }
- var theta = 0;
- if (rh1 !== 0) {
- theta = Math.atan2(con * p.x, con * p.y);
- }
- if (this.sphere) {
- lon = adjust_lon(this.long0 + theta / this.ns);
- lat = adjust_lat(this.g - rh1 / this.a);
- p.x = lon;
- p.y = lat;
- return p;
- } else {
- var ml = this.g - rh1 / this.a;
- lat = imlfn(ml, this.e0, this.e1, this.e2, this.e3);
- lon = adjust_lon(this.long0 + theta / this.ns);
- p.x = lon;
- p.y = lat;
- return p;
- }
- }
- var eqdc_names = ["Equidistant_Conic", "eqdc"];
- /* harmony default export */ var eqdc = ({
- init: eqdc_init,
- forward: eqdc_forward,
- inverse: eqdc_inverse,
- names: eqdc_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/vandg.js
- /* Initialize the Van Der Grinten projection
- ----------------------------------------*/
- function vandg_init() {
- //this.R = 6370997; //Radius of earth
- this.R = this.a;
- }
- function vandg_forward(p) {
- var lon = p.x;
- var lat = p.y;
- /* Forward equations
- -----------------*/
- var dlon = adjust_lon(lon - this.long0);
- var x, y;
- if (Math.abs(lat) <= EPSLN) {
- x = this.x0 + this.R * dlon;
- y = this.y0;
- }
- var theta = asinz(2 * Math.abs(lat / Math.PI));
- if (Math.abs(dlon) <= EPSLN || Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN) {
- x = this.x0;
- if (lat >= 0) {
- y = this.y0 + Math.PI * this.R * Math.tan(0.5 * theta);
- } else {
- y = this.y0 + Math.PI * this.R * -Math.tan(0.5 * theta);
- } // return(OK);
- }
- var al = 0.5 * Math.abs(Math.PI / dlon - dlon / Math.PI);
- var asq = al * al;
- var sinth = Math.sin(theta);
- var costh = Math.cos(theta);
- var g = costh / (sinth + costh - 1);
- var gsq = g * g;
- var m = g * (2 / sinth - 1);
- var msq = m * m;
- var con = Math.PI * this.R * (al * (g - msq) + Math.sqrt(asq * (g - msq) * (g - msq) - (msq + asq) * (gsq - msq))) / (msq + asq);
- if (dlon < 0) {
- con = -con;
- }
- x = this.x0 + con; //con = Math.abs(con / (Math.PI * this.R));
- var q = asq + g;
- con = Math.PI * this.R * (m * q - al * Math.sqrt((msq + asq) * (asq + 1) - q * q)) / (msq + asq);
- if (lat >= 0) {
- //y = this.y0 + Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con);
- y = this.y0 + con;
- } else {
- //y = this.y0 - Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con);
- y = this.y0 - con;
- }
- p.x = x;
- p.y = y;
- return p;
- }
- /* Van Der Grinten inverse equations--mapping x,y to lat/long
- ---------------------------------------------------------*/
- function vandg_inverse(p) {
- var lon, lat;
- var xx, yy, xys, c1, c2, c3;
- var a1;
- var m1;
- var con;
- var th1;
- var d;
- /* inverse equations
- -----------------*/
- p.x -= this.x0;
- p.y -= this.y0;
- con = Math.PI * this.R;
- xx = p.x / con;
- yy = p.y / con;
- xys = xx * xx + yy * yy;
- c1 = -Math.abs(yy) * (1 + xys);
- c2 = c1 - 2 * yy * yy + xx * xx;
- c3 = -2 * c1 + 1 + 2 * yy * yy + xys * xys;
- d = yy * yy / c3 + (2 * c2 * c2 * c2 / c3 / c3 / c3 - 9 * c1 * c2 / c3 / c3) / 27;
- a1 = (c1 - c2 * c2 / 3 / c3) / c3;
- m1 = 2 * Math.sqrt(-a1 / 3);
- con = 3 * d / a1 / m1;
- if (Math.abs(con) > 1) {
- if (con >= 0) {
- con = 1;
- } else {
- con = -1;
- }
- }
- th1 = Math.acos(con) / 3;
- if (p.y >= 0) {
- lat = (-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;
- } else {
- lat = -(-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;
- }
- if (Math.abs(xx) < EPSLN) {
- lon = this.long0;
- } else {
- lon = adjust_lon(this.long0 + Math.PI * (xys - 1 + Math.sqrt(1 + 2 * (xx * xx - yy * yy) + xys * xys)) / 2 / xx);
- }
- p.x = lon;
- p.y = lat;
- return p;
- }
- var vandg_names = ["Van_der_Grinten_I", "VanDerGrinten", "vandg"];
- /* harmony default export */ var vandg = ({
- init: vandg_init,
- forward: vandg_forward,
- inverse: vandg_inverse,
- names: vandg_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/aeqd.js
- function aeqd_init() {
- this.sin_p12 = Math.sin(this.lat0);
- this.cos_p12 = Math.cos(this.lat0);
- }
- function aeqd_forward(p) {
- var lon = p.x;
- var lat = p.y;
- var sinphi = Math.sin(p.y);
- var cosphi = Math.cos(p.y);
- var dlon = adjust_lon(lon - this.long0);
- 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;
- if (this.sphere) {
- if (Math.abs(this.sin_p12 - 1) <= EPSLN) {
- //North Pole case
- p.x = this.x0 + this.a * (HALF_PI - lat) * Math.sin(dlon);
- p.y = this.y0 - this.a * (HALF_PI - lat) * Math.cos(dlon);
- return p;
- } else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {
- //South Pole case
- p.x = this.x0 + this.a * (HALF_PI + lat) * Math.sin(dlon);
- p.y = this.y0 + this.a * (HALF_PI + lat) * Math.cos(dlon);
- return p;
- } else {
- //default case
- cos_c = this.sin_p12 * sinphi + this.cos_p12 * cosphi * Math.cos(dlon);
- c = Math.acos(cos_c);
- kp = c ? c / Math.sin(c) : 1;
- p.x = this.x0 + this.a * kp * cosphi * Math.sin(dlon);
- p.y = this.y0 + this.a * kp * (this.cos_p12 * sinphi - this.sin_p12 * cosphi * Math.cos(dlon));
- return p;
- }
- } else {
- e0 = e0fn(this.es);
- e1 = e1fn(this.es);
- e2 = e2fn(this.es);
- e3 = e3fn(this.es);
- if (Math.abs(this.sin_p12 - 1) <= EPSLN) {
- //North Pole case
- Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);
- Ml = this.a * mlfn(e0, e1, e2, e3, lat);
- p.x = this.x0 + (Mlp - Ml) * Math.sin(dlon);
- p.y = this.y0 - (Mlp - Ml) * Math.cos(dlon);
- return p;
- } else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {
- //South Pole case
- Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);
- Ml = this.a * mlfn(e0, e1, e2, e3, lat);
- p.x = this.x0 + (Mlp + Ml) * Math.sin(dlon);
- p.y = this.y0 + (Mlp + Ml) * Math.cos(dlon);
- return p;
- } else {
- //Default case
- tanphi = sinphi / cosphi;
- Nl1 = gN(this.a, this.e, this.sin_p12);
- Nl = gN(this.a, this.e, sinphi);
- psi = Math.atan((1 - this.es) * tanphi + this.es * Nl1 * this.sin_p12 / (Nl * cosphi));
- Az = Math.atan2(Math.sin(dlon), this.cos_p12 * Math.tan(psi) - this.sin_p12 * Math.cos(dlon));
- if (Az === 0) {
- s = Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi));
- } else if (Math.abs(Math.abs(Az) - Math.PI) <= EPSLN) {
- s = -Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi));
- } else {
- s = Math.asin(Math.sin(dlon) * Math.cos(psi) / Math.sin(Az));
- }
- G = this.e * this.sin_p12 / Math.sqrt(1 - this.es);
- H = this.e * this.cos_p12 * Math.cos(Az) / Math.sqrt(1 - this.es);
- GH = G * H;
- Hs = H * H;
- s2 = s * s;
- s3 = s2 * s;
- s4 = s3 * s;
- s5 = s4 * s;
- 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);
- p.x = this.x0 + c * Math.sin(Az);
- p.y = this.y0 + c * Math.cos(Az);
- return p;
- }
- }
- }
- function aeqd_inverse(p) {
- p.x -= this.x0;
- p.y -= this.y0;
- 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;
- if (this.sphere) {
- rh = Math.sqrt(p.x * p.x + p.y * p.y);
- if (rh > 2 * HALF_PI * this.a) {
- return;
- }
- z = rh / this.a;
- sinz = Math.sin(z);
- cosz = Math.cos(z);
- lon = this.long0;
- if (Math.abs(rh) <= EPSLN) {
- lat = this.lat0;
- } else {
- lat = asinz(cosz * this.sin_p12 + p.y * sinz * this.cos_p12 / rh);
- con = Math.abs(this.lat0) - HALF_PI;
- if (Math.abs(con) <= EPSLN) {
- if (this.lat0 >= 0) {
- lon = adjust_lon(this.long0 + Math.atan2(p.x, -p.y));
- } else {
- lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y));
- }
- } else {
- /*con = cosz - this.sin_p12 * Math.sin(lat);
- if ((Math.abs(con) < EPSLN) && (Math.abs(p.x) < EPSLN)) {
- //no-op, just keep the lon value as is
- } else {
- var temp = Math.atan2((p.x * sinz * this.cos_p12), (con * rh));
- lon = adjust_lon(this.long0 + Math.atan2((p.x * sinz * this.cos_p12), (con * rh)));
- }*/
- lon = adjust_lon(this.long0 + Math.atan2(p.x * sinz, rh * this.cos_p12 * cosz - p.y * this.sin_p12 * sinz));
- }
- }
- p.x = lon;
- p.y = lat;
- return p;
- } else {
- e0 = e0fn(this.es);
- e1 = e1fn(this.es);
- e2 = e2fn(this.es);
- e3 = e3fn(this.es);
- if (Math.abs(this.sin_p12 - 1) <= EPSLN) {
- //North pole case
- Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);
- rh = Math.sqrt(p.x * p.x + p.y * p.y);
- M = Mlp - rh;
- lat = imlfn(M / this.a, e0, e1, e2, e3);
- lon = adjust_lon(this.long0 + Math.atan2(p.x, -1 * p.y));
- p.x = lon;
- p.y = lat;
- return p;
- } else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {
- //South pole case
- Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);
- rh = Math.sqrt(p.x * p.x + p.y * p.y);
- M = rh - Mlp;
- lat = imlfn(M / this.a, e0, e1, e2, e3);
- lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y));
- p.x = lon;
- p.y = lat;
- return p;
- } else {
- //default case
- rh = Math.sqrt(p.x * p.x + p.y * p.y);
- Az = Math.atan2(p.x, p.y);
- N1 = gN(this.a, this.e, this.sin_p12);
- cosAz = Math.cos(Az);
- tmp = this.e * this.cos_p12 * cosAz;
- A = -tmp * tmp / (1 - this.es);
- B = 3 * this.es * (1 - A) * this.sin_p12 * this.cos_p12 * cosAz / (1 - this.es);
- D = rh / N1;
- Ee = D - A * (1 + A) * Math.pow(D, 3) / 6 - B * (1 + 3 * A) * Math.pow(D, 4) / 24;
- F = 1 - A * Ee * Ee / 2 - D * Ee * Ee * Ee / 6;
- psi = Math.asin(this.sin_p12 * Math.cos(Ee) + this.cos_p12 * Math.sin(Ee) * cosAz);
- lon = adjust_lon(this.long0 + Math.asin(Math.sin(Az) * Math.sin(Ee) / Math.cos(psi)));
- sinpsi = Math.sin(psi);
- lat = Math.atan2((sinpsi - this.es * F * this.sin_p12) * Math.tan(psi), sinpsi * (1 - this.es));
- p.x = lon;
- p.y = lat;
- return p;
- }
- }
- }
- var aeqd_names = ["Azimuthal_Equidistant", "aeqd"];
- /* harmony default export */ var aeqd = ({
- init: aeqd_init,
- forward: aeqd_forward,
- inverse: aeqd_inverse,
- names: aeqd_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/ortho.js
- function ortho_init() {
- //double temp; /* temporary variable */
- /* Place parameters in static storage for common use
- -------------------------------------------------*/
- this.sin_p14 = Math.sin(this.lat0);
- this.cos_p14 = Math.cos(this.lat0);
- }
- /* Orthographic forward equations--mapping lat,long to x,y
- ---------------------------------------------------*/
- function ortho_forward(p) {
- var sinphi, cosphi;
- /* sin and cos value */
- var dlon;
- /* delta longitude value */
- var coslon;
- /* cos of longitude */
- var ksp;
- /* scale factor */
- var g, x, y;
- var lon = p.x;
- var lat = p.y;
- /* Forward equations
- -----------------*/
- dlon = adjust_lon(lon - this.long0);
- sinphi = Math.sin(lat);
- cosphi = Math.cos(lat);
- coslon = Math.cos(dlon);
- g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon;
- ksp = 1;
- if (g > 0 || Math.abs(g) <= EPSLN) {
- x = this.a * ksp * cosphi * Math.sin(dlon);
- y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);
- }
- p.x = x;
- p.y = y;
- return p;
- }
- function ortho_inverse(p) {
- var rh;
- /* height above ellipsoid */
- var z;
- /* angle */
- var sinz, cosz;
- /* sin of z and cos of z */
- var con;
- var lon, lat;
- /* Inverse equations
- -----------------*/
- p.x -= this.x0;
- p.y -= this.y0;
- rh = Math.sqrt(p.x * p.x + p.y * p.y);
- z = asinz(rh / this.a);
- sinz = Math.sin(z);
- cosz = Math.cos(z);
- lon = this.long0;
- if (Math.abs(rh) <= EPSLN) {
- lat = this.lat0;
- p.x = lon;
- p.y = lat;
- return p;
- }
- lat = asinz(cosz * this.sin_p14 + p.y * sinz * this.cos_p14 / rh);
- con = Math.abs(this.lat0) - HALF_PI;
- if (Math.abs(con) <= EPSLN) {
- if (this.lat0 >= 0) {
- lon = adjust_lon(this.long0 + Math.atan2(p.x, -p.y));
- } else {
- lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y));
- }
- p.x = lon;
- p.y = lat;
- return p;
- }
- lon = adjust_lon(this.long0 + Math.atan2(p.x * sinz, rh * this.cos_p14 * cosz - p.y * this.sin_p14 * sinz));
- p.x = lon;
- p.y = lat;
- return p;
- }
- var ortho_names = ["ortho"];
- /* harmony default export */ var ortho = ({
- init: ortho_init,
- forward: ortho_forward,
- inverse: ortho_inverse,
- names: ortho_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/qsc.js
- // QSC projection rewritten from the original PROJ4
- // https://github.com/OSGeo/proj.4/blob/master/src/PJ_qsc.c
- /* constants */
- var FACE_ENUM = {
- FRONT: 1,
- RIGHT: 2,
- BACK: 3,
- LEFT: 4,
- TOP: 5,
- BOTTOM: 6
- };
- var AREA_ENUM = {
- AREA_0: 1,
- AREA_1: 2,
- AREA_2: 3,
- AREA_3: 4
- };
- function qsc_init() {
- this.x0 = this.x0 || 0;
- this.y0 = this.y0 || 0;
- this.lat0 = this.lat0 || 0;
- this.long0 = this.long0 || 0;
- this.lat_ts = this.lat_ts || 0;
- this.title = this.title || "Quadrilateralized Spherical Cube";
- /* Determine the cube face from the center of projection. */
- if (this.lat0 >= HALF_PI - FORTPI / 2.0) {
- this.face = FACE_ENUM.TOP;
- } else if (this.lat0 <= -(HALF_PI - FORTPI / 2.0)) {
- this.face = FACE_ENUM.BOTTOM;
- } else if (Math.abs(this.long0) <= FORTPI) {
- this.face = FACE_ENUM.FRONT;
- } else if (Math.abs(this.long0) <= HALF_PI + FORTPI) {
- this.face = this.long0 > 0.0 ? FACE_ENUM.RIGHT : FACE_ENUM.LEFT;
- } else {
- this.face = FACE_ENUM.BACK;
- }
- /* Fill in useful values for the ellipsoid <-> sphere shift
- * described in [LK12]. */
- if (this.es !== 0) {
- this.one_minus_f = 1 - (this.a - this.b) / this.a;
- this.one_minus_f_squared = this.one_minus_f * this.one_minus_f;
- }
- } // QSC forward equations--mapping lat,long to x,y
- // -----------------------------------------------------------------
- function qsc_forward(p) {
- var xy = {
- x: 0,
- y: 0
- };
- var lat, lon;
- var theta, phi;
- var t, mu;
- /* nu; */
- var area = {
- value: 0
- }; // move lon according to projection's lon
- p.x -= this.long0;
- /* Convert the geodetic latitude to a geocentric latitude.
- * This corresponds to the shift from the ellipsoid to the sphere
- * described in [LK12]. */
- if (this.es !== 0) {
- //if (P->es != 0) {
- lat = Math.atan(this.one_minus_f_squared * Math.tan(p.y));
- } else {
- lat = p.y;
- }
- /* Convert the input lat, lon into theta, phi as used by QSC.
- * This depends on the cube face and the area on it.
- * For the top and bottom face, we can compute theta and phi
- * directly from phi, lam. For the other faces, we must use
- * unit sphere cartesian coordinates as an intermediate step. */
- lon = p.x; //lon = lp.lam;
- if (this.face === FACE_ENUM.TOP) {
- phi = HALF_PI - lat;
- if (lon >= FORTPI && lon <= HALF_PI + FORTPI) {
- area.value = AREA_ENUM.AREA_0;
- theta = lon - HALF_PI;
- } else if (lon > HALF_PI + FORTPI || lon <= -(HALF_PI + FORTPI)) {
- area.value = AREA_ENUM.AREA_1;
- theta = lon > 0.0 ? lon - SPI : lon + SPI;
- } else if (lon > -(HALF_PI + FORTPI) && lon <= -FORTPI) {
- area.value = AREA_ENUM.AREA_2;
- theta = lon + HALF_PI;
- } else {
- area.value = AREA_ENUM.AREA_3;
- theta = lon;
- }
- } else if (this.face === FACE_ENUM.BOTTOM) {
- phi = HALF_PI + lat;
- if (lon >= FORTPI && lon <= HALF_PI + FORTPI) {
- area.value = AREA_ENUM.AREA_0;
- theta = -lon + HALF_PI;
- } else if (lon < FORTPI && lon >= -FORTPI) {
- area.value = AREA_ENUM.AREA_1;
- theta = -lon;
- } else if (lon < -FORTPI && lon >= -(HALF_PI + FORTPI)) {
- area.value = AREA_ENUM.AREA_2;
- theta = -lon - HALF_PI;
- } else {
- area.value = AREA_ENUM.AREA_3;
- theta = lon > 0.0 ? -lon + SPI : -lon - SPI;
- }
- } else {
- var q, r, s;
- var sinlat, coslat;
- var sinlon, coslon;
- if (this.face === FACE_ENUM.RIGHT) {
- lon = qsc_shift_lon_origin(lon, +HALF_PI);
- } else if (this.face === FACE_ENUM.BACK) {
- lon = qsc_shift_lon_origin(lon, +SPI);
- } else if (this.face === FACE_ENUM.LEFT) {
- lon = qsc_shift_lon_origin(lon, -HALF_PI);
- }
- sinlat = Math.sin(lat);
- coslat = Math.cos(lat);
- sinlon = Math.sin(lon);
- coslon = Math.cos(lon);
- q = coslat * coslon;
- r = coslat * sinlon;
- s = sinlat;
- if (this.face === FACE_ENUM.FRONT) {
- phi = Math.acos(q);
- theta = qsc_fwd_equat_face_theta(phi, s, r, area);
- } else if (this.face === FACE_ENUM.RIGHT) {
- phi = Math.acos(r);
- theta = qsc_fwd_equat_face_theta(phi, s, -q, area);
- } else if (this.face === FACE_ENUM.BACK) {
- phi = Math.acos(-q);
- theta = qsc_fwd_equat_face_theta(phi, s, -r, area);
- } else if (this.face === FACE_ENUM.LEFT) {
- phi = Math.acos(-r);
- theta = qsc_fwd_equat_face_theta(phi, s, q, area);
- } else {
- /* Impossible */
- phi = theta = 0;
- area.value = AREA_ENUM.AREA_0;
- }
- }
- /* Compute mu and nu for the area of definition.
- * For mu, see Eq. (3-21) in [OL76], but note the typos:
- * compare with Eq. (3-14). For nu, see Eq. (3-38). */
- mu = Math.atan(12 / SPI * (theta + Math.acos(Math.sin(theta) * Math.cos(FORTPI)) - HALF_PI));
- t = Math.sqrt((1 - Math.cos(phi)) / (Math.cos(mu) * Math.cos(mu)) / (1 - Math.cos(Math.atan(1 / Math.cos(theta)))));
- /* Apply the result to the real area. */
- if (area.value === AREA_ENUM.AREA_1) {
- mu += HALF_PI;
- } else if (area.value === AREA_ENUM.AREA_2) {
- mu += SPI;
- } else if (area.value === AREA_ENUM.AREA_3) {
- mu += 1.5 * SPI;
- }
- /* Now compute x, y from mu and nu */
- xy.x = t * Math.cos(mu);
- xy.y = t * Math.sin(mu);
- xy.x = xy.x * this.a + this.x0;
- xy.y = xy.y * this.a + this.y0;
- p.x = xy.x;
- p.y = xy.y;
- return p;
- } // QSC inverse equations--mapping x,y to lat/long
- // -----------------------------------------------------------------
- function qsc_inverse(p) {
- var lp = {
- lam: 0,
- phi: 0
- };
- var mu, nu, cosmu, tannu;
- var tantheta, theta, cosphi, phi;
- var t;
- var area = {
- value: 0
- };
- /* de-offset */
- p.x = (p.x - this.x0) / this.a;
- p.y = (p.y - this.y0) / this.a;
- /* Convert the input x, y to the mu and nu angles as used by QSC.
- * This depends on the area of the cube face. */
- nu = Math.atan(Math.sqrt(p.x * p.x + p.y * p.y));
- mu = Math.atan2(p.y, p.x);
- if (p.x >= 0.0 && p.x >= Math.abs(p.y)) {
- area.value = AREA_ENUM.AREA_0;
- } else if (p.y >= 0.0 && p.y >= Math.abs(p.x)) {
- area.value = AREA_ENUM.AREA_1;
- mu -= HALF_PI;
- } else if (p.x < 0.0 && -p.x >= Math.abs(p.y)) {
- area.value = AREA_ENUM.AREA_2;
- mu = mu < 0.0 ? mu + SPI : mu - SPI;
- } else {
- area.value = AREA_ENUM.AREA_3;
- mu += HALF_PI;
- }
- /* Compute phi and theta for the area of definition.
- * The inverse projection is not described in the original paper, but some
- * good hints can be found here (as of 2011-12-14):
- * http://fits.gsfc.nasa.gov/fitsbits/saf.93/saf.9302
- * (search for "Message-Id: <9302181759.AA25477 at fits.cv.nrao.edu>") */
- t = SPI / 12 * Math.tan(mu);
- tantheta = Math.sin(t) / (Math.cos(t) - 1 / Math.sqrt(2));
- theta = Math.atan(tantheta);
- cosmu = Math.cos(mu);
- tannu = Math.tan(nu);
- cosphi = 1 - cosmu * cosmu * tannu * tannu * (1 - Math.cos(Math.atan(1 / Math.cos(theta))));
- if (cosphi < -1) {
- cosphi = -1;
- } else if (cosphi > +1) {
- cosphi = +1;
- }
- /* Apply the result to the real area on the cube face.
- * For the top and bottom face, we can compute phi and lam directly.
- * For the other faces, we must use unit sphere cartesian coordinates
- * as an intermediate step. */
- if (this.face === FACE_ENUM.TOP) {
- phi = Math.acos(cosphi);
- lp.phi = HALF_PI - phi;
- if (area.value === AREA_ENUM.AREA_0) {
- lp.lam = theta + HALF_PI;
- } else if (area.value === AREA_ENUM.AREA_1) {
- lp.lam = theta < 0.0 ? theta + SPI : theta - SPI;
- } else if (area.value === AREA_ENUM.AREA_2) {
- lp.lam = theta - HALF_PI;
- } else
- /* area.value == AREA_ENUM.AREA_3 */
- {
- lp.lam = theta;
- }
- } else if (this.face === FACE_ENUM.BOTTOM) {
- phi = Math.acos(cosphi);
- lp.phi = phi - HALF_PI;
- if (area.value === AREA_ENUM.AREA_0) {
- lp.lam = -theta + HALF_PI;
- } else if (area.value === AREA_ENUM.AREA_1) {
- lp.lam = -theta;
- } else if (area.value === AREA_ENUM.AREA_2) {
- lp.lam = -theta - HALF_PI;
- } else
- /* area.value == AREA_ENUM.AREA_3 */
- {
- lp.lam = theta < 0.0 ? -theta - SPI : -theta + SPI;
- }
- } else {
- /* Compute phi and lam via cartesian unit sphere coordinates. */
- var q, r, s;
- q = cosphi;
- t = q * q;
- if (t >= 1) {
- s = 0;
- } else {
- s = Math.sqrt(1 - t) * Math.sin(theta);
- }
- t += s * s;
- if (t >= 1) {
- r = 0;
- } else {
- r = Math.sqrt(1 - t);
- }
- /* Rotate q,r,s into the correct area. */
- if (area.value === AREA_ENUM.AREA_1) {
- t = r;
- r = -s;
- s = t;
- } else if (area.value === AREA_ENUM.AREA_2) {
- r = -r;
- s = -s;
- } else if (area.value === AREA_ENUM.AREA_3) {
- t = r;
- r = s;
- s = -t;
- }
- /* Rotate q,r,s into the correct cube face. */
- if (this.face === FACE_ENUM.RIGHT) {
- t = q;
- q = -r;
- r = t;
- } else if (this.face === FACE_ENUM.BACK) {
- q = -q;
- r = -r;
- } else if (this.face === FACE_ENUM.LEFT) {
- t = q;
- q = r;
- r = -t;
- }
- /* Now compute phi and lam from the unit sphere coordinates. */
- lp.phi = Math.acos(-s) - HALF_PI;
- lp.lam = Math.atan2(r, q);
- if (this.face === FACE_ENUM.RIGHT) {
- lp.lam = qsc_shift_lon_origin(lp.lam, -HALF_PI);
- } else if (this.face === FACE_ENUM.BACK) {
- lp.lam = qsc_shift_lon_origin(lp.lam, -SPI);
- } else if (this.face === FACE_ENUM.LEFT) {
- lp.lam = qsc_shift_lon_origin(lp.lam, +HALF_PI);
- }
- }
- /* Apply the shift from the sphere to the ellipsoid as described
- * in [LK12]. */
- if (this.es !== 0) {
- var invert_sign;
- var tanphi, xa;
- invert_sign = lp.phi < 0 ? 1 : 0;
- tanphi = Math.tan(lp.phi);
- xa = this.b / Math.sqrt(tanphi * tanphi + this.one_minus_f_squared);
- lp.phi = Math.atan(Math.sqrt(this.a * this.a - xa * xa) / (this.one_minus_f * xa));
- if (invert_sign) {
- lp.phi = -lp.phi;
- }
- }
- lp.lam += this.long0;
- p.x = lp.lam;
- p.y = lp.phi;
- return p;
- }
- /* Helper function for forward projection: compute the theta angle
- * and determine the area number. */
- function qsc_fwd_equat_face_theta(phi, y, x, area) {
- var theta;
- if (phi < EPSLN) {
- area.value = AREA_ENUM.AREA_0;
- theta = 0.0;
- } else {
- theta = Math.atan2(y, x);
- if (Math.abs(theta) <= FORTPI) {
- area.value = AREA_ENUM.AREA_0;
- } else if (theta > FORTPI && theta <= HALF_PI + FORTPI) {
- area.value = AREA_ENUM.AREA_1;
- theta -= HALF_PI;
- } else if (theta > HALF_PI + FORTPI || theta <= -(HALF_PI + FORTPI)) {
- area.value = AREA_ENUM.AREA_2;
- theta = theta >= 0.0 ? theta - SPI : theta + SPI;
- } else {
- area.value = AREA_ENUM.AREA_3;
- theta += HALF_PI;
- }
- }
- return theta;
- }
- /* Helper function: shift the longitude. */
- function qsc_shift_lon_origin(lon, offset) {
- var slon = lon + offset;
- if (slon < -SPI) {
- slon += TWO_PI;
- } else if (slon > +SPI) {
- slon -= TWO_PI;
- }
- return slon;
- }
- var qsc_names = ["Quadrilateralized Spherical Cube", "Quadrilateralized_Spherical_Cube", "qsc"];
- /* harmony default export */ var qsc = ({
- init: qsc_init,
- forward: qsc_forward,
- inverse: qsc_inverse,
- names: qsc_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/robin.js
- // Robinson projection
- // Based on https://github.com/OSGeo/proj.4/blob/master/src/PJ_robin.c
- // Polynomial coeficients from http://article.gmane.org/gmane.comp.gis.proj-4.devel/6039
- 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]];
- 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]];
- var FXC = 0.8487;
- var FYC = 1.3523;
- var C1 = R2D / 5; // rad to 5-degree interval
- var RC1 = 1 / C1;
- var NODES = 18;
- var poly3_val = function poly3_val(coefs, x) {
- return coefs[0] + x * (coefs[1] + x * (coefs[2] + x * coefs[3]));
- };
- var poly3_der = function poly3_der(coefs, x) {
- return coefs[1] + x * (2 * coefs[2] + x * 3 * coefs[3]);
- };
- function newton_rapshon(f_df, start, max_err, iters) {
- var x = start;
- for (; iters; --iters) {
- var upd = f_df(x);
- x -= upd;
- if (Math.abs(upd) < max_err) {
- break;
- }
- }
- return x;
- }
- function robin_init() {
- this.x0 = this.x0 || 0;
- this.y0 = this.y0 || 0;
- this.long0 = this.long0 || 0;
- this.es = 0;
- this.title = this.title || "Robinson";
- }
- function robin_forward(ll) {
- var lon = adjust_lon(ll.x - this.long0);
- var dphi = Math.abs(ll.y);
- var i = Math.floor(dphi * C1);
- if (i < 0) {
- i = 0;
- } else if (i >= NODES) {
- i = NODES - 1;
- }
- dphi = R2D * (dphi - RC1 * i);
- var xy = {
- x: poly3_val(COEFS_X[i], dphi) * lon,
- y: poly3_val(COEFS_Y[i], dphi)
- };
- if (ll.y < 0) {
- xy.y = -xy.y;
- }
- xy.x = xy.x * this.a * FXC + this.x0;
- xy.y = xy.y * this.a * FYC + this.y0;
- return xy;
- }
- function robin_inverse(xy) {
- var ll = {
- x: (xy.x - this.x0) / (this.a * FXC),
- y: Math.abs(xy.y - this.y0) / (this.a * FYC)
- };
- if (ll.y >= 1) {
- // pathologic case
- ll.x /= COEFS_X[NODES][0];
- ll.y = xy.y < 0 ? -HALF_PI : HALF_PI;
- } else {
- // find table interval
- var i = Math.floor(ll.y * NODES);
- if (i < 0) {
- i = 0;
- } else if (i >= NODES) {
- i = NODES - 1;
- }
- for (;;) {
- if (COEFS_Y[i][0] > ll.y) {
- --i;
- } else if (COEFS_Y[i + 1][0] <= ll.y) {
- ++i;
- } else {
- break;
- }
- } // linear interpolation in 5 degree interval
- var coefs = COEFS_Y[i];
- var t = 5 * (ll.y - coefs[0]) / (COEFS_Y[i + 1][0] - coefs[0]); // find t so that poly3_val(coefs, t) = ll.y
- t = newton_rapshon(function (x) {
- return (poly3_val(coefs, x) - ll.y) / poly3_der(coefs, x);
- }, t, EPSLN, 100);
- ll.x /= poly3_val(COEFS_X[i], t);
- ll.y = (5 * i + t) * D2R;
- if (xy.y < 0) {
- ll.y = -ll.y;
- }
- }
- ll.x = adjust_lon(ll.x + this.long0);
- return ll;
- }
- var robin_names = ["Robinson", "robin"];
- /* harmony default export */ var robin = ({
- init: robin_init,
- forward: robin_forward,
- inverse: robin_inverse,
- names: robin_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/geocent.js
- function geocent_init() {
- this.name = 'geocent';
- }
- function geocent_forward(p) {
- var point = geodeticToGeocentric(p, this.es, this.a);
- return point;
- }
- function geocent_inverse(p) {
- var point = geocentricToGeodetic(p, this.es, this.a, this.b);
- return point;
- }
- var geocent_names = ["Geocentric", 'geocentric', "geocent", "Geocent"];
- /* harmony default export */ var geocent = ({
- init: geocent_init,
- forward: geocent_forward,
- inverse: geocent_inverse,
- names: geocent_names
- });
- ;// CONCATENATED MODULE: ./node_modules/proj4/projs.js
- /* harmony default export */ function proj4_projs(proj4) {
- proj4.Proj.projections.add(tmerc);
- proj4.Proj.projections.add(etmerc);
- proj4.Proj.projections.add(utm);
- proj4.Proj.projections.add(sterea);
- proj4.Proj.projections.add(stere);
- proj4.Proj.projections.add(somerc);
- proj4.Proj.projections.add(omerc);
- proj4.Proj.projections.add(lcc);
- proj4.Proj.projections.add(krovak);
- proj4.Proj.projections.add(cass);
- proj4.Proj.projections.add(laea);
- proj4.Proj.projections.add(aea);
- proj4.Proj.projections.add(gnom);
- proj4.Proj.projections.add(cea);
- proj4.Proj.projections.add(eqc);
- proj4.Proj.projections.add(poly);
- proj4.Proj.projections.add(nzmg);
- proj4.Proj.projections.add(mill);
- proj4.Proj.projections.add(sinu);
- proj4.Proj.projections.add(moll);
- proj4.Proj.projections.add(eqdc);
- proj4.Proj.projections.add(vandg);
- proj4.Proj.projections.add(aeqd);
- proj4.Proj.projections.add(ortho);
- proj4.Proj.projections.add(qsc);
- proj4.Proj.projections.add(robin);
- proj4.Proj.projections.add(geocent);
- }
- ;// CONCATENATED MODULE: ./node_modules/proj4/lib/index.js
- core.defaultDatum = 'WGS84'; //default datum
- core.Proj = Proj;
- core.WGS84 = new core.Proj('WGS84');
- core.Point = lib_Point;
- core.toPoint = toPoint;
- core.defs = lib_defs;
- core.transform = transform;
- core.mgrs = mgrs;
- core.version = '__VERSION__';
- proj4_projs(core);
- /* harmony default export */ var lib = (core);
- ;// CONCATENATED MODULE: ./src/leaflet/core/Proj4Leaflet.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * Inspired by https://github.com/kartena/Proj4Leaflet
- */
- window.proj4 = lib;
- window.Proj4js = lib;
- (external_L_default()).Proj = {};
- (external_L_default()).Proj._isProj4Obj = function (a) {
- return typeof a.inverse !== 'undefined' && typeof a.forward !== 'undefined';
- };
- /**
- * @class L.Proj.Projection
- * @private
- * @classdesc Proj 投影定义类。
- * @category BaseTypes Projection
- * @extends {L.Class}
- * @param {string} code - proj srsCode
- * @param {string} def - 投影的 proj4 定义。{@link [详细]{https://iclient.supermap.io/web/introduction/leafletDevelop.html#projection}}
- * @param {L.bounds} bounds - 投影范围参数
- */
- (external_L_default()).Proj.Projection = external_L_default().Class.extend({
- initialize: function initialize(code, def, bounds, wrapLng) {
- var isP4 = external_L_default().Proj._isProj4Obj(code);
- this._proj = isP4 ? code : this._projFromCodeDef(code, def);
- var boundsOption = bounds;
- if (external_L_default().Util.isArray(bounds)) {
- boundsOption = external_L_default().bounds(bounds);
- }
- this.bounds = isP4 ? def : boundsOption;
- this.wrapLng = wrapLng;
- },
- /**
- * @function L.Proj.Projection.prototype.project
- * @description 通过地理坐标得到投影坐标。
- * @param {L.Latlng} latlng - 经纬度坐标。
- * @returns {L.Point} 返回投影坐标点。
- */
- project: function project(latlng) {
- var point = this._proj.forward([latlng.lng, latlng.lat]);
- return new (external_L_default()).Point(point[0], point[1]);
- },
- /**
- * @function L.Proj.Projection.prototype.unproject
- * @description 通过投影坐标得到地理坐标。
- * @param {L.Point} point - 坐标点。
- * @param {number} unbounded - 坐标点高程值等。
- * @returns {L.LatLng} 返回经纬度坐标
- */
- unproject: function unproject(point, zoom) {
- if (this.bounds && !this.wrapLng) {
- point.x = point.x < this.bounds.min.x ? this.bounds.min.x : point.x > this.bounds.max.x ? this.bounds.max.x : point.x;
- point.y = point.y < this.bounds.min.y ? this.bounds.min.y : point.y > this.bounds.max.y ? this.bounds.max.y : point.y;
- }
- var point2 = this._proj.inverse([point.x, point.y]);
- return new (external_L_default()).LatLng(point2[1], point2[0], zoom);
- },
- _projFromCodeDef: function _projFromCodeDef(code, def) {
- if (def) {
- lib.defs(code, def);
- } else if (lib.defs[code] === undefined) {
- var urn = code.split(':');
- if (urn.length > 3) {
- code = urn[urn.length - 3] + ':' + urn[urn.length - 1];
- }
- if (lib.defs[code] === undefined) {
- throw 'No projection definition for code ' + code;
- }
- }
- return lib(code);
- },
- getUnits: function getUnits() {
- return this._proj.oProj.units || 'degrees';
- }
- });
- /**
- * @class L.Proj.CRS
- * @classdesc 基于 Proj4 坐标系统扩展类。
- * 为计算级别,`options.scales` `options.scaleDenominators` `options.resolutions` `options.bounds` 必须指定一个,先后顺序已按优先级排列。
- * 当指定`options.bounds` 时,第 0 级为一张 256 切片包含整个 bounds,即`Math.max(bounds.getSize().x, bounds.getSize().y)/256` 。
- * 为保证切片行列号正确,`options.origin` `options.bounds` 必须指定一个。
- * 当指定`options.bounds` 时,切片原点为bounds的左上角。
- * @category BaseTypes Projection
- * @extends {L.Class}
- * @param {string} srsCode - proj srsCode。
- * @param {Object} options - 参数。
- * @param {string} options.def - 投影的proj4定义。[详细]{@link https://iclient.supermap.io/web/introduction/leafletDevelop.html#multiProjection}
- * @param {(Array.<number>|L.Point)} [options.origin] - 原点。
- * @param {Array.<number>} [options.scales] - 比例尺数组。
- * @param {Array.<number>} [options.scaleDenominators] - 比例尺分母数组。
- * @param {Array.<number>} [options.resolutions] - 分辨率数组。
- * @param {(Array.<number>|L.Bounds)} [options.bounds] - 范围。
- * @param {number} [options.dpi=96] - dpi。
- * @param {number} [options.wrapLng] - 定义经度(水平)坐标轴是否在给定范围内环绕。大多数情况下默认为[-180,180]。
- * @example
- * var crs =L.Proj.CRS("EPSG:4326",{
- * origin: [-180,90],
- * scaleDenominators: [2000,1000,500,200,100,50,20,10],
- * });
- * var map=L.map('map', {
- * crs: crs
- * ...
- * })
- */
- var CRS = external_L_default().Class.extend({
- includes: (external_L_default()).CRS,
- options: {
- transformation: new (external_L_default()).Transformation(1, 0, -1, 0)
- },
- initialize: function initialize(srsCode, options) {
- var code, proj, def;
- if (external_L_default().Proj._isProj4Obj(srsCode)) {
- proj = srsCode;
- code = proj.srsCode;
- options = options || {};
- this.projection = new (external_L_default()).Proj.Projection(proj, options.bounds, options.wrapLng);
- } else {
- code = srsCode;
- options = options || {};
- def = options.def || '';
- this.projection = new (external_L_default()).Proj.Projection(code, def, options.bounds, options.wrapLng);
- }
- external_L_default().Util.setOptions(this, options);
- if (this.options.wrapLng) {
- this.wrapLng = this.options.wrapLng;
- }
- this.code = code;
- this.transformation = this.options.transformation;
- this.options.dpi = this.options.dpi || 96;
- if (this.options.bounds) {
- this.options.bounds = external_L_default().bounds(this.options.bounds);
- }
- if (!this.options.origin && this.options.bounds) {
- this.options.origin = [this.options.bounds.min.x, this.options.bounds.max.y];
- }
- if (this.options.origin) {
- if (this.options.origin instanceof (external_L_default()).Point) {
- this.options.origin = [this.options.origin.x, this.options.origin.y];
- }
- this.transformation = new (external_L_default()).Transformation(1, -this.options.origin[0], -1, this.options.origin[1]);
- }
- if (this.options.scales && this.options.scales.length > 0) {
- this.scales = this.options.scales;
- this._scales = this._toProj4Scales(this.options.scales, this.options.dpi);
- } else if (this.options.scaleDenominators && this.options.scaleDenominators.length > 0) {
- this.scales = [];
- for (var i = 0; i < this.options.scaleDenominators.length; i++) {
- this.scales[i] = 1 / this.options.scaleDenominators[i];
- }
- this._scales = this._toProj4Scales(this.scales, this.options.dpi);
- } else if (this.options.resolutions && this.options.resolutions.length > 0) {
- this._scales = [];
- for (var _i = this.options.resolutions.length - 1; _i >= 0; _i--) {
- if (this.options.resolutions[_i]) {
- this._scales[_i] = 1 / this.options.resolutions[_i];
- }
- }
- } else if (this.options.bounds) {
- this._scales = this._getDefaultProj4ScalesByBounds(this.options.bounds);
- }
- this._rectify();
- this.infinite = !this.options.bounds;
- },
- _rectify: function _rectify() {
- if (this._scales) {
- if (!this.resolutions) {
- this.resolutions = [];
- this.resolutions = this._proj4ScalesToResolutions(this._scales);
- }
- if (!this.scales) {
- this.scales = [];
- for (var i = 0; i < this.resolutions.length; i++) {
- var scaleD = this.resolutions[i] * this.options.dpi * (1 / 0.0254) * this._getMeterPerMapUnit(this.projection.getUnits());
- this.scales[i] = 1.0 / scaleD;
- }
- }
- }
- },
- /**
- * @function L.Proj.CRS.prototype.scale
- * @description 通过缩放级别获取比例尺值。
- * @param {number} zoom - 缩放级别。
- * @returns 比例尺值。
- */
- scale: function scale(zoom) {
- var iZoom = Math.floor(zoom),
- baseScale,
- nextScale,
- scaleDiff,
- zDiff;
- if (zoom === iZoom) {
- return this._scales[zoom];
- } else {
- // Non-integer zoom, interpolate
- baseScale = this._scales[iZoom];
- nextScale = this._scales[iZoom + 1];
- scaleDiff = nextScale - baseScale;
- zDiff = zoom - iZoom;
- return baseScale + scaleDiff * zDiff;
- }
- },
- /**
- * @function L.Proj.CRS.prototype.zoom
- * @description 根据比例尺返回缩放级别。
- * @param {number} scale - 比例尺。
- * @returns {number} 缩放级别。
- */
- zoom: function zoom(scale) {
- // Find closest number in this._scales, down
- var downScale = this._closestElement(this._scales, scale),
- downZoom = this._scales.indexOf(downScale),
- nextScale,
- nextZoom,
- scaleDiff; // Check if scale is downScale => return array index
- if (!downScale) {
- return 0;
- }
- if (scale === downScale) {
- return downZoom;
- } // Interpolate
- nextZoom = downZoom + 1;
- nextScale = this._scales[nextZoom];
- if (nextScale === undefined) {
- return downZoom;
- }
- scaleDiff = nextScale - downScale;
- return (scale - downScale) / scaleDiff + downZoom;
- },
- distance: (external_L_default()).CRS.Earth.distance,
- R: (external_L_default()).CRS.Earth.R,
- /* Get the closest lowest element in an array */
- _closestElement: function _closestElement(array, element) {
- var low;
- for (var i = array.length; i--;) {
- if (array[i] <= element && (low === undefined || low < array[i])) {
- low = array[i];
- }
- }
- return low;
- },
- _proj4ScalesToResolutions: function _proj4ScalesToResolutions(_scales) {
- var resolutions = [];
- if (!_scales) {
- return resolutions;
- }
- for (var i = 0; i < _scales.length; i++) {
- resolutions[i] = 1.0 / _scales[i];
- }
- return resolutions;
- },
- _toProj4Scales: function _toProj4Scales(scales, dpi) {
- var proj4Scales = [];
- if (!scales) {
- return proj4Scales;
- }
- for (var i = 0; i < scales.length; i++) {
- var a = this.projection ? this._getMeterPerMapUnit(this.projection.getUnits()) : 1;
- proj4Scales[i] = 1 / (0.0254 / ((dpi || 96) * scales[i]) / a);
- }
- return proj4Scales;
- },
- _getMeterPerMapUnit: function _getMeterPerMapUnit(mapUnit) {
- var earchRadiusInMeters = 6378137;
- var meterPerMapUnit = 1;
- if (mapUnit === 'meter') {
- meterPerMapUnit = 1;
- } else if (mapUnit === 'degrees') {
- // 每度表示多少米。
- meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
- } else if (mapUnit === 'kilometer') {
- meterPerMapUnit = 1.0e-3;
- } else if (mapUnit === 'inch') {
- meterPerMapUnit = 1 / 2.5399999918e-2;
- } else if (mapUnit === 'feet') {
- meterPerMapUnit = 0.3048;
- }
- return meterPerMapUnit;
- },
- _getDefaultProj4ScalesByBounds: function _getDefaultProj4ScalesByBounds(bounds) {
- if (!bounds) {
- return [];
- }
- var boundsSize = bounds.getSize();
- var extendsSize = Math.max(boundsSize.x, boundsSize.y);
- var resolution = extendsSize / 256;
- var scales = [];
- var maxZoom = 23;
- for (var i = 0; i < maxZoom; i++) {
- scales[i] = Math.pow(2, i) / resolution;
- }
- return scales;
- }
- });
- var crs = function crs(srsCode, options) {
- return new CRS(srsCode, options);
- };
- (external_L_default()).Proj.CRS = crs;
- ;// CONCATENATED MODULE: ./src/leaflet/core/ExtendsCRS.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @name L.CRS.BaiduCRS
- * @description 百度的坐标对象。
- * @namespace
- * @category BaseTypes Projection
- */
- var BaiduCRS = (external_L_default()).CRS.Baidu = external_L_default().extend({}, (external_L_default()).CRS.EPSG3857, {
- code: 'Baidu',
- scale: function scale(zoom) {
- return 6378137 * Math.PI * 2 / Math.pow(2, 18 - zoom);
- },
- transformation: function () {
- var scale = 0.5 / (Math.PI * 6378137);
- return new (external_L_default()).Transformation(scale, 0, -scale, 0);
- }()
- });
- var tdt_WGS84_resolutions = [];
- for (var i = 1; i < 19; i++) {
- tdt_WGS84_resolutions.push(0.703125 * 2 / Math.pow(2, i));
- }
- /**
- * @name L.CRS.TianDiTu_WGS84CRS
- * @description 天地图 WGS84 坐标对象。
- * @namespace
- * @category BaseTypes Projection
- */
- var TianDiTu_WGS84CRS = (external_L_default()).CRS.TianDiTu_WGS84 = external_L_default().Proj.CRS("EPSG:4326", {
- origin: [-180, 90],
- resolutions: tdt_WGS84_resolutions,
- bounds: external_L_default().bounds([-180, -90], [180, 90]),
- wrapLng: [-180, 180]
- });
- var c = Math.PI * 2 * 6378137;
- var halfC = c / 2;
- var tdt_Mercator_resolutions = [];
- for (var _i = 1; _i < 19; _i++) {
- tdt_Mercator_resolutions.push(c / 256 / Math.pow(2, _i));
- }
- /**
- * @name L.CRS.TianDiTu_MercatorCRS
- * @description 天地图墨卡托坐标对象。
- * @category BaseTypes Projection
- * @namespace
- */
- var TianDiTu_MercatorCRS = (external_L_default()).CRS.TianDiTu_Mercator = external_L_default().Proj.CRS('EPSG:3857', {
- origin: [-halfC, halfC],
- resolutions: tdt_Mercator_resolutions,
- bounds: external_L_default().bounds([-halfC, -halfC], [halfC, halfC]),
- wrapLng: [-180, 180]
- });
- (external_L_default()).CRS.BaiduCRS = BaiduCRS;
- (external_L_default()).CRS.TianDiTu_WGS84CRS = TianDiTu_WGS84CRS;
- (external_L_default()).CRS.TianDiTu_MercatorCRS = TianDiTu_MercatorCRS;
- ;// CONCATENATED MODULE: ./src/leaflet/core/Attributions.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * attribution版权相关配置
- */
- var Attributions = {
- Prefix: "<a href='https://leafletjs.com' title='A JS library for interactive maps'>Leaflet</a>\n with <span>\xA9 <a href='https://iclient.supermap.io' title='SuperMap iClient' target='_blank'>SuperMap iClient</a></span>",
- Common: {
- attribution: "Map Data <span>\xA9 <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>"
- },
- Online: {
- attribution: "Map Data <span>\xA9 <a href='https://www.supermapol.com' title='SuperMap Online' target='_blank'>SuperMap Online</a></span>"
- },
- ECharts: {
- attribution: "\xA9 2018 \u767E\u5EA6 ECharts"
- },
- MapV: {
- attribution: "\xA9 2018 \u767E\u5EA6 MapV "
- },
- Turf: {
- attribution: "<span>\xA9 <a href='https://turfjs.org/' title='turfjs' target='_blank'>turfjs</a></span>"
- },
- Baidu: {
- attribution: "Map Data \xA9 2018 Baidu - GS(2016)2089\u53F7 - Data \xA9 \u957F\u5730\u4E07\u65B9"
- },
- Cloud: {
- attribution: "Map Data \xA92014 SuperMap - GS(2014)6070\u53F7-data\xA9Navinfo"
- },
- Tianditu: {
- attribution: "Map Data <a href='https://www.tianditu.gov.cn' target='_blank'><img style='background-color:transparent;bottom:2px;opacity:1;' src='https://api.tianditu.gov.cn/img/map/logo.png' width='53px' height='22px' opacity='0'></a>"
- }
- };
- /* harmony default export */ var core_Attributions = (Attributions);
- ;// CONCATENATED MODULE: ./src/leaflet/core/Base.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @namespace L
- * @category BaseTypes Namespace
- */
- /**
- * @namespace L.supermap
- * @category BaseTypes Namespace
- */
- /**
- * SuperMap Leaflet基类
- * 定义命名空间
- * 提供公共模块
- */
- (external_L_default()).supermap = (external_L_default()).supermap || {};
- (external_L_default()).supermap.control = (external_L_default()).supermap.control || {};
- (external_L_default()).supermap.components = (external_L_default()).supermap.components || {};
- external_L_default().Control.Attribution.include({
- options: {
- position: 'bottomright',
- prefix: core_Attributions.Prefix
- }
- });
- external_L_default().Map.include({
- /*
- * 获取精确的像素坐标.
- * 当需要绘制比较平滑的曲线的时候可调用此方法代替latLngToContainerPoint
- * @param latlng
- */
- latLngToAccurateContainerPoint: function latLngToAccurateContainerPoint(latlng) {
- var projectedPoint = this.project(external_L_default().latLng(latlng));
- var layerPoint = projectedPoint._subtract(this.getPixelOrigin());
- return external_L_default().point(layerPoint).add(this._getMapPanePos());
- }
- });
- wrapToGeoJSON([(external_L_default()).Polyline, (external_L_default()).Polygon, (external_L_default()).Marker, (external_L_default()).CircleMarker, (external_L_default()).Circle, (external_L_default()).LayerGroup]);
- function wrapToGeoJSON(objClassArray) {
- objClassArray.map(function (objClass) {
- objClass.defaultFunction = objClass.prototype.toGeoJSON;
- objClass.include({
- toGeoJSON: function toGeoJSON(precision) {
- return objClass.defaultFunction.call(this, precision || 10);
- }
- });
- return objClass;
- });
- }
- ;// CONCATENATED MODULE: ./src/leaflet/services/ServiceBase.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.ServiceBase
- * @classdesc L.supermap 服务基类。
- * @category iServer
- * @param {string} url - 与客户端交互的服务地址。
- * @param {Object} options - 参数。
- * @param {string} [options.proxy] - 服务代理地址。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
- * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @fires L.supermap.ServiceBase#initialized
- * @fires L.supermap.ServiceBase#destroy
- * @extends {L.Evented}
- */
- var ServiceBase = external_L_default().Evented.extend({
- options: {
- url: null,
- proxy: null,
- //服务来源 ISERVER|IPORTAL|ONLINE
- serverType: null,
- withCredentials: false,
- crossOrigin: null
- },
- initialize: function initialize(url, options) {
- if (url) {
- url = url.indexOf("/") !== url.length - 1 ? url : url.substr(0, url.length - 1);
- }
- this.url = url;
- external_L_default().setOptions(this, options);
- /**
- * @event L.supermap.ServiceBase#initialized
- * @description 构造函数构造成功后触发。
- * @property {L.supermap.ServiceBase} this - this 对象。
- */
- this.fire("initialized", this);
- },
- /**
- * @function L.supermap.ServiceBase.prototype.destroy
- * @description 释放资源,将引用的资源属性置空。
- */
- destroy: function destroy() {
- /**
- * @event L.supermap.ServiceBase#destroy
- * @description 资源释放成功后触发。
- * @property {L.supermap.ServiceBase} this - this 对象。
- */
- this.fire("destroy", this);
- }
- });
- (external_L_default()).supermap.ServiceBase = ServiceBase;
- ;// CONCATENATED MODULE: ./src/leaflet/services/MapService.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.mapService
- * @classdesc 地图信息服务类。
- * @category iServer Map
- * @extends {L.supermap.ServiceBase}
- * @param {string} url - 地图服务地址。
- * @param {Object} options - 参数。
- * @param {string} [options.proxy] - 服务代理地址。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
- * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @example
- * L.supermap.mapService(url)
- * .getMapInfo(function(result){
- * //doSomething
- * })
- */
- var MapService_MapService = ServiceBase.extend({
- options: {
- projection: null
- },
- initialize: function initialize(url, options) {
- options = options || {};
- external_L_default().setOptions(this, options);
- if (options.projection) {
- this.options.projection = options.projection;
- }
- ServiceBase.prototype.initialize.call(this, url, options);
- },
- /**
- * @function L.supermap.mapService.prototype.getMapInfo
- * @description 获取地图信息。
- * @param {RequestCallback} callback - 回调函数。
- */
- getMapInfo: function getMapInfo(callback) {
- var me = this;
- var getMapStatusService = new MapService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- projection: me.options.projection
- });
- getMapStatusService.processAsync();
- },
- /**
- * @function L.supermap.mapService.prototype.getTilesets
- * @description 获取切片列表信息。
- * @param {RequestCallback} callback - 回调函数。
- */
- getTilesets: function getTilesets(callback) {
- var me = this;
- var tilesetsService = new TilesetsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- tilesetsService.processAsync();
- }
- });
- var mapService = function mapService(url, options) {
- return new MapService_MapService(url, options);
- };
- (external_L_default()).supermap.mapService = mapService;
- ;// CONCATENATED MODULE: ./src/leaflet/control/ChangeTileVersion.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.control.changeTileVersion
- * @classdesc 版本切换控件,支持 IE10 及以上。
- * @category Control
- * @extends {L.Control}
- * @example
- * L.supermap.control.changeTileVersion({
- * layer: baseLayer,
- * position: "topleft",
- * orientation: "horizontal"
- * }).addTo(map);
- * @param {Object} options - logo 控件配置项。
- * @param {L.Layer} options.layer - 绑定的底图图层。
- * @param {string} [options.position='topleft'] - 控件位置继承自 leaflet control。
- * @param {string} [options.title='switch tile version'] - 鼠标滑过时提示。
- * @param {string} [options.tooltip='top'] - tooltip 提示显示位置 top | right | bottom | left。
- * @param {boolean} [options.collapsed=true] - 是否折叠。
- * @param {string} [options.nextText='+'] - 下一个版本的按钮布局。
- * @param {string} [options.lastText='-'] - 上一个版本的按钮布局。
- * @param {string} [options.ico='v'] - 控件显示的 logo。
- * @param {string} [options.orientation='horizontal'] - 方向 horizontal|vertical。
- * @param {boolean} [options.switch=true] - 是否显示上/下一个版本切换控件。
- */
- var ChangeTileVersion = external_L_default().Control.extend({
- options: {
- //绑定的底图图层
- layer: null,
- //控件位置 继承自leaflet control
- position: 'topleft',
- //鼠标滑过时提示
- title: 'switch tile version',
- //tooltip提示显示位置 top | right | bottom | left
- tooltip: "top",
- //是否折叠
- collapsed: true,
- //下一个版本的按钮布局
- nextText: "+",
- //上一个版本的按钮布局
- lastText: "-",
- //控件显示的logo
- ico: 'V',
- //方向horizontal|vertical
- orientation: 'horizontal',
- //是否显示上/下一个版本切换控件
- "switch": true
- },
- /**
- * @private
- * @function L.supermap.control.changeTileVersion.prototype.onAdd
- * @description 添加控件。
- */
- onAdd: function onAdd() {
- if (this.options.orientation !== 'vertical') {
- this.options.orientation = 'horizontal';
- }
- var layout = this._initLayout();
- if (this.options.layer) {
- this.setLayer(this.options.layer);
- }
- return layout;
- },
- /**
- * @function L.supermap.control.changeTileVersion.prototype.setContent
- * @description 设置版本相关信息。
- * @param {Object} version - 版本信息。
- */
- setContent: function setContent(version) {
- var content = external_L_default().Util.extend({}, version);
- this.setVersionName(content.desc).setToolTip(content.desc);
- },
- /**
- * @function L.supermap.control.changeTileVersion.prototype.setVersionName
- * @description 设置版本号。
- * @param {string} content - 版本信息。
- * @returns {this} this
- */
- setVersionName: function setVersionName(content) {
- var value = content;
- if (!content) {
- value = this.getValue();
- }
- this._sliderValue.innerHTML = value;
- return this;
- },
- /**
- * @function L.supermap.control.changeTileVersion.prototype.setToolTip
- * @description 设置提示信息。
- * @param {(HTMLElement|String)} tooltip - 要需要设置的提示信息。
- * @returns {this} this
- */
- setToolTip: function setToolTip(tooltip) {
- this.tooltip.innerHTML = tooltip;
- return this;
- },
- /**
- * @function L.supermap.control.changeTileVersion.prototype.updateLength
- * @description 更新进度条长度。
- * @param {number} length - 进度长度参数。
- */
- updateLength: function updateLength(length) {
- if (length > 0) {
- this.length = length;
- this.max = this.length - 1;
- this.slider.setAttribute("max", this.max);
- }
- },
- /**
- * @function L.supermap.control.changeTileVersion.prototype.setLayer
- * @description 绑定图层。
- * @param {L.supermap.tiledMapLayer} layer - 绑定的图层。
- */
- setLayer: function setLayer(layer) {
- if (layer) {
- this.options.layer = layer;
- }
- var me = this;
- var tileLayer = me.options.layer;
- tileLayer.on("tilesetsinfoloaded", function (result) {
- var tileVersions = result && result.tileVersions;
- me.update(tileVersions);
- });
- tileLayer.on("tileversionschanged", function (result) {
- var tileVersions = result && result.tileVersion;
- me.setContent(tileVersions);
- });
- me.getTileSetsInfo();
- },
- /**
- * @function L.supermap.control.changeTileVersion.prototype.update
- * @description 更新缓存切片集及进度条长度。
- * @param {number} tileVersions - 待更新的切片版本号。
- */
- update: function update(tileVersions) {
- this.tileVersions = tileVersions;
- this.updateLength(this.tileVersions.length);
- },
- /**
- * @function L.supermap.control.changeTileVersion.prototype.getTileSetsInfo
- * @description 请求获取切片集信息。
- */
- getTileSetsInfo: function getTileSetsInfo() {
- var me = this;
- if (me.options.layer) {
- new MapService_MapService(me.options.layer._url).getTilesets(function getTilesInfoSucceed(info) {
- me.options.layer.setTileSetsInfo(info.result);
- });
- }
- },
- /**
- * @function L.supermap.control.changeTileVersion.prototype.removeLayer
- * @description 移除绑定的地图图层。
- */
- removeLayer: function removeLayer() {
- this.options.layer = null;
- },
- /**
- * @function L.supermap.control.changeTileVersion.prototype.nextTilesVersion
- * @description 下一个版本,第一次不进行加减,是无版本的状态。
- * @returns {this} this
- */
- nextTilesVersion: function nextTilesVersion() {
- if (this.firstLoad) {
- this.options.layer.nextTilesVersion();
- this.firstLoad = !!0;
- return this;
- }
- if (parseInt(this.slider.value) > this.max - 1) {
- return this;
- }
- this.slider.value = parseInt(this.slider.value) + 1;
- this.options.layer.nextTilesVersion();
- return this;
- },
- /**
- * @function L.supermap.control.changeTileVersion.prototype.lastTilesVersion
- * @description 上一个版本。
- */
- lastTilesVersion: function lastTilesVersion() {
- if (parseInt(this.slider.value) < this.min + 1) {
- return this;
- }
- this.slider.value = parseInt(this.slider.value) - 1;
- this.options.layer.lastTilesVersion();
- return this;
- },
- /**
- * @function L.supermap.control.changeTileVersion.prototype.tilesVersion
- * @description 根据指定版本号请求版本。
- * @param {string} version - 版本号参数。
- */
- tilesVersion: function tilesVersion(version) {
- var layer = this.options.layer,
- tileVersions = this.tileVersions;
- var len = tileVersions.length;
- for (var i = 0; i < len; i++) {
- if (tileVersions[i].name == version) {
- layer.updateCurrentTileSetsIndex(i);
- layer.changeTilesVersion();
- break;
- }
- }
- },
- /**
- * @function L.supermap.control.changeTileVersion.prototype.getValue
- * @description 获取进度条的值。注:(进度条的值并不是版本号)。
- */
- getValue: function getValue() {
- return this.slider.value;
- },
- /**
- * @function L.supermap.control.changeTileVersion.prototype.getVersion
- * @description 获取当前进度条值对应的版本号。
- */
- getVersion: function getVersion() {
- var version = this.tileVersions[this.getValue()];
- return version && version.name;
- },
- _initLayout: function _initLayout() {
- var className = 'leaflet-control-ctv';
- this._container = external_L_default().DomUtil.create('div', className + ' ' + className + '-' + this.options.orientation); //正常情况下显示btn
- this._sliderBtn = external_L_default().DomUtil.create('a', className + '-toggle', this._container);
- this._sliderBtn.setAttribute("title", this.options.title);
- this._sliderBtn.innerHTML = this.options.ico; //滑块拖动时值显示区域
- this._sliderValue = external_L_default().DomUtil.create('p', className + '-value', this._container);
- this._sliderValue.innerHTML = this.options.ico;
- var sliderClassName = "leaflet-ctv-slider";
- this._sliderContent = external_L_default().DomUtil.create('div', sliderClassName + "-main" + " tooltip", this._container); //tooltip提示框
- this.tooltip = external_L_default().DomUtil.create("span", "tooltip-text" + " " + "tooltip-" + this.options.tooltip, this._sliderContent);
- this.tooltip.innerHTML = this.options.ico; //加控件
- if (this.options["switch"]) {
- this._next = external_L_default().DomUtil.create('a', sliderClassName + "-incdec" + " " + sliderClassName + '-next', this._sliderContent);
- this._next.innerHTML = this.options.nextText;
- external_L_default().DomEvent.on(this._next, 'click', this.nextTilesVersion, this);
- external_L_default().DomUtil.addClass(this._container, className + '-incdec');
- } //滑块
- this._sliderContainer = external_L_default().DomUtil.create('div', sliderClassName + '-container', this._sliderContent);
- this.slider = external_L_default().DomUtil.create('input', sliderClassName, this._sliderContainer);
- this.min = this.min == null || isNaN(this.min) ? 0 : parseInt(this.min);
- this.slider.setAttribute("title", this.options.title);
- this.slider.setAttribute("id", "slider");
- this.slider.setAttribute("type", "range");
- this.slider.setAttribute("min", this.min);
- this.slider.setAttribute("max", 0);
- this.slider.setAttribute("step", 1);
- this.slider.setAttribute("value", 0); // //判断浏览器是否支持Range滑动条
- // if (this.slider.type == "text") {
- // console.error("抱歉,您的浏览器不支持HTML5 range滑动条,请使用高版本浏览器");
- // }
- this.firstLoad = true;
- if ('oninput' in this.slider || 'onchange' in this.slider) {
- external_L_default().DomEvent.on(this.slider, "change", this._tilesVersion, this);
- } else {
- this.slider.onpropertychange = this._tilesVersion;
- } //减控件
- if (this.options["switch"]) {
- this._last = external_L_default().DomUtil.create('a', sliderClassName + "-incdec" + " " + sliderClassName + '-last', this._sliderContent);
- this._last.innerHTML = this.options.lastText;
- external_L_default().DomEvent.on(this._last, 'click', this.lastTilesVersion, this);
- } //if (window.matchMedia("screen and (-webkit-min-device-pixel-ratio:0)").matches && this.options.orientation == 'vertical') {
- if (this.options.orientation === 'vertical') {
- this.slider.style.width = 170 + 'px';
- this._sliderContainer.style.height = 170 + 'px';
- } else {
- this._sliderContainer.style.width = 150 + 'px';
- }
- external_L_default().DomEvent.disableClickPropagation(this._container);
- if (this.options.collapsed) {
- if (!(external_L_default()).Browser.android) {
- external_L_default().DomEvent.on(this._container, 'mouseenter', this._expand, this).on(this._container, 'mouseleave', this._collapse, this);
- }
- if ((external_L_default()).Browser.touch) {
- external_L_default().DomEvent.on(this._sliderBtn, 'click', (external_L_default()).DomEvent.stop).on(this._sliderBtn, 'click', this._expand, this);
- } else {
- external_L_default().DomEvent.on(this._sliderBtn, 'focus', this._expand, this);
- }
- } else {
- this._expand();
- }
- return this._container;
- },
- _expand: function _expand() {
- external_L_default().DomUtil.addClass(this._container, 'leaflet-control-ctv-expanded');
- },
- _collapse: function _collapse() {
- external_L_default().DomUtil.removeClass(this._container, 'leaflet-control-ctv-expanded');
- },
- _tilesVersion: function _tilesVersion() {
- var version = this.getVersion();
- this.tilesVersion(version);
- }
- });
- external_L_default().Map.mergeOptions({
- changeTileVersionControl: false
- });
- external_L_default().Map.addInitHook(function () {
- if (this.options.changeTileVersionControl) {
- this.changeTileVersionControl = new ChangeTileVersion();
- this.addControl(this.changeTileVersionControl);
- }
- });
- var changeTileVersion = function changeTileVersion(options) {
- return new ChangeTileVersion(options);
- };
- (external_L_default()).supermap.control.changeTileVersion = changeTileVersion;
- ;// CONCATENATED MODULE: ./src/common/control/img/Logo.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- 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=";
- ;// CONCATENATED MODULE: ./src/leaflet/control/Logo.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.control.logo
- * @classdesc Logo 控件。
- * @category Control
- * @description map 初始化的配置项为 logoControl,如果为 true,则显示控件;否则不显示该控件。目前默认显示。
- * @extends {L.Control}
- * @example
- * L.supermap.control.Logo({
- * imageUrl: xxx,//非必填项
- * }).addTo(map);
- * @param {Object} options - logo 控件配置项。
- * @param {string} [options.position='bottomright'] - 控件位置继承自 leaflet control。
- * @param {string} [options.imageUrl] - logo 图片地址。
- * @param {string} [options.width] - logo 图片宽。
- * @param {string} [options.height] - logo 图片高。
- * @param {string} [options.link] - 跳转链接。
- * @param {string} [options.alt='SuperMap iClient'] - logo 图片失效时显示文本。
- */
- var Logo = external_L_default().Control.extend({
- options: {
- position: 'bottomright',
- //logo图片地址
- imageUrl: null,
- //跳转链接
- link: null,
- //logo图片宽
- width: null,
- //logo图片高
- height: null,
- //logo图片失效时显示文本
- alt: "SuperMap iClient"
- },
- /**
- * @private
- * @function L.supermap.control.logo.prototype.onAdd
- * @override
- * @description 添加一个 logo。
- * @returns {HTMLElement} 返回创建 logo 的 div。
- */
- onAdd: function onAdd() {
- var div = external_L_default().DomUtil.create('div', 'iclient-leaflet-logo');
- div.style.marginTop = 0;
- div.style.marginBottom = 0;
- div.style.marginLeft = 0;
- div.style.marginRight = 0; //iClient.png base64
- var imgSrc = LogoBase64;
- if (this.options.imageUrl) {
- imgSrc = this.options.imageUrl;
- }
- var alt = this.options.alt;
- var imageWidth = "94px";
- var imageHeight = "29px";
- var styleSize = "width:" + imageWidth + ";height:" + imageHeight + ";";
- if (this.options.imageUrl) {
- imageWidth = this.options.width;
- imageHeight = this.options.height;
- styleSize = "width:" + imageWidth + ";height:" + imageHeight + ";";
- if (!imageWidth || !imageHeight) {
- styleSize = "";
- }
- }
- var link = this.options.link || "https://iclient.supermap.io";
- div.innerHTML = "<a href='" + link + "' target='_blank' style='border: none;display: block;'>" + "<img src=" + imgSrc + " alt='" + alt + "' style='border: none;" + styleSize + "margin-right:5px;margin-bottom:2px;white-space: nowrap'></a>";
- return div;
- }
- }); //map默认开启logoControl
- external_L_default().Map.mergeOptions({
- logoControl: true
- }); //map默认开启logoControl
- external_L_default().Map.addInitHook(function () {
- if (!this._logoAdded && this.options.logoControl) {
- if (this.options.logoControl === true) {
- this.logoControl = new Logo();
- } else if (this.options.logoControl instanceof (external_L_default()).Control) {
- this.logoControl = this.options.logoControl;
- }
- if (this.logoControl) {
- this.addControl(this.logoControl);
- this._logoAdded = true;
- }
- }
- });
- var logo = function logo(options) {
- return new Logo(options);
- };
- (external_L_default()).supermap.control.logo = logo;
- ;// CONCATENATED MODULE: ./src/leaflet/control/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/leaflet/core/CommontypesConversion.js
- function CommontypesConversion_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function CommontypesConversion_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function CommontypesConversion_createClass(Constructor, protoProps, staticProps) { if (protoProps) CommontypesConversion_defineProperties(Constructor.prototype, protoProps); if (staticProps) CommontypesConversion_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.CommontypesConversion
- * @category BaseTypes Util
- * @namespace
- * @classdesc Leaflet 对象和 SuperMap 对象转换工具。
- */
- var CommontypesConversion = /*#__PURE__*/function () {
- function CommontypesConversion() {
- CommontypesConversion_classCallCheck(this, CommontypesConversion);
- }
- CommontypesConversion_createClass(CommontypesConversion, null, [{
- key: "toSuperMapBounds",
- /**
- * @function L.supermap.CommontypesConversion.toSuperMapBounds
- * @description 将 Leaflet 对象的 bounds 转成 SuperMap 的 bounds对象。
- * @param {(L.Bounds|L.LatLngBounds)} bounds - 图层显示范围。
- * @returns {SuperMap.Bounds} SuperMap 的 bounds 对象。
- */
- value: function toSuperMapBounds(bounds) {
- if (bounds && ["FeatureCollection", "Feature"].indexOf(bounds.type) !== -1) {
- bounds = external_L_default().geoJSON(bounds).getBounds();
- }
- if (bounds instanceof (external_L_default()).LatLngBounds) {
- return new Bounds(bounds.getSouthWest().lng, bounds.getSouthWest().lat, bounds.getNorthEast().lng, bounds.getNorthEast().lat);
- }
- if (bounds instanceof (external_L_default()).Bounds) {
- return new Bounds(bounds.min.x, bounds.min.y, bounds.max.x, bounds.max.y);
- }
- if (this.isArray(bounds)) {
- return new Bounds(bounds[0], bounds[1], bounds[2], bounds[3]);
- }
- return new Bounds();
- }
- /**
- * @function L.supermap.Util.isArray
- * @description 判断是否为数组格式。
- * @param {Object} obj - 待判断对象。
- * @returns {boolean} 是否是数组。
- */
- }, {
- key: "isArray",
- value: function isArray(obj) {
- return Object.prototype.toString.call(obj) == '[object Array]';
- }
- /**
- * @function L.supermap.CommontypesConversion.toProcessingParam
- * @description 将 Region 节点数组转为 Processing 服务需要的分析参数。
- * @param {Array} points - Region 各个节点数组。
- * @returns processing 服务裁剪、查询分析的分析参数。
- */
- }, {
- key: "toProcessingParam",
- value: function toProcessingParam(points) {
- var geometryParam = {};
- if (points.length < 1) {
- geometryParam = "";
- } else {
- var results = [];
- for (var i = 0; i < points.length; i++) {
- var point = {};
- point.x = points[i][0];
- point.y = points[i][1];
- results.push(point);
- }
- geometryParam.type = "REGION";
- geometryParam.points = results;
- }
- return geometryParam;
- }
- }]);
- return CommontypesConversion;
- }();
- (external_L_default()).supermap.CommontypesConversion = CommontypesConversion;
- ;// CONCATENATED MODULE: ./src/leaflet/core/Util.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @namespace L.Util
- * @category BaseTypes Util
- */
- var supermap_callbacks = {};
- (external_L_default()).Util.supermap_callbacks = supermap_callbacks;
- var toGeoJSON = function toGeoJSON(feature) {
- if (!feature) {
- return feature;
- }
- return new GeoJSON().toGeoJSON(feature);
- };
- var toSuperMapGeometry = function toSuperMapGeometry(geometry) {
- if (!geometry) {
- return geometry;
- }
- var result,
- format = new GeoJSON();
- if (['FeatureCollection', 'Feature', 'Geometry'].indexOf(geometry.type) != -1) {
- result = format.read(geometry, geometry.type);
- } else if (typeof geometry.toGeoJSON === 'function') {
- var geojson = geometry.toGeoJSON();
- result = geojson ? format.read(geojson, geojson.type) : geometry;
- }
- var serverResult = result;
- if (external_L_default().Util.isArray(result)) {
- if (result.length === 1) {
- serverResult = result[0];
- } else if (result.length > 1) {
- serverResult = [];
- result.map(function (item) {
- serverResult.push(item.geometry);
- return item;
- });
- }
- }
- return serverResult && serverResult.geometry ? serverResult.geometry : serverResult;
- };
- var Util_getMeterPerMapUnit = getMeterPerMapUnit;
- var resolutionToScale = function resolutionToScale(resolution, dpi, mapUnit) {
- var inchPerMeter = 1 / 0.0254; // 地球半径。
- var meterPerMapUnit = Util_getMeterPerMapUnit(mapUnit);
- var scale = resolution * dpi * inchPerMeter * meterPerMapUnit;
- scale = 1 / scale;
- return scale;
- };
- var scaleToResolution = function scaleToResolution(scale, dpi, mapUnit) {
- var inchPerMeter = 1 / 0.0254;
- var meterPerMapUnitValue = Util_getMeterPerMapUnit(mapUnit);
- var resolution = scale * dpi * inchPerMeter * meterPerMapUnitValue;
- resolution = 1 / resolution;
- return resolution;
- };
- var GetResolutionFromScaleDpi = function GetResolutionFromScaleDpi(scale, dpi, coordUnit, datumAxis) {
- var resolution = null,
- ratio = 10000; //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
- datumAxis = datumAxis || 6378137;
- coordUnit = coordUnit || '';
- if (scale > 0 && dpi > 0) {
- scale = external_L_default().Util.NormalizeScale(scale);
- if (coordUnit.toLowerCase() === 'degree' || coordUnit.toLowerCase() === 'degrees' || coordUnit.toLowerCase() === 'dd') {
- //scale = SuperMap.Util.normalizeScale(scale);
- resolution = 0.0254 * ratio / dpi / scale / (Math.PI * 2 * datumAxis / 360) / ratio;
- return resolution;
- } else {
- resolution = 0.0254 * ratio / dpi / scale / ratio;
- return resolution;
- }
- }
- return -1;
- };
- var NormalizeScale = function NormalizeScale(scale) {
- return scale > 1.0 ? 1.0 / scale : scale;
- };
- (external_L_default()).Util.toGeoJSON = toGeoJSON;
- (external_L_default()).Util.toSuperMapGeometry = toSuperMapGeometry;
- (external_L_default()).Util.resolutionToScale = resolutionToScale;
- (external_L_default()).Util.scaleToResolution = scaleToResolution;
- (external_L_default()).Util.getMeterPerMapUnit = Util_getMeterPerMapUnit;
- (external_L_default()).Util.GetResolutionFromScaleDpi = GetResolutionFromScaleDpi;
- (external_L_default()).Util.NormalizeScale = NormalizeScale;
- ;// CONCATENATED MODULE: ./src/leaflet/core/Transform.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @function L.Util.transform
- * @description 将要素转换为指定坐标。
- * @param {(L.Marker|L.CircleMarker|L.Polyline|L.Polygon|L.Rectangle|L.LatLngBounds|L.Bounds|Object)} feature - 待转要素包括 Leaflet Vector Layers
- * 的 {@link L.Marker}|{@link L.CircleMarker}|{@link L.Polyline}|{@link L.Polygon}|{@link L.Rectangle}|{@link L.LatLngBounds}|{@link L.Bounds}|{@link GeoJSONObject} 类型。
- * @param {L.Proj.CRS} [sourceCRS=L.CRS.EPSG4326] - 要素转换源坐标系。
- * @param {L.Proj.CRS} targetCRS - 要素转换目标坐标系。
- * @returns {GeoJSONObject} 返回 GeoJSON 规范数据类型。
- */
- var Transform_transform = function transform(feature) {
- var sourceCRS = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (external_L_default()).CRS.EPSG4326;
- var targetCRS = arguments.length > 2 ? arguments[2] : undefined;
- var selfFeatures = null;
- var selfCallback = null; //将数据统一为 geojson 格式处理:
- if (["FeatureCollection", "Feature", "Geometry"].indexOf(feature.type) === -1) {
- if (feature.toGeoJSON) {
- feature = feature.toGeoJSON();
- } else if (feature instanceof (external_L_default()).LatLngBounds) {
- feature = external_L_default().rectangle(feature).toGeoJSON();
- } else if (feature instanceof (external_L_default()).Bounds) {
- feature = external_L_default().rectangle([[feature.getTopLeft().x, feature.getTopLeft().y], [feature.getBottomRight().x, feature.getBottomRight().y]]).toGeoJSON();
- } else {
- throw new Error("This tool only supports data conversion in geojson format or Vector Layers of Leaflet.");
- }
- } //geojson 几种数据类型及处理形式
- var parseCoords = {
- "point": function point(array) {
- return selfCallback(array);
- },
- "multipoint": function multipoint(array) {
- return parseCoords["linestring"].apply(this, [array]);
- },
- "linestring": function linestring(array) {
- var points = [];
- var p = null;
- for (var i = 0, len = array.length; i < len; ++i) {
- try {
- p = parseCoords["point"].apply(this, [array[i]]);
- } catch (err) {
- throw err;
- }
- points.push(p);
- }
- return points;
- },
- "multilinestring": function multilinestring(array) {
- return parseCoords["polygon"].apply(this, [array]);
- },
- "polygon": function polygon(array) {
- var rings = [];
- var l;
- for (var i = 0, len = array.length; i < len; ++i) {
- try {
- l = parseCoords["linestring"].apply(this, [array[i]]);
- } catch (err) {
- throw err;
- }
- rings.push(l);
- }
- return rings;
- },
- "multipolygon": function multipolygon(array) {
- var polys = [];
- var p = null;
- for (var i = 0, len = array.length; i < len; ++i) {
- try {
- p = parseCoords["polygon"].apply(this, [array[i]]);
- } catch (err) {
- throw err;
- }
- polys.push(p);
- }
- return polys;
- }
- }; //返回结果:
- return featureTransform(feature, _transformCoordinates);
- function featureTransform(feature, callback) {
- selfFeatures = feature;
- selfCallback = callback; //分离处理:
- if (feature.type === "Feature") {
- selfFeatures = _prepareFeatuers(feature);
- } else if (feature.type === "FeatureCollection") {
- var featureResults = [];
- for (var i = 0; i < feature.features.length; ++i) {
- try {
- featureResults.push(_prepareFeatuers(feature.features[i]));
- } catch (err) {
- featureResults = null;
- }
- }
- selfFeatures.features = featureResults;
- }
- return selfFeatures;
- }
- function _prepareFeatuers(feature) {
- var geometry = feature.geometry;
- if (!Util.isArray(geometry.coordinates)) {
- throw "Geometry must have coordinates array: " + geometry;
- }
- if (!parseCoords[geometry.type.toLowerCase()]) {
- throw "Unsupported geometry type: " + geometry.type;
- }
- try {
- geometry.coordinates = parseCoords[geometry.type.toLowerCase()].apply(this, [geometry.coordinates]);
- } catch (err) {
- throw err;
- }
- feature.geometry = geometry;
- return feature;
- }
- function _transformCoordinates(coordinates) {
- //判断code 是投影坐标还是地理坐标
- var point = sourceCRS.unproject({
- x: coordinates[0],
- y: coordinates[1]
- });
- var transform = targetCRS.project(point);
- return [transform.x, transform.y];
- }
- };
- (external_L_default()).Util.transform = Transform_transform;
- ;// CONCATENATED MODULE: ./src/leaflet/core/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/leaflet/mapping/BaiduTileLayer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.baiduTileLayer
- * @classdesc 百度地图图层。
- * @category ThirdPartyMap
- * @extends {L.TileLayer}
- * @param {string} [url='https://online{num}.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles={styles}&udt=20150815&scaler=1'] - 切片地址。
- * @param {Object} options - 切片参数。
- * @param {number} [options.minZoom=3] - 最小缩放级别。
- * @param {number} [options.maxZoom=19] - 最大缩放级别。
- * @param {L.LatLngBounds} [options.bounds=L.latLngBounds([-85.0511287798, -180],[85.0511287798, 180])] - 显示范围。
- * @param {L.Browser} [options.retina=L.Browser.retina] - 浏览器显示分辨率。
- * @param {string} [options.tileProxy] - 代理地址。
- * @param {string} [options.attribution='Map Data © 2018 Baidu - GS(2016)2089号 - Data © 长地万方'] - 版权信息。
- */
- var BaiduTileLayer = external_L_default().TileLayer.extend({
- /**
- * @member {string} L.supermap.baiduTileLayer.prototype.url
- * @description 切片地址。
- */
- url: "http://online{num}.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles={styles}&udt=20150815&scaler=1",
- options: {
- minZoom: 3,
- maxZoom: 19,
- bounds: external_L_default().latLngBounds(external_L_default().latLng(-85.0511287798, -180), external_L_default().latLng(85.0511287798, 180)),
- retina: (external_L_default()).Browser.retina,
- attribution: core_Attributions.Baidu.attribution
- },
- initialize: function initialize(url, options) {
- if (url) {
- this.url = url;
- }
- external_L_default().setOptions(this, options);
- if (this.options.retina) {
- this.options.maxZoom = 18;
- }
- external_L_default().stamp(this);
- },
- /**
- * @function L.supermap.baiduTileLayer.prototype.getTileUrl
- * @description 获取切片地址。
- * @param {Object} coords - 行列号。
- * @returns {string} 切片地址。
- */
- getTileUrl: function getTileUrl(coords) {
- var url = external_L_default().Util.template(this.url, {
- num: Math.abs((coords.x + coords.y) % 8) + 1,
- x: coords.x,
- y: -coords.y - 1,
- z: this._getZoomForUrl(),
- styles: this.options.retina ? 'ph' : 'pl'
- }); //支持代理
- if (this.options.tileProxy) {
- url = this.options.tileProxy + encodeURIComponent(url);
- }
- return url;
- }
- });
- var baiduTileLayer = function baiduTileLayer(url, options) {
- return new BaiduTileLayer(url, options);
- };
- (external_L_default()).supermap.baiduTileLayer = baiduTileLayer;
- ;// CONCATENATED MODULE: ./src/leaflet/mapping/CloudTileLayer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.cloudTileLayer
- * @classdesc 超图云服务图层。
- * @category ThirdPartyMap
- * @extends {L.TileLayer}
- * @param {string} [url='http://t2.dituhui.com/FileService/image?map={mapName}&type={type}&x={x}&y={y}&z={z}'] - 服务地址。
- * @param {Object} options - 图层可选参数。
- * @param {string} [options.type='web'] - type。
- * @param {number} [options.minZoom=3] - 最小缩放级别。
- * @param {number} [options.maxZoom=18] - 最大缩放级别。
- * @param {string} [options.mapName='quanguo'] - 地图名称。
- * @param {string} [options.attribution='Map Data ©2014 SuperMap - GS(2014)6070号-data©Navinfo'] - 版权信息。
- */
- var CloudTileLayer = external_L_default().TileLayer.extend({
- defaultURL: 'http://t2.dituhui.com/FileService/image',
- options: {
- /**
- * @member {string} [L.supermap.cloudTileLayer.prototype.options='quanguo']
- * @description 地图名称。
- */
- mapName: "quanguo",
- /**
- * @member {string} L.supermap.cloudTileLayer.prototype.type
- * @description 地图投影。
- */
- type: "web",
- minZoom: 3,
- maxZoom: 18,
- attribution: core_Attributions.Cloud.attribution
- },
- initialize: function initialize(url, options) {
- external_L_default().setOptions(this, options);
- var cloudURL = url || this.defaultURL;
- this._url = cloudURL + "?map=" + this.options.mapName + "&type=" + this.options.type;
- external_L_default().stamp(this);
- },
- /**
- * @function L.supermap.cloudTileLayer.prototype.getTileUrl
- * @description 获取切片地址。
- * @param {Object} coords - 行列号。
- * @returns {string} 切片地址。
- */
- getTileUrl: function getTileUrl(coords) {
- var layerUrl = this._url;
- var tileUrl = layerUrl + "&x=" + coords.x + "&y=" + coords.y + "&z=" + coords.z; //支持代理
- if (this.options.tileProxy) {
- tileUrl = this.options.tileProxy + encodeURIComponent(tileUrl);
- }
- return tileUrl;
- }
- });
- var cloudTileLayer = function cloudTileLayer(url, options) {
- return new CloudTileLayer(url, options);
- };
- (external_L_default()).supermap.cloudTileLayer = cloudTileLayer;
- ;// CONCATENATED MODULE: ./src/leaflet/mapping/ImageMapLayer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.imageMapLayer
- * @classdesc SuperMap iServer 的 REST 地图服务的图层(SuperMap iServer Java 6R 及以上分块动态 REST 图层)。使用 Image 资源出图。
- * @category iServer Map
- * @extends {L.Layer}
- * @example
- * L.supermap.imageMapLayer(url).addTo(map);
- * @param {string} url - 地图服务地址,如:http://{ip}:{port}/iserver/services/map-china400/rest/maps/China
- * @param {Object} options - 图层可选参数。
- * @param {string} [options.layersID] - 获取进行切片的地图图层 ID,即指定进行地图切片的图层,可以是临时图层集,也可以是当前地图中图层的组合
- * @param {boolean} [options.redirect=false] - 如果为 true,则将请求重定向到瓦片的真实地址;如果为 false,则响应体中是瓦片的字节流。
- * @param {boolean} [options.transparent=true] - 地图瓦片是否透明。
- * @param {boolean} [options.cacheEnabled=true] - 是否使用服务器缓存出图。
- * @param {boolean} [options.clipRegionEnabled=false] - 地图显示裁剪的区域是否有效。
- * @param {L.Path} [options.clipRegion] - 地图显示裁剪的区域。是一个面对象,当 clipRegionEnabled = true 时有效,即地图只显示该区域覆盖的部分。
- * @param {Object} [options.prjCoordSys] - 请求的地图的坐标参考系统。 如:prjCoordSys={"epsgCode":3857}。
- * @param {boolean} [options.overlapDisplayed=false] - 地图对象在同一范围内时,是否重叠显示。
- * @param {string} [options.overlapDisplayedOptions] - 避免地图对象压盖显示的过滤选项。
- * @param {number} [options.opacity=1] - 图层不透明度。
- * @param {string} [options.alt] - 无法显示图像时显示替代的文本。
- * @param {string} [options.pane='tilePane'] - 图层所归属的 map DOM 的分组。
- * @param {boolean} [options.interactive=false] - 是否响应鼠标点击或悬停交互事件。
- * @param {boolean} [options.crossOrigin=false] - 是否设置跨域属性。
- * @param {string} [options.errorOverlayUrl] - 图层未能加载时代替显示的瓦片地址。
- * @param {number} [options.zIndex=1] - 设置图层的层级。
- * @param {string} [options.className] - 自定义 dom 元素的 className。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 iServer|iPortal|online。
- * @param {number} [options.updateInterval=150] - 平移时图层延迟刷新间隔时间。
- * @param {string} [options.tileProxy] - 代理地址。
- * @param {string} [options.format='png'] - 瓦片表述类型,支持 "png" 、"webp"、"bmp" 、"jpg"、 "gif" 等图片格式。
- * @param {(SuperMap.NDVIParameter|SuperMap.HillshadeParameter)} [options.rasterfunction] - 栅格分析参数。
- * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权信息。
- * @fires L.supermap.imageMapLayer#load
- * @fires L.supermap.imageMapLayer#error
- * @fires L.supermap.imageMapLayer#loading
- */
- var ImageMapLayer = external_L_namespaceObject.Layer.extend({
- options: {
- //如果有layersID,则是在使用专题图
- layersID: null,
- //如果为 true,则将请求重定向到图片的真实地址;如果为 false,则响应体中是图片的字节流
- redirect: false,
- //地图图片是否透明
- transparent: true,
- //是否启用服务器缓存
- cacheEnabled: true,
- //地图显示裁剪的区域是否有效
- clipRegionEnabled: false,
- //地图显示裁剪的区域
- clipRegion: null,
- //请求的地图的坐标参考系统。 如:prjCoordSys= {"epsgCode":3857}。
- prjCoordSys: null,
- //地图对象在同一范围内时,是否重叠显示
- overlapDisplayed: false,
- //避免地图对象压盖显示的过滤选项
- overlapDisplayedOptions: null,
- //图层不透明度
- opacity: 1,
- //无法显示图像时显示替代的文本
- alt: '',
- //图层所归属的map DOM的分组。默认为:"tilePane"
- pane: 'tilePane',
- //是否响应鼠标点击或悬停交互事件
- interactive: false,
- //是否设置跨域属性
- crossOrigin: false,
- //图层未能加载时代替显示的瓦片地址
- errorOverlayUrl: '',
- //设置图层的显示层级
- zIndex: 1,
- //自定义的html class name
- className: '',
- //服务来源 iServer|iPortal|online。
- serverType: ServerType.ISERVER,
- //版权信息
- attribution: core_Attributions.Common.attribution,
- //平移时图层延迟刷新间隔时间。
- updateInterval: 150,
- //启用托管地址。
- tileProxy: null,
- format: 'png'
- },
- initialize: function initialize(url, options) {
- this._url = url;
- external_L_namespaceObject.Util.setOptions(this, options);
- },
- /**
- * @private
- * @function L.supermap.imageMapLayer.prototype.onAdd
- * @description 添加到地图。
- * @param {L.Map} map - 待添加到的地图对象。
- */
- onAdd: function onAdd(map) {
- this.update = external_L_namespaceObject.Util.throttle(this.update, this.options.updateInterval, this);
- map.on('moveend', this.update, this);
- if (this._currentImage && this._currentImage._bounds.equals(this._map.getBounds())) {
- map.addLayer(this._currentImage);
- } else if (this._currentImage) {
- this._map.removeLayer(this._currentImage);
- this._currentImage = null;
- }
- this.update();
- },
- /**
- * @private
- * @function L.supermap.imageMapLayer.prototype.onRemove
- * @description 从地图上移除。
- */
- onRemove: function onRemove() {
- // eslint-disable-line no-unused-vars
- if (this._currentImage) {
- this._map.removeLayer(this._currentImage);
- }
- this._map.off('moveend', this.update, this);
- },
- /**
- * @function L.supermap.imageMapLayer.prototype.bringToFront
- * @description 将当前图层置顶
- */
- bringToFront: function bringToFront() {
- this.options.position = 'front';
- if (this._currentImage) {
- this._currentImage.bringToFront();
- }
- return this;
- },
- /**
- * @function L.supermap.imageMapLayer.prototype.bringToFront
- * @description 将当前图层置底。
- */
- bringToBack: function bringToBack() {
- this.options.position = 'back';
- if (this._currentImage) {
- this._currentImage.bringToBack();
- }
- return this;
- },
- /**
- * @function L.supermap.imageMapLayer.prototype.getOpacity
- * @description 获取图层透明度。
- * @returns {number} 图层的透明度。
- */
- getOpacity: function getOpacity() {
- return this.options.opacity;
- },
- /**
- * @function L.supermap.imageMapLayer.prototype.setOpacity
- * @description 设置透明度。
- */
- setOpacity: function setOpacity(opacity) {
- this.options.opacity = opacity;
- if (this._currentImage) {
- this._currentImage.setOpacity(opacity);
- }
- return this;
- },
- /**
- * @function L.supermap.imageMapLayer.prototype.getImageUrl
- * @description 获取 image 图层请求地址,子类可重写实现。
- * @returns {string} 请求瓦片地址。
- */
- getImageUrl: function getImageUrl(params) {
- var serviceUrl = Util.urlPathAppend(this._url, "image.".concat(this.options.format));
- var imageUrl = serviceUrl + external_L_namespaceObject.Util.getParamString(Object.assign({}, this._initAllRequestParams(), params), serviceUrl);
- imageUrl = this._appendCredential(imageUrl); //支持代理
- if (this.options.tileProxy) {
- imageUrl = this.options.tileProxy + encodeURIComponent(imageUrl);
- }
- if (!this.options.cacheEnabled) {
- imageUrl += '&_t=' + new Date().getTime();
- }
- return imageUrl;
- },
- //获取请求瓦片宽高以及请求范围参数
- _getImageParams: function _getImageParams() {
- var size = this._calculateImageSize();
- return {
- viewBounds: this._compriseBounds(this._calculateBounds()),
- width: size.x,
- height: size.y
- };
- },
- //初始化服务请求参数
- _initAllRequestParams: function _initAllRequestParams() {
- var me = this,
- options = me.options || {},
- params = {};
- var redirect = options.redirect === true ? options.redirect : false;
- params['redirect'] = redirect;
- var transparent = options.transparent === true ? options.transparent : false;
- params['transparent'] = transparent;
- var cacheEnabled = options.cacheEnabled === false ? options.cacheEnabled : true;
- params['cacheEnabled'] = cacheEnabled;
- if (options.prjCoordSys) {
- params['prjCoordSys'] = JSON.stringify(options.prjCoordSys);
- }
- if (options.layersID) {
- params['layersID'] = options.layersID;
- }
- if (options.rasterfunction) {
- params['rasterfunction'] = JSON.stringify(options.rasterfunction);
- }
- if (options.clipRegionEnabled && options.clipRegion) {
- params['clipRegionEnabled'] = options.clipRegionEnabled;
- params['clipRegion'] = JSON.stringify(ServerGeometry.fromGeometry(toSuperMapGeometry(options.clipRegion)));
- }
- if (options.overlapDisplayed === false) {
- params['overlapDisplayed'] = false;
- if (options.overlapDisplayedOptions) {
- params['overlapDisplayedOptions'] = me.overlapDisplayedOptions.toString();
- }
- } else {
- params['overlapDisplayed'] = true;
- }
- return params;
- },
- //初始化请求链接
- _requestImage: function _requestImage(params, bounds) {
- var imageUrl = this.getImageUrl(params);
- this._loadImage(imageUrl, bounds);
- },
- //加载请求图层
- _loadImage: function _loadImage(url, bounds) {
- if (!this._map) {
- return;
- }
- var image = new external_L_namespaceObject.ImageOverlay(url, bounds, {
- opacity: 0,
- alt: this.options.alt,
- zIndex: this.options.zIndex,
- className: this.options.className,
- errorOverlayUrl: this.options.error,
- crossOrigin: this.options.crossOrigin,
- pane: this.options.pane || this.getPane(),
- interactive: this.options.interactive
- }).addTo(this._map);
- var onLoad = function onLoad(e) {
- image.off('error', onLoad, this);
- var map = this._map;
- if (!map) {
- return;
- }
- var newImage = e.target;
- var oldImage = this._currentImage;
- if (newImage._bounds && newImage._bounds.equals(bounds) && newImage._bounds.equals(map.getBounds())) {
- this._currentImage = newImage;
- if (this.options.position === 'front') {
- this.bringToFront();
- }
- if (this.options.position === 'back') {
- this.bringToBack();
- }
- if (this._currentImage._map) {
- this._currentImage.setOpacity(this.options.opacity);
- }
- oldImage && map.removeLayer(oldImage);
- oldImage && oldImage._map && oldImage._map.removeLayer(oldImage);
- } else {
- map.removeLayer(newImage);
- }
- /**
- * @event L.supermap.imageMapLayer#load
- * @description 请求图层加载完成后触发。
- * @property {L.bounds} bounds - 图层 bounds。
- */
- this.fire('load', {
- bounds: bounds
- });
- };
- image.once('load', onLoad, this);
- image.once('error', function () {
- this._map.removeLayer(image);
- /**
- * @event L.supermap.imageMapLayer#error
- * @description 请求图层加载失败后触发。
- */
- this.fire('error');
- image.off('load', onLoad, this);
- }, this);
- /**
- * @event L.supermap.imageMapLayer#loading
- * @description 请求图层加载中触发。
- * @property {L.bounds} bounds - 图层 bounds。
- */
- this.fire('loading', {
- bounds: bounds
- });
- },
- /**
- * @function L.supermap.imageMapLayer.prototype.update
- * @description 更新图层。
- */
- update: function update() {
- if (!this._map) {
- return;
- }
- var zoom = this._map.getZoom();
- var bounds = this._map.getBounds();
- if (zoom > (this._map.options.maxZoom || 18) || zoom < (this._map.options.minZoom || 0)) {
- if (this._currentImage) {
- this._currentImage._map.removeLayer(this._currentImage);
- this._currentImage = null;
- }
- return;
- }
- var params = this._getImageParams();
- if (params) {
- this._requestImage(params, bounds);
- } else if (this._currentImage) {
- this._currentImage._map.removeLayer(this._currentImage);
- this._currentImage = null;
- }
- },
- //将像素坐标转成点坐标
- _calculateBounds: function _calculateBounds() {
- var pixelBounds = this._map.getPixelBounds();
- var sw = this._map.unproject(pixelBounds.getBottomLeft());
- var ne = this._map.unproject(pixelBounds.getTopRight());
- var neProjected = this._map.options.crs.project(ne);
- var swProjected = this._map.options.crs.project(sw);
- return external_L_default().bounds(neProjected, swProjected);
- },
- //转换viewBounds为JSON字符串
- _compriseBounds: function _compriseBounds(boundsProjected) {
- var projBounds = {
- leftBottom: {
- x: boundsProjected.getBottomLeft().x,
- y: boundsProjected.getTopRight().y
- },
- rightTop: {
- x: boundsProjected.getTopRight().x,
- y: boundsProjected.getBottomLeft().y
- }
- };
- return JSON.stringify(projBounds);
- },
- //计算图层的宽高
- _calculateImageSize: function _calculateImageSize() {
- var map = this._map;
- var bounds = map.getPixelBounds();
- var size = map.getSize();
- var sw = map.unproject(bounds.getBottomLeft());
- var ne = map.unproject(bounds.getTopRight());
- var top = map.latLngToLayerPoint(ne).y;
- var bottom = map.latLngToLayerPoint(sw).y;
- if (top > 0 || bottom < size.y) {
- size.y = bottom - top;
- }
- return size;
- },
- //追加token或key
- _appendCredential: function _appendCredential(url) {
- var newUrl = url,
- credential,
- value;
- switch (this.options.serverType) {
- case ServerType.IPORTAL:
- value = SecurityManager.getToken(this._url);
- credential = value ? new Credential(value, 'token') : null;
- if (!credential) {
- value = SecurityManager.getKey(this._url);
- credential = value ? new Credential(value, 'key') : null;
- }
- break;
- case ServerType.ONLINE:
- value = SecurityManager.getKey(this._url);
- credential = value ? new Credential(value, 'key') : null;
- break;
- default:
- //iserver or others
- value = SecurityManager.getToken(this._url);
- credential = value ? new Credential(value, 'token') : null;
- break;
- }
- if (credential) {
- newUrl = Util.urlAppend(newUrl, credential.getUrlParameters());
- }
- return newUrl;
- }
- });
- var imageMapLayer = function imageMapLayer(url, options) {
- return new ImageMapLayer(url, options);
- };
- (external_L_default()).supermap.imageMapLayer = imageMapLayer;
- ;// CONCATENATED MODULE: ./src/leaflet/mapping/TileLayer.WMTS.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.wmtsLayer
- * @classdesc wmts 图层类。
- * @category OGC
- * @extends {L.TileLayer}
- * @param {string} url - wmts 图层地址。
- * @param {Object} options - wmts 图层可选参数。
- * @param {string} options.layer - 需要显示的图层。
- * @param {string} [options.tileProxy] - 代理地址。
- * @param {Object} [options.style] - 图层样式。
- * @param {string} [options.format='image/png'] - wmts 图像格式('image/png'用于具有透明度的图层)。
- * @param {(number|L.Point)} [options.tileSize='256'] - 瓦片大小。
- * @param {string} [options.requestEncoding='KVP'] - KVP 或者 REST 的请求方式。
- * @param {string} [options.tilematrixSet] - 瓦片矩阵集。
- * @param {Array.<L.supermap.wmtsLayer.matrix>} [options.matrixIds] - 瓦片矩阵对象。不设置时,默认为获取当前级别为tilematrix参数。
- * @param {string} [options.version='1.0.0'] - 版本。
- * @param {string} [options.attribution] - 版权信息。
- * @param {string} [options.noWrap=true] - 图层是否X方向平铺。
- */
- /**
- * @typedef {Object} L.supermap.wmtsLayer.matrix
- * @description 瓦片矩阵。
- * @property {string} identifier - 瓦片矩阵标识符。
- */
- var WMTSLayer = external_L_default().TileLayer.extend({
- options: {
- version: '1.0.0',
- style: '',
- tilematrixSet: '',
- format: 'image/png',
- tileSize: 256,
- matrixIds: null,
- layer: '',
- requestEncoding: 'KVP',
- attribution: '',
- noWrap: true
- },
- //todo 自动获取Capabilities
- initialize: function initialize(url, options) {
- // (String, Object)
- this._url = url;
- external_L_default().setOptions(this, options);
- var opt = this.options;
- if (opt.requestEncoding === "REST") {
- var formatSuffixMap = {
- "image/png": "png",
- "image/png8": "png",
- "image/png24": "png",
- "image/png32": "png",
- "png": "png",
- "image/jpeg": "jpg",
- "image/jpg": "jpg",
- "jpeg": "jpg",
- "jpg": "jpg"
- };
- this.formatSuffix = "." + (formatSuffixMap[opt.format] || opt.format.split("/").pop() || "png");
- } else {
- opt.requestEncoding = "KVP";
- }
- },
- /**
- * @function L.supermap.wmtsLayer.prototype.getTileUrl
- * @description 根据行列号获取切片地址。
- * @param {Object} coords - 行列号。
- * @returns {string} 切片地址。
- */
- getTileUrl: function getTileUrl(coords) {
- // (Point, Number) -> String
- var zoom = this._getZoomForUrl();
- var ident = this.options.matrixIds ? this.options.matrixIds[zoom].identifier : zoom;
- var url = external_L_default().Util.template(this._url, {
- s: this._getSubdomain(coords)
- });
- var obj = {
- service: 'WMTS',
- request: 'GetTile',
- version: this.options.version,
- style: this.options.style,
- tilematrixSet: this.options.tilematrixSet,
- format: this.options.format,
- width: this.options.tileSize,
- height: this.options.tileSize,
- layer: this.options.layer,
- tilematrix: ident,
- tilerow: coords.y,
- tilecol: coords.x
- };
- if (this.options.tileProxy) {
- url = this.options.tileProxy + url;
- }
- if (this.options.requestEncoding === 'KVP') {
- url += external_L_default().Util.getParamString(obj, url);
- } else if (this.options.requestEncoding === 'REST') {
- var params = "/" + obj.layer + "/" + obj.style + "/" + obj.tilematrixSet + "/" + obj.tilematrix + "/" + obj.tilerow + "/" + obj.tilecol + this.formatSuffix;
- url += params;
- }
- return url;
- }
- });
- var wmtsLayer = function wmtsLayer(url, options) {
- return new WMTSLayer(url, options);
- };
- (external_L_default()).supermap.wmtsLayer = wmtsLayer;
- ;// CONCATENATED MODULE: ./src/leaflet/mapping/TiandituTileLayer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.tiandituTileLayer
- * @classdesc 天地图图层类。
- * @category ThirdPartyMap
- * @extends L.supermap.wmtsLayer
- * @param {Object} options - 切片图层参数。
- * @param {string} [options.url='https://t{s}.tianditu.gov.cn/{layer}_{proj}/wmts?'] - 地图地址。
- * @param {string} options.key - 天地图服务密钥。详见{@link https://lbs.tianditu.gov.cn/server/MapService.html}
- * @param {string} [options.layerType='vec'] - 图层类型。(vec:矢量图层,img:影像图层,ter:地形图层)
- * @param {string} [options.style='default'] - 图层风格。
- * @param {string} [options.format='tiles'] - 格式。
- * @param {boolean} [options.isLabel=false] - 是否是标注图层。
- * @param {Array.<number>} [options.subdomains=[0, 1, 2, 3, 4, 5, 6, 7]] - 子域名数组。
- * @param {string} [options.attribution='Map Data <a href='https://www.tianditu.gov.cn' target='_blank'><img style='background-color:transparent;bottom:2px;opacity:1;' src='https://api.tianditu.gov.cn/img/map/logo.png' width='53px' height='22px' opacity='0'></a>'] - 版权信息
- * @param {string} [options.noWrap=true] - 图层是否X方向平铺。
- */
- var TiandituTileLayer = WMTSLayer.extend({
- layerLabelMap: {
- vec: 'cva',
- ter: 'cta',
- img: 'cia'
- },
- layerZoomMap: {
- vec: 18,
- ter: 14,
- img: 18
- },
- options: {
- layerType: 'vec',
- //(vec:矢量图层,vec:矢量标签图层,img:影像图层,cia:影像标签图层,ter:地形,cta:地形标签图层)
- isLabel: false,
- attribution: core_Attributions.Tianditu.attribution,
- url: 'https://t{s}.tianditu.gov.cn/{layer}_{proj}/wmts?',
- zoomOffset: 1,
- key: '',
- dpi: 96,
- style: 'default',
- format: 'tiles',
- subdomains: [0, 1, 2, 3, 4, 5, 6, 7],
- bounds: [[-90, -180], [90, 180]],
- noWrap: true
- },
- initialize: function initialize(options) {
- options = options || {};
- external_L_default().setOptions(this, options);
- this.options.layer = this.options.isLabel ? this.layerLabelMap[this.options.layerType] : this.options.layerType;
- this.options.maxZoom = this.layerZoomMap[this.options.layerType] - 1;
- WMTSLayer.prototype.initialize.call(this, this.options.url, this.options);
- external_L_default().stamp(this);
- if (this.options.key) {
- this._url = "".concat(this._url, "tk=").concat(this.options.key);
- }
- },
- onAdd: function onAdd(map) {
- this.options.tilematrixSet = map.options.crs.code === "EPSG:4326" ? "c" : "w";
- this._url = this._url.replace("{layer}", this.options.layer).replace("{proj}", this.options.tilematrixSet);
- WMTSLayer.prototype.onAdd.call(this, map);
- },
- _isValidTile: function _isValidTile(coords) {
- var crs = this._map.options.crs;
- if (!crs.infinite) {
- var bounds = this._globalTileRange;
- if ((!crs.wrapLng || this.options.noWrap) && (coords.x < bounds.min.x || coords.x > bounds.max.x) || !crs.wrapLat && (coords.y < bounds.min.y || coords.y > bounds.max.y)) {
- return false;
- }
- }
- if (!this.options.bounds) {
- return true;
- }
- var tileBounds = this._tileCoordsToBounds(coords);
- return external_L_default().latLngBounds(this.options.bounds).overlaps(tileBounds);
- }
- });
- var tiandituTileLayer = function tiandituTileLayer(options) {
- return new TiandituTileLayer(options);
- };
- (external_L_default()).supermap.tiandituTileLayer = tiandituTileLayer;
- ;// CONCATENATED MODULE: ./src/leaflet/mapping/TiledMapLayer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.tiledMapLayer
- * @classdesc SuperMap iServer 的 REST 地图服务的图层(SuperMap iServer Java 6R 及以上分块动态 REST 图层)。使用 TileImage 资源出图。
- * @category iServer Map
- * @extends {L.TileLayer}
- * @example
- * L.supermap.tiledMapLayer(url).addTo(map);
- * @param {string} url - 地图服务地址,例如: http://{ip}:{port}/iserver/services/map-world/rest/maps/World。
- * @param {Object} options - 参数。
- * @param {string} [options.layersID] - 获取进行切片的地图图层 ID,即指定进行地图切片的图层,可以是临时图层集,也可以是当前地图中图层的组合
- * @param {boolean} [options.redirect=false] - 是否重定向,如果为 true,则将请求重定向到瓦片的真实地址;如果为 false,则响应体中是瓦片的字节流。
- * @param {boolean} [options.transparent=true] - 是否背景透明。
- * @param {boolean} [options.cacheEnabled=true] - 启用缓存。
- * @param {boolean} [options.clipRegionEnabled=false] - 是否启用地图裁剪。
- * @param {L.Path} [options.clipRegion] - 地图显示裁剪的区域。是一个面对象,当 clipRegionEnabled = true 时有效,即地图只显示该区域覆盖的部分。
- * @param {Object} [options.prjCoordSys] - 请求的地图的坐标参考系统。 如:prjCoordSys={"epsgCode":3857}。
- * @param {boolean} [options.overlapDisplayed=false] - 地图对象在同一范围内时,是否重叠显示。
- * @param {string} [options.overlapDisplayedOptions] - 避免地图对象压盖显示的过滤选项。
- * @param {string} [options.tileversion] - 切片版本名称,cacheEnabled 为 true 时有效。如果没有设置 tileversion 参数,而且当前地图的切片集中存在多个版本,则默认使用最后一个更新版本。
- * @param {L.Proj.CRS} [options.crs] - 坐标系统类。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
- * @param {string} [options.tileProxy] - 代理地址。
- * @param {string} [options.format='png'] - 瓦片表述类型,支持 "png" 、"webp"、"bmp" 、"jpg"、 "gif" 等图片格式。
- * @param {(number|L.Point)} [options.tileSize=256] - 瓦片大小。
- * @param {(SuperMap.NDVIParameter|SuperMap.HillshadeParameter)} [options.rasterfunction] - 栅格分析参数。
- * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权信息。
- * @param {Array.<number>} [options.subdomains] - 子域名数组。
- * @fires L.supermap.tiledMapLayer#tilesetsinfoloaded
- * @fires L.supermap.tiledMapLayer#tileversionschanged
- */
- var TiledMapLayer = external_L_default().TileLayer.extend({
- options: {
- //如果有layersID,则是在使用专题图
- layersID: null,
- //如果为 true,则将请求重定向到瓦片的真实地址;如果为 false,则响应体中是瓦片的字节流
- redirect: false,
- transparent: true,
- cacheEnabled: true,
- clipRegionEnabled: false,
- //地图显示裁剪的区域
- clipRegion: null,
- //请求的地图的坐标参考系统。 如:prjCoordSys={"epsgCode":3857}
- prjCoordSys: null,
- //地图对象在同一范围内时,是否重叠显示
- overlapDisplayed: false,
- //避免地图对象压盖显示的过滤选项
- overlapDisplayedOptions: null,
- //切片版本名称,cacheEnabled 为 true 时有效。
- tileversion: null,
- crs: null,
- serverType: ServerType.ISERVER,
- format: 'png',
- //启用托管地址。
- tileProxy: null,
- attribution: core_Attributions.Common.attribution,
- subdomains: null
- },
- initialize: function initialize(url, options) {
- this._url = url;
- external_L_default().TileLayer.prototype.initialize.apply(this, arguments);
- external_L_default().setOptions(this, options);
- external_L_default().stamp(this); //当前切片在切片集中的index
- this.tileSetsIndex = -1;
- this.tempIndex = -1;
- },
- /**
- * @private
- * @function L.supermap.tiledMapLayer.prototype.onAdd
- * @description 添加地图。
- * @param {L.Map} map - 待添加的影像地图参数。
- */
- onAdd: function onAdd(map) {
- this._crs = this.options.crs || map.options.crs;
- external_L_default().TileLayer.prototype.onAdd.call(this, map);
- },
- /**
- * @function L.supermap.tiledMapLayer.prototype.getTileUrl
- * @description 根据行列号获取瓦片地址。
- * @param {Object} coords - 行列号。
- * @returns {string} 瓦片地址。
- */
- getTileUrl: function getTileUrl(coords) {
- var scale = this.getScaleFromCoords(coords);
- var layerUrl = this._getLayerUrl();
- var tileUrl = layerUrl + "&scale=" + scale + "&x=" + coords.x + "&y=" + coords.y; //支持代理
- if (this.options.tileProxy) {
- tileUrl = this.options.tileProxy + encodeURIComponent(tileUrl);
- }
- if (!this.options.cacheEnabled) {
- tileUrl += "&_t=" + new Date().getTime();
- }
- if (this.options.subdomains) {
- tileUrl = external_L_default().Util.template(tileUrl, {
- s: this._getSubdomain(coords)
- });
- }
- return tileUrl;
- },
- /**
- * @function L.supermap.tiledMapLayer.prototype.getScale
- * @description 根据缩放级别获取比例尺。
- * @param {number} zoom - 缩放级别。
- * @returns {number} 比例尺。
- */
- getScale: function getScale(zoom) {
- var me = this; //返回当前比例尺
- var z = zoom || me._map.getZoom();
- return me.scales[z];
- },
- /**
- * @function L.supermap.tiledMapLayer.prototype.getScaleFromCoords
- * @description 通过行列号获取比例尺。
- * @param {Object} coords - 行列号。
- * @returns {number} 比例尺。
- */
- getScaleFromCoords: function getScaleFromCoords(coords) {
- var me = this,
- scale;
- if (me.scales && me.scales[coords.z]) {
- return me.scales[coords.z];
- }
- me.scales = me.scales || {};
- scale = me.getDefaultScale(coords);
- me.scales[coords.z] = scale;
- return scale;
- },
- /**
- * @private
- * @function L.supermap.tiledMapLayer.prototype.getDefaultScale
- * @description 获取默认比例尺信息。
- * @param {Object} coords - 坐标对象参数。
- */
- getDefaultScale: function getDefaultScale(coords) {
- var me = this,
- crs = me._crs;
- if (crs.scales) {
- return crs.scales[coords.z];
- } else {
- var tileBounds = me._tileCoordsToBounds(coords);
- var ne = crs.project(tileBounds.getNorthEast());
- var sw = crs.project(tileBounds.getSouthWest());
- var tileSize = me.options.tileSize;
- var resolution = Math.max(Math.abs(ne.x - sw.x) / tileSize, Math.abs(ne.y - sw.y) / tileSize);
- var mapUnit = Unit.METER;
- if (crs.code) {
- var array = crs.code.split(':');
- if (array && array.length > 1) {
- var code = parseInt(array[1]);
- mapUnit = code && code >= 4000 && code <= 5000 ? Unit.DEGREE : Unit.METER;
- }
- }
- return resolutionToScale(resolution, 96, mapUnit);
- }
- },
- /**
- * @function L.supermap.tiledMapLayer.prototype.setTileSetsInfo
- * @description 设置瓦片集信息。
- * @param {Object} tileSets - 瓦片对象集。
- */
- setTileSetsInfo: function setTileSetsInfo(tileSets) {
- this.tileSets = tileSets;
- if (external_L_default().Util.isArray(this.tileSets)) {
- this.tileSets = this.tileSets[0];
- }
- if (!this.tileSets) {
- return;
- }
- /**
- * @event L.supermap.tiledMapLayer#tilesetsinfoloaded
- * @description 瓦片集信息设置完成后触发。
- * @property {Array.<Object>} tileVersions - 瓦片集信息。
- */
- this.fire('tilesetsinfoloaded', {
- tileVersions: this.tileSets.tileVersions
- });
- this.changeTilesVersion();
- },
- /**
- * @function L.supermap.tiledMapLayer.prototype.lastTilesVersion
- * @description 请求上一个版本切片,并重新绘制。
- */
- lastTilesVersion: function lastTilesVersion() {
- this.tempIndex = this.tileSetsIndex - 1;
- this.changeTilesVersion();
- },
- /**
- * @function L.supermap.tiledMapLayer.prototype.nextTilesVersion
- * @description 请求下一个版本切片,并重新绘制。
- */
- nextTilesVersion: function nextTilesVersion() {
- this.tempIndex = this.tileSetsIndex + 1;
- this.changeTilesVersion();
- },
- /**
- * @function L.supermap.tiledMapLayer.prototype.changeTilesVersion
- * @description 切换到某一版本的切片,并重绘。通过 this.tempIndex 保存需要切换的版本索引
- */
- changeTilesVersion: function changeTilesVersion() {
- var me = this; //切片版本集信息是否存在
- if (me.tileSets == null) {
- //版本信息为空,重新查询,查询成功继续跳转到相应的版本
- //me.getTileSetsInfo();
- return;
- }
- if (me.tempIndex === me.tileSetsIndex || this.tempIndex < 0) {
- return;
- } //检测index是否可用
- var tileVersions = me.tileSets.tileVersions;
- if (tileVersions && me.tempIndex < tileVersions.length && me.tempIndex >= 0) {
- var name = tileVersions[me.tempIndex].name;
- var result = me.mergeTileVersionParam(name);
- if (result) {
- me.tileSetsIndex = me.tempIndex;
- /**
- * @event L.supermap.tiledMapLayer#tileversionschanged
- * @description 切片的版本切换和重绘成功之后触发。
- * @property {Object} tileVersion - 该版本的切片。
- */
- me.fire('tileversionschanged', {
- tileVersion: tileVersions[me.tempIndex]
- });
- }
- }
- },
- /**
- * @function L.supermap.tiledMapLayer.prototype.updateCurrentTileSetsIndex
- * @description 手动设置当前切片集索引,目前主要提供给控件使用。
- * @param {number} index - 索引值。
- */
- updateCurrentTileSetsIndex: function updateCurrentTileSetsIndex(index) {
- this.tempIndex = index;
- },
- /**
- * @function L.supermap.tiledMapLayer.prototype.mergeTileVersionParam
- * @description 更改URL请求参数中的切片版本号,并重绘。
- * @param {string} version - 切片版本号。
- * @returns {boolean} 是否成功。
- */
- mergeTileVersionParam: function mergeTileVersionParam(version) {
- if (version) {
- this.requestParams["tileversion"] = version;
- this._paramsChanged = true;
- this.redraw();
- this._paramsChanged = false;
- return true;
- }
- return false;
- },
- _getLayerUrl: function _getLayerUrl() {
- if (this._paramsChanged) {
- this._layerUrl = this._createLayerUrl();
- }
- return this._layerUrl || this._createLayerUrl();
- },
- _createLayerUrl: function _createLayerUrl() {
- var layerUrl = Util.urlPathAppend(this._url, "tileImage.".concat(this.options.format));
- this.requestParams = this.requestParams || this._getAllRequestParams();
- layerUrl = Util.urlAppend(layerUrl, external_L_namespaceObject.Util.getParamString(this.requestParams));
- layerUrl = this._appendCredential(layerUrl);
- this._layerUrl = layerUrl;
- return layerUrl;
- },
- _getAllRequestParams: function _getAllRequestParams() {
- var me = this,
- options = me.options || {},
- params = {};
- var tileSize = this.options.tileSize;
- if (!(tileSize instanceof (external_L_default()).Point)) {
- tileSize = external_L_default().point(tileSize, tileSize);
- }
- params["width"] = tileSize.x;
- params["height"] = tileSize.y;
- params["redirect"] = options.redirect === true;
- params["transparent"] = options.transparent === true;
- params["cacheEnabled"] = !(options.cacheEnabled === false);
- if (options.prjCoordSys) {
- params["prjCoordSys"] = JSON.stringify(options.prjCoordSys);
- }
- if (options.layersID) {
- params["layersID"] = options.layersID.toString();
- }
- if (options.clipRegionEnabled && options.clipRegion) {
- options.clipRegion = ServerGeometry.fromGeometry(toSuperMapGeometry(options.clipRegion));
- params["clipRegionEnabled"] = options.clipRegionEnabled;
- params["clipRegion"] = JSON.stringify(options.clipRegion);
- } //切片的起始参考点,默认为地图范围的左上角。
- var crs = me._crs;
- if (crs.options && crs.options.origin) {
- params["origin"] = JSON.stringify({
- x: crs.options.origin[0],
- y: crs.options.origin[1]
- });
- } else if (crs.projection && crs.projection.bounds) {
- var bounds = crs.projection.bounds;
- var tileOrigin = external_L_default().point(bounds.min.x, bounds.max.y);
- params["origin"] = JSON.stringify({
- x: tileOrigin.x,
- y: tileOrigin.y
- });
- }
- if (options.overlapDisplayed === false) {
- params["overlapDisplayed"] = false;
- if (options.overlapDisplayedOptions) {
- params["overlapDisplayedOptions"] = me.overlapDisplayedOptions.toString();
- }
- } else {
- params["overlapDisplayed"] = true;
- }
- if (params.cacheEnabled === true && options.tileversion) {
- params["tileversion"] = options.tileversion.toString();
- }
- if (options.rasterfunction) {
- params["rasterfunction"] = JSON.stringify(options.rasterfunction);
- }
- return params;
- },
- //追加token或key
- _appendCredential: function _appendCredential(url) {
- var newUrl = url,
- credential,
- value;
- switch (this.options.serverType) {
- case ServerType.IPORTAL:
- value = SecurityManager.getToken(this._url);
- credential = value ? new Credential(value, "token") : null;
- if (!credential) {
- value = SecurityManager.getKey(this._url);
- credential = value ? new Credential(value, "key") : null;
- }
- break;
- case ServerType.ONLINE:
- value = SecurityManager.getKey(this._url);
- credential = value ? new Credential(value, "key") : null;
- break;
- default:
- //iserver or others
- value = SecurityManager.getToken(this._url);
- credential = value ? new Credential(value, "token") : null;
- break;
- }
- if (credential) {
- newUrl = Util.urlAppend(newUrl, credential.getUrlParameters());
- }
- return newUrl;
- }
- });
- var tiledMapLayer = function tiledMapLayer(url, options) {
- return new TiledMapLayer(url, options);
- };
- (external_L_default()).supermap.tiledMapLayer = tiledMapLayer;
- // EXTERNAL MODULE: ./node_modules/jsonsql/index.js
- var jsonsql = __webpack_require__(879);
- var jsonsql_default = /*#__PURE__*/__webpack_require__.n(jsonsql);
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/carto/CartoDefaultStyle.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @constant L.supermap.DefaultStyle
- * @description 这个 style 对应的是默认设置。
- * @category BaseTypes Style
- * @private
- */
- var DefaultStyle = {
- /**
- * @constant L.supermap.DefaultStyle.prototype.TEXT
- * @description 默认文本样式。
- */
- "TEXT": {
- fontSize: "14px",
- fontFamily: "Arial Unicode MS Regular,Microsoft YaHei",
- textAlign: "left",
- color: "rgba(255,255,255,0)",
- fillColor: "rgba(80,80,80,1)",
- weight: 1,
- globalAlpha: 1
- },
- /**
- * @constant L.supermap.DefaultStyle.prototype.POINT
- * @description 默认点样式。
- */
- "POINT": {
- fillColor: "#ffcc00",
- color: "#cc3333",
- weight: 1,
- radius: 3,
- opacity: 1
- },
- /**
- * @constant L.supermap.DefaultStyle.prototype.LINE
- * @description 默认线样式。
- */
- "LINE": {
- color: "rgba(0,0,0,0)",
- weight: 1,
- lineCap: "butt",
- lineJoin: "round",
- dashOffset: 0,
- dashArray: [],
- opacity: 1
- },
- /**
- * @constant L.supermap.DefaultStyle.prototype.REGION
- * @description 默认多边形样式。
- */
- "REGION": {
- color: "rgba(0,0,0,0)",
- fillColor: "rgba(0,0,0,0)",
- weight: 1,
- lineCap: "butt",
- lineJoin: "round",
- dashOffset: 0,
- opacity: 1,
- fillOpacity: 1,
- dashArray: []
- }
- };
- (external_L_default()).supermap.DefaultStyle = DefaultStyle;
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/carto/CartoStyleMap.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @constant L.supermap.CartoStyleMap
- * @description CartoCSS 中的 style 属性名与 leaflet 的 style 属性名的对应表。
- * @category BaseTypes Style
- * @private
- */
- var CartoStyleMap = {
- /*
- * @constant L.supermap.CartoStyleMap.prototype.TEXT
- * @description 默认文本样式。
- */
- "TEXT": {
- "text-size": "fontSize",
- "text-face-name": "fontFamily",
- "text-align": "textAlign",
- "text-name": "textName",
- 'text-weight': 'fontWeight',
- "text-halo-color": "color",
- "text-fill": "fillColor",
- "text-comp-op": "globalCompositeOperation"
- },
- /*
- * @constant L.supermap.CartoStyleMap.prototype.POINT
- * @description 默认点样式。
- */
- "POINT": {
- "point-file": "iconUrl",
- "point-fill": "fillColor",
- "point-radius": "radius",
- "point-halo-color": "color",
- "point-comp-op": "globalCompositeOperation"
- },
- /*
- * @constant L.supermap.CartoStyleMap.prototype.LINE
- * @description 默认线样式。
- */
- "LINE": {
- "line-color": "color",
- "line-width": "weight",
- "line-cap": "lineCap",
- "line-join": "lineJoin",
- "line-dash-offset": "dashOffset",
- "line-opacity": "opacity",
- "line-dasharray": "dashArray",
- "line-comp-op": "globalCompositeOperation"
- },
- /*
- * @constant L.supermap.CartoStyleMap.prototype.REGION
- * @description 默认多边形样式。
- */
- "REGION": {
- "line-color": "color",
- "line-width": "weight",
- "line-cap": "lineCap",
- "line-join": "lineJoin",
- "line-dash-offset": "dashOffset",
- "line-opacity": "opacity",
- "line-dasharray": "dashArray",
- "polygon-fill": "fillColor",
- "polygon-opacity": "fillOpacity",
- "polygon-comp-op": "globalCompositeOperation"
- }
- };
- /**
- * @constant L.supermap.ServerStyleMap
- * @description 服务端传过来的 style 属性名与 leaflet 的 style 属性名的对应表。
- * @private
- */
- var ServerStyleMap = {
- /**
- * @member L.supermap.ServerStyleMap.prototype.lineWidth
- * @description 线宽。
- */
- lineWidth: {
- leafletStyle: "weight",
- type: "number",
- unit: "mm",
- defaultValue: 0.1
- },
- /**
- * @member L.supermap.ServerStyleMap.prototype.fillForeColor
- * @description 填充前景色。
- */
- fillForeColor: {
- leafletStyle: "fillColor",
- type: "color",
- defaultValue: "rgba(0,0,0,0)"
- },
- /**
- * @member L.supermap.ServerStyleMap.prototype.foreColor
- * @description 前景色。
- */
- foreColor: {
- leafletStyle: "color",
- type: "color",
- defaultValue: "rgba(0,0,0,0)"
- },
- /**
- * @member L.supermap.ServerStyleMap.prototype.markerSize
- * @description 图标大小。
- */
- markerSize: {
- leafletStyle: "markerSize",
- type: "number",
- unit: "mm",
- defaultValue: 2.4
- },
- /**
- * @member L.supermap.ServerStyleMap.prototype.lineColor
- * @description 线要素颜色。
- */
- lineColor: {
- leafletStyle: "color",
- type: "color",
- defaultValue: "#000000"
- }
- };
- /**
- * @constant L.supermap.CompOpMap
- * @description Canvas 中的 globalCompositeOperation 属性值与 CartoCSS 中的 CompOp 属性值对照表。
- * @private
- */
- var CompOpMap = {
- "clear": "",
- "src": "",
- "dst": "",
- "src-over": "source-over",
- "dst-over": "destination-over",
- "src-in": "source-in",
- "dst-in": "destination-in",
- "src-out": "source-out",
- "dst-out": "destination-out",
- "src-atop": "source-atop",
- "dst-atop": "destination-atop",
- "xor": "xor",
- "plus": "lighter",
- "minus": "",
- "multiply": "",
- "screen": "",
- "overlay": "",
- "darken": "",
- "lighten": "lighter",
- "color-dodge": "",
- "color-burn": "",
- "hard-light": "",
- "soft-light": "",
- "difference": "",
- "exclusion": "",
- "contrast": "",
- "invert": "",
- "invert-rgb": "",
- "grain-merge": "",
- "grain-extract": "",
- "hue": "",
- "saturation": "",
- "color": "",
- "value": ""
- };
- (external_L_default()).supermap.CartoStyleMap = CartoStyleMap;
- (external_L_default()).supermap.ServerStyleMap = ServerStyleMap;
- (external_L_default()).supermap.CompOpMap = CompOpMap;
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/carto/CartoCSSToLeaflet.js
- function CartoCSSToLeaflet_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function CartoCSSToLeaflet_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function CartoCSSToLeaflet_createClass(Constructor, protoProps, staticProps) { if (protoProps) CartoCSSToLeaflet_defineProperties(Constructor.prototype, protoProps); if (staticProps) CartoCSSToLeaflet_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.CartoCSSToLeaflet
- * @classdesc CartoCSS 样式转 Leaflet 样式类。
- * @category BaseTypes Style
- * @param {string} url - 地图服务地址。
- * @private
- */
- var CartoCSSToLeaflet = /*#__PURE__*/function () {
- function CartoCSSToLeaflet(url) {
- CartoCSSToLeaflet_classCallCheck(this, CartoCSSToLeaflet);
- /**
- * @member L.supermap.CartoCSSToLeaflet.prototype.cartoCSS
- * @description CartoCSS 样式。
- */
- this.cartoCSS = null;
- /**
- * @member L.supermap.CartoCSSToLeaflet.prototype.mapUrl
- * @description 地图服务地址。
- */
- this.mapUrl = url;
- }
- /**
- * @function L.supermap.CartoCSSToLeaflet.prototype.pretreatedCartoCSS
- * @description CartoCSS 样式预处理。
- * @param {string} cartoStr - Carto 信息。
- * @param {Object} processCharacters - 需要处理的特征对象。
- */
- CartoCSSToLeaflet_createClass(CartoCSSToLeaflet, [{
- key: "pretreatedCartoCSS",
- value: function pretreatedCartoCSS(cartoStr, processCharacters) {
- if (processCharacters) {
- cartoStr = this.processCharacters(cartoStr);
- }
- this.cartoCSS = this.cartoCSS || {};
- var shaders = new CartoCSS(cartoStr).getShaders();
- if (!shaders) {
- return;
- }
- for (var i = 0; i < shaders.length; i++) {
- var element = shaders[i].elements[0];
- var attachment = shaders[i].attachment;
- this.cartoCSS[element.clean] = this.cartoCSS[element.clean] || {};
- this.cartoCSS[element.clean][attachment] = this.cartoCSS[element.clean][attachment] || [];
- this.cartoCSS[element.clean][attachment].push(shaders[i]);
- }
- }
- /**
- * @function L.supermap.CartoCSSToLeaflet.prototype.processCharacters
- * @description 替换一些关键符号。
- * @param {string} cartoCSSStr - cartoCSSS信息。
- */
- }, {
- key: "processCharacters",
- value: function processCharacters(cartoCSSStr) {
- var style = cartoCSSStr;
- if (!style) {
- return;
- }
- var me = this;
- style = style.replace(/[@]/gi, "___");
- style = style.replace(/\\#/gi, "\#");
- var cachedLayer = {};
- me.layersInfo && Object.keys(me.layersInfo).sort().forEach(function (attr) {
- var newAttr = attr.replace(/[@#\s]/gi, "___");
- var to = attr;
- var keys = Object.keys(cachedLayer);
- for (var index = keys.length; index > -1; index--) {
- if (attr.indexOf(keys[index]) > -1) {
- to = attr.replace(keys[index], cachedLayer[keys[index]]);
- break;
- }
- }
- to = to.replace(/[#]/gi, "\#");
- cachedLayer[attr] = newAttr;
- style = style.replace(new RegExp(to, "g"), newAttr);
- });
- style = style.replace(/[#]/gi, "\n#"); //将zoom转化为scale,以免引起混淆
- style = style.replace(/\[zoom/gi, "[scale");
- return style;
- }
- /**
- * @function L.supermap.CartoCSSToLeaflet.prototype.pickShader
- * @description 拾取着色对象。
- * @param {string} layerName - 图层名称。
- */
- }, {
- key: "pickShader",
- value: function pickShader(layerName) {
- if (!this.cartoCSS) {
- return null;
- }
- var name = layerName.replace(/[@#\s]/gi, "___");
- return this.cartoCSS[name];
- }
- /**
- * @function L.supermap.CartoCSSToLeaflet.prototype.getDefaultStyle
- * @description 获取默认风格。
- * @param {string} type - 默认风格类型。
- */
- }, {
- key: "getDefaultStyle",
- value: function getDefaultStyle(type) {
- var style = {}; //设置默认值
- var expandStyle = DefaultStyle[type];
- for (var prop in expandStyle) {
- var val = expandStyle[prop];
- style[prop] = val;
- }
- return style;
- }
- /**
- * @function L.supermap.CartoCSSToLeaflet.prototype.getStyleFromiPortalMarker
- * @description 从 iPortalMarker 中获取样式。
- * @param {string} icon - iPortal 图标。
- */
- }, {
- key: "getStyleFromiPortalMarker",
- value: function getStyleFromiPortalMarker(icon) {
- if (icon.indexOf("./") == 0) {
- return null;
- } //兼容iportal示例的问题
- if (icon.indexOf("http://support.supermap.com.cn:8092/static/portal") == 0) {
- icon = icon.replace("http://support.supermap.com.cn:8092/static/portal", "http://support.supermap.com.cn:8092/apps/viewer/static");
- }
- return external_L_default().icon({
- iconUrl: icon,
- iconSize: external_L_default().point(48, 43),
- iconAnchor: external_L_default().point(24, 43),
- popupAnchor: external_L_default().point(0, -43)
- });
- }
- /**
- * @function L.supermap.CartoCSSToLeaflet.prototype.getStyleFromiPortalStyle
- * @description 从 iPortal 的风格中获取样式。
- * @param {Object} iPortalStyle - iPortal 的样式对象。
- * @param {string} type - 样式类型。
- * @param {Object} [fStyle] - 图标参数。
- */
- }, {
- key: "getStyleFromiPortalStyle",
- value: function getStyleFromiPortalStyle(iPortalStyle, type, fStyle) {
- var featureStyle = fStyle ? JSON.parse(fStyle) : null;
- var style = {};
- if (type === 'Point' || type === 'MultiPoint') {
- var pointStyle = featureStyle || iPortalStyle.pointStyle;
- if (pointStyle.externalGraphic) {
- if (pointStyle.externalGraphic.indexOf("./") == 0) {
- return null;
- } //兼容iportal示例的问题
- if (pointStyle.externalGraphic.indexOf("http://support.supermap.com.cn:8092/static/portal") == 0) {
- pointStyle.externalGraphic = pointStyle.externalGraphic.replace("http://support.supermap.com.cn:8092/static/portal", "http://support.supermap.com.cn:8092/apps/viewer/static");
- }
- return external_L_default().icon({
- iconUrl: pointStyle.externalGraphic,
- iconSize: external_L_default().point(pointStyle.graphicWidth, pointStyle.graphicHeight),
- iconAnchor: external_L_default().point(-pointStyle.graphicXOffset, -pointStyle.graphicYOffset),
- popupAnchor: external_L_default().point(0, -pointStyle.graphicHeight)
- });
- }
- style.radius = pointStyle.pointRadius;
- style.color = pointStyle.strokeColor;
- style.opacity = pointStyle.strokeOpacity;
- style.lineCap = pointStyle.strokeLineCap;
- style.weight = pointStyle.strokeWidth;
- style.fillColor = pointStyle.fillColor;
- style.fillOpacity = pointStyle.fillOpacity;
- style.dashArray = this.dashStyle(pointStyle, 1);
- return style;
- }
- if (type === 'LineString' || type === 'MultiLineString' || type === 'Box') {
- var lineStyle = featureStyle || iPortalStyle.lineStyle;
- style.color = lineStyle.strokeColor;
- style.opacity = lineStyle.strokeOpacity;
- style.fillOpacity = lineStyle.fillOpacity;
- style.lineCap = lineStyle.strokeLineCap;
- style.weight = lineStyle.strokeWidth;
- style.dashArray = this.dashStyle(lineStyle, 1);
- return style;
- }
- if (type === 'Polygon' || type === 'MultiPolygon') {
- var polygonStyle = featureStyle || iPortalStyle.polygonStyle;
- style.color = polygonStyle.strokeColor;
- style.opacity = polygonStyle.strokeOpacity;
- style.lineCap = polygonStyle.strokeLineCap;
- style.weight = polygonStyle.strokeWidth;
- style.fillColor = polygonStyle.fillColor;
- style.fillOpacity = polygonStyle.fillOpacity;
- style.dashArray = this.dashStyle(polygonStyle, 1);
- return style;
- }
- }
- /**
- * @function L.supermap.CartoCSSToLeaflet.prototype.dashStyle
- * @description 符号样式。
- * @param {Object} style - 样式参数。
- * @param {number} widthFactor - 宽度系数。
- */
- }, {
- key: "dashStyle",
- value: function dashStyle(style, widthFactor) {
- if (!style) {
- return [];
- }
- var w = style.strokeWidth * widthFactor;
- var str = style.strokeDashstyle;
- switch (str) {
- case 'solid':
- return [];
- case 'dot':
- return [1, 4 * w];
- case 'dash':
- return [4 * w, 4 * w];
- case 'dashdot':
- return [4 * w, 4 * w, 1, 4 * w];
- case 'longdash':
- return [8 * w, 4 * w];
- case 'longdashdot':
- return [8 * w, 4 * w, 1, 4 * w];
- default:
- if (!str) {
- return [];
- }
- if (Util.isArray(str)) {
- return str;
- }
- str = StringExt.trim(str).replace(/\s+/g, ",");
- return str.replace(/\[|\]/gi, "").split(",");
- }
- }
- /**
- * @function L.supermap.CartoCSSToLeaflet.prototype.getValidStyleFromCarto
- * @description 从 Carto 中获取有效的样式。
- * @param {number} zoom - 缩放级别。
- * @param {number} scale - 比例尺。
- * @param {Array.<Object>} shader - 渲染器对象数组。
- * @param {Object} feature - 要素。
- * @param {string} [fromServer] - 服务源。
- */
- }, {
- key: "getValidStyleFromCarto",
- value: function getValidStyleFromCarto(zoom, scale, shader, feature, fromServer) {
- if (!shader) {
- return null;
- }
- var type = feature.type,
- attributes = feature.properties.attributes || {},
- style = this.getDefaultStyle(type);
- fromServer = fromServer === undefined ? true : fromServer;
- attributes.FEATUREID = feature.properties.id;
- attributes.SCALE = scale;
- var cartoStyleMap = CartoStyleMap[type];
- var fontSize, fontName;
- for (var i = 0, len = shader.length; i < len; i++) {
- var _shader = shader[i];
- var prop = cartoStyleMap[_shader.property];
- var value = _shader.getValue(attributes, zoom, true);
- if (value !== null && prop) {
- if (prop === "fontSize") {
- if (fromServer) {
- value *= 0.8;
- }
- fontSize = value + "px";
- style.fontSize = fontSize;
- } else if (prop === "fontName") {
- fontName = value;
- style.fontName = fontName;
- } else {
- if (prop === "globalCompositeOperation") {
- value = CompOpMap[value];
- if (!value) {
- continue;
- }
- } else if (fromServer && prop === 'iconUrl') {
- value = this.mapUrl + '/tileFeature/symbols/' + value.replace(/(___)/gi, '@');
- value = value.replace(/(__0__0__)/gi, '__8__8__');
- style["iconUrl"] = value;
- continue;
- }
- if (prop === 'weight' && value < 1) {
- value = Math.ceil(value);
- }
- style[prop] = value;
- }
- }
- }
- return style;
- }
- /**
- * @function L.supermap.CartoCSSToLeaflet.prototype.getValidStyleFromLayerInfo
- * @description 通过图层信息获取有效的样式。
- * @param {SuperMap.Feature} feature - 要素。
- * @param {Object} layerInfo - 图层信息。
- */
- }, {
- key: "getValidStyleFromLayerInfo",
- value: function getValidStyleFromLayerInfo(feature, layerInfo) {
- var type = feature.type,
- style = this.getDefaultStyle(type),
- shader = layerInfo && layerInfo.layerStyle;
- if (!shader) {
- return style;
- }
- if (type === "POINT") {
- var size = Math.ceil(shader.markerSize * SuperMap.DOTS_PER_INCH * SuperMap.INCHES_PER_UNIT.mm) || 8;
- var symbolParameters = {
- "transparent": true,
- "resourceType": "SYMBOLMARKER",
- "picWidth": size,
- "picHeight": size,
- "style": JSON.stringify(shader)
- };
- style.iconUrl = Util.urlAppend(this.mapUrl + "/symbol.png", Util.getParameterString(symbolParameters));
- style.iconSize = [size, size];
- return style;
- }
- if (type === "TEXT") {
- shader = feature.properties.textStyle || layerInfo.layerStyle; //设置文本是否使用粗体
- style.fontWeight = shader.bold ? shader.fontWeight : "normal"; //设置文本的尺寸(对应fontHeight属性)和行高,行高iserver不支持,默认5像素
- //固定大小的时候单位是毫米
- if (shader.fontHeight) {
- var text_h = shader.fontHeight * SuperMap.DOTS_PER_INCH * SuperMap.INCHES_PER_UNIT.mm * 0.85; //毫米转像素,服务端的字体貌似要稍微小一点
- style.fontSize = text_h + "px";
- style.textHeight = text_h;
- } //设置文本字体类型
- //在桌面字体钱加@时为了解决对联那种形式,但是在canvas不支持,并且添加了@会导致
- //字体大小被固定,这里需要去掉
- if (shader.fontName) {
- style.fontFamily = shader.fontName.indexOf("@") ? shader.fontName.replace(/@/g, "") : shader.fontName;
- } //设置对齐方式
- if (shader.align) {
- var alignStr = shader.align.replace(/TOP|MIDDLE|BASELINE|BOTTOM/, "");
- style.textAlign = alignStr.toLowerCase();
- }
- style.weight = shader.outline ? shader.outlineWidth : 0;
- if (shader.backColor) {
- style.color = "rgba(" + shader.backColor.red + "," + shader.backColor.green + "," + shader.backColor.blue + ",1)";
- }
- if (shader.foreColor) {
- style.fillColor = "rgba(" + shader.foreColor.red + "," + shader.foreColor.green + "," + shader.foreColor.blue + ",1)";
- }
- style.rotation = shader.rotation || 0;
- return style;
- } //目前只实现桌面系统默认的几种symbolID,非系统默认的面用颜色填充替代,线则用实线来替代
- var fillSymbolID = shader["fillSymbolID"] > 7 ? 0 : shader["fillSymbolID"];
- var lineSymbolID = shader["lineSymbolID"] > 5 ? 0 : shader["lineSymbolID"];
- for (var attr in shader) {
- var obj = ServerStyleMap[attr];
- if (!obj) {
- continue;
- }
- var leafletStyle = obj.leafletStyle;
- switch (obj.type) {
- case "number":
- {
- var value = shader[attr];
- if (obj.unit) {
- value = value * SuperMap.DOTS_PER_INCH * SuperMap.INCHES_PER_UNIT[obj.unit] * 2.5;
- }
- style[leafletStyle] = value;
- break;
- }
- case "color":
- {
- var color = shader[attr];
- var _value = void 0,
- alpha = 1;
- if (leafletStyle === "fillColor") {
- if (fillSymbolID === 0 || fillSymbolID === 1) {
- //当fillSymbolID为0时,用颜色填充,为1是无填充,即为透明填充,alpha通道为0
- alpha = 1 - fillSymbolID;
- _value = "rgba(" + color.red + "," + color.green + "," + color.blue + "," + alpha + ")";
- }
- } else if (leafletStyle === "color") {
- if (lineSymbolID === 0 || lineSymbolID === 5) {
- //对于lineSymbolID为0时,线为实线,为lineSymbolID为5时,为无线模式,即线为透明,即alpha通道为0
- alpha = lineSymbolID === 0 ? 1 : 0;
- } else {
- //以下几种linePattern分别模拟了桌面的SymbolID为1~4几种符号的linePattern
- var linePattern = [1, 0];
- switch (lineSymbolID) {
- case 1:
- linePattern = [9.7, 3.7];
- break;
- case 2:
- linePattern = [3.7, 3.7];
- break;
- case 3:
- linePattern = [9.7, 3.7, 2.3, 3.7];
- break;
- case 4:
- linePattern = [9.7, 3.7, 2.3, 3.7, 2.3, 3.7];
- break;
- default:
- break;
- }
- style.lineDasharray = linePattern;
- }
- _value = "rgba(" + color.red + "," + color.green + "," + color.blue + "," + alpha + ")";
- }
- style[leafletStyle] = _value;
- break;
- }
- default:
- break;
- }
- } //处理标签文本的情况
- if (layerInfo.textField) {
- style.textAlign = "LEFT";
- }
- return style;
- }
- }]);
- return CartoCSSToLeaflet;
- }();
- (external_L_default()).supermap.CartoCSSToLeaflet = CartoCSSToLeaflet;
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/graphic/Graphic.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.graphic
- * @classdesc 高效率点图层要素类。
- * @category Visualization Graphic
- * @extends {L.Class}
- * @param {Object} options - 图形参数。
- * @param {L.LatLng} options.latLng - 经纬度。
- * @param {number} options.id - 要素id。
- * @param {(L.supermap.circleStyle|L.supermap.cloverStyle|L.supermap.imageStyle)} [options.style] - 点样式。
- * @param {Object} [options.attributes] - 要素属性。
- */
- var Graphic = external_L_default().Class.extend({
- initialize: function initialize(options) {
- options = options || {};
- var latLng = options.latLng || options._latLng;
- this._latLng = external_L_default().latLng(latLng.lat, latLng.lng);
- this._style = options.style || options._canvas;
- this.attributes = options.attributes;
- this.id = options.id ? options.id : null;
- },
- /**
- * @function L.supermap.graphic.prototype.getId
- * @description 获取当前 ID。
- * @returns {string} id
- */
- getId: function getId() {
- return this.id;
- },
- /**
- * @function L.supermap.graphic.prototype.setId
- * @description 设置当前要素 ID。
- * @param {string} id - 要素 ID。
- */
- setId: function setId(id) {
- this.id = id;
- },
- /**
- * @function L.supermap.graphic.prototype.setLatLng
- * @description 设置经纬度。
- * @param {L.LatLng} latLng - 经纬度参数。
- */
- setLatLng: function setLatLng(latLng) {
- this._latLng = latLng;
- },
- /**
- * @deprecated
- * @function L.supermap.graphic.prototype.setCanvas
- * @description 设置画布,已弃用该设置,请使用 setStyle 接口。
- * @param {HTMLCanvasElement} canvas - 传入需要设置的画布。
- */
- setCanvas: function setCanvas(canvas) {
- this._style = canvas;
- },
- /**
- * @function L.supermap.graphic.prototype.setAttributes
- * @description 设置要素属性。
- * @param {Object} attributes - 属性对象。
- */
- setAttributes: function setAttributes(attributes) {
- this.attributes = attributes;
- },
- /**
- * @function L.supermap.graphic.prototype.getLatLng
- * @description 获取经纬度。
- * @returns {L.LatLng} 经纬度。
- */
- getLatLng: function getLatLng() {
- return this._latLng;
- },
- /**
- * @deprecated
- * @function L.supermap.graphic.prototype.getCanvas
- * @description 获取画布,已弃用该设置,请使用 getStyle 接口
- * @returns {HTMLCanvasElement} 画布。
- */
- getCanvas: function getCanvas() {
- return this._style;
- },
- /**
- * @function L.supermap.graphic.prototype.getAttributes
- * @description 获取要素属性。
- * @returns {Object} 要素属性。
- */
- getAttributes: function getAttributes() {
- return this.attributes;
- },
- /**
- * @function L.supermap.graphic.prototype.setStyle
- * @description 设置样式。
- * @param {(L.supermap.circleStyle|L.supermap.imageStyle|L.supermap.cloverStyle)} style - 样式。
- */
- setStyle: function setStyle(style) {
- this._style = style;
- },
- /**
- * @function L.supermap.graphic.prototype.getStyle
- * @description 获取样式。
- * @returns {(L.supermap.circleStyle|L.supermap.imageStyle|L.supermap.cloverStyle)} 样式。
- */
- getStyle: function getStyle() {
- return this._style;
- }
- });
- var graphic = function graphic(options) {
- return new Graphic(options);
- };
- (external_L_default()).supermap.graphic = graphic;
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/theme/ThemeFeature.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.themeFeature
- * @classdesc 客户端专题图要素类。
- * 支持的 geometry 参数类型为 {@link L.Point},{@link L.LatLng},{@link L.Polyline},{@link L.Polygon}。
- * @category Visualization Theme
- * @extends {L.Class}
- * @param {(L.Path|L.Point|L.LatLng)} geometry - 要素图形。
- * @param {Object} attributes - 要素属性。
- */
- var ThemeFeature = external_L_default().Class.extend({
- initialize: function initialize(geometry, attributes) {
- this.geometry = geometry;
- this.attributes = attributes;
- },
- /**
- * @function L.supermap.themeFeature.prototype.toFeature
- * @description 转为内部矢量要素。
- * @returns {SuperMap.Feature.Vector} 内部矢量要素。
- */
- toFeature: function toFeature() {
- var geometry = this.geometry;
- if (geometry.toGeoJSON) {
- var geojsonObject = geometry.toGeoJSON();
- geojsonObject.properties = this.attributes;
- return new GeoJSON().read(geojsonObject)[0];
- }
- if (geometry.length === 3) {
- geometry = new GeoText(geometry[1], geometry[0], geometry[2]);
- } else if (geometry.length === 2) {
- geometry = new Point(geometry[0], geometry[1]);
- } else if (geometry instanceof (external_L_default()).LatLng) {
- geometry = new Point(geometry.lng, geometry.lat);
- } else if (geometry instanceof (external_L_default()).Point) {
- geometry = new Point(geometry.x, geometry.y);
- } else if (geometry instanceof (external_L_default()).CircleMarker) {
- var latLng = geometry.getLatLng();
- geometry = new Point(latLng.lng, latLng.lat);
- }
- return new Vector(geometry, this.attributes);
- },
- /**
- * @function L.supermap.themeFeature.prototype.reverseLatLngs
- * @description 坐标反转。
- * @param {L.Latlng} latlngs - 坐标值。
- */
- reverseLatLngs: function reverseLatLngs(latlngs) {
- if (!external_L_default().Util.isArray(latlngs)) {
- latlngs = [latlngs];
- }
- for (var i = 0; i < latlngs.length; i++) {
- latlngs[i] = [latlngs[i].lng, latlngs[i].lat];
- }
- return latlngs;
- }
- });
- var themeFeature = function themeFeature(geometry, attributes) {
- return new ThemeFeature(geometry, attributes);
- };
- (external_L_default()).supermap.themeFeature = themeFeature;
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/theme/ThemeLayer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.ThemeLayer
- * @classdesc 专题图层基类,调用建议使用其子类实现类。
- * @category Visualization Theme
- * @extends {L.Layer}
- * @param {string} name - 专题图图层名称。
- * @param {Object} options - 可选参数。
- * @param {string} [options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
- * @param {number} [options.opacity=1] - 图层透明度。
- * @param {boolean} [options.alwaysMapCRS=false] - 要素坐标是否和地图坐标系一致,要素默认是经纬度坐标。
- * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权描述信息。
- * @param {Array} [options.TFEvents] - 专题要素事件临时存储。
- * @fires L.supermap.ThemeLayer#featuresremoved
- */
- var ThemeLayer = external_L_default().Layer.extend({
- options: {
- //要素坐标是否和地图坐标系一致,默认为false,要素默认是经纬度坐标。
- alwaysMapCRS: false,
- id: Util.createUniqueID("themeLayer_"),
- opacity: 1,
- // {Array} 专题要素事件临时存储,临时保存图层未添加到 map 前用户添加的事件监听,待图层添加到 map 后把这些事件监听添加到图层上,清空此图层。
- //这是一个二维数组,组成二维数组的每个一维数组长度为 2,分别是 event, callback。
- TFEvents: [],
- attribution: core_Attributions.Common.attribution
- },
- initialize: function initialize(name, options) {
- external_L_default().Util.setOptions(this, options);
- this.name = name;
- this.features = [];
- this.TFEvents = this.options.TFEvents;
- this.levelRenderer = new LevelRenderer();
- this.movingOffset = [0, 0];
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.getEvents
- * @description 获取图层事件。
- * @returns {Object} 返回图层支持的事件。
- */
- getEvents: function getEvents() {
- var me = this;
- var events = {
- zoomend: me._reset,
- moveend: me._reset,
- resize: me._resize
- };
- if (this._map._zoomAnimated) {
- events.zoomanim = me._zoomAnim;
- }
- return events;
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.onRemove
- * @description 删除某个地图。
- * @param {L.Map} map - 要删除的地图。
- */
- onRemove: function onRemove(map) {
- var me = this;
- external_L_default().DomUtil.remove(me.container);
- map.off("mousemove", me.mouseMoveHandler);
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.onAdd
- * @description 添加专题图。
- * @param {L.Map} map - 要添加的地图。
- * @private
- */
- onAdd: function onAdd(map) {
- var me = this;
- me.map = me._map = map;
- me._initContainer();
- if (!me.levelRenderer) {
- map.removeLayer(me);
- return;
- } //初始化渲染器
- var size = map.getSize();
- me.container.style.width = size.x + "px";
- me.container.style.height = size.y + "px";
- me._updateOpacity();
- me.renderer = me.levelRenderer.init(me.container);
- me.renderer.clear();
- if (me.features && me.features.length > 0) {
- me._reset();
- } //处理用户预先(在图层添加到 map 前)监听的事件
- me.addTFEvents();
- me.mouseMoveHandler = function (e) {
- var xy = e.layerPoint;
- me.currentMousePosition = external_L_default().point(xy.x + me.movingOffset[0], xy.y + me.movingOffset[1]);
- };
- map.on("mousemove", me.mouseMoveHandler);
- me.update(map.getBounds());
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.addFeatures
- * @description 向专题图图层中添加数据。
- * @param {(SuperMap.ServerFeature|L.supermap.themeFeature|GeoJSONObject)} features - 待转要素。
- */
- addFeatures: function addFeatures(features) {// eslint-disable-line no-unused-vars
- //子类实现此方法
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.redrawThematicFeatures
- * @description 抽象方法,可实例化子类必须实现此方法。
- * @param {L.bounds} bounds - 重绘专题要素范围。
- */
- redrawThematicFeatures: function redrawThematicFeatures(bounds) {// eslint-disable-line no-unused-vars
- //子类必须实现此方法
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.destroyFeatures
- * @description 销毁要素。
- * @param {Array.<SuperMap.Feature.Vector>} features - 将被销毁的要素。
- */
- destroyFeatures: function destroyFeatures(features) {
- if (features === undefined) {
- features = this.features;
- }
- if (!features) {
- return;
- }
- this.removeFeatures(features);
- for (var i = features.length - 1; i >= 0; i--) {
- features[i].destroy();
- }
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.removeFeatures
- * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。
- * @param {Array.<SuperMap.Feature.Vector>} features - 将被删除的要素。
- */
- removeFeatures: function removeFeatures(features) {
- var me = this;
- if (!features || features.length === 0) {
- return;
- }
- if (features === me.features) {
- return me.removeAllFeatures();
- }
- if (!external_L_default().Util.isArray(features)) {
- features = [features];
- }
- var featuresFailRemoved = [];
- for (var i = features.length - 1; i >= 0; i--) {
- var feature = features[i]; //如果我们传入的feature在features数组中没有的话,则不进行删除,
- //并将其放入未删除的数组中。
- var findex = external_L_default().Util.indexOf(me.features, feature);
- if (findex === -1) {
- featuresFailRemoved.push(feature);
- continue;
- }
- me.features.splice(findex, 1);
- }
- var drawFeatures = [];
- for (var hex = 0, len = me.features.length; hex < len; hex++) {
- feature = me.features[hex];
- drawFeatures.push(feature);
- }
- me.features = [];
- me.addFeatures(drawFeatures); //绘制专题要素
- if (me.renderer) {
- if (me._map) {
- me.redrawThematicFeatures(me._map.getBounds());
- } else {
- me.redrawThematicFeatures();
- }
- }
- var succeed = featuresFailRemoved.length == 0;
- /**
- * @event L.supermap.ThemeLayer#featuresremoved
- * @description 删除的要素成功之后触发。
- * @property {Array.<SuperMap.Feature.Vector>} features - 事件对象。
- * @property {boolean} succeed - 要输是否删除成功,true 为删除成功,false 为删除失败。
- */
- me.fire("featuresremoved", {
- features: featuresFailRemoved,
- succeed: succeed
- });
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.removeAllFeatures
- * @description 清除当前图层所有的矢量要素。
- */
- removeAllFeatures: function removeAllFeatures() {
- var me = this;
- if (me.renderer) {
- me.renderer.clear();
- }
- me.features = [];
- me.fire("featuresremoved", {
- features: [],
- succeed: true
- });
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.getFeatures
- * @description 查看当前图层中的有效数据。
- * @returns {Array} 返回图层中的有效数据。
- */
- getFeatures: function getFeatures() {
- var me = this;
- var len = me.features.length;
- var clonedFeatures = new Array(len);
- for (var i = 0; i < len; ++i) {
- clonedFeatures[i] = me.features[i];
- }
- return clonedFeatures;
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.getFeatureBy
- * @description 在专题图的要素数组 features 里面遍历每一个 feature,当 feature[property] === value 时,返回此 feature(并且只返回第一个)。
- * @param {string} property - 要的某个属性名。
- * @param {string} value - 对应属性名得值。
- */
- getFeatureBy: function getFeatureBy(property, value) {
- var me = this;
- var feature = null;
- for (var id in me.features) {
- if (me.features[id][property] !== value) {
- continue;
- }
- feature = me.features[id];
- break;
- }
- return feature;
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.getFeatureById
- * @description 通过给定一个 ID,返回对应的矢量要素,如果不存在则返回 null。
- * @param {number} featureId - 要素 ID。
- */
- getFeatureById: function getFeatureById(featureId) {
- return this.getFeatureBy('id', featureId);
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.getFeaturesByAttribute
- * @description 通过给定一个属性的 key 值和 value 值,返回所有匹配的要素数组。
- * @param {string} attrName - key 值。
- * @param {string} attrValue - value 值。
- * @returns {Array} 返回所有匹配的要素数组。
- */
- getFeaturesByAttribute: function getFeaturesByAttribute(attrName, attrValue) {
- var me = this,
- feature,
- foundFeatures = [];
- for (var id in me.features) {
- feature = me.features[id];
- if (feature && feature.attributes && feature.attributes[attrName] === attrValue) {
- foundFeatures.push(feature);
- }
- }
- return foundFeatures;
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.update
- * @description 更新图层。
- * @param {L.bounds} bounds - 图层范围。
- */
- update: function update(bounds) {
- var mapOffset = this._map.containerPointToLayerPoint([0, 0]);
- external_L_default().DomUtil.setPosition(this.container, mapOffset);
- var me = this; // var bounds = me._map.getBounds();
- // var topLeft = me._map.latLngToLayerPoint(bounds.getNorthWest());
- // var mapOffset = [parseInt(topLeft.x, 10) || 0, parseInt(topLeft.y, 10) || 0]
- // // var offsetLeft = parseInt(me._map.getContainer().style.left, 10);
- // // offsetLeft = -Math.round(offsetLeft);
- // //var offsetTop = parseInt(me._map.getContainer().style.top, 10);
- // //offsetTop = -Math.round(offsetTop);
- // me.container.style.left = mapOffset[0] + 'px';
- // me.container.style.top = mapOffset[1] + 'px';
- //绘制专题要素
- if (me.renderer) {
- me.redrawThematicFeatures(bounds);
- }
- if (me.currentMousePosition) {
- me.currentMousePosition = external_L_default().point(me.currentMousePosition.x - me.movingOffset[0], me.currentMousePosition.y - me.movingOffset[1]);
- }
- me.movingOffset = [0, 0];
- me._zoom = me._map.getZoom();
- me._center = me._map.getCenter();
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.setOpacity
- * @description 设置图层的不透明度,取值 [0-1] 之间。
- * @param {number} opacity - 不透明度。
- */
- setOpacity: function setOpacity(opacity) {
- var me = this;
- if (opacity === me.options.opacity) {
- return;
- }
- if (!isNaN(opacity)) {
- me.options.opacity = opacity;
- me._updateOpacity();
- }
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.redraw
- * @description 重绘该图层。
- * @returns {boolean} 返回是否重绘成功。
- */
- redraw: function redraw() {
- var me = this;
- if (!me.renderer) {
- return false;
- }
- if (me._map) {
- me.redrawThematicFeatures(me._map.getBounds());
- } else {
- me.redrawThematicFeatures();
- }
- return true;
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.on
- * @description 添加专题要素事件监听。添加专题要素事件监听。
- * @param {Event} event - 监听事件。
- * @param {Function} callback - 回调函数。
- * @param {string} context - 信息。
- */
- on: function on(event, callback, context) {
- // eslint-disable-line no-unused-vars
- if (this.renderer) {
- this.renderer.on(event, callback);
- } else {
- external_L_default().Layer.prototype.on.call(this, event, callback);
- }
- return this;
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.off
- * @description 移除专题要素事件监听。
- * @param {Event} event - 监听事件。
- * @param {Function} callback - 回调函数。
- * @param {string} context - 信息。
- */
- off: function off(event, callback, context) {
- // eslint-disable-line no-unused-vars
- var me = this;
- if (me.renderer) {
- me.renderer.un(event, callback);
- } else {
- external_L_default().Layer.prototype.off.call(this, event, callback);
- }
- return this;
- },
- fire: function fire(type, data, propagate) {
- // eslint-disable-line no-unused-vars
- if (this.renderer) {
- this.renderer.trigger(type, data);
- }
- external_L_default().Layer.prototype.fire.call(this, type, data, propagate);
- return this;
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.addTFEvents
- * @description 将图层添加到地图上之前用户要求添加的事件监听添加到图层。
- * @private
- */
- addTFEvents: function addTFEvents() {
- var me = this;
- var tfEs = me.TFEvents;
- var len = tfEs.length;
- for (var i = 0; i < len; i++) {
- me.renderer.on(tfEs[i][0], tfEs[i][1]);
- }
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.getLocalXY
- * @description 地理坐标转为像素坐标。
- * @param {Array} coordinate
- */
- getLocalXY: function getLocalXY(coordinate) {
- if (!this._map) {
- return coordinate;
- }
- var coor = coordinate;
- if (external_L_default().Util.isArray(coordinate)) {
- coor = external_L_default().point(coordinate[0], coordinate[1]);
- }
- if (!(coordinate instanceof (external_L_default()).Point)) {
- if (coordinate instanceof Point || coordinate instanceof GeoText) {
- coor = external_L_default().point(coordinate.x, coordinate.y);
- } else {
- coor = external_L_default().point(coordinate.lon, coordinate.lat);
- }
- }
- var point = this._map.latLngToAccurateContainerPoint(!this.options.alwaysMapCRS ? external_L_default().latLng(coor.y, coor.x) : this._map.options.crs.unproject(coor));
- return [point.x, point.y];
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.toiClientFeature
- * @description 转为 iClient 要素。
- * @param {(SuperMap.ServerFeature|L.supermap.themeFeature|GeoJSONObject)} features - 待转要素。
- * @returns {Array.<SuperMap.Feature.Vector>} 转换后的 iClient 要素。
- */
- toiClientFeature: function toiClientFeature(features) {
- //若 features 非数组形式 feature 则先做以下处理:
- if (!Util.isArray(features)) {
- features = [features];
- }
- var featuresTemp = [];
- for (var i = 0; i < features.length; i++) {
- //L.supermap.themeFeature 数据类型
- if (features[i] instanceof ThemeFeature) {
- featuresTemp.push(features[i].toFeature());
- } else if (features[i] instanceof Vector) {
- // 若是 GeometryVector 类型直接返回
- featuresTemp.push(features[i]);
- } else if (["FeatureCollection", "Feature", "Geometry"].indexOf(features[i].type) != -1) {
- //GeoJSON 规范数据类型
- var format = new GeoJSON();
- featuresTemp = featuresTemp.concat(format.read(features[i]));
- } else if (features[i].geometry && features[i].geometry.parts) {
- //iServer服务器返回数据格式 todo 暂未找到更好的参数判断,暂用 geometry.parts 试用
- featuresTemp.push(ServerFeature.fromJson(features[i]).toFeature());
- } else {
- throw new Error("features[".concat(i, "]'s type is not be supported."));
- }
- }
- return featuresTemp;
- },
- /**
- * @function L.supermap.ThemeLayer.prototype.toFeature
- * @deprecated
- * @description 转为 iClient 要素,该方法将被弃用,由 {@link L.supermap.ThemeLayer#toiClientFeature} 代替。
- * @param {(SuperMap.ServerFeature|L.supermap.themeFeature|GeoJSONObject)} features - 待转要素。
- * @returns {SuperMap.Feature.Vector} 转换后的 iClient 要素。
- */
- toFeature: function toFeature(features) {
- return this.toiClientFeature(features);
- },
- _initContainer: function _initContainer() {
- var parentContainer = this.getPane();
- var animated = this._map.options.zoomAnimation && (external_L_default()).Browser.any3d;
- var className = 'themeLayer leaflet-layer leaflet-zoom-' + (animated ? 'animated' : 'hide');
- this.container = external_L_default().DomUtil.create("div", className, parentContainer);
- var originProp = external_L_default().DomUtil.testProp(['transformOrigin', 'WebkitTransformOrigin', 'msTransformOrigin']);
- this.container.id = this.options.id;
- this.container.style[originProp] = '50% 50%';
- this.container.style.position = "absolute";
- this.container.style.zIndex = 200;
- },
- _zoomAnim: function _zoomAnim(e) {
- var scale = this._map.getZoomScale(e.zoom),
- offset = this._map._getCenterOffset(e.center)._multiplyBy(-scale).subtract(this._map._getMapPanePos());
- if ((external_L_default()).DomUtil.setTransform) {
- external_L_default().DomUtil.setTransform(this.container, offset, scale);
- } else {
- this.container.style[(external_L_default()).DomUtil.TRANSFORM] = external_L_default().DomUtil.getTranslateString(offset) + ' scale(' + scale + ')';
- }
- },
- _updateOpacity: function _updateOpacity() {
- var me = this;
- Util.modifyDOMElement(me.container, null, null, null, null, null, null, me.options.opacity);
- if (me._map !== null) {
- /**
- * @event L.supermap.ThemeLayer#changelayer
- * @description 图层属性改变之后触发。
- * @property {Object} layer - 图层。
- * @property {string} property - 图层属性。
- */
- me._map.fire("changelayer", {
- layer: me,
- property: "opacity"
- });
- }
- },
- //缩放移动重绘
- _reset: function _reset() {
- var me = this;
- var latLngBounds = me._map.getBounds();
- me.update(latLngBounds);
- var size = me._map.getSize(); // var bounds = me._map.getBounds();
- // var topLeft = me._map.latLngToLayerPoint(bounds.getNorthWest());
- // var mapOffset = [parseInt(topLeft.x, 10) || 0, parseInt(topLeft.y, 10) || 0]
- // var offsetLeft = parseInt(me._map.getContainer().style.left, 10);
- // offsetLeft = -Math.round(offsetLeft);
- //var offsetTop = parseInt(me._map.getContainer().style.top, 10);
- //offsetTop = -Math.round(offsetTop);
- //me.container.style.left = mapOffset[0] + 'px';
- //me.container.style.top = mapOffset[1] + 'px';
- var mapOffset = this._map.containerPointToLayerPoint([0, 0]);
- external_L_default().DomUtil.setPosition(this.container, mapOffset);
- if (parseFloat(me.container.width) !== parseFloat(size.x)) {
- me.container.width = size.x + 'px';
- }
- if (parseFloat(me.container.height) !== parseFloat(size.y)) {
- me.container.height = size.y + 'px';
- }
- me.redraw();
- },
- //通知渲染器的尺寸变化
- _resize: function _resize() {
- var me = this;
- var newSize = me._map.getSize();
- me.container.style.width = newSize.x + "px";
- me.container.style.height = newSize.y + "px";
- me.renderer.resize();
- }
- });
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/theme/GeoFeatureThemeLayer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.GeoFeatureThemeLayer
- * @classdesc 地理几何专题要素型专题图层基类。此类型专题图的专题要素形状就是由 feature.geometry 决定。此类不建议直接实例化调用。
- * @category Visualization Theme
- * @extends L.supermap.ThemeLayer
- * @category Visualization Graphic
- * @param {string} name - 专题图名。
- * @param {Object} options - 需要设置的参数对象。
- * @param {string} [options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
- * @param {number} [options.opacity=1] - 图层透明度。
- * @param {boolean} [options.alwaysMapCRS=false] - 要素坐标是否和地图坐标系一致,要素默认是经纬度坐标。
- * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权描述信息。
- * @param {Array} [options.TFEvents] - 专题要素事件临时存储。
- * @param {number} [options.nodesClipPixel=2] - 节点抽稀像素距离。
- * @param {boolean} [options.isHoverAble=false] - 图形是否在 hover 时高亮。
- * @param {boolean} [options.isMultiHover=false] - 是否多图形同时高亮,用于高亮同一个数据对应的所有图形(如:多面)。
- * @param {boolean} [options.isClickAble=true] - 图形是否可点击。
- * @param {boolean} [options.isAllowFeatureStyle=false] - 是否允许 feature 样式(style) 中的有效属性应用到专题图层。
- * 禁止对专题要素使用数据(feature)的 style。
- * 此属性可强制将数据 feature 的 style 中有效属性应用到专题要素上,且拥有比图层 style 和 styleGroups 更高的优先级,使专题要素
- * 的样式脱离专题图层的控制。可以通过此方式实现对特殊数据(feature) 对应专题要素赋予独立 style。
- * @fires L.supermap.GeoFeatureThemeLayer#beforefeaturesadded
- */
- var GeoFeatureThemeLayer = ThemeLayer.extend({
- options: {
- // {number} 节点抽稀像素距离,默认值 2。
- nodesClipPixel: 2,
- //{boolean} 图形是否在 hover 时高亮 ,默认值:false。
- isHoverAble: false,
- //{boolean} 是否多图形同时高亮,用于高亮同一个数据对应的所有图形(如:多面),默认值:false。
- isMultiHover: false,
- // {boolean} 图形是否可点击,默认 true
- isClickAble: true,
- //是否允许 feature 样式(style) 中的有效属性应用到专题图层。
- //默认值为: false,禁止对专题要素使用数据(feature)的 style。
- //此属性可强制将数据 feature 的 style 中有效属性应用到专题要素上,且拥有比图层 style 和 styleGroups 更高的优先级,使专题要素
- //的样式脱离专题图层的控制。可以通过此方式实现对特殊数据(feature) 对应专题要素赋予独立 style。
- isAllowFeatureStyle: false
- },
- initialize: function initialize(name, options) {
- ThemeLayer.prototype.initialize.call(this, name, options);
- external_L_default().Util.setOptions(this, options);
- var me = this;
- me.cache = {};
- me.cacheFields = [];
- me.style = {};
- me.highlightStyle = {};
- },
- /**
- * @function L.supermap.GeoFeatureThemeLayer.prototype.addFeatures
- * @description 向专题图图层中添加数据。
- * @param {(SuperMap.ServerFeature|L.supermap.themeFeature|GeoJSONObject)} features - 待填加的要素。
- */
- addFeatures: function addFeatures(features) {
- var me = this;
- /**
- * @event L.supermap.GeoFeatureThemeLayer#beforefeaturesadded
- * @description 向专题图图层中添加数据之前触发。
- * @property {(SuperMap.ServerFeature|L.supermap.themeFeature|GeoJSONObject)} features - 事件对象。
- */
- me.fire("beforefeaturesadded", {
- features: features
- }); //转换 features 形式
- this.features = this.toiClientFeature(features);
- if (!me.isCustomSetMaxCacheCount) {
- me.maxCacheCount = me.features.length * 5;
- }
- if (!me.renderer) {
- return;
- } //绘制专题要素
- if (me._map) {
- me.redrawThematicFeatures(me._map.getBounds());
- } else {
- me.redrawThematicFeatures();
- }
- },
- /**
- * @function L.supermap.GeoFeatureThemeLayer.prototype.removeFeatures
- * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。参数中的 features 数组中的每一项,必须是已经添加到当前图层中的 feature。
- * @param {SuperMap.Feature.Vector} features - 要删除的要素。
- */
- removeFeatures: function removeFeatures(features) {
- // eslint-disable-line no-unused-vars
- this.clearCache();
- ThemeLayer.prototype.removeFeatures.call(this, arguments);
- },
- /**
- * @function L.supermap.GeoFeatureThemeLayer.prototype.removeAllFeatures
- * @description 清除当前图层所有的矢量要素。
- */
- removeAllFeatures: function removeAllFeatures() {
- this.clearCache();
- ThemeLayer.prototype.removeAllFeatures.call(this, arguments);
- },
- /**
- * @function L.supermap.GeoFeatureThemeLayer.prototype.redrawThematicFeatures
- * @description 重绘所有专题要素。
- * 此方法包含绘制专题要素的所有步骤,包含用户数据到专题要素的转换,抽稀,缓存等步骤。
- * 地图漫游时调用此方法进行图层刷新。
- * @param {L.bounds} bounds - 重绘的范围。
- */
- redrawThematicFeatures: function redrawThematicFeatures(bounds) {
- var me = this; //获取高亮专题要素对应的用户 id
- var hoverone = me.renderer.getHoverOne();
- var hoverFid = null;
- if (hoverone && hoverone.refDataID) {
- hoverFid = hoverone.refDataID;
- }
- if (this.options.alwaysMapCRS && bounds && bounds instanceof (external_L_default()).LatLngBounds) {
- var crs = this._map.options.crs;
- bounds = external_L_default().bounds(crs.project(bounds.getSouthWest()), crs.project(bounds.getNorthEast()));
- }
- bounds = CommontypesConversion.toSuperMapBounds(bounds); //清除当前所有可视元素
- me.renderer.clearAll();
- var features = me.features;
- var cache = me.cache;
- var cacheFields = me.cacheFields;
- var cmZoom = me._map.getZoom();
- var maxCC = me.maxCacheCount;
- for (var i = 0, len = features.length; i < len; i++) {
- var feature = features[i];
- var feaBounds = feature.geometry.getBounds(); //剔除当前视图(地理)范围以外的数据
- if (bounds && !bounds.intersectsBounds(feaBounds)) {
- continue;
- } //缓存字段
- var fields = feature.id + "_zoom_" + cmZoom.toString();
- if (cache[fields]) {
- cache[fields].updateAndAddShapes();
- continue;
- }
- var thematicFeature = me.createThematicFeature(features[i]); //检查 thematicFeature 是否有可视化图形
- if (thematicFeature.getShapesCount() < 1) {
- continue;
- } //加入缓存
- cache[fields] = thematicFeature;
- cacheFields.push(fields); //缓存数量限制
- if (cacheFields.length > maxCC) {
- var fieldsTemp = cacheFields[0];
- cacheFields.splice(0, 1);
- delete cache[fieldsTemp];
- }
- }
- me.renderer.render(); //地图漫游后,重新高亮图形
- if (hoverFid && me.options.isHoverAble && me.options.isMultiHover) {
- var hShapes = this.getShapesByFeatureID(hoverFid);
- this.renderer.updateHoverShapes(hShapes);
- }
- },
- /**
- * @function L.supermap.GeoFeatureThemeLayer.prototype.createThematicFeature
- * @description 创建专题要素。
- * @param {SuperMap.Feature.Vector} feature - 要创建的要素。
- */
- createThematicFeature: function createThematicFeature(feature) {
- var me = this;
- var style = me.getStyleByData(feature);
- if (feature.style && me.isAllowFeatureStyle) {
- style = Util.copyAttributesWithClip(feature.style);
- } //创建专题要素时的可选参数
- var options = {};
- options.nodesClipPixel = me.options.nodesClipPixel;
- options.isHoverAble = me.options.isHoverAble;
- options.isMultiHover = me.options.isMultiHover;
- options.isClickAble = me.options.isClickAble;
- options.highlightStyle = ShapeFactory.transformStyle(me.highlightStyle); //将数据转为专题要素(Vector)
- var thematicFeature = new ThemeVector(feature, me, ShapeFactory.transformStyle(style), options); //直接添加图形到渲染器
- for (var m = 0; m < thematicFeature.shapes.length; m++) {
- me.renderer.addShape(thematicFeature.shapes[m]);
- }
- return thematicFeature;
- },
- /**
- * @function L.supermap.GeoFeatureThemeLayer.prototype.redraw
- * @description 重绘该图层。
- */
- redraw: function redraw() {
- this.clearCache();
- return ThemeLayer.prototype.redraw.apply(this, arguments);
- },
- /**
- * @function L.supermap.GeoFeatureThemeLayer.prototype.clearCache
- * @description 清除缓存数据。
- */
- clearCache: function clearCache() {
- this.cache = {};
- this.cacheFields = [];
- },
- /**
- * @function L.supermap.GeoFeatureThemeLayer.prototype.clear
- * @description 清除的内容包括数据(features) 、专题要素、缓存。
- */
- clear: function clear() {
- var me = this;
- me.renderer.clearAll();
- me.renderer.refresh();
- me.removeAllFeatures();
- me.clearCache();
- },
- /**
- * @function L.supermap.GeoFeatureThemeLayer.prototype.getCacheCount
- * @description 获取当前缓存数量。
- * @returns {number} 返回当前缓存数量。
- */
- getCacheCount: function getCacheCount() {
- return this.cacheFields.length;
- },
- /**
- * @function L.supermap.GeoFeatureThemeLayer.prototype.setMaxCacheCount
- * @description 设置最大缓存数量。
- * @param {number} cacheCount - 最大缓存量。
- */
- setMaxCacheCount: function setMaxCacheCount(cacheCount) {
- if (isNaN(cacheCount)) {
- return;
- }
- this.maxCacheCount = cacheCount;
- this.isCustomSetMaxCacheCount = true;
- },
- /**
- * @function L.supermap.GeoFeatureThemeLayer.prototype.getShapesByFeatureID
- * @description 通过 FeatureID 获取 feature 关联的所有图形。如果不传入此参数,函数将返回所有图形。
- * @param {number} featureID - 要素 ID。
- */
- getShapesByFeatureID: function getShapesByFeatureID(featureID) {
- var me = this,
- list = [],
- shapeList = me.renderer.getAllShapes();
- if (!featureID) {
- return shapeList;
- }
- for (var i = 0, len = shapeList.length; i < len; i++) {
- var si = shapeList[i];
- if (si.refDataID && featureID === si.refDataID) {
- list.push(si);
- }
- }
- return list;
- }
- });
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/UniqueThemeLayer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.uniqueThemeLayer
- * @classdesc 客户端单值专题图。
- * @category Visualization Theme
- * @description 单值专题图是利用不同的颜色或符号(线型、填充)表示图层中某一属性信息的不同属性值,属性值相同的要素具有相同的渲染风格。
- * 比如土壤类型分布图、土地利用图、行政区划图等。单值专题图着重表示现象质的差别,一般不表示数量的特征。
- * @extends L.supermap.GeoFeatureThemeLayer
- * @param {string} name - 专题图层名。
- * @param {Object} options - 可选参数。
- * @param {string} [options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
- * @param {number} [options.opacity=1] - 图层透明度。
- * @param {boolean} [options.alwaysMapCRS=false] - 要素坐标是否和地图坐标系一致,要素默认是经纬度坐标。
- * @param {Array} [options.TFEvents] - 专题要素事件临时存储。
- * @param {number} [options.nodesClipPixel=2] - 节点抽稀像素距离。
- * @param {boolean} [options.isHoverAble=false] - 图形是否在 hover 时高亮。
- * @param {boolean} [options.isMultiHover=false] - 是否多图形同时高亮,用于高亮同一个数据对应的所有图形(如:多面)。
- * @param {boolean} [options.isClickAble=true] - 图形是否可点击。
- * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权描述信息。
- * @param {boolean} [options.isAllowFeatureStyle=false] - 是否允许 feature 样式(style) 中的有效属性应用到专题图层。
- * 禁止对专题要素使用数据(feature)的 style。
- * 此属性可强制将数据 feature 的 style 中有效属性应用到专题要素上,且拥有比图层 style 和 styleGroups 更高的优先级,使专题要素
- * 的样式脱离专题图层的控制。可以通过此方式实现对特殊数据(feature) 对应专题要素赋予独立 style。
- */
- var UniqueThemeLayer = GeoFeatureThemeLayer.extend({
- /**
- * @member {Object} L.supermap.uniqueThemeLayer.prototype.style
- * @description 专题图样式。
- */
- /**
- * @member {Object} L.supermap.uniqueThemeLayer.prototype.styleGroups
- * @description 各专题类型样式组。
- */
- /**
- * @member {Object} L.supermap.uniqueThemeLayer.prototype.highlightStyle
- * @description 开启 hover 事件后,触发的样式风格。
- */
- initialize: function initialize(name, options) {
- GeoFeatureThemeLayer.prototype.initialize.call(this, name, options); //{Array.<SuperMap.ThemeStyle>} 图层中专题要素的样式
- this.style = []; //{string} 用于指定专题要素样式的属性字段名称。
- // 此属性字段是要用户数据(feature) attributes 中包含的字段,且字段对应的值的类型必须是数值型。使用标签分组显示还需要设置 styleGroups 属性。
- this.themeField = null; //使用此属性需要设置 themeField 属性。
- //1.没有同时设置 themeField 和 styleGroups,则所有专题要素都使用本图层的 style 进行渲染;
- //2.同时设置 themeField 和 styleGroups,则按照 themeField 指定的字段名称获取用户数据(feature)attributes 中对应的属性值;
- // a.如果属性值等于 styleGroups 数组里某个元素定义的 value 值,则此专题要素取 styleGroups 数组中该元素定义的 style 进行渲染。
- // b.如果属性值不等于 styleGroups 数组里任何元素定义的 value 值,则此专题要素按照本图层的 style 进行渲染。
- //此数组每个元素对象必须有两个属性:value : 与字段 themeField 相对应的属性值;style:专题要素 style。
- this.styleGroups = [];
- },
- /**
- * @private
- * @function L.supermap.uniqueThemeLayer.prototype.getStyleByData
- * @description 根据用户数据(feature)设置专题要素的 Style。
- * @param {SuperMap.Feature.Vector} feat - 用户要素数据。
- * @returns {Array.<SuperMap.ThemeStyle>} 返回包含专题要素 style 的对象。
- */
- getStyleByData: function getStyleByData(feat) {
- var me = this,
- feature = feat,
- style = Util.copyAttributesWithClip({}, me.style);
- var groups = me.styleGroups,
- isSfInAttributes = false,
- //指定的 themeField 是否是 feature 的属性字段之一
- attribute = null; //属性值
- var isValidStyleGroup = me.styleGroups && me.styleGroups.length > 0;
- if (me.themeField && isValidStyleGroup && feature.attributes) {
- var tf = me.themeField,
- attributes = feature.attributes;
- for (var property in attributes) {
- if (tf !== property) {
- continue;
- }
- isSfInAttributes = true;
- attribute = attributes[property];
- break;
- }
- } //判断属性值是否属于styleGroups的某一个范围,以便对获取分组 style
- if (isSfInAttributes) {
- for (var i = 0, len = groups.length; i < len; i++) {
- if (attribute.toString() === groups[i].value.toString()) {
- var sty1 = groups[i].style;
- style = Util.copyAttributesWithClip(style, sty1);
- }
- }
- }
- return style;
- }
- });
- var uniqueThemeLayer = function uniqueThemeLayer(name, options) {
- return new UniqueThemeLayer(name, options);
- };
- (external_L_default()).supermap.uniqueThemeLayer = uniqueThemeLayer;
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/RangeThemeLayer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.rangeThemeLayer
- * @classdesc 范围分段专题图。
- * @category Visualization Theme
- * @description 范围分段专题图对数据(<{@link SuperMap.Feature.Vector}>)属性字段(attributes)的属性值进行分段,使用不同的颜色或符号(线型、填充)渲染不同范围段的属性值。
- * 分段专题图一般用来反映连续分布现象的数量或程度特征,如降水量的分布,土壤侵蚀强度的分布等。
- * @extends L.supermap.GeoFeatureThemeLayer
- * @param {string} name - 图层名
- * @param {Object} options - 图层参数。
- * @param {string} [options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
- * @param {number} [options.opacity=1] - 图层透明度。
- * @param {boolean} [options.alwaysMapCRS=false] - 要素坐标是否和地图坐标系一致,要素默认是经纬度坐标。
- * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权描述信息。
- * @param {Array} [options.TFEvents] - 专题要素事件临时存储。
- * @param {number} [options.nodesClipPixel=2] - 节点抽稀像素距离。
- * @param {boolean} [options.isHoverAble=false] - 图形是否在 hover 时高亮。
- * @param {boolean} [options.isMultiHover=false] - 是否多图形同时高亮,用于高亮同一个数据对应的所有图形(如:多面)。
- * @param {boolean} [options.isClickAble=true] - 图形是否可点击。
- * @param {boolean} [options.isAllowFeatureStyle=false] - 是否允许 feature 样式(style) 中的有效属性应用到专题图层。
- * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权描述信息。
- * 禁止对专题要素使用数据(feature)的 style。
- * 此属性可强制将数据 feature 的 style 中有效属性应用到专题要素上,且拥有比图层 style 和 styleGroups 更高的优先级,使专题要素
- * 的样式脱离专题图层的控制。可以通过此方式实现对特殊数据(feature) 对应专题要素赋予独立 style。
- */
- var RangeThemeLayer = GeoFeatureThemeLayer.extend({
- /**
- * @member {Object} L.supermap.rangeThemeLayer.prototype.style
- * @description 专题图样式。
- */
- /**
- * @member {Object} L.supermap.rangeThemeLayer.prototype.styleGroups
- * @description 各专题类型样式组。
- */
- /**
- * @member {Object} L.supermap.rangeThemeLayer.prototype.highlightStyle
- * @description 开启 hover 事件后,触发的样式风格。
- */
- initialize: function initialize(name, options) {
- GeoFeatureThemeLayer.prototype.initialize.call(this, name, options); //{Array.<SuperMap.ThemeStyle>} 图层中专题要素的样式
- this.style = []; //{string} 用于指定专题要素样式的属性字段名称。
- // 此属性字段是要用户数据(feature) attributes 中包含的字段,且字段对应的值的类型必须是数值型。使用标签分组显示还需要设置 styleGroups 属性。
- this.themeField = null; //使用此属性需要设置 themeField 属性。
- //1.没有同时设置 themeField 和 styleGroups,则所有专题要素都使用本图层的 style 进行渲染;
- //2.同时设置 themeField 和 styleGroups,则按照 themeField 指定的字段名称获取用户数据(feature)attributes 中对应的属性值;
- // a.如果属性值等于 styleGroups 数组里某个元素定义的 value 值,则此专题要素取 styleGroups 数组中该元素定义的 style 进行渲染。
- // b.如果属性值不等于 styleGroups 数组里任何元素定义的 value 值,则此专题要素按照本图层的 style 进行渲染。
- //此数组每个元素对象必须有两个属性:value : 与字段 themeField 相对应的属性值;style:专题要素 style。
- this.styleGroups = [];
- },
- /**
- * @function L.supermap.rangeThemeLayer.prototype.getStyleByData
- * @description 根据用户数据(feature)设置专题要素的 Style。
- * @param {SuperMap.Feature.Vector} feat - 矢量要素对象。
- * @returns {Array.<SuperMap.ThemeStyle>} 专题要素的 Style。
- */
- getStyleByData: function getStyleByData(feat) {
- var me = this,
- feature = feat,
- style = Util.copyAttributesWithClip({}, me.style);
- var groups = me.styleGroups,
- isSfInAttributes = false,
- //指定的 themeField 是否是 feature 的属性字段之一
- attribute = null; //属性值
- var isValidStyleGroup = me.styleGroups && me.styleGroups.length > 0;
- if (me.themeField && isValidStyleGroup && feature.attributes) {
- var Sf = me.themeField,
- attributes = feature.attributes;
- for (var property in attributes) {
- if (Sf !== property) {
- continue;
- }
- isSfInAttributes = true;
- attribute = attributes[property];
- break;
- }
- } //判断属性值是否属于styleGroups的某一个范围,以便对获取分组 style
- if (isSfInAttributes) {
- for (var i = 0, len = groups.length; i < len; i++) {
- var isContianed = i === len - 1 ? attribute >= groups[i].start && attribute <= groups[i].end : attribute >= groups[i].start && attribute < groups[i].end;
- if (isContianed) {
- var sty1 = groups[i].style;
- style = Util.copyAttributesWithClip(style, sty1);
- }
- }
- }
- return style;
- }
- });
- var rangeThemeLayer = function rangeThemeLayer(name, options) {
- return new RangeThemeLayer(name, options);
- };
- (external_L_default()).supermap.rangeThemeLayer = rangeThemeLayer;
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/LabelThemeLayer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.labelThemeLayer
- * @classdesc 标签专题图。
- * @category Visualization Theme
- * @extends L.supermap.GeoFeatureThemeLayer
- * @param {string} name - 图层名。
- * @param {Object} options - 图层参数。
- * @param {string} options.themeFields - 指定创建专题图字段。
- * @param {string} [options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
- * @param {boolean} [options.isAvoid=true] - 是否进行地图边缘的避让处理。
- * @param {boolean} [options.alwaysMapCRS=false] - 要素坐标是否和地图坐标系一致,要素默认是经纬度坐标。
- * @param {boolean} [options.isOverLay=true] - 是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表。
- * @param {number} [options.opacity=1] - 图层透明度。
- * @param {Array} [options.TFEvents] - 专题要素事件临时存储。
- * @param {number} [options.nodesClipPixel=2] - 节点抽稀像素距离。
- * @param {boolean} [options.isHoverAble=false] - 图形是否在 hover 时高亮。
- * @param {boolean} [options.isMultiHover=false] - 是否多图形同时高亮,用于高亮同一个数据对应的所有图形(如:多面)。
- * @param {boolean} [options.isClickAble=true] - 图形是否可点击。
- * @param {boolean} [options.isAllowFeatureStyle=false] - 是否允许 feature 样式(style) 中的有效属性应用到专题图层。
- * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权描述信息。
- * 禁止对专题要素使用数据(feature)的 style。
- * 此属性可强制将数据 feature 的 style 中有效属性应用到专题要素上,且拥有比图层 style 和 styleGroups 更高的优先级,使专题要素
- * 的样式脱离专题图层的控制。可以通过此方式实现对特殊数据(feature) 对应专题要素赋予独立 style。
- */
- var LabelThemeLayer = GeoFeatureThemeLayer.extend({
- /**
- * @member {Object} L.supermap.labelThemeLayer.prototype.style
- * @description 专题图样式。
- */
- /**
- * @member {Object} L.supermap.labelThemeLayer.prototype.styleGroups
- * @description 各专题类型样式组。
- */
- /**
- * @member {Object} L.supermap.labelThemeLayer.prototype.highlightStyle
- * @description 开启 hover 事件后,触发的样式风格。
- */
- options: {
- //是否进行压盖处理,如果设为true,将隐藏被压盖的标签,默认为true。
- isOverLay: true,
- //是否进行地图边缘的避让处理,如果设为true,将把与地图边缘相交的标签移到地图范围内,默认为 true,在地图边缘处做避让处理。
- isAvoid: true
- },
- initialize: function initialize(name, options) {
- GeoFeatureThemeLayer.prototype.initialize.call(this, name, options);
- external_L_default().Util.setOptions(this, options); //图层中专题要素的样式
- this.style = []; //用于指定专题要素样式的属性字段名称。
- // 此属性字段是要用户数据(feature) attributes 中包含的字段,且字段对应的值的类型必须是数值型。使用标签分组显示还需要设置 styleGroups 属性。
- this.themeField = null; //使用此属性需要设置 themeField 属性。
- //1.没有同时设置 themeField 和 styleGroups,则所有专题要素都使用本图层的 style 进行渲染;
- //2.同时设置 themeField 和 styleGroups,则按照 themeField 指定的字段名称获取用户数据(feature)attributes 中对应的属性值;
- // a.如果属性值等于 styleGroups 数组里某个元素定义的 value 值,则此专题要素取 styleGroups 数组中该元素定义的 style 进行渲染。
- // b.如果属性值不等于 styleGroups 数组里任何元素定义的 value 值,则此专题要素按照本图层的 style 进行渲染。
- //此数组每个元素对象必须有两个属性:value : 与字段 themeField 相对应的属性值;style:专题要素 style。
- this.styleGroups = [];
- this.defaultStyle = {
- //默认文本样式
- fontColor: "#000000",
- fontOpacity: 1,
- fontSize: "12px",
- fontStyle: "normal",
- fontWeight: "normal",
- labelAlign: "cm",
- labelXOffset: 0,
- labelYOffset: 0,
- labelRotation: 0,
- //默认样式
- fill: false,
- fillColor: "#ee9900",
- fillOpacity: 0.4,
- stroke: false,
- strokeColor: "#ee9900",
- strokeOpacity: 1,
- strokeWidth: 1,
- strokeLinecap: "round",
- strokeDashstyle: "solid",
- //默认显示背景框
- labelRect: true,
- //对用户隐藏但必须保持此值的属性
- //cursor: "pointer",
- labelSelect: true,
- //用 _isGeoTextStrategyStyle 标记此style,携带此类style的要素特指GeoText策略中的标签要素
- _isGeoTextStrategyStyle: true
- }; //获取标签像素 bounds 的方式。0 - 表示通过文本类容和文本风格计算获取像素范围,现在支持中文、英文; 1 - 表示通过绘制的文本标签获取像素范围,支持各个语种的文字范围获取,但性能消耗较大(尤其是采用SVG渲染)。默认值为0。
- this.getPxBoundsMode = 0;
- this.labelFeatures = [];
- },
- /**
- * @function L.supermap.LabelThemeLayer.prototype.onAdd
- * @description 添加专题图。
- * @param {L.Map} map - 要添加的地图。
- * @private
- */
- onAdd: function onAdd(map) {
- GeoFeatureThemeLayer.prototype.onAdd.call(this, map);
- this.container.style.zIndex = 200;
- },
- /**
- * @function L.supermap.LabelThemeLayer.prototype.redrawThematicFeatures
- * @description 重绘所有专题要素。
- * 此方法包含绘制专题要素的所有步骤,包含用户数据到专题要素的转换,抽稀,缓存等步骤。
- * 地图漫游时调用此方法进行图层刷新。
- * @param {L.bounds} bounds - 重绘范围。
- */
- redrawThematicFeatures: function redrawThematicFeatures(bounds) {
- if (this.features.length > 0 && this.labelFeatures.length == 0) {
- var feats = this.setLabelsStyle(this.features);
- for (var i = 0, len = feats.length; i < len; i++) {
- this.labelFeatures.push(feats[i]);
- }
- }
- this.features = this.getDrawnLabels(this.labelFeatures);
- GeoFeatureThemeLayer.prototype.redrawThematicFeatures.call(this, bounds);
- },
- /**
- * @function L.supermap.LabelThemeLayer.prototype.removeFeatures
- * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。参数中的 features 数组中的每一项,必须是已经添加到当前图层中的 feature。
- * @param {Array.<SuperMap.Feature.Vector>} features - 要删除的要素。
- */
- removeFeatures: function removeFeatures(features) {
- // eslint-disable-line no-unused-vars
- this.labelFeatures = [];
- GeoFeatureThemeLayer.prototype.removeFeatures.call(this, arguments);
- },
- /**
- * @function L.supermap.LabelThemeLayer.prototype.removeAllFeatures
- * @description 清除当前图层所有的矢量要素。
- */
- removeAllFeatures: function removeAllFeatures() {
- this.labelFeatures = [];
- GeoFeatureThemeLayer.prototype.removeAllFeatures.call(this, arguments);
- },
- /**
- * @function L.supermap.LabelThemeLayer.prototype.getDrawnLabels
- * @description 获取经(压盖)处理后将要绘制在图层上的标签要素。
- * @param {Array.<SuperMap.Feature.Vector>} labelFeatures - 所有标签要素的数组。
- * @returns {Array.<SuperMap.Feature.Vector>} 最终要绘制的标签要素数组。
- */
- getDrawnLabels: function getDrawnLabels(labelFeatures) {
- var feas = [],
- //最终要绘制的标签要素集
- fea,
- //最终要绘制的标签要素
- fi,
- //临时标签要素,用户的第i个标签
- labelsB = [],
- //不产生压盖的标签要素范围集
- styTmp,
- //用于临时存储要素style的变量
- feaSty,
- //标签要素最终的style
- // styleTemp用于屏蔽文本style中带有偏移性质style属性,偏移已经在计算bounds的过程中参与了运算,
- // 所以在最终按照bounds来绘制标签时,需屏蔽style中带有偏移性质属性,否则文本的偏移量将扩大一倍。
- styleTemp = {
- labelAlign: "cm",
- labelXOffset: 0,
- labelYOffset: 0
- };
- var map = this._map;
- var mapSize = map.getSize();
- var zoom = map.getZoom(); //对用户的每个标签要素进行处理与判断
- for (var i = 0, len = labelFeatures.length; i < len; i++) {
- fi = labelFeatures[i]; //检查fi的style在避让中是否被改变,如果改变,重新设置要素的style
- if (fi.isStyleChange || fi.isStyleChange === undefined) {
- fi = this.setStyle(fi);
- } //标签最终的中心点像素位置 (偏移后)
- var loc = this.getLabelPxLocation(fi); //过滤掉地图范围外的标签 (偏移后)
- if (loc.x >= 0 && loc.x <= mapSize.x && loc.y >= 0 && loc.y <= mapSize.y) {
- //根据当前地图缩放级别过滤标签
- if (fi.style.minZoomLevel > -1) {
- if (zoom <= fi.style.minZoomLevel) {
- continue;
- }
- }
- if (fi.style.maxZoomLevel > -1) {
- if (zoom > fi.style.maxZoomLevel) {
- continue;
- }
- } //计算标签bounds
- var boundsQuad = null;
- if (fi.isStyleChange) {
- fi.isStyleChange = null;
- boundsQuad = this.calculateLabelBounds(fi, loc);
- } else {
- if (fi.geometry.bsInfo.w && fi.geometry.bsInfo.h) {
- //使用calculateLabelBounds2可以提高bounds的计算效率,尤其是在getPxBoundsMode = 1时
- boundsQuad = this.calculateLabelBounds2(fi, loc);
- } else {
- boundsQuad = this.calculateLabelBounds(fi, loc);
- }
- } //避让处理 -start
- var mapViewBounds = new Bounds(0, mapSize.y, mapSize.x, 0),
- //地图像素范围
- quadlen = boundsQuad.length;
- if (this.options.isAvoid) {
- var avoidInfo = this.getAvoidInfo(mapViewBounds, boundsQuad); //避让信息
- if (avoidInfo) {
- //横向(x方向)上的避让
- if (avoidInfo.aspectW === "left") {
- fi.style.labelXOffset += avoidInfo.offsetX;
- for (var j = 0; j < quadlen; j++) {
- boundsQuad[j].x += avoidInfo.offsetX;
- }
- } else if (avoidInfo.aspectW === "right") {
- fi.style.labelXOffset += -avoidInfo.offsetX;
- for (var _j = 0; _j < quadlen; _j++) {
- boundsQuad[_j].x += -avoidInfo.offsetX;
- }
- } //纵向(y方向)上的避让
- if (avoidInfo.aspectH === "top") {
- fi.style.labelYOffset += avoidInfo.offsetY;
- for (var _j2 = 0; _j2 < quadlen; _j2++) {
- boundsQuad[_j2].y += avoidInfo.offsetY;
- }
- } else if (avoidInfo.aspectH === "bottom") {
- fi.style.labelYOffset += -avoidInfo.offsetY;
- for (var _j3 = 0; _j3 < quadlen; _j3++) {
- boundsQuad[_j3].y += -avoidInfo.offsetY;
- }
- } //如果style发生变化,记录下来
- fi.isStyleChange = true;
- }
- } //避让处理 -end
- //压盖处理 -start
- if (this.options.isOverLay) {
- //是否压盖
- var isOL = false;
- if (i != 0) {
- for (var _j4 = 0; _j4 < labelsB.length; _j4++) {
- //压盖判断
- if (this.isQuadrilateralOverLap(boundsQuad, labelsB[_j4])) {
- isOL = true;
- break;
- }
- }
- }
- if (isOL) {
- continue;
- } else {
- labelsB.push(boundsQuad);
- }
- } //压盖处理 -end
- //背景(事件)-start
- //将标签像素范围转为地理范围
- var geoBs = [];
- for (var _j5 = 0; _j5 < quadlen - 1; _j5++) {
- geoBs.push(map.containerPointToLatLng(boundsQuad[_j5]));
- } //屏蔽有偏移性质的style属性,偏移量在算bounds时已经加入计算
- var leftBottom = geoBs[3];
- var rightTop = geoBs[1];
- var bounds = new Bounds(leftBottom.lng, leftBottom.lat, rightTop.lng, rightTop.lat);
- var center = bounds.getCenterLonLat();
- var label = new GeoText(center.lon, center.lat, fi.attributes[this.themeField]);
- label.calculateBounds();
- styTmp = Util.cloneObject(fi.style);
- feaSty = Util.cloneObject(Util.copyAttributes(styTmp, styleTemp));
- fea = new Vector(label, fi.attributes, feaSty); //赋予id
- fea.id = fi.id;
- fea.fid = fi.fid;
- feas.push(fea);
- }
- } //返回最终要绘制的标签要素
- return feas;
- },
- /**
- * @function L.supermap.LabelThemeLayer.prototype.getStyleByData
- * @description 根据用户数据(feature)设置专题要素的 Style。
- * @param {SuperMap.Feature.Vector} feat - 矢量要素对象。
- * @returns {Array.<SuperMap.ThemeStyle>} 专题要素的 Style。
- */
- getStyleByData: function getStyleByData(feat) {
- var feature = feat;
- feature.style = Util.copyAttributes(feature.style, this.defaultStyle); //将style赋给标签
- if (this.style && this.style.fontSize && parseFloat(this.style.fontSize) < 12) {
- this.style.fontSize = "12px";
- }
- feature.style = Util.copyAttributes(feature.style, this.style);
- if (this.themeField && this.styleGroups && feature.attributes) {
- var Sf = this.themeField;
- var attributes = feature.attributes;
- var groups = this.styleGroups;
- var isSfInAttrs = false; //指定的 groupField 是否是geotext的属性字段之一
- var attr = null; //属性值
- for (var property in attributes) {
- if (Sf === property) {
- isSfInAttrs = true;
- attr = attributes[property];
- break;
- }
- } //判断属性值是否属于styleGroups的某一个范围,以便对标签分组
- if (isSfInAttrs) {
- for (var i = 0, len = groups.length; i < len; i++) {
- if (attr >= groups[i].start && attr < groups[i].end) {
- var sty1 = groups[i].style;
- if (sty1 && sty1.fontSize && parseFloat(sty1.fontSize) < 12) {
- sty1.fontSize = "12px";
- }
- feature.style = Util.copyAttributes(feature.style, sty1);
- }
- }
- }
- feature.style.label = feature.attributes[this.themeField];
- }
- return feature.style;
- },
- /**
- * @function L.supermap.LabelThemeLayer.prototype.setLabelsStyle
- * @description 设置标签要素的 Style。
- * @param {Array.<SuperMap.Feature.Vector>} labelFeatures - 需要设置 Style 的标签要素数组。
- * @returns {Array.<SuperMap.Feature.Vector>} 赋予 Style 后的标签要素数组。
- */
- setLabelsStyle: function setLabelsStyle(labelFeatures) {
- var fea,
- labelFeas = [];
- for (var i = 0, len = labelFeatures.length; i < len; i++) {
- var feature = labelFeatures[i];
- if (feature.geometry.CLASS_NAME === "SuperMap.Geometry.GeoText") {
- //设置标签的Style
- if (feature.geometry.bsInfo.w || feature.geometry.bsInfo.h) {
- feature.geometry.bsInfo.w = null;
- feature.geometry.bsInfo.h = null;
- feature.geometry.labelWTmp = null;
- }
- fea = this.setStyle(feature); //为标签要素指定图层
- fea.layer = this.layer;
- labelFeas.push(fea);
- } else {
- return labelFeatures;
- }
- }
- return labelFeas;
- },
- /**
- * @function L.supermap.LabelThemeLayer.prototype.setStyle
- * @description 设置标签要素的 Style。
- * @param {SuperMap.Feature.Vector} feat - 需要赋予 style 的要素。
- */
- setStyle: function setStyle(feat) {
- var feature = feat;
- feature.style = Util.copyAttributes(feature.style, this.defaultStyle); //将style赋给标签
- if (this.style && this.style.fontSize && parseFloat(this.style.fontSize) < 12) {
- this.style.fontSize = "12px";
- }
- feature.style = Util.copyAttributes(feature.style, this.style);
- if (this.groupField && this.styleGroups && feature.attributes) {
- var Sf = this.groupField;
- var Attrs = feature.attributes;
- var Gro = this.styleGroups;
- var isSfInAttrs = false; //指定的 groupField 是否是geotext的属性字段之一
- var attr = null; //属性值
- for (var property in Attrs) {
- if (Sf === property) {
- isSfInAttrs = true;
- attr = Attrs[property];
- break;
- }
- } //判断属性值是否属于styleGroups的某一个范围,以便对标签分组
- if (isSfInAttrs) {
- for (var i = 0, len = Gro.length; i < len; i++) {
- if (attr >= Gro[i].start && attr < Gro[i].end) {
- //feature.style = Util.copyAttributes(feature.style, this.defaultStyle);
- var sty1 = Gro[i].style;
- if (sty1 && sty1.fontSize && parseFloat(sty1.fontSize) < 12) {
- sty1.fontSize = "12px";
- }
- feature.style = Util.copyAttributes(feature.style, sty1);
- }
- }
- }
- } //将文本内容赋到标签要素的style上
- feature.style.label = feature.geometry.text;
- return feature;
- },
- /**
- * @function L.supermap.LabelThemeLayer.prototype.getLabelPxLocation
- * @description 获取标签要素的像素坐标。
- * @param {SuperMap.Feature.Vector} feature - 标签要素。
- * @returns {L.point} 标签位置。
- */
- getLabelPxLocation: function getLabelPxLocation(feature) {
- var geoText = feature.geometry;
- var styleTmp = feature.style; //将标签的地理位置转为像素位置
- var locationTmp = geoText.getCentroid();
- var locTmp = this._map.latLngToContainerPoint(!this.options.alwaysMapCRS ? external_L_default().latLng(locationTmp.y, locationTmp.x) : this._map.options.crs.unproject(external_L_default().point(locationTmp.x, locationTmp.y)));
- var loc = external_L_default().point(locTmp.x, locTmp.y); //偏移处理
- if (styleTmp.labelXOffset || styleTmp.labelYOffset) {
- var xOffset = isNaN(styleTmp.labelXOffset) ? 0 : styleTmp.labelXOffset;
- var yOffset = isNaN(styleTmp.labelYOffset) ? 0 : styleTmp.labelYOffset;
- var point = loc.add(external_L_default().point(xOffset, -yOffset));
- return external_L_default().point(point.x, point.y);
- } else {
- return external_L_default().point(loc.x, loc.y);
- }
- },
- /**
- * @function L.supermap.LabelThemeLayer.prototype.calculateLabelBounds
- * @description 获得标签要素的最终范围。
- *
- * @param {SuperMap.Feature.Vector} feature - 需要计算 bounds 的标签要素数。
- * @param {L.point} loc - 标签位置。
- *
- * @returns {Array.<Object>} 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
- */
- calculateLabelBounds: function calculateLabelBounds(feature, loc) {
- var geoText = feature.geometry; //标签范围(未旋转前)
- var labB = null;
- var labelInfo = null; //获取bounds的方式
- if (this.getPxBoundsMode == 0) {
- labB = geoText.getLabelPxBoundsByText(loc, feature.style);
- } else if (this.getPxBoundsMode === 1) {
- //canvas
- labelInfo = this.getLabelInfo(feature.geometry.getCentroid(), feature.style);
- labB = geoText.getLabelPxBoundsByLabel(loc, labelInfo.w, labelInfo.h, feature.style);
- } else {
- return null;
- } //旋转Bounds
- var boundsQuad = [];
- if (feature.style.labelRotation % 180 == 0) {
- boundsQuad = [{
- "x": labB.left,
- "y": labB.top
- }, {
- "x": labB.right,
- "y": labB.top
- }, {
- "x": labB.right,
- "y": labB.bottom
- }, {
- "x": labB.left,
- "y": labB.bottom
- }, {
- "x": labB.left,
- "y": labB.top
- }];
- } else {
- boundsQuad = this.rotationBounds(labB, loc, feature.style.labelRotation);
- } //重置GeoText的bounds
- geoText.bounds = new Bounds(boundsQuad[1].x, boundsQuad[3].y, boundsQuad[2].x, boundsQuad[4].y);
- return boundsQuad;
- },
- /**
- * @function L.supermap.LabelThemeLayer.prototype.calculateLabelBounds2
- * @description 获得标签要素的最终范围的另一种算法(通过记录下的标签宽高),提高计算 bounds 的效率。
- *
- * @param {SuperMap.Feature.Vector} feature - 需要计算 bounds 的标签要素数。
- * @param {L.point} loc - 标签位置。
- *
- * @returns {Array.<Object>} 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
- */
- calculateLabelBounds2: function calculateLabelBounds2(feature, loc) {
- var labB, left, bottom, top, right;
- var labelSize = feature.geometry.bsInfo;
- var style = feature.style;
- var locationPx = Util.cloneObject(loc); //处理文字对齐
- if (style.labelAlign && style.labelAlign !== "cm") {
- switch (style.labelAlign) {
- case "lt":
- locationPx.x += labelSize.w / 2;
- locationPx.y += labelSize.h / 2;
- break;
- case "lm":
- locationPx.x += labelSize.w / 2;
- break;
- case "lb":
- locationPx.x += labelSize.w / 2;
- locationPx.y -= labelSize.h / 2;
- break;
- case "ct":
- locationPx.y += labelSize.h / 2;
- break;
- case "cb":
- locationPx.y -= labelSize.h / 2;
- break;
- case "rt":
- locationPx.x -= labelSize.w / 2;
- locationPx.y += labelSize.h / 2;
- break;
- case "rm":
- locationPx.x -= labelSize.w / 2;
- break;
- case "rb":
- locationPx.x -= labelSize.w / 2;
- locationPx.y -= labelSize.h / 2;
- break;
- default:
- break;
- }
- }
- left = locationPx.x - labelSize.w / 2;
- bottom = locationPx.y + labelSize.h / 2; //处理斜体字
- if (style.fontStyle && style.fontStyle === "italic") {
- right = locationPx.x + labelSize.w / 2 + parseInt(parseFloat(style.fontSize) / 2);
- } else {
- right = locationPx.x + labelSize.w / 2;
- }
- top = locationPx.y - labelSize.h / 2;
- labB = new Bounds(left, bottom, right, top); //旋转Bounds
- var boundsQuad = [];
- if (style.labelRotation % 180 == 0) {
- boundsQuad = [{
- "x": labB.left,
- "y": labB.top
- }, {
- "x": labB.right,
- "y": labB.top
- }, {
- "x": labB.right,
- "y": labB.bottom
- }, {
- "x": labB.left,
- "y": labB.bottom
- }, {
- "x": labB.left,
- "y": labB.top
- }];
- } else {
- boundsQuad = this.rotationBounds(labB, loc, style.labelRotation);
- } //重置GeoText的bounds
- feature.geometry.bounds = new Bounds(boundsQuad[1].x, boundsQuad[3].y, boundsQuad[2].x, boundsQuad[4].y);
- return boundsQuad;
- },
- /**
- * @function L.supermap.LabelThemeLayer.prototype.getLabelInfo
- * @description 根据当前位置获取绘制后的标签信息,包括标签的宽,高和行数等。
- * @returns {Object} 绘制后的标签信息。
- */
- getLabelInfo: function getLabelInfo(location, style) {
- var LABEL_ALIGN = {
- "l": "left",
- "r": "right",
- "t": "top",
- "b": "bottom"
- },
- LABEL_FACTOR = {
- "l": 0,
- "r": -1,
- "t": 0,
- "b": -1
- };
- style = Util.extend({
- fontColor: "#000000",
- labelAlign: "cm"
- }, style);
- var pt = this.getLocalXY(location);
- var labelWidth = 0;
- if (style.labelXOffset || style.labelYOffset) {
- var xOffset = isNaN(style.labelXOffset) ? 0 : style.labelXOffset;
- var yOffset = isNaN(style.labelYOffset) ? 0 : style.labelYOffset;
- pt[0] += xOffset;
- pt[1] -= yOffset;
- }
- var canvas = document.createElement('canvas');
- canvas.globalAlpha = 0;
- canvas.lineWidth = 1;
- var ctx = canvas.getContext("2d");
- ctx.fillStyle = style.fontColor;
- ctx.globalAlpha = style.fontOpacity || 1.0;
- 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(" ");
- var labelRows = style.label.split('\n');
- var numRows = labelRows.length;
- var vfactor, lineHeight, labelWidthTmp;
- if (ctx.fillText) {
- // HTML5
- ctx.font = fontStyle;
- ctx.textAlign = LABEL_ALIGN[style.labelAlign[0]] || "center";
- ctx.textBaseline = LABEL_ALIGN[style.labelAlign[1]] || "middle";
- vfactor = LABEL_FACTOR[style.labelAlign[1]];
- if (vfactor == null) {
- vfactor = -.5;
- }
- lineHeight = ctx.measureText('Mg').height || ctx.measureText('xx').width;
- pt[1] += lineHeight * vfactor * (numRows - 1);
- for (var i = 0; i < numRows; i++) {
- labelWidthTmp = ctx.measureText(labelRows[i]).width;
- if (labelWidth < labelWidthTmp) {
- labelWidth = labelWidthTmp;
- }
- }
- } else if (ctx.mozDrawText) {
- // Mozilla pre-Gecko1.9.1 (<FF3.1)
- ctx.mozTextStyle = fontStyle;
- vfactor = LABEL_FACTOR[style.labelAlign[1]];
- if (vfactor == null) {
- vfactor = -.5;
- }
- lineHeight = ctx.mozMeasureText('xx');
- pt[1] += lineHeight * (1 + vfactor * numRows);
- for (var _i = 0; _i < numRows; _i++) {
- labelWidthTmp = ctx.measureText(labelRows[_i]).width;
- if (labelWidth < labelWidthTmp) {
- labelWidth = labelWidthTmp;
- }
- }
- }
- var labelInfo = {}; //标签信息
- if (labelWidth) {
- labelInfo.w = labelWidth; //标签的宽
- } else {
- return null;
- }
- labelInfo.h = style.fontSize; //一行标签的高
- labelInfo.rows = labelRows.length; //标签的行数
- return labelInfo;
- },
- /**
- * @function L.supermap.LabelThemeLayer.prototype.rotationBounds
- * @description 旋转 bounds。
- *
- * @param {SuperMap.Bounds} bounds - 要旋转的 bounds。
- * @param {Object} rotationCenterPoi - 旋转中心点对象,此对象含有属性x(横坐标),属性y(纵坐标)。
- * @param {number} angle - 旋转角度(顺时针)。
- *
- * @returns {Array.<Object>} bounds旋转后形成的多边形节点数组。是一个四边形,形如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
- */
- rotationBounds: function rotationBounds(bounds, rotationCenterPoi, angle) {
- var ltPoi = external_L_default().point(bounds.left, bounds.top);
- var rtPoi = external_L_default().point(bounds.right, bounds.top);
- var rbPoi = external_L_default().point(bounds.right, bounds.bottom);
- var lbPoi = external_L_default().point(bounds.left, bounds.bottom);
- var ver = [];
- ver.push(this.getRotatedLocation(ltPoi.x, ltPoi.y, rotationCenterPoi.x, rotationCenterPoi.y, angle));
- ver.push(this.getRotatedLocation(rtPoi.x, rtPoi.y, rotationCenterPoi.x, rotationCenterPoi.y, angle));
- ver.push(this.getRotatedLocation(rbPoi.x, rbPoi.y, rotationCenterPoi.x, rotationCenterPoi.y, angle));
- ver.push(this.getRotatedLocation(lbPoi.x, lbPoi.y, rotationCenterPoi.x, rotationCenterPoi.y, angle)); //bounds旋转后形成的多边形节点数组
- var quad = [];
- for (var i = 0; i < ver.length; i++) {
- quad.push({
- "x": ver[i].x,
- "y": ver[i].y
- });
- }
- quad.push({
- "x": ver[0].x,
- "y": ver[0].y
- });
- return quad;
- },
- /**
- * @function L.supermap.LabelThemeLayer.prototype.getRotatedLocation
- * @description 获取一个点绕旋转中心顺时针旋转后的位置。(此方法用于屏幕坐标)。
- *
- * @param {number} x - 旋转点横坐标。
- * @param {number} y - 旋转点纵坐标。
- * @param {number} rx - 旋转中心点横坐标。
- * @param {number} ry - 旋转中心点纵坐标。
- * @param {number} angle - 旋转角度。
- *
- * @returns {Object} 旋转后的坐标位置对象,该对象含有属性 x(横坐标),属性 y(纵坐标)。
- */
- getRotatedLocation: function getRotatedLocation(x, y, rx, ry, angle) {
- var loc = {},
- x0,
- y0;
- y = -y;
- ry = -ry;
- angle = -angle; //顺时针旋转
- x0 = (x - rx) * Math.cos(angle / 180 * Math.PI) - (y - ry) * Math.sin(angle / 180 * Math.PI) + rx;
- y0 = (x - rx) * Math.sin(angle / 180 * Math.PI) + (y - ry) * Math.cos(angle / 180 * Math.PI) + ry;
- loc.x = x0;
- loc.y = -y0;
- return loc;
- },
- /**
- * @function L.supermap.LabelThemeLayer.prototype.getAvoidInfo
- * @description 获取避让的信息。
- *
- * @param {SuperMap.Bounds} bounds - 地图像素范围。
- * @param {Array.<Object>} quadrilateral - 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
- *
- * @returns {Object} 避让的信息。
- */
- getAvoidInfo: function getAvoidInfo(bounds, quadrilateral) {
- if (quadrilateral.length !== 5) {
- return null;
- } //不是四边形
- //将bound序列化为点数组形式
- var bounddQuad = [{
- "x": bounds.left,
- "y": bounds.top
- }, {
- "x": bounds.right,
- "y": bounds.top
- }, {
- "x": bounds.right,
- "y": bounds.bottom
- }, {
- "x": bounds.left,
- "y": bounds.bottom
- }, {
- "x": bounds.left,
- "y": bounds.top
- }];
- var isIntersection = false,
- bqLen = bounddQuad.length,
- quadLen = quadrilateral.length;
- var offsetX = 0,
- offsetY = 0,
- aspectH = "",
- aspectW = "";
- for (var i = 0; i < bqLen - 1; i++) {
- for (var j = 0; j < quadLen - 1; j++) {
- var isLineIn = Util.lineIntersection(bounddQuad[i], bounddQuad[i + 1], quadrilateral[j], quadrilateral[j + 1]);
- if (isLineIn.CLASS_NAME === "SuperMap.Geometry.Point") {
- //设置避让信息
- setInfo(quadrilateral[j]);
- setInfo(quadrilateral[j + 1]);
- isIntersection = true;
- }
- }
- }
- if (isIntersection) {
- //组织避让操作所需的信息
- return {
- "aspectW": aspectW,
- "aspectH": aspectH,
- "offsetX": offsetX,
- "offsetY": offsetY
- };
- } else {
- return null;
- } //内部函数:设置避让信息
- //参数:vec-{Object} quadrilateral四边形单个节点。如:{"x":1,"y":1}。
- function setInfo(vec) {
- //四边形不在bounds内的节点
- if (!bounds.contains(vec.x, vec.y)) {
- //bounds的Top边
- if (vec.y < bounds.top) {
- var oY = Math.abs(bounds.top - vec.y);
- if (oY > offsetY) {
- offsetY = oY;
- aspectH = "top";
- }
- } //bounds的Bottom边
- if (vec.y > bounds.bottom) {
- var _oY = Math.abs(vec.y - bounds.bottom);
- if (_oY > offsetY) {
- offsetY = _oY;
- aspectH = "bottom";
- }
- } //bounds的left边
- if (vec.x < bounds.left) {
- var oX = Math.abs(bounds.left - vec.x);
- if (oX > offsetX) {
- offsetX = oX;
- aspectW = "left";
- }
- } //bounds的right边
- if (vec.x > bounds.right) {
- var _oX = Math.abs(vec.x - bounds.right);
- if (_oX > offsetX) {
- offsetX = _oX;
- aspectW = "right";
- }
- }
- }
- }
- },
- /**
- * @function L.supermap.LabelThemeLayer.prototype.isQuadrilateralOverLap
- * @description 判断两个四边形是否有压盖。
- *
- * @param {Array.<Object>} quadrilateral - 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
- * @param {Array.<Object>} quadrilateral2 - 第二个四边形节点数组。
- *
- * @returns {boolean} 是否压盖,true表示压盖。
- */
- isQuadrilateralOverLap: function isQuadrilateralOverLap(quadrilateral, quadrilateral2) {
- var quadLen = quadrilateral.length,
- quad2Len = quadrilateral2.length;
- if (quadLen !== 5 || quad2Len !== 5) {
- return null;
- } //不是四边形
- var OverLap = false; //如果两四边形互不包含对方的节点,则两个四边形不相交
- for (var i = 0; i < quadLen; i++) {
- if (this.isPointInPoly(quadrilateral[i], quadrilateral2)) {
- OverLap = true;
- break;
- }
- }
- for (var _i2 = 0; _i2 < quad2Len; _i2++) {
- if (this.isPointInPoly(quadrilateral2[_i2], quadrilateral)) {
- OverLap = true;
- break;
- }
- } //加上两矩形十字相交的情况
- for (var _i3 = 0; _i3 < quadLen - 1; _i3++) {
- if (OverLap) {
- break;
- }
- for (var j = 0; j < quad2Len - 1; j++) {
- var isLineIn = Util.lineIntersection(quadrilateral[_i3], quadrilateral[_i3 + 1], quadrilateral2[j], quadrilateral2[j + 1]);
- if (isLineIn.CLASS_NAME === "SuperMap.Geometry.Point") {
- OverLap = true;
- break;
- }
- }
- }
- return OverLap;
- },
- /**
- * @function L.supermap.LabelThemeLayer.prototype.isPointInPoly
- * @description 判断一个点是否在多边形里面。(射线法)。
- *
- * @param {Object} pt - 需要判定的点对象,该对象含有属性 x(横坐标),属性 y(纵坐标)。
- * @param {Array.<Object>} poly - 多边形节点数组。例如一个四边形:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
- * @returns {boolean} 点是否在多边形内。
- */
- isPointInPoly: function isPointInPoly(pt, poly) {
- for (var isIn = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) {
- (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);
- }
- return isIn;
- }
- });
- var labelThemeLayer = function labelThemeLayer(name, options) {
- return new LabelThemeLayer(name, options);
- };
- (external_L_default()).supermap.labelThemeLayer = labelThemeLayer;
- ;// CONCATENATED MODULE: ./src/leaflet/services/FeatureService.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.featureService
- * @classdesc 要素数据集类。提供:ID 查询,范围查询,SQL 查询,几何查询,bounds 查询,缓冲区查询,地物编辑。
- * @category iServer Data Feature
- * @example
- * L.supermap.featureService(url)
- * .getFeaturesByIDs(param,function(result){
- * //doSomething
- * })
- * @extends {L.supermap.ServiceBase}
- * @param {string} url - 要素数据集服务地址。
- * @param {Object} options - 参数。
- * @param {string} [options.proxy] - 服务代理地址。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
- * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var FeatureService = ServiceBase.extend({
- initialize: function initialize(url, options) {
- ServiceBase.prototype.initialize.call(this, url, options);
- },
- /**
- * @function L.supermap.featureService.prototype.getFeaturesByIDs
- * @description 数据集 ID 查询服务。
- * @param {SuperMap.GetFeaturesByIDsParameters} params - ID 查询参数类。
- * @param {RequestCallback} callback - 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
- */
- getFeaturesByIDs: function getFeaturesByIDs(params, callback, resultFormat) {
- var me = this;
- var getFeaturesByIDsService = new GetFeaturesByIDsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- getFeaturesByIDsService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.featureService.prototype.getFeaturesByBounds
- * @description 数据集 bounds 查询服务。
- * @param {SuperMap.GetFeaturesByBoundsParameters} params - 数据集范围查询参数类。
- * @param {RequestCallback} callback - 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
- */
- getFeaturesByBounds: function getFeaturesByBounds(params, callback, resultFormat) {
- var me = this;
- var getFeaturesByBoundsService = new GetFeaturesByBoundsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- getFeaturesByBoundsService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.featureService.prototype.getFeaturesByBuffer
- * @description 数据集 buffer 查询服务。
- * @param {SuperMap.GetFeaturesByBufferParameters} params - 数据服务中数据集缓冲区查询参数类。
- * @param {RequestCallback} callback - 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
- */
- getFeaturesByBuffer: function getFeaturesByBuffer(params, callback, resultFormat) {
- var me = this;
- var getFeatureService = new GetFeaturesByBufferService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- getFeatureService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.featureService.prototype.getFeaturesBySQL
- * @description 数据集 SQL 查询服务。
- * @param {SuperMap.GetFeaturesBySQLParameters} params - 数据服务中数据集 SQL 查询参数类。
- * @param {RequestCallback} callback - 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
- */
- getFeaturesBySQL: function getFeaturesBySQL(params, callback, resultFormat) {
- var me = this;
- var getFeatureBySQLService = new GetFeaturesBySQLService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- getFeatureBySQLService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.featureService.prototype.getFeaturesByGeometry
- * @description 数据集几何查询服务类。
- * @param {SuperMap.GetFeaturesByGeometryParameters} params - 数据集几何查询参数类。
- * @param {RequestCallback} callback - 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
- */
- getFeaturesByGeometry: function getFeaturesByGeometry(params, callback, resultFormat) {
- var me = this;
- var getFeaturesByGeometryService = new GetFeaturesByGeometryService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- getFeaturesByGeometryService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.featureService.prototype.editFeatures
- * @description 地物编辑服务。
- * @param {SuperMap.EditFeaturesParameters} params - 数据服务中数据集添加、修改、删除参数类。
- * @param {RequestCallback} callback - 回调函数。
- */
- editFeatures: function editFeatures(params, callback) {
- if (!params || !params.dataSourceName || !params.dataSetName) {
- return;
- }
- var me = this,
- url = me.url,
- dataSourceName = params.dataSourceName,
- dataSetName = params.dataSetName;
- url = Util.urlPathAppend(url, "datasources/" + dataSourceName + "/datasets/" + dataSetName);
- var editFeatureService = new EditFeaturesService(url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- processCompleted: callback,
- processFailed: callback
- }
- });
- editFeatureService.processAsync(me._processParams(params));
- },
- _processParams: function _processParams(params) {
- if (!params) {
- return {};
- }
- params.returnContent = params.returnContent == null ? true : params.returnContent;
- params.fromIndex = params.fromIndex ? params.fromIndex : 0;
- params.toIndex = params.toIndex ? params.toIndex : -1;
- params.isUseBatch = params.isUseBatch == null ? false : params.isUseBatch;
- if (params.bounds) {
- params.bounds = CommontypesConversion.toSuperMapBounds(params.bounds);
- }
- if (params.geometry) {
- params.geometry = toSuperMapGeometry(params.geometry);
- }
- if (params.editType) {
- params.editType = params.editType.toLowerCase();
- }
- var me = this;
- if (params.features) {
- var features = [];
- if (external_L_default().Util.isArray(params.features)) {
- params.features.map(function (feature) {
- features.push(me._createServerFeature(feature));
- return feature;
- });
- } else {
- features.push(me._createServerFeature(params.features));
- }
- params.features = features;
- }
- return params;
- },
- _createServerFeature: function _createServerFeature(geoFeature) {
- var geoJSONFeature,
- feature = {},
- fieldNames = [],
- fieldValues = [];
- geoJSONFeature = geoFeature || {};
- for (var key in geoJSONFeature.properties) {
- fieldNames.push(key);
- fieldValues.push(geoJSONFeature.properties[key]);
- }
- feature.fieldNames = fieldNames;
- feature.fieldValues = fieldValues;
- if (geoJSONFeature.id) {
- feature.id = geoJSONFeature.id;
- }
- feature.geometry = toSuperMapGeometry(geoJSONFeature);
- return feature;
- },
- _processFormat: function _processFormat(resultFormat) {
- return resultFormat ? resultFormat : DataFormat.GEOJSON;
- }
- });
- var featureService = function featureService(url, options) {
- return new FeatureService(url, options);
- };
- (external_L_default()).supermap.featureService = featureService;
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/UnicodeMarker.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.unicodeMarker
- * @classdesc Unicode 字符图标。
- * @category Visualization Marker
- * @extends {L.Path}
- * @param {L.LatLngBounds} latlng - 经纬度坐标。
- * @param {Object} options - 符号参数。
- * @param {string} options.label - 符号 Unicode 值。
- * @param {string} [options.labelRotation='0'] - 符号旋转角度。
- * @param {string} [options.globalAlpha='1'] - 符号的透明值。
- * @param {string} [options.fontStyle='normal'] - 符号的风格。
- * @param {string} [options.fontWeight='normal'] - 符号的粗细。
- * @param {string} [options.fontSize='1em'] - 符号的尺寸。
- * @param {string} [options.fontFamily='sans-serif'] - 符号的字体。
- * @param {string} [options.textAlign='center'] - 符号内容的对齐方式。
- * @param {string} [options.textBaseline='middle'] - 绘制符号时使用的基线。
- * @fires L.supermap.unicodeMarker#move
- */
- var UnicodeMarker = external_L_default().Path.extend({
- // @section
- // @aka CircleMarker options
- options: {
- fontStyle: "normal",
- fontWeight: "normal",
- fontSize: "1em",
- fontFamily: "sans-serif",
- textAlign: "center",
- textBaseline: "middle",
- vfactor: -.5,
- labelRotation: 0,
- globalAlpha: 1,
- label: ""
- },
- initialize: function initialize(latlng, options) {
- external_L_default().Util.setOptions(this, options);
- this._latlng = latlng;
- },
- /**
- * @function L.supermap.unicodeMarker.prototype.setLatLng
- * @description 设置 marker 新坐标。
- * @param {L.LatLng} setLatLng - 需要设置的新坐标。
- */
- setLatLng: function setLatLng(latlng) {
- this._latlng = latlng;
- this.redraw();
- /**
- * @event L.supermap.unicodeMarker#move
- * @description circle marker 重设坐标之后触发。
- * @property {L.LatLng} latlng - 当前 marker 坐标。
- */
- return this.fire('move', {
- latlng: this._latlng
- });
- },
- /**
- * @function L.supermap.unicodeMarker.prototype.getLatLng
- * @description 获取 marker 坐标。
- * @returns {L.LatLng} 返回当前 marker 坐标。
- */
- getLatLng: function getLatLng() {
- return this._latlng;
- },
- _project: function _project() {
- this._point = this._map.latLngToLayerPoint(this._latlng);
- this._updateBounds();
- },
- _updateBounds: function _updateBounds() {
- var w = this._clickTolerance(),
- p = [w, w];
- this._pxBounds = new (external_L_default()).Bounds(this._point.subtract(p), this._point.add(p));
- },
- _update: function _update() {
- if (this._map) {
- this._updatePath();
- }
- },
- _updatePath: function _updatePath() {
- this._renderer._updateUnicode(this);
- },
- // Needed by the `Canvas` renderer for interactivity
- _containsPoint: function _containsPoint(p) {
- return p.distanceTo(this._point) <= this._clickTolerance();
- }
- });
- var unicodeMarker = function unicodeMarker(latlng, options) {
- return new UnicodeMarker(latlng, options);
- };
- external_L_default().Canvas.include({
- _updateUnicode: function _updateUnicode(layer) {
- if (!this._drawing) {
- return;
- }
- var pt = {
- x: layer._point.x,
- y: layer._point.y
- },
- ctx = this._ctx,
- fontStyle = [layer.options.fontStyle, "normal", layer.options.fontWeight, layer.options.fontSize, layer.options.fontFamily].join(" ");
- var label = layer.options.label.replace(/^&#x/, '');
- label = String.fromCharCode(parseInt(label, 16));
- var labelRows = label.split('\n');
- var numRows = labelRows.length; // if (layer.options.labelXOffset || layer.options.labelYOffset) {
- // let xOffset = isNaN(layer.options.labelXOffset) ? 0 : layer.options.labelXOffset;
- // let yOffset = isNaN(layer.options.labelYOffset) ? 0 : layer.options.labelYOffset;
- // pt.x += xOffset;
- // pt.y -= yOffset;
- // }
- ctx.fillStyle = layer.options.fontColor;
- ctx.globalAlpha = 1.0;
- if (layer.options.fontOpacity >= 0 && layer.options.fontOpacity < 1) {
- ctx.globalAlpha = layer.options.fontOpacity;
- }
- if (ctx.fillText) {
- // HTML5
- ctx.font = fontStyle;
- ctx.textAlign = layer.options.textAlign;
- ctx.textBaseline = layer.options.textBaseline;
- var vfactor = layer.options.vfactor;
- var lineHeight = ctx.measureText('Mg').height || ctx.measureText('xx').width;
- pt.y += lineHeight * vfactor * (numRows - 1);
- for (var i = 0; i < numRows; i++) {
- if (layer.options.labelRotation != 0) {
- ctx.save();
- ctx.translate(pt.x, pt.y);
- ctx.rotate(layer.options.labelRotation * Math.PI / 180);
- ctx.fillText(labelRows[i], 0, lineHeight * i);
- ctx.restore();
- } else {
- ctx.fillText(labelRows[i], pt.x, pt.y);
- }
- }
- } else if (ctx.mozDrawText) {
- // Mozilla pre-Gecko1.9.1 (<FF3.1)
- ctx.mozTextStyle = fontStyle; // No built-in text alignment, so we measure and adjust the position
- var hfactor = layer.options.textAlign;
- var _vfactor = layer.options.vfactor;
- var _lineHeight = ctx.mozMeasureText('xx');
- pt.y += _lineHeight * (1 + _vfactor * numRows);
- for (var _i = 0; _i < numRows; _i++) {
- var x = pt.x + hfactor * ctx.mozMeasureText(labelRows[_i]);
- var y = pt.y + _i * _lineHeight;
- ctx.translate(x, y);
- ctx.mozDrawText(labelRows[_i]);
- ctx.translate(-x, -y);
- }
- }
- }
- });
- (external_L_default()).supermap.unicodeMarker = unicodeMarker;
- ;// CONCATENATED MODULE: ./src/leaflet/mapping/WebMap.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.webmap
- * @classdesc 对接 iPortal/Online 地图类。
- * @category iPortal/Online
- * @extends {L.LayerGroup}
- * @param {number} id - iPortal/Online 地图 id。
- * @param {Object} options - 可选参数。
- * @param {string} [options.map='map'] - 地图容器id。
- * @param {string} [options.server='https://www.supermapol.com'] - iPortal/Online 服务地址。
- * @param {boolean} [options.featureLayerPopupEnable=true] - 是否启动要素图层提示框。
- * @param {string} [options.featureLayerPopup] - 提示框提示信息。
- * @param {string} [options.credentialValue] - 证书值。
- * @param {string} [options.credentialKey='key'] - 证书密钥。
- * @param {string} [options.attribution='Map Data <span>© <a href='https://www.supermapol.com' title='SuperMap Online' target='_blank'>SuperMap Online</a></span>'] - 版权信息。
- * @fires L.supermap.webmap#mapLoaded
- * @fires L.supermap.webmap#coordconvertsuccess
- * @fires L.supermap.webmap#coordconvertfailed
- * @fires L.supermap.webmap#featureunselected
- * @fires L.supermap.webmap#featureselected
- * @fires L.supermap.webmap#featuremousemove
- */
- var WebMap = external_L_default().LayerGroup.extend({
- options: {
- map: 'map',
- server: 'https://www.supermapol.com',
- featureLayerPopupEnable: true,
- featureLayerPopup: null,
- credentialValue: null,
- credentialKey: 'key',
- attribution: core_Attributions.Online.attribution
- },
- /**
- * @private
- * @function L.supermap.webmap.prototype.defaultFeatureLayerPopup
- * @description 默认图层弹出框。
- * @param {L.Layer} layer - 指定图层。
- * @returns {string} 图层弹出框内容。
- */
- defaultFeatureLayerPopup: function defaultFeatureLayerPopup(layer) {
- return layer.feature.properties.attributes.title + ":" + layer.feature.properties.attributes.description;
- },
- initialize: function initialize(id, options) {
- if (!id && !options) {
- return;
- }
- this._layers = {};
- external_L_default().setOptions(this, options);
- this.id = id;
- this.load();
- this.cartoCSSToLeaflet = new CartoCSSToLeaflet();
- },
- /**
- * @private
- * @function L.supermap.webmap.prototype.load
- * @description 登陆后添加地图图层。
- */
- load: function load() {
- if (this.options.server.indexOf('http://') < 0 && this.options.server.indexOf('https://') < 0) {
- this.options.server = "http://" + this.options.server;
- }
- var mapUrl = this.options.server + '/web/maps/' + this.id + '.json';
- if (this.options.credentialValue) {
- mapUrl += '?' + this.options.credentialKey + '=' + this.options.credentialValue;
- }
- var me = this;
- FetchRequest.get(mapUrl).then(function (response) {
- return response.json();
- }).then(function (jsonObj) {
- if (!jsonObj) {
- return;
- }
- var layers = jsonObj.layers;
- me.mapInfo = jsonObj;
- me.createLayersByJson(layers);
- });
- },
- /**
- * @private
- * @function L.supermap.webmap.prototype.addLayerWrapper
- * @description 添加图层容器。
- * @param {L.Layer} layer - 待添加的图层。
- * @param {boolean} [isBaseLayer] - 是否为底图层。
- * @param {Object} options - 创建地图的可选参数。
- * @returns {this} this
- */
- addLayerWrapper: function addLayerWrapper(layer, isBaseLayer, options) {
- if (isBaseLayer) {
- this.createMap(options);
- }
- this.addLayer(layer);
- if (layer.labelLayer) {
- this.addLayer(layer.labelLayer);
- }
- return this;
- },
- /**
- * @private
- * @function L.supermap.webmap.prototype.createLayersByJson
- * @description 通过 JSON 创建图层。
- * @param {JSON} layersJson - 图层的 JSON 信息。
- */
- createLayersByJson: function createLayersByJson(layersJson) {
- if (!external_L_default().Util.isArray(layersJson)) {
- return;
- }
- if (layersJson.length === 0) {
- return;
- }
- this.layers = [];
- var layerQueue = [];
- for (var i = 0; i < layersJson.length; i++) {
- var layerJson = layersJson[i];
- layerJson["_originIndex"] = i;
- var layerJsonType = layerJson.layerType = layerJson.layerType || "BASE_LAYER";
- if (layerJsonType !== "BASE_LAYER") {
- //如果图层不是底图,则先加到图层队列里面等待底图完成后再处理
- layerQueue.unshift(layerJson);
- continue;
- } else {
- layerJson.isBaseLayer = true;
- this.createLayer(layerJson.type, layerJson);
- }
- } //底图加载完成后开始处理图层队列里的图层
- while (layerQueue.length > 0) {
- var layerInfo = layerQueue.pop();
- var type = layerInfo.type;
- var layerType = layerInfo.layerType = layerInfo.layerType || "BASE_LAYER";
- if (layerType !== "OVERLAY_LAYER") {
- type = layerType;
- }
- this.createLayer(type, layerInfo);
- }
- /**
- * @event L.supermap.webmap#maploaded
- * @description 底图加载完成后触发。
- * @property {L.Map} map - Leaflet Map 对象。
- */
- this.fire('maploaded', {
- map: this._map
- });
- },
- /**
- * @private
- * @function L.supermap.webmap.prototype.createCRS
- * @description 创建坐标对象。
- * @param {number} epsgCode - epsg 编码。
- * @param {string} type - 坐标类型。
- * @param {number} resolutions - 分辨率。
- * @param {L.Point} origin - 切片原点。
- * @param {L.Bounds} bounds - 地图范围。
- */
- createCRS: function createCRS(epsgCode, type, resolutions, origin, bounds) {
- if (epsgCode < 0) {
- return new NonEarthCRS({
- bounds: bounds,
- origin: origin,
- resolutions: resolutions
- });
- }
- if (epsgCode === 910112 || epsgCode === 910102) {
- return (external_L_default()).CRS.BaiduCRS;
- }
- if (epsgCode === 910111) {
- epsgCode = 3857; //todo 火星mercator
- }
- if (epsgCode === 910101) {
- epsgCode = 4326; //todo 火星
- }
- return external_L_default().Proj.CRS("EPSG:" + epsgCode, {
- origin: origin,
- resolutions: resolutions,
- bounds: bounds
- });
- },
- /**
- * @private
- * @function L.supermap.webmap.prototype.createMap
- * @description 创建地图。
- * @param {Object} options - 创建地图所需参数。
- */
- createMap: function createMap(options) {
- var crs = options.crs || (external_L_default()).CRS.EPSG3857;
- var bounds = external_L_default().latLngBounds(crs.unproject(options.bounds.min), crs.unproject(options.bounds.max));
- this._map = external_L_default().map(this.options.map, {
- center: bounds.getCenter(),
- maxZoom: options.maxZoom || 22,
- minZoom: options.minZoom || 0,
- zoom: options.zoom || 0,
- crs: crs,
- renderer: external_L_default().canvas()
- });
- if (crs instanceof NonEarthCRS) {
- this._map.setZoom(options.zoom ? options.zoom + 2 : 2, {
- maxZoom: options.maxZoom || 22
- });
- } else {
- this._map.fitBounds(bounds, {
- maxZoom: options.maxZoom || 22
- });
- }
- },
- /**
- * @private
- * @function L.supermap.webmap.prototype.getResolutionsFromScales
- * @description 通过比例尺获取分辨率。
- * @param {Array.<number>} scales - 排序比例尺数组。
- * @param {number} dpi - 屏幕分辨率。
- * @param {string} units - 地图的单位。
- * @param {SuperMap.Datum} datum - 大地参照系类。
- * @returns {Array.<number>} 返回给定比例尺所对应的分辨率。
- */
- getResolutionsFromScales: function getResolutionsFromScales(scales, dpi, units, datum) {
- var resolutions = [];
- for (var i = 0; i < scales.length; i++) {
- resolutions.push(external_L_default().Util.GetResolutionFromScaleDpi(scales[i], dpi, units, datum));
- }
- return resolutions;
- },
- /**
- * @private
- * @function L.supermap.webmap.prototype.createLayer
- * @description 创建图层。
- * @param {string} type - 图层类型。
- * @param {Object} layerInfo - 图层信息。
- */
- createLayer: function createLayer(type, layerInfo) {
- var prjCoordSys = layerInfo.prjCoordSys,
- epsgCode = prjCoordSys && prjCoordSys.epsgCode || this.mapInfo.epsgCode,
- center = this.mapInfo.center || layerInfo.center,
- level = this.mapInfo.level || layerInfo.level,
- bounds = this.mapInfo.extent || layerInfo.bounds,
- scales = layerInfo.scales,
- isBaseLayer = layerInfo.isBaseLayer,
- opacity = layerInfo.opacity;
- var mapBounds = external_L_default().bounds([bounds.leftBottom.x, bounds.leftBottom.y], [bounds.rightTop.x, bounds.rightTop.y]);
- var layerBounds = layerInfo.bounds ? external_L_default().bounds([layerInfo.bounds.leftBottom.x, layerInfo.bounds.leftBottom.y], [layerInfo.bounds.rightTop.x, layerInfo.bounds.rightTop.y]) : mapBounds;
- if (!center) {
- center = layerBounds.getCenter();
- }
- var origin = external_L_default().point(layerBounds.min.x, layerBounds.max.y);
- var resolutions = !scales ? null : this.getResolutionsFromScales(scales, 96, layerInfo.units);
- var crs = this.createCRS(epsgCode, prjCoordSys ? prjCoordSys.type : '', resolutions, origin, layerBounds);
- var mapOptions = {
- bounds: mapBounds,
- center: external_L_default().point(center.x, center.y),
- crs: crs,
- zoom: level
- };
- var layer;
- switch (type) {
- case "SUPERMAP_REST":
- layer = tiledMapLayer(layerInfo.url, {
- transparent: true,
- opacity: opacity
- });
- break;
- case "SUPERMAP_REST_VECTOR":
- //ToDO
- break;
- case "TIANDITU_VEC":
- case "TIANDITU_IMG":
- case "TIANDITU_TER":
- mapOptions.crs = epsgCode === 4326 ? (external_L_default()).CRS.TianDiTu_WGS84 : (external_L_default()).CRS.TianDiTu_Mercator;
- mapOptions.minZoom = 1;
- mapOptions.zoom = 1 + mapOptions.zoom;
- layer = this.createTiandituLayer(layerInfo);
- break;
- case "BAIDU":
- mapOptions.crs = (external_L_default()).CRS.BaiduCRS;
- mapOptions.zoom = 3 + mapOptions.zoom;
- mapOptions.minZoom = 3;
- layer = baiduTileLayer();
- break;
- case 'BING':
- //todo
- break;
- case "WMS":
- layer = this.createWmsLayer(layerInfo);
- break;
- case "WMTS":
- mapOptions.resolutions = this.getResolutionsFromScales(scales, 90.71446714322, layerInfo.units);
- var identifier = layerInfo.identifier;
- var layerName = identifier.substring(identifier.indexOf("_") + 1);
- layer = wmtsLayer(layerInfo.url, {
- layer: layerName,
- style: "default",
- tilematrixSet: identifier,
- format: "image/png"
- });
- break;
- case "CLOUD":
- mapOptions.crs = (external_L_default()).CRS.EPSG3857;
- mapOptions.zoom = 3 + mapOptions.zoom;
- mapOptions.minZoom = 3;
- layer = cloudTileLayer(layerInfo.url, {
- opacity: opacity
- });
- break;
- case "MARKER_LAYER":
- layer = this.createMarkersLayer(layerInfo, crs);
- break;
- case "FEATURE_LAYER":
- if (layerInfo.identifier == "ANIMATORVECTOR") {//todo
- } else if (layerInfo.identifier == "THEME") {
- layer = this.createThemeLayer(layerInfo);
- } else {
- layer = this.createVectorLayer(layerInfo, crs);
- }
- break;
- default:
- throw new Error('unSupported Layer Type');
- }
- if (layer && layerInfo.isVisible) {
- this.addLayerWrapper(layer, isBaseLayer, mapOptions);
- }
- },
- /**
- * @private
- * @function L.supermap.webmap.prototype.createTiandituLayer
- * @description 创建天地图图层。
- * @param {Object} layerInfo - 图层信息。
- * @returns {L.supermap.tiandituTileLayer} 返回天地图图层对象。
- */
- createTiandituLayer: function createTiandituLayer(layerInfo) {
- var type = layerInfo.type.split('_')[1].toLowerCase();
- var isLabel = layerInfo.layerType === 'OVERLAY_LAYER';
- var layer = new TiandituTileLayer({
- layerType: type,
- isLabel: isLabel
- });
- return layer;
- },
- /**
- * @private
- * @function L.supermap.webmap.prototype.createMarkersLayer
- * @description 创建图标图层。
- * @param {Object} layerInfo - 图层信息。
- * @param {Object} crs - 坐标对象。
- * @returns {L.Layer} 返回 marker 图层。
- */
- createMarkersLayer: function createMarkersLayer(layerInfo, crs) {
- var that = this;
- var markers = layerInfo.markers || []; //style = layerInfo.style,
- //opacity = layerInfo.opacity,
- //marker, point, size, offset, icon, that = this;
- //todo offset
- var coordsToLatLng = function coordsToLatLng(coords) {
- var ll = crs.unproject(external_L_default().point(coords[0], coords[1]));
- return new (external_L_default()).LatLng(ll.lat, ll.lng, coords[2]);
- };
- var layer = external_L_default().geoJSON(external_L_default().Util.toGeoJSON(markers), {
- pointToLayer: function pointToLayer(geojson, latlng) {
- var m = new (external_L_default()).Marker(latlng);
- m.setStyle = function (style) {
- if (style) {
- m.setIcon(style);
- }
- };
- return m;
- },
- coordsToLatLng: coordsToLatLng,
- style: function style(geoJsonFeature) {
- return that.cartoCSSToLeaflet.getStyleFromiPortalMarker(geoJsonFeature.properties.icon);
- }
- });
- if (this.options.featureLayerPopupEnable) {
- layer.bindPopup(this.options.featureLayerPopup || this.defaultFeatureLayerPopup);
- }
- return layer;
- },
- /**
- * @private
- * @function L.supermap.webmap.prototype.createWmsLayer
- * @description 创建 Wms 图层。
- * @param {Object} layerInfo - 图层信息。
- * @returns {L.Layer} 返回 Wms 图层对象。
- */
- createWmsLayer: function createWmsLayer(layerInfo) {
- var url = layerInfo.url,
- opacity = layerInfo.opacity,
- subLayers = layerInfo.subLayers;
- if (!subLayers || subLayers === "undefined" || subLayers === "null") {
- subLayers = "0";
- }
- return external_L_default().tileLayer.wms(url, {
- layers: subLayers,
- format: 'image/png',
- transparent: true,
- noWrap: true,
- opacity: opacity
- });
- },
- /**
- * @private
- * @function L.supermap.webmap.prototype.createVectorLayer
- * @description 创建矢量要素图层。
- * @param {Object} layerInfo - 图层信息。
- * @param {Object} crs - 坐标对象。
- * @returns {L.Layer} 返回矢量要素图层对象。
- */
- createVectorLayer: function createVectorLayer(layerInfo, crs) {
- var _this = this;
- var _style = layerInfo.style,
- opacity = layerInfo.opacity,
- me = this; //todo readonly = layerInfo.readonly;
- var coordsToLatLng = function coordsToLatLng(coords) {
- var ll = crs.unproject(external_L_default().point(coords[0], coords[1]));
- return new (external_L_default()).LatLng(ll.lat, ll.lng, coords[2]);
- };
- if (!layerInfo.url) {
- var layer = external_L_default().geoJSON(external_L_default().Util.toGeoJSON(layerInfo.features), {
- pointToLayer: function pointToLayer(geojson, latlng) {
- var m = new (external_L_default()).Marker(latlng);
- m.setStyle = function (style) {
- if (style) {
- m.setIcon(style);
- }
- };
- return m;
- },
- coordsToLatLng: coordsToLatLng,
- style: function style(geoJsonFeature) {
- var lStyle = me.cartoCSSToLeaflet.getStyleFromiPortalStyle(_style ? _style : {}, geoJsonFeature.geometry.type, geoJsonFeature.properties.style);
- if (lStyle && lStyle.dashArray && lStyle.dashArray.length == 0) {
- lStyle.dashArray = null;
- }
- return lStyle;
- },
- opacity: opacity
- });
- if (this.options.featureLayerPopupEnable) {
- layer.bindPopup(this.options.featureLayerPopup || this.defaultFeatureLayerPopup);
- }
- return layer;
- } else {
- var url = layerInfo.url,
- datasourceName = layerInfo.name,
- datasets = layerInfo.features;
- for (var setNameIndex = 0; setNameIndex < datasets.length; setNameIndex++) {
- var dataset = datasets[setNameIndex];
- if (dataset.visible) {
- this.getFeaturesBySQL(url, datasourceName, dataset.name, "", DataFormat.GEOJSON, function (serviceResult) {
- var layer = external_L_default().geoJSON(serviceResult.result, {
- pointToLayer: function pointToLayer(geojson, latlng) {
- var m = new (external_L_default()).Marker(latlng);
- m.setStyle = function (style) {
- if (style) {
- m.setIcon(style);
- }
- };
- return m;
- },
- coordsToLatLng: coordsToLatLng,
- style: function style(geoJsonFeature) {
- return this.cartoCSSToLeaflet.getStyleFromiPortalStyle(_style ? _style : {}, geoJsonFeature.geometry.type, geoJsonFeature.properties.style);
- },
- opacity: opacity
- });
- if (_this.options.featureLayerPopupEnable) {
- layer.bindPopup(me.options.featureLayerPopup || me.defaultFeatureLayerPopup);
- }
- _this.addLayer(layer);
- });
- }
- }
- }
- },
- getFeaturesBySQL: function getFeaturesBySQL(url, datasourceName, datasetName, filter, format, callback) {
- filter = filter || "SMID > 0";
- var sqlParam = new GetFeaturesBySQLParameters({
- queryParameter: {
- name: datasetName + "@" + datasourceName,
- attributeFilter: filter
- },
- datasetNames: [datasourceName + ":" + datasetName],
- fromIndex: 0,
- toIndex: 100000
- });
- featureService(url).getFeaturesBySQL(sqlParam, callback, format);
- },
- /**
- * @private
- * @function L.supermap.webmap.prototype.createThemeLayer
- * @description 创建专题图图层。
- * @param {Object} layerInfo - 图层信息。
- * @returns {L.Layer} 返回专题图图层对象。
- */
- createThemeLayer: function createThemeLayer(layerInfo) {
- var _this2 = this;
- var themeSettings = layerInfo.themeSettings && JSON.parse(layerInfo.themeSettings);
- var layer;
- var type = themeSettings.type;
- layerInfo.themeSettings = themeSettings;
- if (type === "HEAT") {
- layer = this.createHeatLayer(layerInfo, themeSettings);
- } else if (type === "UNIQUE") {
- layer = this.createUniqueLayer(layerInfo, themeSettings);
- } else if (type === "RANGE") {
- layer = this.createRangeLayer(layerInfo, themeSettings);
- } else {
- layer = this.createBaseThemeLayer(layerInfo, themeSettings);
- }
- if (layer) {
- this.addFeature2ThemeLayer(layerInfo, layer);
- layer.on('add', function (e) {
- _this2.registerThemeEvent(e.target);
- });
- }
- if (themeSettings && themeSettings.labelField) {
- var labelLayer = this.createLabelLayer(layerInfo, themeSettings);
- labelLayer.on('add', function (e) {
- _this2.registerThemeEvent(e.target);
- });
- layer.labelLayer = labelLayer;
- }
- return layer;
- },
- createBaseThemeLayer: function createBaseThemeLayer(layerInfo, themeSettings) {
- var style = layerInfo.style,
- opacity = layerInfo.opacity,
- vectorType = themeSettings.vectorType,
- featureStyle = style.pointStyle;
- if (vectorType === "LINE") {
- featureStyle.fill = false;
- } else {
- featureStyle.fill = true;
- }
- var pointStyle = {};
- pointStyle.radius = featureStyle.pointRadius;
- pointStyle.color = featureStyle.strokeColor;
- pointStyle.opacity = featureStyle.strokeOpacity;
- pointStyle.lineCap = featureStyle.strokeLineCap;
- pointStyle.weight = featureStyle.strokeWidth;
- pointStyle.fillColor = featureStyle.fillColor;
- pointStyle.fillOpacity = featureStyle.fillOpacity;
- var pointToLayer = function pointToLayer(geojson, latlng) {
- return external_L_default().circleMarker(latlng, pointStyle);
- };
- if (featureStyle.unicode) {
- pointToLayer = function pointToLayer(geojson, latlng) {
- return new UnicodeMarker(latlng, featureStyle);
- };
- }
- return external_L_default().geoJSON({
- type: "GeometryCollection",
- geometries: []
- }, {
- pointToLayer: pointToLayer,
- opacity: opacity
- }); //this.registerVectorEvent(vector);
- },
- createUniqueLayer: function createUniqueLayer(layerInfo, themeSettings) {
- var title = layerInfo.title;
- var themeField = themeSettings.field,
- styleGroups = [],
- settings = themeSettings.settings,
- isVisible = layerInfo.isVisible,
- opacity = layerInfo.opacity,
- vectorType = themeSettings.vectorType; //组成styleGroup
- for (var i = 0; i < settings.length; i++) {
- var object = {};
- object.value = settings[i].value;
- object.style = settings[i].style;
- styleGroups.push(object);
- }
- var unique = new UniqueThemeLayer(title, {
- opacity: opacity,
- visibility: isVisible
- });
- this.registerThemeEvent(unique);
- unique.style = layerInfo.style.pointStyle;
- if (vectorType === "LINE") {
- unique.style.fill = false;
- } else {
- unique.style.fill = true;
- }
- unique.style.stroke = true;
- unique.themeField = themeField;
- unique.styleGroups = styleGroups;
- var that = this;
- unique.on('click', function (event) {
- if (event.target && event.target.refDataID) {
- var currenFeature = unique.getFeatureById(event.target.refDataID);
- that.events.triggerEvent("uniquefeatureclicked", currenFeature, unique);
- }
- });
- return unique;
- },
- createRangeLayer: function createRangeLayer(layerInfo, themeSettings) {
- var title = layerInfo.title;
- var themeField = themeSettings.field,
- styleGroups = [],
- settings = themeSettings.settings,
- isVisible = layerInfo.isVisible,
- opacity = layerInfo.opacity,
- vectorType = themeSettings.vectorType,
- featureStyle = layerInfo.style.pointStyle;
- if (vectorType === "LINE") {
- featureStyle.fill = false;
- } else {
- featureStyle.fill = true;
- } //组成styleGroup
- for (var i = 0; i < settings.length; i++) {
- var object = {};
- object.start = settings[i].start;
- object.end = settings[i].end;
- object.style = settings[i].style;
- styleGroups.push(object);
- }
- var range = new RangeThemeLayer(title, {
- visibility: isVisible,
- opacity: opacity
- });
- this.registerThemeEvent(range);
- range.style = layerInfo.style.pointStyle;
- range.style.stroke = true;
- range.themeField = themeField;
- range.styleGroups = styleGroups;
- return range;
- },
- createLabelLayer: function createLabelLayer(layerInfo, themeSettings) {
- var title = layerInfo.title;
- var labelField = themeSettings.labelField,
- settings = themeSettings.settings,
- isVisible = layerInfo.isVisible; //目前只是同一样式
- var style;
- if (!settings || settings.length > 0) {
- style = {
- "fillColor": "#ffffff"
- };
- } else {
- style = settings[0].style;
- }
- var layerStyle = external_L_default().Util.extend(new ThemeStyle(), style);
- layerStyle.fontWeight = "bold";
- layerStyle.fontSize = "14px"; //默认显示标签边框背景
- layerStyle.labelRect = true;
- layerStyle.strokeColor = layerStyle.fillColor;
- layerStyle.fontColor = themeSettings.labelColor;
- if (themeSettings.labelFont) {
- layerStyle.fontFamily = themeSettings.labelFont;
- }
- var label = new LabelThemeLayer(title, {
- visibility: isVisible,
- opacity: 0.7
- });
- this.registerThemeEvent(label);
- label.style = layerStyle;
- label.themeField = labelField; //styleGroup, 目前只是同一样式
- label.styleGroups = [];
- return label;
- },
- createHeatLayer: function createHeatLayer(layerInfo, themeSettings) {
- var colors = themeSettings.colors || ['blue', 'cyan', 'lime', 'yellow', 'red'];
- var gradient = {},
- featureWeight;
- for (var i = 0, len = colors.length, index = 1; i < len; i++) {
- gradient[index / len] = colors[i];
- index++;
- }
- var radius = themeSettings.settings[0].radius; //判断单位
- if (themeSettings.heatUnit === "千米" || themeSettings.heatUnit === "km") {
- radius = themeSettings.heatRadius * 1000;
- } //权重
- if (themeSettings.settings[0] && themeSettings.settings[0].featureWeight) {
- featureWeight = themeSettings.settings[0].featureWeight;
- }
- return external_L_default().heatLayer([], {
- radius: radius / 2,
- minOpacity: layerInfo.opacity,
- gradient: gradient,
- blur: radius / 2,
- featureWeight: featureWeight
- });
- },
- addFeature2ThemeLayer: function addFeature2ThemeLayer(layerInfo, layer) {
- var _this3 = this;
- if (layerInfo.layerType !== "FEATURE_LAYER" || layerInfo.identifier !== "THEME") {
- return;
- }
- var me = this;
- var isRestData = !!layerInfo.datasourceName;
- var cartoCSS = layerInfo.cartoCSS;
- if (cartoCSS) {
- var needTransform = this.getCartoCSS2Obj(cartoCSS).needTransform;
- var isAddFile = this.getCartoCSS2Obj(cartoCSS).isAddFile;
- }
- var url = layerInfo.url,
- subLayers,
- subLayer,
- layerName,
- credential = layerInfo.credential,
- themeSettings = layerInfo.themeSettings,
- filter = themeSettings.filter;
- if (isAddFile) {
- var position = JSON.parse(layerInfo.datasourceName);
- var sql = this.getSQLFromFilter(filter);
- if (url) {
- this.getFeatureFromFileAdded(layerInfo, function (data) {
- var sFeaturesArr = [],
- features,
- result;
- if (data.type === 'EXCEL' || data.type === 'CSV') {
- features = me.parseFeatureFromEXCEL.apply(me, [data.content.rows, data.content.colTitles, false, position]);
- for (var x = 0, len = features.length; x < len; x++) {
- result = jsonsql_default()({
- attr: features[x].attributes
- }, sql);
- if (result.length > 0) {
- sFeaturesArr.push(features[x]);
- }
- }
- } else {
- features = me.parseFeatureFromJson(data.content);
- for (var i = 0, length = features.length; i < length; i++) {
- result = jsonsql_default()({
- attr: features[i].attributes
- }, sql);
- if (result.length > 0) {
- sFeaturesArr.push(features[i]);
- }
- }
- }
- var newEpsgCode = '4326',
- oldEpsgCode = layerInfo.prjCoordSys && layerInfo.prjCoordSys.epsgCode;
- if (needTransform) {
- me.changeFeatureLayerEpsgCode(oldEpsgCode, newEpsgCode, layer, sFeaturesArr, function (features) {
- addFeatures(features);
- });
- } else {
- addFeatures(sFeaturesArr);
- }
- }, function () {});
- } else {
- var newFeautures = [],
- features = layerInfo.features;
- for (var i = 0, len = features.length; i < len; i++) {
- var feature = features[i];
- var sqlResult = jsonsql_default()({
- attr: feature.attributes
- }, sql);
- if (sqlResult.length > 0) {
- var lon = feature.geometry.points[0].x,
- lat = feature.geometry.points[0].y;
- var point = new Point(lon, lat);
- var vector = new Vector(point, feature.attributes, feature.style);
- newFeautures.push(vector);
- }
- }
- addFeatures(newFeautures);
- }
- } else if (isRestData) {
- var dataSourceName = layerInfo.datasourceName;
- subLayers = layerInfo.subLayers && JSON.parse(layerInfo.subLayers);
- if (subLayers.length && subLayers.length > 0) {
- subLayer = subLayers[0];
- } else {
- subLayer = subLayers;
- }
- layerName = subLayer && subLayer.name;
- this.getFeaturesBySQL(layerInfo.url, dataSourceName, layerName, themeSettings.filter, DataFormat.ISERVER, function (getFeaturesEventArgs) {
- var features,
- feature,
- result = getFeaturesEventArgs.result,
- addedFeatures = [];
- if (result && result.features) {
- features = result.features;
- for (var fi = 0, felen = features.length; fi < felen; fi++) {
- feature = ServerFeature.fromJson(features[fi]).toFeature();
- addedFeatures.push(feature);
- }
- var newEpsgCode = '4326',
- oldEpsgCode = layerInfo.prjCoordSys && layerInfo.prjCoordSys.epsgCode;
- if (needTransform) {
- _this3.changeFeatureLayerEpsgCode(oldEpsgCode, newEpsgCode, layer, addedFeatures, function (features) {
- addFeatures(features);
- });
- } else {
- addFeatures(features);
- }
- }
- });
- } else {
- subLayers = layerInfo.subLayers && JSON.parse(layerInfo.subLayers);
- if (subLayers.length && subLayers.length > 0) {
- subLayer = subLayers[0];
- } else {
- subLayer = subLayers;
- }
- layerName = subLayer && subLayer.name;
- var oldEpsgCode = layerInfo.prjCoordSys && layerInfo.prjCoordSys.epsgCode;
- this.getFeaturesBySQL(url, credential, layerName, filter, DataFormat.ISERVER, function (features) {
- var newEpsgCode = '4326';
- if (needTransform) {
- me.changeFeatureLayerEpsgCode(oldEpsgCode, newEpsgCode, layer, features, function (features) {
- addFeatures(features);
- });
- } else {
- addFeatures(features);
- }
- });
- }
- function addFeatures(features) {
- if (layer && layer.labelLayer instanceof LabelThemeLayer) {
- me.addFeature2LabelLayer(layer.labelLayer, features, layerInfo);
- }
- if ((external_L_default()).HeatLayer && layer instanceof (external_L_default()).HeatLayer) {
- var heatPoints = [];
- for (var _i = 0, _len = features.length; _i < _len; _i++) {
- var geometry = features[_i].geometry;
- heatPoints[_i] = external_L_default().latLng(geometry.y, geometry.x);
- if (layer.options.featureWeight) {
- heatPoints[_i] = [heatPoints[_i].lat, heatPoints[_i].lng, parseFloat(features[_i].attributes[layer.options.featureWeight])];
- }
- }
- layer.setLatLngs(heatPoints);
- } else if (layer instanceof (external_L_default()).GeoJSON) {
- layer.addData(new GeoJSON().toGeoJSON(features));
- } else {
- layer.addFeatures(features);
- }
- }
- },
- addFeature2LabelLayer: function addFeature2LabelLayer(layer, features, layerInfo) {
- if (!features) {
- return;
- }
- var feature, geoTextFeature;
- var themeSettings = layerInfo.themeSettings;
- themeSettings = typeof themeSettings === "string" ? JSON.parse(layerInfo.themeSettings) : layerInfo.themeSettings;
- var themeField = themeSettings.labelField;
- var style = layer.style;
- var labelFeatures = [],
- lngLat;
- var styleInfo = layerInfo.styleString && JSON.parse(layerInfo.styleString);
- for (var i = 0; i < features.length; i++) {
- lngLat = this.getLabelLngLat(themeSettings.vectorType, features[i]); //设置标签的偏移量
- this.setLabelOffset(themeSettings.vectorType, styleInfo, features[i], style);
- feature = features[i];
- var attributes = feature.attributes;
- geoTextFeature = new ThemeFeature([lngLat.lat, lngLat.lng, attributes[themeField]], attributes);
- labelFeatures.push(geoTextFeature);
- }
- layer.style = style;
- layer.addFeatures(labelFeatures);
- },
- setLabelOffset: function setLabelOffset(vectorType, styleInfo, feature, layerStyle) {
- if (vectorType === 'POINT') {
- var pointRadius = styleInfo.pointStyle.pointRadius || 0;
- var strokeWidth = styleInfo.pointStyle.strokeWidth || 0;
- var fontSize = parseInt(styleInfo.pointStyle.fontSize) || 0;
- layerStyle.labelXOffset = 0;
- layerStyle.labelYOffset = styleInfo.pointStyle.unicode ? 20 + fontSize : 25 + (pointRadius + strokeWidth);
- } else {
- return;
- }
- },
- getLabelLngLat: function getLabelLngLat(vectorType, feature) {
- var lngLat = {};
- if (vectorType === 'POINT') {
- var geometry = feature.geometry;
- lngLat.lng = geometry.x;
- lngLat.lat = geometry.y;
- } else if (vectorType === 'LINE') {
- //一条线所有顶点的数量
- var length, index;
- var components = feature.geometry.components;
- if (components[0].x) {
- //说明是lineString类型
- length = components.length; //线取中间点下一个显示标签
- index = parseInt(length / 2);
- lngLat.lng = components[index].x;
- lngLat.lat = components[index].y;
- } else {
- //说明是MultiLineString类型,取第一条线
- var lineOne = components[0].components;
- length = lineOne.length;
- index = parseInt(length / 2);
- lngLat.lng = lineOne[index].x;
- lngLat.lat = lineOne[index].y;
- }
- } else {
- var centroid = feature.geometry.getCentroid();
- lngLat.lng = centroid.x;
- lngLat.lat = centroid.y;
- }
- return lngLat;
- },
- changeFeatureLayerEpsgCode: function changeFeatureLayerEpsgCode(oldEpsgCode, newEpsgCode, layer, features, success) {
- var me = this,
- i,
- len;
- var points = [];
- if (!oldEpsgCode || !newEpsgCode) {
- return;
- }
- if (features && features.length > 0) {
- for (i = 0, len = features.length; i < len; i++) {
- var feature = features[i];
- var geometry = feature.geometry;
- var vertices = geometry.getVertices();
- points = points.concat(vertices);
- }
- oldEpsgCode = 'EPSG:' + oldEpsgCode;
- newEpsgCode = 'EPSG:' + newEpsgCode;
- me.coordsTransform(oldEpsgCode, newEpsgCode, points, function (layer, features) {
- return function (newCoors) {
- var start = 0,
- len = newCoors.length;
- for (i = start; i < len; i++) {
- var point = points[i],
- coor = newCoors[i];
- point.x = coor.x;
- point.y = coor.y;
- point.calculateBounds();
- }
- for (i = 0, len = features.length; i < len; i++) {
- var feature = features[i];
- var geometry = feature.geometry;
- if (geometry.components) {
- me.calculateComponents(geometry.components);
- }
- geometry.calculateBounds();
- }
- success && success.call(me, features);
- };
- }(layer, features));
- }
- return true;
- },
- calculateComponents: function calculateComponents(components) {
- if (components) {
- if (components.components) {
- this.calculateComponents(components.components);
- } else {
- for (var i = 0, len = components.length; i < len; i++) {
- var component = components[i];
- if (component.components) {
- this.calculateComponents(component.components);
- }
- component.calculateBounds();
- }
- }
- }
- },
- coordsTransform: function coordsTransform(fromEpsg, toEpsg, point, success) {
- var newCoord;
- var from = this.SERVER_TYPE_MAP[fromEpsg],
- to = this.SERVER_TYPE_MAP[toEpsg];
- if (fromEpsg === toEpsg || !from || !to) {
- if (point && point.length !== undefined) {
- newCoord = [];
- for (var i = 0, len = point.length; i < len; i++) {
- var coor = {
- x: point[i].x,
- y: point[i].y
- };
- newCoord.push(coor);
- }
- } else {
- newCoord = {
- x: point.x,
- y: point.y
- };
- }
- if (success) {
- success.call(this, newCoord);
- }
- } else {
- var mercator = this.SERVER_TYPE_MAP['EPSG:3857'],
- wgs84 = this.SERVER_TYPE_MAP['EPSG:4326'];
- if ((from === mercator || from === wgs84) && (to === mercator || to === wgs84)) {
- this.projTransform(fromEpsg, toEpsg, point, success);
- } else {
- var convertType = from + '_' + to;
- this.postTransform(convertType, point, success);
- }
- }
- },
- projTransform: function projTransform(fromEpsg, toEpsg, point, success) {
- var newCoor,
- me = this;
- if (!lib) {
- return;
- }
- if (point && point.length !== undefined) {
- newCoor = [];
- for (var i = 0, len = point.length; i < len; i++) {
- var coor = lib(fromEpsg, toEpsg, [point[i].x, point[i].y]);
- newCoor.push({
- x: coor[0],
- y: coor[1]
- });
- }
- } else {
- newCoor = lib(fromEpsg, toEpsg, [point.x, point.y]);
- newCoor = {
- x: newCoor[0],
- y: newCoor[1]
- };
- }
- if (success) {
- /**
- * @event L.supermap.webmap#coordconvertsuccess
- * @description 坐标转换成功后触发。
- * @property {L.latLng} newCoor - 转换成功后的坐标。
- */
- me.fire('coordconvertsuccess', {
- newCoor: newCoor
- });
- success.call(me, newCoor);
- }
- },
- postTransform: function postTransform(convertType, point, success) {
- var _this4 = this;
- var me = this,
- epsgArray = [];
- if (!convertType) {
- return success.call(me, null);
- }
- if (point && point.length !== undefined) {
- for (var i = 0, len = point.length; i < len; i++) {
- epsgArray.push({
- x: point[i].x,
- y: point[i].y
- });
- }
- } else {
- epsgArray = [{
- x: point.x,
- y: point.y
- }];
- }
- if (epsgArray.length === 0) {
- return success.call(me, null);
- }
- var postData = {
- "convertType": convertType,
- "points": epsgArray
- };
- var url = this.server + "/apps/viewer/coordconvert.json";
- postData = JSON.stringify(postData);
- var options = {};
- if (!Util.isInTheSameDomain(url) && this.proxy) {
- options.proxy = this.proxy;
- }
- FetchRequest.post(url, postData, options).then(function (response) {
- return response.json();
- }).then(function (jsonObj) {
- var newCoors = jsonObj;
- if (!point && point.length !== undefined) {
- newCoors = newCoors[0];
- }
- _this4.fire('coordconvertsuccess', {
- newCoors: newCoors
- });
- success.call(_this4, newCoors);
- })["catch"](function (err) {
- if (!_this4.actived) {
- return;
- }
- /**
- * @event L.supermap.webmap#coordconvertfailed
- * @description 坐标转换失败后触发。
- * @property {Object} err - error 对象。
- */
- _this4.fire('coordconvertfailed', {
- err: err
- });
- });
- },
- getSQLFromFilter: function getSQLFromFilter(filter) {
- if (!filter) {
- return ' * where (1==1||1>=0)';
- } else {
- filter = filter.replace(/=/g, '==').replace(/and|AND/g, '&&').replace(/or|OR/g, '||').replace(/>==/g, '>=').replace(/<==/g, '<=');
- return ' * where (' + filter + ')';
- }
- },
- getAttributesObjFromTable: function getAttributesObjFromTable(cols, colTitles) {
- if (cols.length === 0 || colTitles.length === 0) {
- return;
- }
- var attrArr = [];
- for (var i = 0; i < cols.length; i++) {
- var obj = {};
- for (var j = 0; j < colTitles.length; j++) {
- obj[colTitles[j]] = cols[i][j];
- }
- attrArr.push(obj);
- }
- return attrArr;
- },
- parseFeatureFromEXCEL: function parseFeatureFromEXCEL(rows, colTitles, isGraphic, position) {
- var attrArr = this.getAttributesObjFromTable(rows, colTitles);
- var features = [];
- for (var i = 0, len = attrArr.length; i < len; i++) {
- var lon = attrArr[i][position["lon"]];
- var lat = attrArr[i][position["lat"]];
- if (!lon || !lat) {
- continue;
- }
- lon = parseFloat(lon);
- lat = parseFloat(lat);
- var geometry = new Point(lon, lat);
- var pointGraphic;
- if (isGraphic) {
- pointGraphic = new Graphic(geometry, attrArr[i], null);
- } else {
- pointGraphic = new Vector(geometry, attrArr[i], null);
- }
- features.push(pointGraphic);
- }
- return features;
- },
- parseFeatureFromJson: function parseFeatureFromJson(feature) {
- var format = new GeoJSON();
- var features = format.read(feature); //兼容insights数据格式
- if (features == null) {
- var content = JSON.parse(feature.replace(/'/, '"'));
- if (content.isAnalyseResult || content.type === 'MapEditor' || content.type === 'DataInsights' || content.type === 'ISERVER') {
- content = content.data.recordsets[0].features;
- }
- format = new GeoJSON();
- features = format.read(content);
- }
- for (var i = 0, len = features.length; i < len; i++) {
- features[i].attributes = features[i].attributes.properties || features[i].attributes;
- }
- return features;
- },
- getFeatureFromFileAdded: function getFeatureFromFileAdded(layerInfo, success, failed, isGraphic) {
- var url = isGraphic ? layerInfo.url + '?currentPage=1&&pageSize=9999999' : layerInfo.url;
- FetchRequest.get(url).then(function (response) {
- return response.json();
- }).then(function (data) {
- success && success(data);
- })["catch"](function (err) {
- return failed && failed(err);
- });
- },
- getCartoCSS2Obj: function getCartoCSS2Obj(cartoCSS) {
- var isAddFile,
- needTransform = false;
- if (cartoCSS.indexOf('}') > -1) {
- cartoCSS = JSON.parse(cartoCSS);
- needTransform = cartoCSS.needTransform;
- isAddFile = cartoCSS.isAddFile;
- } else {
- if (cartoCSS === 'needTransform') {
- needTransform = true; //layerInfo.needTransform = true;
- isAddFile = false;
- } else {
- isAddFile = cartoCSS === 'true';
- }
- }
- return {
- isAddFile: isAddFile,
- needTransform: needTransform
- };
- },
- registerThemeEvent: function registerThemeEvent(themeLayer) {
- var _this5 = this;
- themeLayer.on('click', function (evt) {
- if (!themeLayer.map) {
- return;
- }
- if (_this5.selectedFeature) {
- /**
- * @event L.supermap.webmap#featureunselected
- * @description 重置选中的要素为空。
- * @property {SuperMap.Feature.Vector} feature - 在重置之前选中的要素。
- */
- _this5.fire('featureunselected', {
- feature: _this5.selectedFeature
- });
- _this5.selectedFeature = null;
- }
- var feature;
- if (evt.target && evt.target.refDataID) {
- feature = themeLayer.getFeatureById(evt.target.refDataID);
- }
- if (feature) {
- _this5.selectedFeature = feature;
- /**
- * @event L.supermap.webmap#featureselected
- * @description 点击要素,要素存在之后触发。设置选中的要素。
- * @property {SuperMap.Feature.Vector} feature - 点击的要素。
- */
- _this5.fire('featureselected', {
- feature: feature
- });
- }
- });
- themeLayer.on('mousemove', function (evt) {
- if (!themeLayer.map) {
- return;
- }
- if (evt.target && evt.target.refDataID) {
- var feature;
- if (evt.target && evt.target.refDataID) {
- feature = themeLayer.getFeatureById(evt.target.refDataID);
- }
- if (feature) {
- /**
- * @event L.supermap.webmap#featuremousemove
- * @description 鼠标移动到要素上之后触发。
- * @property {SuperMap.Feature.Vector} feature - 当前被移动到的要素。
- */
- _this5.fire('featuremousemove', {
- feature: feature
- });
- }
- }
- });
- },
- SERVER_TYPE_MAP: {
- "EPSG:4326": "WGS84",
- "EPSG:3857": "MERCATOR",
- "EPSG:900913": "MERCATOR",
- "EPSG:102113": "MERCATOR",
- "EPSG:910101": "GCJ02",
- "EPSG:910111": "GCJ02MERCATOR",
- "EPSG:910102": "BD",
- "EPSG:910112": "BDMERCATOR"
- }
- });
- var webMap = function webMap(id, options) {
- return new WebMap(id, options);
- };
- (external_L_default()).supermap.webmap = webMap;
- ;// CONCATENATED MODULE: ./src/leaflet/mapping/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/leaflet/services/DataFlowService.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.dataFlowService
- * @classdesc 数据流服务类。
- * @category iServer DataFlow
- * @extends {L.supermap.ServiceBase}
- * @param {string} url - 数据流服务地址。
- * @param {Object} options - 参数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
- * @param {Function} [options.style] - 设置数据加载样式。
- * @param {Function} [options.onEachFeature] - 设置每个数据加载 popup 等。
- * @param {GeoJSONObject} [options.geometry] - 指定几何范围,该范围内的要素才能被订阅。
- * @param {Object} [options.excludeField] - 排除字段。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @fires L.supermap.dataFlowService#broadcastSocketConnected
- * @fires L.supermap.dataFlowService#broadcastSocketError
- * @fires L.supermap.dataFlowService#broadcastFailed
- * @fires L.supermap.dataFlowService#broadcastSucceeded
- * @fires L.supermap.dataFlowService#subscribeSocketError
- * @fires L.supermap.dataFlowService#messageSucceeded
- * @fires L.supermap.dataFlowService#setFilterParamSucceeded
- */
- var DataFlowService_DataFlowService = ServiceBase.extend({
- options: {
- geometry: null,
- prjCoordSys: null,
- excludeField: null
- },
- initialize: function initialize(url, options) {
- options = options || {};
- external_L_default().setOptions(this, options);
- if (options.projection) {
- this.options.prjCoordSys = options.projection;
- }
- ServiceBase.prototype.initialize.call(this, url, options);
- this.dataFlow = new DataFlowService(url, options);
- /**
- * @event L.supermap.dataFlowService#broadcastSocketConnected
- * @description broadcast Socket 连接成功。
- */
- /**
- * @event L.supermap.dataFlowService#broadcastSocketError
- * @description broadcast Socket 连接失败。
- */
- /**
- * @event L.supermap.dataFlowService#broadcastFailed
- * @description 广播失败。
- */
- /**
- * @event L.supermap.dataFlowService#broadcastSucceeded
- * @description 广播成功。
- */
- /**
- * @event L.supermap.dataFlowService#subscribeSocketConnected
- * @description 订阅数据连接成功。
- */
- /**
- * @event L.supermap.dataFlowService#subscribeSocketError
- * @description 订阅数据连接失败。
- */
- /**
- * @event L.supermap.dataFlowService#messageSucceeded
- * @description 获取信息成功。
- */
- /**
- * @event L.supermap.dataFlowService#setFilterParamSucceeded
- * @description 设置过滤参数成功。
- */
- this.dataFlow.events.on({
- "broadcastSocketConnected": this._defaultEvent,
- "broadcastSocketError": this._defaultEvent,
- "broadcastFailed": this._defaultEvent,
- "broadcastSucceeded": this._defaultEvent,
- "subscribeSocketConnected": this._defaultEvent,
- "subscribeSocketError": this._defaultEvent,
- "messageSucceeded": this._defaultEvent,
- "setFilterParamSucceeded": this._defaultEvent,
- scope: this
- });
- },
- /**
- * @function L.supermap.dataFlowService.prototype.initBroadcast
- * @description 初始化广播。
- */
- initBroadcast: function initBroadcast() {
- this.dataFlow.initBroadcast();
- return this;
- },
- /**
- * @function L.supermap.dataFlowService.prototype.broadcast
- * @description 加载广播数据。
- * @param {JSONObject} obj - JSON 格式的要素数据。
- */
- broadcast: function broadcast(obj) {
- this.dataFlow.broadcast(obj);
- },
- /**
- * @function L.supermap.dataFlowService.prototype.initSubscribe
- * @description 初始化订阅数据。
- */
- initSubscribe: function initSubscribe() {
- this.dataFlow.initSubscribe();
- return this;
- },
- /**
- * @function L.supermap.dataFlowService.prototype.setExcludeField
- * @description 设置排除字段。
- * @param {Object} excludeField - 排除字段。
- */
- setExcludeField: function setExcludeField(excludeField) {
- this.dataFlow.setExcludeField(excludeField);
- this.options.excludeField = excludeField;
- return this;
- },
- /**
- * @function L.supermap.dataFlowService.prototype.setGeometry
- * @description 设置添加的 GeoJSON 几何要素数据。
- * @param {GeoJSONObject} geometry - 指定几何范围,该范围内的要素才能被订阅。
- */
- setGeometry: function setGeometry(geometry) {
- this.dataFlow.setGeometry(geometry);
- this.options.geometry = geometry;
- return this;
- },
- /**
- * @function L.supermap.dataFlowService.prototype.unSubscribe
- * @description 结束订阅数据。
- */
- unSubscribe: function unSubscribe() {
- this.dataFlow.unSubscribe();
- },
- /**
- * @function L.supermap.dataFlowService.prototype.unBroadcast
- * @description 结束加载广播。
- */
- unBroadcast: function unBroadcast() {
- this.dataFlow.unBroadcast();
- },
- _defaultEvent: function _defaultEvent(e) {
- this.fire(e.eventType || e.type, e);
- }
- });
- var dataFlowService = function dataFlowService(url, options) {
- return new DataFlowService_DataFlowService(url, options);
- };
- (external_L_default()).supermap.dataFlowService = dataFlowService;
- ;// CONCATENATED MODULE: external "function(){try{return mapv}catch(e){return {}}}()"
- var external_function_try_return_mapv_catch_e_return_namespaceObject = function(){try{return mapv}catch(e){return {}}}();
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/mapv/MapVRenderer.js
- function MapVRenderer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MapVRenderer_typeof = function _typeof(obj) { return typeof obj; }; } else { MapVRenderer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MapVRenderer_typeof(obj); }
- function MapVRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function MapVRenderer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function MapVRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapVRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapVRenderer_defineProperties(Constructor, staticProps); return Constructor; }
- function MapVRenderer_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { MapVRenderer_get = Reflect.get; } else { MapVRenderer_get = function _get(target, property, receiver) { var base = MapVRenderer_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return MapVRenderer_get(target, property, receiver || target); }
- function MapVRenderer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MapVRenderer_getPrototypeOf(object); if (object === null) break; } return object; }
- function MapVRenderer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) MapVRenderer_setPrototypeOf(subClass, superClass); }
- function MapVRenderer_setPrototypeOf(o, p) { MapVRenderer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MapVRenderer_setPrototypeOf(o, p); }
- function MapVRenderer_createSuper(Derived) { var hasNativeReflectConstruct = MapVRenderer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MapVRenderer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MapVRenderer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MapVRenderer_possibleConstructorReturn(this, result); }; }
- function MapVRenderer_possibleConstructorReturn(self, call) { if (call && (MapVRenderer_typeof(call) === "object" || typeof call === "function")) { return call; } return MapVRenderer_assertThisInitialized(self); }
- function MapVRenderer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- function MapVRenderer_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; } }
- function MapVRenderer_getPrototypeOf(o) { MapVRenderer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MapVRenderer_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- var BaseLayer = external_function_try_return_mapv_catch_e_return_namespaceObject.baiduMapLayer ? external_function_try_return_mapv_catch_e_return_namespaceObject.baiduMapLayer.__proto__ : Function;
- /**
- * @class L.supermap.MapVRenderer
- * @classdesc 地图渲染类。
- * @category Visualization MapV
- * @private
- * @extends mapv.BaseLayer
- * @param {L.Map} map - 待渲染的地图。
- * @param {L.Layer} layer - 待渲染的图层。
- * @param {DataSet} dataSet - 待渲染的数据集。
- * @param {Object} options - 渲染的参数。
- */
- var MapVRenderer = /*#__PURE__*/function (_BaseLayer) {
- MapVRenderer_inherits(MapVRenderer, _BaseLayer);
- var _super = MapVRenderer_createSuper(MapVRenderer);
- function MapVRenderer(map, layer, dataSet, options) {
- var _this;
- MapVRenderer_classCallCheck(this, MapVRenderer);
- _this = _super.call(this, map, dataSet, options);
- if (!BaseLayer) {
- return MapVRenderer_possibleConstructorReturn(_this);
- }
- var self = MapVRenderer_assertThisInitialized(_this);
- options = options || {};
- self.init(options);
- self.argCheck(options);
- _this.canvasLayer = layer;
- _this.clickEvent = _this.clickEvent.bind(MapVRenderer_assertThisInitialized(_this));
- _this.mousemoveEvent = _this.mousemoveEvent.bind(MapVRenderer_assertThisInitialized(_this));
- _this._moveStartEvent = _this.moveStartEvent.bind(MapVRenderer_assertThisInitialized(_this));
- _this._moveEndEvent = _this.moveEndEvent.bind(MapVRenderer_assertThisInitialized(_this));
- _this._zoomStartEvent = _this.zoomStartEvent.bind(MapVRenderer_assertThisInitialized(_this));
- _this.bindEvent();
- return _this;
- }
- /**
- * @function L.supermap.MapVRenderer.prototype.clickEvent
- * @description 点击事件。
- * @param {Object} e - 触发对象。
- */
- MapVRenderer_createClass(MapVRenderer, [{
- key: "clickEvent",
- value: function clickEvent(e) {
- var offset = this.map.containerPointToLayerPoint([0, 0]);
- var devicePixelRatio = this.devicePixelRatio = this.canvasLayer.devicePixelRatio = window.devicePixelRatio || 1;
- var pixel = e.layerPoint;
- MapVRenderer_get(MapVRenderer_getPrototypeOf(MapVRenderer.prototype), "clickEvent", this).call(this, external_L_default().point((pixel.x - offset.x) / devicePixelRatio, (pixel.y - offset.y) / devicePixelRatio), e);
- }
- /**
- * @function L.supermap.MapVRenderer.prototype.mousemoveEvent
- * @description 鼠标移动事件。
- * @param {Object} e - 触发对象。
- */
- }, {
- key: "mousemoveEvent",
- value: function mousemoveEvent(e) {
- var pixel = e.layerPoint;
- MapVRenderer_get(MapVRenderer_getPrototypeOf(MapVRenderer.prototype), "mousemoveEvent", this).call(this, pixel, e);
- }
- /**
- * @function L.supermap.MapVRenderer.prototype.bindEvent
- * @description 绑定鼠标移动和鼠标点击事件。
- * @param {Object} e - 触发对象。
- */
- }, {
- key: "bindEvent",
- value: function bindEvent() {
- var map = this.map;
- if (this.options.methods) {
- if (this.options.methods.click) {
- map.on('click', this.clickEvent);
- }
- if (this.options.methods.mousemove) {
- map.on('mousemove', this.mousemoveEvent);
- }
- }
- this.map.on('movestart', this._moveStartEvent);
- this.map.on('moveend', this._moveEndEvent);
- this.map.on('zoomstart', this._zoomStartEvent);
- }
- /**
- * @function L.supermap.MapVRenderer.prototype.destroy
- * @description 释放资源。
- */
- }, {
- key: "destroy",
- value: function destroy() {
- this.unbindEvent();
- this.clearData();
- this.animator && this.animator.stop();
- this.animator = null;
- this.canvasLayer = null;
- }
- /**
- * @function L.supermap.MapVRenderer.prototype.unbindEvent
- * @description 解绑鼠标移动和鼠标滑动触发的事件。
- * @param {Object} e - 触发对象。
- */
- }, {
- key: "unbindEvent",
- value: function unbindEvent() {
- var map = this.map;
- if (this.options.methods) {
- if (this.options.methods.click) {
- map.off('click', this.clickEvent);
- }
- if (this.options.methods.mousemove) {
- map.off('mousemove', this.mousemoveEvent);
- }
- }
- this.map.off('movestart', this._moveStartEvent);
- this.map.off('moveend', this._moveEndEvent);
- this.map.off('zoomstart', this._zoomStartEvent);
- }
- /**
- * @function L.supermap.MapVRenderer.prototype.getContext
- * @description 获取信息。
- */
- }, {
- key: "getContext",
- value: function getContext() {
- return this.canvasLayer.getCanvas().getContext(this.context);
- }
- /**
- * @function L.supermap.MapVRenderer.prototype.addData
- * @description 添加数据。
- * @param {Object} data - 待添加的数据。
- * @param {Object} options - 待添加的数据信息。
- */
- }, {
- key: "addData",
- value: function addData(data, options) {
- var _data = data;
- if (data && data.get) {
- _data = data.get();
- }
- this.dataSet.add(_data);
- this.update({
- options: options
- });
- }
- /**
- * @function L.supermap.MapVRenderer.prototype.update
- * @description 更新图层。
- * @param {Object} opt - 待更新的数据。
- * @param {Object} opt.data - mapv数据集。
- * @param {Object} opt.options - mapv绘制参数。
- */
- }, {
- key: "update",
- value: function update(opt) {
- var update = opt || {};
- var _data = update.data;
- if (_data && _data.get) {
- _data = _data.get();
- }
- if (_data != undefined) {
- this.dataSet.set(_data);
- }
- MapVRenderer_get(MapVRenderer_getPrototypeOf(MapVRenderer.prototype), "update", this).call(this, {
- options: update.options
- });
- }
- /**
- * @function L.supermap.MapVRenderer.prototype.getData
- * @description 获取数据
- */
- }, {
- key: "getData",
- value: function getData() {
- return this.dataSet;
- }
- /**
- * @function L.supermap.MapVRenderer.prototype.removeData
- * @description 删除符合过滤条件的数据。
- * @param {Function} filter - 过滤条件。条件参数为数据项,返回值为 true,表示删除该元素;否则表示不删除。
- */
- }, {
- key: "removeData",
- value: function removeData(_filter) {
- if (!this.dataSet) {
- return;
- }
- var newData = this.dataSet.get({
- filter: function filter(data) {
- return _filter != null && typeof _filter === "function" ? !_filter(data) : true;
- }
- });
- this.dataSet.set(newData);
- this.update({
- options: null
- });
- }
- /**
- * @function L.supermap.MapVRenderer.prototype.clearData
- * @description 清除数据
- */
- }, {
- key: "clearData",
- value: function clearData() {
- this.dataSet && this.dataSet.clear();
- this.update({
- options: null
- });
- }
- }, {
- key: "_canvasUpdate",
- value: function _canvasUpdate(time) {
- if (!this.canvasLayer) {
- return;
- }
- var self = this;
- var animationOptions = self.options.animation;
- var context = this.getContext();
- var map = this.map;
- if (self.isEnabledTime()) {
- if (time === undefined) {
- this.clear(context);
- return;
- }
- if (this.context === '2d') {
- context.save();
- context.globalCompositeOperation = 'destination-out';
- context.fillStyle = 'rgba(0, 0, 0, .1)';
- context.fillRect(0, 0, context.canvas.width, context.canvas.height);
- context.restore();
- }
- } else {
- this.clear(context);
- }
- if (this.context === '2d') {
- for (var key in self.options) {
- context[key] = self.options[key];
- }
- } else {
- context.clear(context.COLOR_BUFFER_BIT);
- }
- if (self.options.minZoom && map.getZoom() < self.options.minZoom || self.options.maxZoom && map.getZoom() > self.options.maxZoom) {
- return;
- }
- var bounds = map.getBounds(); //获取当前像素下的地理范围
- var dw = bounds.getEast() - bounds.getWest();
- var dh = bounds.getNorth() - bounds.getSouth();
- var mapCanvas = map.getSize();
- var resolutionX = dw / mapCanvas.x,
- resolutionY = dh / mapCanvas.y; // 一个像素是多少米
- var zoomUnit = Util_getMeterPerMapUnit('DEGREE') * resolutionX; //var centerPx = map.latLngToLayerPoint(map.getCenter());
- //获取屏幕左上角的地理坐标坐标
- //左上角屏幕坐标为0,0
- var topLeft = this.canvasLayer.getTopLeft();
- var topLeftPX = map.latLngToAccurateContainerPoint(topLeft); // var lopLeft = map.containerPointToLatLng([0, 0]);
- var dataGetOptions = {
- transferCoordinate: function transferCoordinate(coordinate) {
- var offset;
- if (self.context === '2d') {
- offset = map.latLngToAccurateContainerPoint(external_L_default().latLng(coordinate[1], coordinate[0]));
- } else {
- offset = {
- 'x': (coordinate[0] - topLeft.lng) / resolutionX,
- 'y': (topLeft.lat - coordinate[1]) / resolutionY
- };
- }
- var pixel = {
- x: offset.x - topLeftPX.x,
- y: offset.y - topLeftPX.y
- };
- return [pixel.x, pixel.y];
- }
- };
- if (time !== undefined) {
- dataGetOptions.filter = function (item) {
- var trails = animationOptions.trails || 10;
- return time && item.time > time - trails && item.time < time;
- };
- }
- var data = self.dataSet.get(dataGetOptions);
- this.processData(data);
- var worldPoint = map.latLngToContainerPoint(external_L_default().latLng(0, 0));
- var pixel = {
- x: worldPoint.x - topLeftPX.x,
- y: worldPoint.y - topLeftPX.y
- }; // 兼容unit为'm'的情况
- if (self.options.unit === 'm') {
- if (self.options.size) {
- self.options._size = self.options.size / zoomUnit;
- }
- if (self.options.width) {
- self.options._width = self.options.width / zoomUnit;
- }
- if (self.options.height) {
- self.options._height = self.options.height / zoomUnit;
- }
- } else {
- self.options._size = self.options.size;
- self.options._height = self.options.height;
- self.options._width = self.options.width;
- }
- this.drawContext(context, data, self.options, pixel);
- self.options.updateCallback && self.options.updateCallback(time);
- }
- }, {
- key: "init",
- value: function init(options) {
- var self = this;
- self.options = options;
- this.initDataRange(options);
- this.context = self.options.context || '2d';
- if (self.options.zIndex) {
- this.canvasLayer && this.canvasLayer.setZIndex(self.options.zIndex);
- }
- this.initAnimator();
- }
- }, {
- key: "addAnimatorEvent",
- value: function addAnimatorEvent() {}
- /**
- * @function L.supermap.MapVRenderer.prototype.moveStartEvent
- * @description 开始移动事件。
- */
- }, {
- key: "moveStartEvent",
- value: function moveStartEvent() {
- var animationOptions = this.options.animation;
- if (this.isEnabledTime() && this.animator) {
- this.steps.step = animationOptions.stepsRange.start;
- this._hide();
- }
- }
- /**
- * @function L.supermap.MapVRenderer.prototype.moveEndEvent
- * @description 结束移动事件。
- */
- }, {
- key: "moveEndEvent",
- value: function moveEndEvent() {
- this.canvasLayer.draw();
- this._show();
- }
- /**
- * @function L.supermap.MapVRenderer.prototype.zoomStartEvent
- * @description 隐藏渲染样式。
- */
- }, {
- key: "zoomStartEvent",
- value: function zoomStartEvent() {
- this._hide();
- }
- /**
- * @function L.supermap.MapVRenderer.prototype.clear
- * @description 清除信息。
- * @param {string} context - 指定要清除的信息。
- */
- }, {
- key: "clear",
- value: function clear(context) {
- context && context.clearRect && context.clearRect(0, 0, context.canvas.width, context.canvas.height);
- }
- }, {
- key: "_hide",
- value: function _hide() {
- this.canvasLayer.canvas.style.display = 'none';
- }
- }, {
- key: "_show",
- value: function _show() {
- this.canvasLayer.canvas.style.display = 'block';
- }
- /**
- * @function L.supermap.MapVRenderer.prototype.draw
- * @description 绘制渲染
- */
- }, {
- key: "draw",
- value: function draw() {
- this.canvasLayer.draw();
- }
- }]);
- return MapVRenderer;
- }(BaseLayer);
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/MapVLayer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.mapVLayer
- * @classdesc MapV 图层。
- * @category Visualization MapV
- * @extends {L.Layer}
- * @param {mapv.DataSet} dataSet - MapV 图层数据集。
- * @param {Object} mapVOptions - MapV 图层参数。
- * @param {Object} options - 参数。
- * @param {string} [options.attributionPrefix] - 版权信息前缀。
- * @param {string} [options.attribution='© 2018 百度 MapV'] - 版权信息。
- * @fires L.supermap.mapVLayer#loaded
- */
- var MapVLayer = external_L_default().Layer.extend({
- options: {
- attributionPrefix: null,
- attribution: core_Attributions.MapV.attribution
- },
- initialize: function initialize(dataSet, mapVOptions, options) {
- options = options || {};
- this.dataSet = dataSet || {};
- this.mapVOptions = mapVOptions || {};
- this.render = this.render.bind(this);
- external_L_default().Util.setOptions(this, options);
- if (this.options.attributionPrefix) {
- this.options.attribution = this.options.attributionPrefix + this.options.attribution;
- }
- this.canvas = this._createCanvas();
- external_L_default().stamp(this);
- },
- /**
- * @private
- * @function L.supermap.mapVLayer.prototype.onAdd
- * @description 添加地图图层。
- * @param {L.Map} map - 要添加的地图。
- */
- onAdd: function onAdd(map) {
- this._map = map;
- var overlayPane = this.getPane();
- var container = this.container = external_L_default().DomUtil.create("div", "leaflet-layer leaflet-zoom-animated", overlayPane);
- container.appendChild(this.canvas);
- var size = map.getSize();
- container.style.width = size.x + "px";
- container.style.height = size.y + "px";
- this.renderer = new MapVRenderer(map, this, this.dataSet, this.mapVOptions);
- this.draw();
- /**
- * @event L.supermap.mapVLayer#loaded
- * @description 图层添加完成之后触发。
- */
- this.fire("loaded");
- },
- // _hide: function () {
- // this.canvas.style.display = 'none';
- // },
- // _show: function () {
- // this.canvas.style.display = 'block';
- // },
- /**
- * @private
- * @function L.supermap.mapVLayer.prototype.onRemove
- * @description 删除地图图层。
- */
- onRemove: function onRemove() {
- external_L_default().DomUtil.remove(this.container);
- this.renderer.destroy();
- },
- /**
- * @function L.supermap.mapVLayer.prototype.addData
- * @description 追加数据。
- * @param {Object} data - 要追加的数据。
- * @param {Object} options - 要追加的值。
- */
- addData: function addData(data, options) {
- this.renderer.addData(data, options);
- },
- /**
- * @function L.supermap.mapVLayer.prototype.update
- * @description 更新图层。
- * @param {Object} opt - 待更新的数据。
- * @param {Object} data - mapv 数据集。
- * @param {Object} options - mapv 绘制参数。
- */
- update: function update(opt) {
- this.renderer.update(opt);
- },
- /**
- * @function L.supermap.mapVLayer.prototype.getData
- * @description 获取数据。
- * @returns {mapv.DataSet} mapv 数据集。
- */
- getData: function getData() {
- if (this.renderer) {
- this.dataSet = this.renderer.getData();
- }
- return this.dataSet;
- },
- /**
- * @function L.supermap.mapVLayer.prototype.removeData
- * @description 删除符合过滤条件的数据。
- * @param {Function} filter - 过滤条件。条件参数为数据项,返回值为 true,表示删除该元素;否则表示不删除。
- * @example
- * filter=function(data){
- * if(data.id=="1"){
- * return true
- * }
- * return false;
- * }
- */
- removeData: function removeData(filter) {
- this.renderer && this.renderer.removeData(filter);
- },
- /**
- * @function L.supermap.mapVLayer.prototype.clearData
- * @description 清除数据。
- */
- clearData: function clearData() {
- this.renderer.clearData();
- },
- /**
- * @function L.supermap.mapVLayer.prototype.draw
- * @description 绘制图层。
- */
- draw: function draw() {
- return this._reset();
- },
- /**
- * @function L.supermap.mapVLayer.prototype.setZIndex
- * @description 设置 canvas 层级。
- * @param {number} zIndex - canvas 层级。
- */
- setZIndex: function setZIndex(zIndex) {
- this.canvas.style.zIndex = zIndex;
- },
- /**
- * @function L.supermap.mapVLayer.prototype.render
- * @description 渲染。
- */
- render: function render() {
- this.renderer._canvasUpdate();
- },
- /**
- * @function L.supermap.mapVLayer.prototype.getCanvas
- * @description 获取 canvas。
- * @returns {HTMLElement} 返回 mapV 图层包含的 canvas 对象。
- */
- getCanvas: function getCanvas() {
- return this.canvas;
- },
- /**
- * @function L.supermap.mapVLayer.prototype.getContainer
- * @description 获取容器。
- * @returns {HTMLElement} 返回包含 mapV 图层的 dom 对象。
- */
- getContainer: function getContainer() {
- return this.container;
- },
- /**
- * @function L.supermap.mapVLayer.prototype.getTopLeft
- * @description 获取左上角坐标。
- * @returns {L.Bounds} 返回左上角坐标。
- */
- getTopLeft: function getTopLeft() {
- var map = this._map;
- var topLeft;
- if (map) {
- var bounds = map.getBounds();
- topLeft = bounds.getNorthWest();
- }
- return topLeft;
- },
- _createCanvas: function _createCanvas() {
- var canvas = document.createElement('canvas');
- canvas.style.position = 'absolute';
- canvas.style.top = 0 + "px";
- canvas.style.left = 0 + "px";
- canvas.style.pointerEvents = "none";
- canvas.style.zIndex = this.options.zIndex || 600;
- var global$2 = typeof window === 'undefined' ? {} : window;
- var devicePixelRatio = this.devicePixelRatio = global$2.devicePixelRatio || 1;
- if (!this.mapVOptions.context || this.mapVOptions.context === '2d') {
- canvas.getContext('2d').scale(devicePixelRatio, devicePixelRatio);
- }
- return canvas;
- },
- _resize: function _resize() {
- var canvas = this.canvas;
- if (!canvas) {
- return;
- }
- var map = this._map;
- var size = map.getSize();
- canvas.width = size.x;
- canvas.height = size.y;
- canvas.style.width = size.x + 'px';
- canvas.style.height = size.y + 'px';
- var bounds = map.getBounds();
- var topLeft = map.latLngToLayerPoint(bounds.getNorthWest());
- external_L_default().DomUtil.setPosition(canvas, topLeft);
- },
- _reset: function _reset() {
- this._resize();
- this._render();
- },
- redraw: function redraw() {
- this._resize();
- this._render();
- },
- _render: function _render() {
- this.render();
- }
- });
- var mapVLayer = function mapVLayer(dataSet, mapVOptions, options) {
- return new MapVLayer(dataSet, mapVOptions, options);
- };
- (external_L_default()).supermap.mapVLayer = mapVLayer;
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/dataflow/MapvRenderer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- *
- * @class MapvRenderer
- * @classdesc 数据流图层 MapV 渲染器。
- * @category iServer DataFlow
- * @extends {L.supermap.MapVLayer}
- * @param {string} url - 数据流图层服务地址
- * @param {Object} options - 设置图层参数。
- * @param {Object} [options.geometry] - GeoJSON 几何对象。
- * @param {Object} [options.prjCoordSys] - 投影坐标对象。
- * @param {string} [options.excludeField] - 排除字段。
- * @param {string} [options.idField='id'] - 要素属性中表示唯一标识的字段。
- */
- var MapvRenderer = MapVLayer.extend({
- initialize: function initialize(url, options) {
- options = options || {};
- external_L_default().Util.setOptions(this, options);
- this.data = [];
- this.mapVOptions = {
- draw: 'simple'
- };
- MapVLayer.prototype.initialize.call(this, new window.mapv.DataSet([]), this.mapVOptions, options);
- this.idCache = {};
- this.url = url;
- this._last = new Date();
- this._imageCache = {};
- },
- onMessageSuccessed: function onMessageSuccessed(msg) {
- var _this = this;
- var geoID = msg.featureResult.properties['id'];
- var geometry = msg.featureResult.geometry; //设置每个点的经纬度和图片的样式
- var item = {
- geometry: msg.featureResult.geometry
- };
- if (geometry.type === 'Point' && this.options.pointToLayer) {
- //const pointStyle = this.options.pointToLayer ? this.options.pointToLayer(msg.featureResult, L.latLng(geometry.coordinates[1],geometry.coordinates[0])) : new L.marker(L.latLng(geometry.coordinates[1],geometry.coordinates[0]));
- var pointStyle = this.options.pointToLayer(msg.featureResult, external_L_default().latLng(geometry.coordinates[1], geometry.coordinates[0]));
- if (pointStyle instanceof (external_L_default()).Marker) {
- this.mapVOptions.draw = 'icon';
- var icon = pointStyle.options.icon;
- var imgUrl = icon._getIconUrl('icon');
- var imgWidth = icon.options.iconSize ? icon.options.iconSize[0] : null;
- var imgHeight = icon.options.iconSize ? icon.options.iconSize[1] : null;
- var iconKey = "".concat(imgUrl, "_").concat(imgWidth, "_").concat(imgHeight);
- var img = this._imageCache[iconKey];
- if (!img) {
- img = icon.createIcon();
- this._imageCache[iconKey] = img;
- img.onload = function () {
- _this.update({
- data: _this.data,
- options: _this.mapVOptions
- });
- };
- }
- item.icon = img;
- if (icon.options.iconSize || img.style.height) {
- this.mapVOptions.offset = {
- x: 0,
- y: -(icon.options.iconSize[1] || img.style.height) / 2
- };
- }
- if (this.options.deg) {
- item.deg = this.options.deg;
- if (typeof item.deg === 'function') {
- if (this.idCache[geoID] && this.data[this.idCache[geoID]]) {
- item.deg = item.deg(msg.featureResult, external_L_default().latLng(geometry.coordinates[1], geometry.coordinates[0]), this.data[this.idCache[geoID]]);
- }
- }
- }
- }
- if (pointStyle instanceof (external_L_default()).CircleMarker) {
- this.mapVOptions.draw = 'simple';
- var sty = this._toMapvStyle(pointStyle);
- for (var key in sty) {
- if (sty.hasOwnProperty(key)) {
- item[key] = sty[key];
- }
- }
- }
- } else if (this.options.style) {
- var _sty = this._toMapvStyle(this.options.style(msg.featureResult));
- for (var _key in _sty) {
- if (_sty.hasOwnProperty(_key)) {
- item[_key] = _sty[_key];
- }
- }
- }
- if (this.idCache[geoID] == undefined) {
- this.data.push(item);
- this.idCache[geoID] = this.data.length - 1;
- } else {
- this.data[this.idCache[geoID]] = item;
- } //绘制图层
- if (new Date() - this._last > 200) {
- this._last = new Date();
- this.update({
- data: this.data,
- options: this.mapVOptions
- });
- }
- },
- _toMapvStyle: function _toMapvStyle(options) {
- var mapvOps = {
- draw: 'simple'
- };
- mapvOps.strokeStyle = options.color;
- mapvOps.lineWidth = options.width;
- mapvOps.globalAlpha = options.fillOpacity || options.opacity;
- mapvOps.lineCap = options.lineCap;
- mapvOps.lineJoin = options.lineJoin;
- mapvOps.fillStyle = options.fillColor;
- mapvOps.size = options.radius;
- return mapvOps;
- }
- });
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/dataflow/NormalRenderer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class NormalRenderer
- * @classdesc 数据流图层普通渲染器。
- * @category iServer DataFlow
- * @extends {L.GeoJSON}
- * @param {string} url - 数据流图层服务地址
- * @param {Object} options - 设置图层参数。
- * @param {GeoJSONObject} [options.geometry] - GeoJSON 几何对象。
- * @param {Object} [options.prjCoordSys] - 投影坐标对象。
- * @param {string} [options.excludeField] - 排除字段。
- * @param {string} [options.idField='id'] - 要素属性中表示唯一标识的字段。
- */
- var NormalRenderer = external_L_default().GeoJSON.extend({
- initialize: function initialize(url, options) {
- options = options || {};
- if (options.style && !options.pointToLayer) {
- options.pointToLayer = function (geojson, latlng) {
- return external_L_default().circleMarker(latlng, options.style());
- };
- }
- external_L_default().Util.setOptions(this, options);
- this._layers = {};
- external_L_default().stamp(this);
- this.url = url;
- this.idCache = {};
- },
- onMessageSuccessed: function onMessageSuccessed(msg) {
- var geojson = msg.featureResult;
- var geoID = msg.featureResult.properties[this.options.idField];
- var layer = null;
- if (geoID !== undefined && this.idCache[geoID]) {
- layer = this.getLayer(this.idCache[geoID]);
- this._updateLayerData(layer, geojson);
- } else {
- layer = external_L_default().GeoJSON.geometryToLayer(geojson, this.options);
- layer.feature = external_L_default().GeoJSON.asFeature(geojson);
- this.addLayer(layer);
- if (geoID !== undefined) {
- this.idCache[geoID] = this.getLayerId(layer);
- }
- }
- if (this.options.onEachFeature) {
- this.options.onEachFeature(geojson, layer);
- }
- },
- _updateLayerData: function _updateLayerData(layer, geojson) {
- if (geojson.properties) {
- layer.feature.properties = geojson.properties;
- }
- var latlngs = [];
- switch (geojson.geometry.type) {
- case 'Point':
- latlngs = external_L_default().GeoJSON.coordsToLatLng(geojson.geometry.coordinates);
- layer.setLatLng(latlngs);
- break;
- case 'LineString':
- latlngs = external_L_default().GeoJSON.coordsToLatLngs(geojson.geometry.coordinates, 0);
- layer.setLatLngs(latlngs);
- break;
- case 'MultiLineString':
- case 'Polygon':
- latlngs = external_L_default().GeoJSON.coordsToLatLngs(geojson.geometry.coordinates, 1);
- layer.setLatLngs(latlngs);
- break;
- case 'MultiPolygon':
- latlngs = external_L_default().GeoJSON.coordsToLatLngs(geojson.geometry.coordinates, 2);
- layer.setLatLngs(latlngs);
- break;
- }
- }
- });
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/DataFlowLayer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.dataFlowLayer
- * @classdesc 数据流图层源。订阅SuperMap iServer 数据流服务并上图。订阅得到的数据会根据 `options.idField` 自动更新。
- * @category iServer DataFlow
- * @extends {L.LayerGroup}
- * @param {string} url - SuperMap iServer 数据流服务地址,例如:http://localhost:8090/iserver/services/dataflowTest/dataflow。
- * @param {Object} options - 设置图层参数。
- * @param {Object} [options.render='normal'] - 绘制方式。可选值为'normal','mapv'。
- 'normal' 表示以 {( {@link L.LatLng}|{@link L.Polyline}|{@link L.Polygon}|{@link L.Marker} )} 方式绘制数据流。'mapv' 表示以 {@link L.supermap.mapVLayer} 方式绘制实时数据。
- * @param {GeoJSONObject} [options.geometry] - 指定几何范围,该范围内的要素才能被订阅。
- * @param {Object} [options.prjCoordSys] - 投影坐标对象。
- * @param {string} [options.excludeField] - 排除字段。
- * @param {string} [options.idField='id'] - 要素属性中表示唯一标识的字段。
- * @param {Function} [options.pointToLayer] - 定义点要素如何绘制在地图上。
- `function(geoJsonPoint, latlng) {
- return L.marker(latlng);
- }`
- * @param {Function} [options.style] - 定义点、线、面要素样式。参数为{@link L.Path-option}。</br>
- `function (feature) {
- return {
- fillColor: "red",
- fillOpacity: 1,
- radius: 6,
- weight: 0
- };
- }`
- * @param {function|number} [options.deg] - 定义图标的旋转角度。`options.render` 为 `mapv` 时有效。</br>
- `function (feature,latlng) {
- return feature.properties['rotate'];
- }`
- * @fires L.supermap.dataFlowLayer#subscribesucceeded
- * @fires L.supermap.dataFlowLayer#subscribefailed
- * @fires L.supermap.dataFlowLayer#setfilterparamsucceeded
- * @fires L.supermap.dataFlowLayer#dataupdated
- */
- var DataFlowLayer = external_L_default().LayerGroup.extend({
- options: {
- geometry: null,
- prjCoordSys: null,
- excludeField: null,
- idField: "id",
- render: 'normal'
- },
- initialize: function initialize(url, options) {
- options = options || {};
- external_L_default().Util.setOptions(this, options);
- this.url = url;
- this._layers = {};
- this.dataService = new DataFlowService_DataFlowService(this.url, {
- geometry: this.options.geometry,
- prjCoordSys: this.options.prjCoordSys,
- excludeField: this.options.excludeField
- });
- },
- /**
- * @private
- * @function L.supermap.dataFlowLayer.prototype.onAdd
- * @description 添加地图。
- * @param {L.Map} map - 待添加的地图。
- */
- onAdd: function onAdd(map) {
- var _this = this;
- // eslint-disable-line no-unused-vars
- this.dataService.initSubscribe();
- /**
- * @event L.supermap.dataFlowLayer#subscribesucceeded
- * @description 初始化成功后触发。
- * @property {Object} e - 事件对象。
- */
- this.dataService.on('subscribeSocketConnected', function (e) {
- return _this.fire("subscribesucceeded", e);
- });
- /**
- * @event L.supermap.dataFlowLayer#subscribefailed
- * @description 初始化失败后触发。
- * @property {Object} e - 事件对象。
- */
- this.dataService.on('subscribeSocketError', function (e) {
- return _this.fire("subscribefailed", e);
- });
- this.dataService.on('messageSucceeded', function (msg) {
- return _this._onMessageSuccessed(msg);
- });
- /**
- * @event L.supermap.dataFlowLayer#setfilterparamsucceeded
- * @description 过滤参数设置成功后触发。
- * @property {Object} e - 事件对象。
- */
- this.dataService.on('setFilterParamSucceeded', function (msg) {
- return _this.fire("setfilterparamsucceeded", msg);
- });
- if (this.options.render === 'mapv') {
- this.addLayer(new MapvRenderer(this.url, this.options));
- } else {
- this.addLayer(new NormalRenderer(this.url, this.options));
- }
- external_L_default().LayerGroup.prototype.onAdd.call(this, map);
- },
- /**
- * @private
- * @function L.supermap.dataFlowLayer.prototype.onRemove
- * @description 删除指定地图。
- * @param {L.Map} map - 待删除的地图。
- */
- onRemove: function onRemove(map) {
- // eslint-disable-line no-unused-vars
- external_L_default().LayerGroup.prototype.onRemove.call(this, map);
- this.dataService && this.dataService.unSubscribe();
- },
- /**
- * @function L.supermap.dataFlowLayer.prototype.setExcludeField
- * @description 设置唯一字段。
- * @param {string} excludeField - 唯一字段。
- */
- setExcludeField: function setExcludeField(excludeField) {
- this.dataService.setExcludeField(excludeField);
- this.options.excludeField = excludeField;
- return this;
- },
- /**
- * @function L.supermap.dataFlowLayer.prototype.setGeometry
- * @description 设置集合要素。
- * @param {GeoJSONObject} geometry - 待设置的 GeoJSON 几何要素对象。
- */
- setGeometry: function setGeometry(geometry) {
- this.dataService.setGeometry(geometry);
- this.options.geometry = geometry;
- return this;
- },
- _onMessageSuccessed: function _onMessageSuccessed(msg) {
- var _this2 = this;
- this.getLayers().map(function (layer) {
- if (layer.onMessageSuccessed) {
- layer.onMessageSuccessed(msg);
- /**
- * @description 图层数据更新成功后触发。
- * @event L.supermap.dataFlowLayer#dataupdated
- * @property {Object} layer - 更新数据成功的图层。
- * @property {Object} data - 更新的要素。
- */
- _this2.fire("dataupdated", {
- layer: layer,
- data: msg.featureResult
- });
- }
- return layer;
- });
- }
- });
- var dataFlowLayer = function dataFlowLayer(url, options) {
- return new DataFlowLayer(url, options);
- };
- (external_L_default()).supermap.dataFlowLayer = dataFlowLayer;
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/EChartsLayer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.echartsLayer
- * @classdesc 百度 ECharts 图层类。
- * @category Visualization ECharts
- * @extends {L.Layer}
- * @param {Object} echartsOptions - 图表参数。
- * @param {Object} options - 可选图层参数。
- * @param {boolean} [options.loadWhileAnimating=false] - 是否在移动时实时绘制。
- * @param {string} [options.attribution='© 2018 百度 ECharts'] - 版权信息。
- */
- var EchartsLayer = external_L_default().Layer.extend({
- includes: [],
- _echartsContainer: null,
- _map: null,
- _ec: null,
- _echartsOptions: null,
- options: {
- attribution: core_Attributions.ECharts.attribution,
- loadWhileAnimating: false
- },
- initialize: function initialize(echartsOptions, options) {
- external_L_default().Util.setOptions(this, options);
- this.setOption(echartsOptions);
- },
- /**
- * @function L.supermap.echartsLayer.prototype.setOption
- * @description 设置图表地图参数。
- * @param {Object} echartsOptions - 图表参数。
- * @param {string} lazyUpdate - 后台自动更新。
- * @param {boolean} [notMerge] - 是否合并参数。
- */
- setOption: function setOption(echartsOptions, notMerge, lazyUpdate) {
- var baseOption = echartsOptions.baseOption || echartsOptions;
- baseOption.LeafletMap = baseOption.LeafletMap || {
- roam: true
- };
- baseOption.animation = baseOption.animation === true;
- this._echartsOptions = echartsOptions;
- this._ec && this._ec.setOption(echartsOptions, notMerge, lazyUpdate);
- },
- getEcharts: function getEcharts() {
- return this._ec;
- },
- _disableEchartsContainer: function _disableEchartsContainer() {
- this._echartsContainer.style.visibility = "hidden";
- },
- _enableEchartsContainer: function _enableEchartsContainer() {
- this._echartsContainer.style.visibility = "visible";
- },
- /**
- * @private
- * @function L.supermap.echartsLayer.prototype.onAdd
- * @description 添加地图。
- * @param {L.Map} map - 待添加的地图。
- */
- onAdd: function onAdd(map) {
- this._map = map;
- this._initEchartsContainer();
- this._ec = external_function_try_return_echarts_catch_e_return_default().init(this._echartsContainer);
- this._ec.leafletMap = map;
- var me = this;
- map.on("zoomstart", function () {
- me._disableEchartsContainer();
- });
- !me.options.loadWhileAnimating && map.on("movestart", function () {
- me._disableEchartsContainer();
- });
- external_function_try_return_echarts_catch_e_return_default().registerAction({
- type: 'LeafletMapLayout',
- event: 'LeafletMapLayout',
- update: 'updateLayout'
- }, function (payload) {// eslint-disable-line no-unused-vars
- });
- external_function_try_return_echarts_catch_e_return_default().registerCoordinateSystem('leaflet', LeafletMapCoordSys);
- external_function_try_return_echarts_catch_e_return_default().extendComponentModel({
- type: 'LeafletMap',
- getBMap: function getBMap() {
- return this.__LeafletMap;
- },
- defaultOption: {
- roam: false
- }
- });
- external_function_try_return_echarts_catch_e_return_default().extendComponentView({
- type: 'LeafletMap',
- render: function render(LeafletMapModel, ecModel, api) {
- var rendering = true;
- var leafletMap = ecModel.scheduler.ecInstance.leafletMap;
- var viewportRoot = api.getZr().painter.getViewportRoot();
- var animated = leafletMap.options.zoomAnimation && (external_L_default()).Browser.any3d;
- viewportRoot.className = ' leaflet-layer leaflet-zoom-' + (animated ? 'animated' : 'hide') + ' echarts-layer';
- var originProp = external_L_default().DomUtil.testProp(['transformOrigin', 'WebkitTransformOrigin', 'msTransformOrigin']);
- viewportRoot.style[originProp] = '50% 50%';
- var coordSys = LeafletMapModel.coordinateSystem;
- var ecLayers = api.getZr().painter.getLayers();
- var moveHandler = function moveHandler() {
- if (rendering) {
- return;
- }
- var offset = me._map.containerPointToLayerPoint([0, 0]);
- var mapOffset = [offset.x || 0, offset.y || 0];
- viewportRoot.style.left = mapOffset[0] + 'px';
- viewportRoot.style.top = mapOffset[1] + 'px';
- if (!me.options.loadWhileAnimating) {
- for (var item in ecLayers) {
- if (!ecLayers.hasOwnProperty(item)) {
- continue;
- }
- ecLayers[item] && clearContext(ecLayers[item].ctx);
- }
- me._enableEchartsContainer();
- }
- coordSys.setMapOffset(mapOffset);
- LeafletMapModel.__mapOffset = mapOffset;
- api.dispatchAction({
- type: 'LeafletMapLayout'
- });
- };
- function clearContext(context) {
- context && context.clearRect && context.clearRect(0, 0, context.canvas.width, context.canvas.height);
- }
- function zoomEndHandler() {
- if (rendering) {
- return;
- }
- api.dispatchAction({
- type: 'LeafletMapLayout'
- });
- me._enableEchartsContainer();
- }
- if (me._oldMoveHandler) {
- leafletMap.off(me.options.loadWhileAnimating ? 'move' : 'moveend', me._oldMoveHandler);
- }
- if (me._oldZoomEndHandler) {
- leafletMap.off('zoomend', me._oldZoomEndHandler);
- }
- leafletMap.on(me.options.loadWhileAnimating ? 'move' : 'moveend', moveHandler);
- leafletMap.on('zoomend', zoomEndHandler);
- me._oldMoveHandler = moveHandler;
- me._oldZoomEndHandler = zoomEndHandler;
- rendering = false;
- }
- });
- this._ec.setOption(this._echartsOptions);
- },
- onRemove: function onRemove() {
- // 销毁echarts实例
- this._ec.clear();
- this._ec.dispose();
- delete this._ec;
- external_L_default().DomUtil.remove(this._echartsContainer);
- if (this._oldZoomEndHandler) {
- this._map.off("zoomend", this._oldZoomEndHandler);
- this._oldZoomEndHandler = null;
- }
- if (this._oldMoveHandler) {
- this._map.off(this.options.loadWhileAnimating ? 'move' : 'moveend', this._oldMoveHandler);
- this._oldMoveHandler = null;
- }
- if (this._resizeHandler) {
- this._map.off('resize', this._resizeHandler);
- this._resizeHandler = null;
- }
- delete this._map;
- },
- _initEchartsContainer: function _initEchartsContainer() {
- var size = this._map.getSize();
- var _div = document.createElement('div');
- _div.style.position = 'absolute';
- _div.style.height = size.y + 'px';
- _div.style.width = size.x + 'px';
- _div.style.zIndex = 10;
- this._echartsContainer = _div;
- this.getPane().appendChild(this._echartsContainer);
- var me = this;
- function _resizeHandler(e) {
- var size = e.newSize;
- me._echartsContainer.style.width = size.x + 'px';
- me._echartsContainer.style.height = size.y + 'px';
- me._ec.resize();
- }
- this._map.on('resize', _resizeHandler);
- this._resizeHandler = _resizeHandler;
- }
- });
- /**
- * @class L.supermap.LeafletMapCoordSys
- * @private
- * @classdesc 地图坐标系统类。
- * @param {L.Map} leafletMap - 地图。
- */
- function LeafletMapCoordSys(leafletMap) {
- this._LeafletMap = leafletMap;
- this.dimensions = ['lng', 'lat'];
- this._mapOffset = [0, 0];
- }
- LeafletMapCoordSys.prototype.dimensions = ['lng', 'lat'];
- LeafletMapCoordSys.prototype.setMapOffset = function (mapOffset) {
- this._mapOffset = mapOffset;
- };
- LeafletMapCoordSys.prototype.getBMap = function () {
- return this._LeafletMap;
- };
- LeafletMapCoordSys.prototype.prepareCustoms = function () {
- var zrUtil = (external_function_try_return_echarts_catch_e_return_default()).util;
- var rect = this.getViewRect();
- return {
- coordSys: {
- // The name exposed to user is always 'cartesian2d' but not 'grid'.
- type: 'leaflet',
- x: rect.x,
- y: rect.y,
- width: rect.width,
- height: rect.height
- },
- api: {
- coord: zrUtil.bind(this.dataToPoint, this),
- size: zrUtil.bind(dataToCoordSize, this)
- }
- };
- function dataToCoordSize(dataSize, dataItem) {
- dataItem = dataItem || [0, 0];
- return zrUtil.map([0, 1], function (dimIdx) {
- var val = dataItem[dimIdx];
- var halfSize = dataSize[dimIdx] / 2;
- var p1 = [];
- var p2 = [];
- p1[dimIdx] = val - halfSize;
- p2[dimIdx] = val + halfSize;
- p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];
- return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);
- }, this);
- }
- };
- LeafletMapCoordSys.prototype.dataToPoint = function (data) {
- //处理数据中的null值
- if (data[1] === null) {
- data[1] = (external_L_default()).CRS.EPSG3857.projection.MAX_LATITUDE;
- } //平面坐标系不能这么处理
- //data[1] = this.fixLat(data[1]);
- var px = this._LeafletMap.latLngToLayerPoint([data[1], data[0]]);
- var mapOffset = this._mapOffset;
- return [px.x - mapOffset[0], px.y - mapOffset[1]];
- };
- LeafletMapCoordSys.prototype.fixLat = function (lat) {
- if (lat >= 90) {
- return 89.99999999999999;
- }
- if (lat <= -90) {
- return -89.99999999999999;
- }
- return lat;
- };
- LeafletMapCoordSys.prototype.pointToData = function (pt) {
- var mapOffset = this._mapOffset;
- var point = this._LeafletMap.layerPointToLatLng([pt[0] + mapOffset[0], pt[1] + mapOffset[1]]);
- return [point.lng, point.lat];
- };
- LeafletMapCoordSys.prototype.getViewRect = function () {
- var size = this._LeafletMap.getSize();
- return new (external_function_try_return_echarts_catch_e_return_default()).graphic.BoundingRect(0, 0, size.x, size.y);
- };
- LeafletMapCoordSys.prototype.getRoamTransform = function () {
- return external_function_try_return_echarts_catch_e_return_default().matrix.create();
- };
- LeafletMapCoordSys.dimensions = LeafletMapCoordSys.prototype.dimensions;
- LeafletMapCoordSys.create = function (ecModel) {
- var coordSys;
- var leafletMap = ecModel.scheduler.ecInstance.leafletMap;
- ecModel.eachComponent('LeafletMap', function (leafletMapModel) {
- if (!coordSys) {
- coordSys = new LeafletMapCoordSys(leafletMap);
- }
- leafletMapModel.coordinateSystem = coordSys;
- leafletMapModel.coordinateSystem.setMapOffset(leafletMapModel.__mapOffset || [0, 0]);
- });
- ecModel.eachSeries(function (seriesModel) {
- if (!seriesModel.get('coordinateSystem') || seriesModel.get('coordinateSystem') === 'leaflet') {
- if (!coordSys) {
- coordSys = new LeafletMapCoordSys(leafletMap);
- }
- seriesModel.coordinateSystem = coordSys;
- seriesModel.animation = seriesModel.animation === true;
- }
- });
- };
- var echartsLayer = function echartsLayer(echartsOptions, options) {
- return new EchartsLayer(echartsOptions, options);
- };
- (external_L_default()).supermap.echartsLayer = echartsLayer;
- ;// CONCATENATED MODULE: ./src/leaflet/core/Detector.js
- function Detector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function Detector_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function Detector_createClass(Constructor, protoProps, staticProps) { if (protoProps) Detector_defineProperties(Constructor.prototype, protoProps); if (staticProps) Detector_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- var Detector = /*#__PURE__*/function () {
- function Detector() {
- Detector_classCallCheck(this, Detector);
- }
- Detector_createClass(Detector, null, [{
- key: "supportWebGL",
- value: function supportWebGL() {
- return getContext('webgl');
- }
- }, {
- key: "supportWebGL2",
- value: function supportWebGL2() {
- return getContext('webgl2');
- }
- }, {
- key: "supportCanvas",
- value: function supportCanvas() {
- return getContext('2d');
- }
- }]);
- return Detector;
- }();
- function getContext(context) {
- var canvas = document.createElement('canvas');
- return canvas && canvas.getContext(context);
- }
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/graphic/CloverStyle.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.cloverStyle
- * @classdesc 三叶草要素风格。
- * @category Visualization Graphic
- * @extends {L.Class}
- * @param {Object} options - 三叶草形要素风格参数。
- * @param {number} [options.angle=60] - 三叶草每个扇叶的圆心角,单位弧度。
- * @param {number} [options.spaceAngle=0] - 扇叶间隔角度,通过计算获取。
- * @param {number} [options.count=3] - 扇叶数量。
- * @param {boolean} [options.stroke=true] - 是否描边。
- * @param {number} [options.strokeWidth=1] - 边框宽度。
- * @param {string} [options.color='#3388ff'] - 颜色。
- * @param {number} [options.weight=1] - 线宽。
- * @param {number} [options.opacity=1] - 透明度。
- * @param {string} [options.lineCap='round'] - 线帽形状。
- * @param {string} [options.lineJoin='round'] - 线条交汇边角形状。
- * @param {boolean} [options.fill=false] - 是否填充。
- * @param {string} [options.fillColor='#66ccff'] - 填充色。
- * @param {number} [options.fillOpacity=0.2] - 填充透明度。
- * @param {string} [options.fillRule='evenodd'] - 填充形状。
- * @param {number} [options.radius=10] - 半径。
- */
- var CloverStyle = external_L_default().Class.extend({
- options: {
- radius: 10,
- angele: 60,
- spaceAngle: 0,
- count: 3,
- fill: false,
- stroke: true,
- color: '#3388ff',
- weight: 1,
- lineCap: 'round',
- lineJoin: 'round',
- fillColor: '#66ccff',
- fillOpacity: 0.2,
- fillRule: 'evenodd',
- opacity: 1,
- strokeWidth: 1
- },
- initialize: function initialize(options) {
- options = options || {};
- external_L_default().Util.setOptions(this, options);
- this._canvas = document.createElement('canvas');
- this._canvas.width = 2 * (this.options.radius + this.options.weight);
- this._canvas.height = 2 * (this.options.radius + this.options.weight);
- this._ctx = this._canvas.getContext('2d');
- var strokeWidth = this.options.strokeWidth === undefined ? 1 : this.options.strokeWidth;
- this.options.width = 2 * (this.options.radius + strokeWidth) + 1;
- this._initStyle();
- },
- /**
- * @function L.supermap.cloverStyle.prototype.getStyle
- * @description 获取画布。
- */
- getStyle: function getStyle() {
- return this._canvas;
- },
- /**
- * @function L.supermap.cloverStyle.prototype.drawSector
- * @description 绘制扇形。
- * @param {CanvasRenderingContext2D} ctx - context 对象。
- * @param {number} x - 中心点 x。
- * @param {number} y - 中心点 y。
- * @param {number} r - 中心点 r。
- * @param {number} sAngle - 扇叶起始角度。
- * @param {number} eAngle - 扇叶终止角度。
- */
- drawSector: function drawSector(ctx, x, y, r, sAngle, eAngle) {
- //角度转换
- sAngle = sAngle / 180 * Math.PI;
- eAngle = eAngle / 180 * Math.PI;
- ctx.moveTo(x, y);
- ctx.lineTo(x + r * Math.cos(sAngle), y + r * Math.sin(sAngle));
- ctx.arc(x, y, r, sAngle, eAngle);
- ctx.lineTo(x, y);
- },
- _initStyle: function _initStyle() {
- //起始角度
- var sAngle = 0;
- var options = this.options;
- var eAngle = options.angle;
- options.spaceAngle = 360 / options.count - options.angle;
- if (options.spaceAngle < 0) {
- return;
- }
- this._ctx.beginPath();
- this.anchor = [options.width / 2, options.width / 2];
- for (var i = 0; i < options.count; i++) {
- this.drawSector(this._ctx, this.anchor[0], this.anchor[1], options.radius, sAngle, eAngle);
- sAngle = eAngle + options.spaceAngle;
- eAngle = sAngle + options.angle;
- }
- this._fillStroke();
- },
- _fillStroke: function _fillStroke() {
- var options = this.options;
- if (options.fill) {
- this._ctx.globalAlpha = options.fillOpacity;
- this._ctx.fillStyle = options.fillColor || options.color;
- this._ctx.fill(options.fillRule || 'evenodd');
- }
- if (options.stroke && options.weight !== 0) {
- this._ctx.globalAlpha = options.opacity;
- this._ctx.lineWidth = options.weight;
- this._ctx.strokeStyle = options.color;
- this._ctx.lineCap = options.lineCap;
- this._ctx.lineJoin = options.lineJoin;
- this._ctx.stroke();
- }
- }
- });
- var cloverStyle = function cloverStyle(options) {
- return new CloverStyle(options);
- };
- (external_L_default()).supermap.cloverStyle = cloverStyle;
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/graphic/CircleStyle.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.circleStyle
- * @classdesc 圆形要素风格。
- * @category Visualization Graphic
- * @extends {L.Class}
- * @param {Object} options - 圆形要素风格参数。
- * @param {boolean} [options.stroke=true] - 是否描边。
- * @param {string} [options.color='#3388ff'] - 颜色。
- * @param {number} [options.weight=1] - 线宽。
- * @param {number} [options.opacity=1] - 透明度。
- * @param {string} [options.lineCap='round'] - 线帽形状。
- * @param {string} [options.lineJoin='round'] - 线条交汇边角形状。
- * @param {boolean} [options.fill=false] - 是否填充。
- * @param {string} [options.fillColor] - 填充色。
- * @param {number} [options.fillOpacity=0.2] - 填充透明度。
- * @param {string} [options.fillRule='evenodd'] - 填充形状。
- * @param {number} [options.radius=3] - 半径。
- */
- var CircleStyle = external_L_default().Class.extend({
- options: {
- stroke: true,
- color: '#3388ff',
- weight: 1,
- opacity: 1,
- lineCap: 'round',
- lineJoin: 'round',
- fill: false,
- fillColor: null,
- fillOpacity: 0.2,
- fillRule: 'evenodd',
- radius: 3
- },
- initialize: function initialize(options) {
- options = options || {};
- external_L_default().Util.setOptions(this, options);
- this._canvas = document.createElement('canvas');
- this._canvas.width = 2 * (this.options.radius + this.options.weight);
- this._canvas.height = 2 * (this.options.radius + this.options.weight);
- this._ctx = this._canvas.getContext('2d');
- this._initStyle();
- },
- /**
- * @deprecated
- * @function L.supermap.circleStyle.prototype.getCanvas
- * @description 获取画布,已弃用该设置,请使用 getStyle 接口。
- */
- getCanvas: function getCanvas() {
- return this._canvas;
- },
- /**
- * @function L.supermap.circleStyle.prototype.getStyle
- * @description 获取画布。
- */
- getStyle: function getStyle() {
- return this._canvas;
- },
- _initStyle: function _initStyle() {
- this._ctx.beginPath();
- this._ctx.arc(this._canvas.width / 2, this._canvas.height / 2, this.options.radius, 0, Math.PI * 2);
- this._fillStroke();
- },
- _fillStroke: function _fillStroke() {
- var options = this.options;
- if (options.fill) {
- this._ctx.globalAlpha = options.fillOpacity;
- this._ctx.fillStyle = options.fillColor || options.color;
- this._ctx.fill(options.fillRule || 'evenodd');
- }
- if (options.stroke && options.weight !== 0) {
- this._ctx.globalAlpha = options.opacity;
- this._ctx.lineWidth = options.weight;
- this._ctx.strokeStyle = options.color;
- this._ctx.lineCap = options.lineCap;
- this._ctx.lineJoin = options.lineJoin;
- this._ctx.stroke();
- }
- }
- });
- var circleStyle = function circleStyle(options) {
- return new CircleStyle(options);
- };
- (external_L_default()).supermap.circleStyle = circleStyle;
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/graphic/ImageStyle.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.imageStyle
- * @classdesc 自定义图形要素风格。
- * @category Visualization Graphic
- * @extends {L.Class}
- * @param {Object} options - 图形要素风格参数。
- * @param {HTMLImageElement} options.img - image 对象。
- * @param {Array} [options.origin=[0.0]] - 中心点。
- * @param {Array} [options.anchor] - 偏移量。
- * @param {Array} [options.size] - 图形大小,即高度和宽度[width,height]。
- * @param {Array} [options.radius] - 半径。
- * @param {Array} [options.weight] - 宽度。
- */
- var ImageStyle = external_L_default().Class.extend({
- options: {
- img: null,
- origin: [0, 0],
- anchor: null,
- size: null
- },
- initialize: function initialize(options) {
- options = options || {};
- external_L_default().Util.setOptions(this, options);
- this._canvas = document.createElement('canvas');
- this._canvas.width = 2 * (this.options.radius + this.options.weight);
- this._canvas.height = 2 * (this.options.radius + this.options.weight);
- this._ctx = this._canvas.getContext('2d');
- },
- /**
- * @function L.supermap.imageStyle.prototype.getStyle
- * @description 获取样式。
- */
- getStyle: function getStyle() {
- return this.options;
- }
- });
- var imageStyle = function imageStyle(options) {
- return new ImageStyle(options);
- };
- (external_L_default()).supermap.imageStyle = imageStyle;
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/graphic/CanvasRenderer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- var emptyFunc = (external_L_default()).Util.falseFn;
- var GraphicCanvasRenderer = external_L_default().Class.extend({
- initialize: function initialize(layer, options) {
- this.layer = layer;
- options = options || {};
- external_L_default().Util.setOptions(this, options);
- },
- /**
- * @private
- * @function GraphicCanvasRenderer.prototype.getRenderer
- * @description 返回渲染器给图层,提供图层后续的数据增删改。
- * @returns {L.Canvas}
- */
- getRenderer: function getRenderer() {
- return this.options.renderer;
- },
- /**
- * @private
- * @function GraphicCanvasRenderer.prototype.update
- * @description 更新图层,数据或者样式改变后调用。
- */
- update: function update() {
- this.getRenderer()._clear();
- this.getRenderer()._draw();
- },
- _getGraphicAtPoint: function _getGraphicAtPoint(p) {
- var layer = this.layer;
- var map = layer._map;
- var graphics = layer._getGraphicsInBounds();
- for (var i = graphics.length - 1; i >= 0; i--) {
- var p1 = void 0,
- p2 = void 0,
- bounds = void 0;
- var center = map.latLngToLayerPoint(graphics[i].getLatLng());
- var style = graphics[i].getStyle();
- if (!style && this.defaultStyle) {
- style = this.defaultStyle;
- }
- if (style.img) {
- var imgWidth = style.img.width;
- var imgHeight = style.img.height;
- if (style.size && style.size[0] && style.size[1]) {
- imgWidth = style.size[0];
- imgHeight = style.size[1];
- }
- var anchor = style.anchor || [imgWidth / 2, imgHeight / 2];
- p1 = external_L_default().point(center.x - anchor[0], center.y - anchor[1]);
- p2 = external_L_default().point(p1.x + imgWidth, p1.y + imgHeight);
- } else {
- p1 = external_L_default().point(center.x - style.width / 2, center.y - style.height / 2);
- p2 = external_L_default().point(center.x + style.width / 2, center.y + style.height / 2);
- }
- bounds = external_L_default().bounds(p1, p2);
- if (bounds.contains(p)) {
- return graphics[i];
- }
- }
- return null;
- },
- containsPoint: function containsPoint(p) {
- return !!this._getGraphicAtPoint(p);
- },
- _handleClick: function _handleClick(evt) {
- evt.target = null;
- var layer = this.layer;
- var map = layer._map;
- var graphic = this._getGraphicAtPoint(map.latLngToLayerPoint(evt.latlng));
- if (graphic) {
- this.layer._renderer._ctx.canvas.style.cursor = 'pointer';
- evt.target = graphic;
- if (evt.type === 'click' && layer.options.onClick) {
- layer.options.onClick.call(layer, graphic, evt);
- }
- return;
- }
- this.layer._renderer._ctx.canvas.style.cursor = 'auto';
- },
- //跟GraphicWebGLRenderer保持一致
- _clearBuffer: emptyFunc
- });
- external_L_default().Canvas.include({
- drawGraphics: function drawGraphics(graphics, defaultStyle) {
- var me = this;
- if (!me._drawing) {
- return;
- } //this._ctx.clearRect(0, 0, this._ctx.canvas.width, me._ctx.canvas.height);
- graphics.forEach(function (graphic) {
- var style = graphic.getStyle();
- if (!style && defaultStyle) {
- style = defaultStyle;
- }
- if (style.img) {
- //绘制图片
- me._drawImage.call(me, me._ctx, style, graphic.getLatLng());
- } else {
- //绘制canvas
- me._drawCanvas.call(me, me._ctx, style, graphic.getLatLng());
- }
- });
- },
- _drawCanvas: function _drawCanvas(ctx, style, latLng) {
- var canvas = style;
- var pt = this._map.latLngToLayerPoint(latLng);
- var p0 = pt.x - canvas.width / 2;
- var p1 = pt.y - canvas.height / 2;
- var width = canvas.width;
- var height = canvas.height;
- ctx.drawImage(canvas, p0, p1, width, height);
- },
- _drawImage: function _drawImage(ctx, style, latLng) {
- //设置图片的大小
- var width, height;
- if (style.size) {
- var size = style.size;
- width = size[0];
- height = size[1];
- } else {
- width = style.img.width;
- height = style.img.height;
- } //设置偏移
- var point = this._coordinateToPoint(latLng);
- var pt = external_L_default().point(point),
- ac = external_L_default().point(style.anchor || [width / 2, height / 2]);
- point = [pt.x - ac.x, pt.y - ac.y]; //参数分别为:图片,图片裁剪下x,y位置,裁剪长宽,放置在画布的位置x,y, 占取画布长宽
- //ctx.drawImage(style.img, 0, 0, width, height, point[0], point[1], width, height);
- ctx.drawImage(style.img, point[0], point[1], width, height);
- },
- _coordinateToPoint: function _coordinateToPoint(coordinate) {
- if (!this._map) {
- return coordinate;
- }
- var latLng = coordinate;
- if (external_L_default().Util.isArray(coordinate)) {
- latLng = external_L_default().latLng(coordinate[0], coordinate[1]);
- } else if (coordinate instanceof (external_L_default()).LatLng) {
- latLng = external_L_default().latLng(coordinate.lat, coordinate.lng);
- }
- var point = this._map.latLngToLayerPoint(latLng);
- return [point.x, point.y];
- }
- });
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/graphic/WebGLRenderer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- var WebGLRenderer_emptyFunc = (external_L_default()).Util.falseFn;
- /**
- * @private
- * @class GraphicWebGLRenderer
- * @classdesc 高效率点图层 webgl 渲染器。
- * @category Visualization Graphic
- * @extends {L.Layer}
- * @param {Array.<L.supermap.graphicLayer>} layer - 高效率点图层。
- * @param {Object} options - 图层参数。
- * @param {number} options.width - 地图宽度。
- * @param {number} options.height - 地图高度。
- * @param {HTMLElement} options.container - 放置渲染器的父元素。
- * @param {Array.<number>} [options.color=[0, 0, 0, 255]] - 颜色,目前只支持 rgba 数组。
- * @param {number} [options.radius=10] - 半径。
- * @param {number} [options.opacity=0.8] - 不透明度。
- * @param {Array} [options.highlightColor] - 高亮颜色,目前只支持 rgba 数组。
- * @param {number} [options.radiusScale=1] - 点放大倍数。
- * @param {number} [options.radiusMinPixels=0] - 半径最小值(像素)。
- * @param {number} [options.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - 半径最大值(像素)。
- * @param {number} [options.strokeWidth=1] - 边框大小。
- * @param {boolean} [options.outline=false] - 是否显示边框。
- * @param {Function} [options.onClick] - 点击事件。
- * @param {Function} [options.onHover] - 悬停事件。
- */
- var CSS_TRANSFORM = function () {
- var div = document.createElement('div');
- var props = ['transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform'];
- for (var i = 0; i < props.length; i++) {
- var prop = props[i];
- if (div.style[prop] !== undefined) {
- return prop;
- }
- }
- return props[0];
- }();
- var GraphicWebGLRenderer = external_L_default().Class.extend({
- initialize: function initialize(layer, options) {
- this.layer = layer;
- var opt = options || {};
- external_L_default().Util.setOptions(this, opt);
- this.options.radius = this._pixelToMeter(this.options.radius);
- this._initContainer();
- },
- /**
- * @private
- * @function GraphicWebGLRenderer.prototype.getRenderer
- * @description 返回渲染器本身给图层,提供图层后续的数据增删改。
- * @returns {GraphicWebGLRenderer}
- */
- getRenderer: function getRenderer() {
- return this;
- },
- /**
- * @private
- * @function GraphicWebGLRenderer.prototype.update
- * @description 更新图层,数据或者样式改变后调用。
- */
- update: function update(graphics) {
- if (graphics && graphics.length > -1) {
- this._data = graphics;
- }
- this._renderLayer.setChangeFlags({
- dataChanged: true,
- propsChanged: true,
- viewportChanged: true,
- updateTriggersChanged: true
- });
- this._refreshData();
- var state = this._getLayerState();
- state.data = this._data || [];
- this._layerDefaultStyleCache = null;
- this._renderLayer.setNeedsRedraw(true);
- this._renderLayer.setState(state);
- },
- /**
- * @private
- * @function GraphicWebGLRenderer.prototype.drawGraphics
- * @description 绘制点要素。
- */
- drawGraphics: function drawGraphics(graphics) {
- this._clearBuffer();
- var size = this.layer._map.getSize();
- if (this._container.width !== size.x) {
- this._container.width = size.x;
- }
- if (this._container.height !== size.y) {
- this._container.height = size.y;
- }
- var mapPane = this.layer._map.getPanes().mapPane;
- var point = mapPane._leaflet_pos;
- this._container.style[CSS_TRANSFORM] = 'translate(' + -Math.round(point.x) + 'px,' + -Math.round(point.y) + 'px)';
- this._data = graphics || [];
- if (!this._renderLayer) {
- this._createInnerRender();
- }
- this._draw();
- },
- _initContainer: function _initContainer() {
- this._container = this._createCanvas(this.options.width, this.options.height);
- this._layerContainer = this.options.container;
- this._wrapper = external_L_default().DomUtil.create('div', "deck-wrapper", this._layerContainer);
- this._wrapper.appendChild(this._container);
- },
- _createCanvas: function _createCanvas(width, height) {
- //leaflet-layer 对应的css会自动设置position
- var canvas = external_L_default().DomUtil.create('canvas', 'graphicLayer leaflet-layer leaflet-zoom-hide');
- canvas.oncontextmenu = (external_L_default()).Util.falseFn;
- canvas.width = width;
- canvas.height = height;
- canvas.style.width = width + "px";
- canvas.style.height = height + "px";
- return canvas;
- },
- _pixelToMeter: function _pixelToMeter(pixel) {
- var bounds = this.layer._map.getBounds();
- var latlngRes = (bounds.getEast() - bounds.getWest()) / this.layer._map.getSize().x;
- var meterRes = latlngRes * (Math.PI * 6378137 / 180);
- return pixel * meterRes;
- },
- _createInnerRender: function _createInnerRender() {
- var me = this;
- var state = this._getLayerState();
- var color = state.color,
- radius = state.radius,
- opacity = state.opacity,
- highlightColor = state.highlightColor,
- radiusScale = state.radiusScale,
- radiusMinPixels = state.radiusMinPixels,
- radiusMaxPixels = state.radiusMaxPixels,
- strokeWidth = state.strokeWidth,
- outline = state.outline;
- var innerLayerOptions = {
- id: 'scatter-plot',
- data: me._data,
- pickable: Boolean(this.options.onClick) || Boolean(this.options.onHover),
- autoHighlight: true,
- color: color,
- opacity: opacity,
- radius: radius,
- radiusScale: radiusScale,
- highlightColor: highlightColor,
- radiusMinPixels: radiusMinPixels,
- radiusMaxPixels: radiusMaxPixels,
- strokeWidth: strokeWidth,
- outline: outline,
- getPosition: function getPosition(point) {
- if (!point) {
- return [0, 0, 0];
- }
- var lngLat = point.getLatLng();
- return lngLat && [lngLat.lng, lngLat.lat, 0];
- },
- getColor: function getColor(point) {
- var defaultStyle = me._getLayerDefaultStyle();
- var style = point && point.options;
- return style && style.color || defaultStyle.color;
- },
- getRadius: function getRadius(point) {
- var defaultStyle = me._getLayerDefaultStyle();
- var style = point && point.getStyle();
- return style && style.radius || defaultStyle.radius;
- },
- updateTriggers: {
- getColor: [color],
- getRadius: [radius]
- }
- };
- var _self = this;
- if (this.options.onClick) {
- innerLayerOptions.onClick = function () {
- _self._container.style.cursor = "pointer";
- _self.options.onClick.apply(_self, arguments);
- };
- }
- if (this.options.onHover) {
- innerLayerOptions.onHover = function () {
- _self._container.style.cursor = "pointer";
- _self.options.onHover.apply(_self, arguments);
- };
- }
- me._renderLayer = new window.DeckGL.ScatterplotLayer(innerLayerOptions);
- },
- _getLayerDefaultStyle: function _getLayerDefaultStyle() {
- if (this._layerDefaultStyleCache) {
- return this._layerDefaultStyleCache;
- }
- var _this$layer$options = this.layer.options,
- color = _this$layer$options.color,
- opacity = _this$layer$options.opacity,
- radius = _this$layer$options.radius,
- radiusScale = _this$layer$options.radiusScale,
- radiusMinPixels = _this$layer$options.radiusMinPixels,
- radiusMaxPixels = _this$layer$options.radiusMaxPixels,
- strokeWidth = _this$layer$options.strokeWidth,
- outline = _this$layer$options.outline;
- radius = this._pixelToMeter(radius);
- this._layerDefaultStyleCache = {
- color: color,
- opacity: opacity,
- radius: radius,
- radiusScale: radiusScale,
- radiusMinPixels: radiusMinPixels,
- radiusMaxPixels: radiusMaxPixels,
- strokeWidth: strokeWidth,
- outline: outline
- };
- return this._layerDefaultStyleCache;
- },
- _getLayerState: function _getLayerState() {
- var state = this.layer.getState();
- state.zoom = state.zoom - 1;
- return state;
- },
- _draw: function _draw() {
- var state = this._getLayerState();
- this._refreshData();
- state.data = this._data || [];
- var deckOptions = {};
- for (var key in state) {
- deckOptions[key] = state[key];
- }
- this._layerDefaultStyleCache = null;
- this._renderLayer.setNeedsRedraw(true);
- deckOptions.layers = [this._renderLayer];
- deckOptions.canvas = this._container;
- deckOptions.onBeforeRender = this._onBeforeRender.bind(this);
- deckOptions.onAfterRender = this._onAfterRender.bind(this);
- if (!this.deckGL) {
- this.deckGL = new window.DeckGL.experimental.DeckGLJS(deckOptions);
- } else {
- this.deckGL.setProps(deckOptions);
- }
- },
- _clearBuffer: function _clearBuffer() {
- if (this.deckGL) {
- var lm = this.deckGL.layerManager;
- lm && lm.context.gl.clear(lm.context.gl.COLOR_BUFFER_BIT);
- }
- return this;
- },
- _refreshData: function _refreshData() {
- var graphics = this._data || [];
- var sGraphics = !external_L_default().Util.isArray(graphics) ? [graphics] : [].concat(graphics); //this.layer.props.data不能被重新赋值,只能在原数组上进行操作
- if (!this._renderLayer.props.data) {
- this._renderLayer.props.data = [];
- }
- this._renderLayer.props.data.length = 0;
- for (var i = 0; i < sGraphics.length; i++) {
- this._renderLayer.props.data.push(sGraphics[i]);
- }
- this._data = this._renderLayer.props.data;
- },
- _handleClick: WebGLRenderer_emptyFunc,
- //deck渲染开始前调用,可以重写
- _onBeforeRender: WebGLRenderer_emptyFunc,
- //deck渲染结束后调用,可以重写
- _onAfterRender: WebGLRenderer_emptyFunc,
- //以下为leaflet再带的renderer的方法,为了保持接口正常调用,故增加这几个方法
- _removePath: function _removePath() {
- this._wrapper.parentElement.removeChild(this._wrapper);
- this._container = null;
- this._wrapper = null;
- return this;
- },
- _initPath: WebGLRenderer_emptyFunc,
- _addPath: WebGLRenderer_emptyFunc,
- containsPoint: WebGLRenderer_emptyFunc
- });
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/graphic/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/GraphicLayer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- var Renderer = ['canvas', 'webgl'];
- var defaultProps = {
- color: [0, 0, 0, 255],
- opacity: 0.8,
- radius: 10,
- radiusScale: 1,
- radiusMinPixels: 0,
- radiusMaxPixels: Number.MAX_SAFE_INTEGER,
- strokeWidth: 1,
- outline: false
- };
- /**
- * @class L.supermap.graphicLayer
- * @classdesc 高效率点图层类。
- * @category Visualization Graphic
- * @extends {L.Path}
- * @param {Array.<L.supermap.graphic>} graphics - 要素对象。
- * @param {Object} options - 图层参数。
- * @param {string} [options.render='canvas'] - 指定使用的渲染器。可选值:“webgl”,“canvas”(webgl 渲染目前只支持散点)。
- * @param {Array.<number>} [options.color=[0, 0, 0, 255]] - 要素颜色。
- * @param {Array.<number>} [options.highlightColor] - webgl 渲染时要素高亮颜色。
- * @param {number} [options.opacity=0.8] - 要素透明度。
- * @param {number} [options.radius=10] - 要素半径,单位像素。
- * @param {number} [options.radiusScale=1] - webgl 渲染时的要素放大倍数。
- * @param {number} [options.radiusMinPixels=0] - webgl 渲染时的要素半径最小值(像素)。
- * @param {number} [options.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - webgl 渲染时的要素半径最大值(像素)。
- * @param {number} [options.strokeWidth=1] - 边框大小。
- * @param {boolean} [options.outline=false] - 是否显示边框。
- * @param {Function} [options.onClick] - 图层鼠标点击响应事件(webgl、canvas 渲染时都有用)。
- * @param {Function} [options.onHover] - 图层鼠标悬停响应事件(只有 webgl 渲染时有用)。
- */
- var GraphicLayer = external_L_default().Path.extend({
- initialize: function initialize(graphics, options) {
- this.graphics = [].concat(graphics);
- var opt = options || {}; // 由于是canvas实现所以不能更改pane
- opt.pane = 'overlayPane';
- external_L_default().Util.setOptions(this, opt); //因为跟基类的renderer冲突,所以采用render这个名字
- this.options.render = this.options.render || Renderer[0]; //浏览器支持webgl并且指定使用webgl渲染才使用webgl渲染
- if (!Detector.supportWebGL2()) {
- this.options.render = Renderer[0];
- }
- if (this.options.interactive) {
- this.on('click mousemove dblclick mousedown mouseup mouseout contextmenu', this._handleClick, this);
- }
- },
- /**
- * @private
- * @function L.supermap.graphicLayer.prototype.getEvents
- * @description 获取事件。
- * @returns {Object} 返回该图层支持的事件对象。
- */
- getEvents: function getEvents() {
- var events = {
- resize: this._resize.bind(this),
- moveend: this._moveEnd.bind(this)
- };
- return events;
- },
- /**
- * @private
- * @function L.supermap.graphicLayer.prototype.onAdd
- * @description 添加图形。
- */
- onAdd: function onAdd(map) {
- this._map = map;
- this.defaultStyle = this._getDefaultStyle(this.options);
- this._renderer = this._createRenderer();
- this._container = this._renderer._container; // this.addInteractiveTarget(this._container);
- external_L_default().Path.prototype.onAdd.call(this);
- },
- /**
- * @private
- * @override
- * @function L.supermap.graphicLayer.prototype.onRemove
- * @description 移除图层。
- */
- onRemove: function onRemove() {
- this.off('click mousemove dblclick mousedown mouseup contextmenu', this._handleClick, this);
- this._renderer._removePath(this);
- },
- /**
- * @function L.supermap.graphicLayer.prototype.setGraphics
- * @description 设置绘制的点要素数据,会覆盖之前的所有要素。
- * @param {Array.<L.supermap.graphic>} graphics - 点要素对象数组。
- */
- setGraphics: function setGraphics(graphics) {
- this.graphics = this.graphics || [];
- this.graphics.length = 0;
- var sGraphics = !external_L_default().Util.isArray(graphics) ? [graphics] : [].concat(graphics);
- this.graphics = [].concat(sGraphics);
- this.update();
- },
- /**
- * @function L.supermap.graphicLayer.prototype.addGraphics
- * @description 追加点要素,不会覆盖之前的要素。
- * @param {Array.<L.supermap.graphic>} graphics - 点要素对象数组。
- */
- addGraphics: function addGraphics(graphics) {
- this.graphics = this.graphics || [];
- var sGraphics = !external_L_default().Util.isArray(graphics) ? [graphics] : [].concat(graphics);
- this.graphics = this.graphics.concat(sGraphics);
- this.update();
- },
- /**
- * @function L.supermap.graphicLayer.prototype.getGraphicBy
- * @description 在 Vector 的要素数组 graphics 里面遍历每一个 graphic,当 graphic[property]===value 时,返回此 graphic(并且只返回第一个)。
- * @param {string} property - graphic 的某个属性名称。
- * @param {string} value - property 所对应的值。
- * @returns {ol.Graphic} 一个匹配的 graphic。
- */
- getGraphicBy: function getGraphicBy(property, value) {
- var graphic = null;
- for (var index in this.graphics) {
- if (this.graphics[index][property] === value) {
- graphic = this.graphics[index];
- break;
- }
- }
- return graphic;
- },
- /**
- * @function L.supermap.graphicLayer.prototype.getGraphicById
- * @description 通过给定一个 id,返回对应的矢量要素。
- * @param {string} graphicId - 矢量要素的属性 id。
- * @returns {ol.Graphic} 一个匹配的 graphic。
- */
- getGraphicById: function getGraphicById(graphicId) {
- return this.getGraphicBy('id', graphicId);
- },
- /**
- * @function L.supermap.graphicLayer.prototype.getGraphicsByAttribute
- * @description 通过给定一个属性的 key 值和 value 值,返回所有匹配的要素数组。
- * @param {string} attrName - graphic 的某个属性名称。
- * @param {string} attrValue - property 所对应的值。
- * @returns {Array.<ol.Graphic>} 一个匹配的 graphic 数组。
- */
- getGraphicsByAttribute: function getGraphicsByAttribute(attrName, attrValue) {
- var graphic,
- foundgraphics = [];
- for (var index in this.graphics) {
- graphic = this.graphics[index];
- if (graphic && graphic.attributes) {
- if (graphic.attributes[attrName] === attrValue) {
- foundgraphics.push(graphic);
- }
- }
- }
- return foundgraphics;
- },
- /**
- * @function L.supermap.graphicLayer.prototype.removeGraphics
- * @description 删除要素数组,默认将删除所有要素。
- * @param {Array.<ol.Graphic>} [graphics=null] - 删除的 graphics 数组。
- */
- removeGraphics: function removeGraphics() {
- var graphics = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
- //当 graphics 为 null 、为空数组,或 === this.graphics,则清除所有要素
- if (!graphics || graphics.length === 0 || graphics === this.graphics) {
- this.graphics.length = 0;
- this.update();
- return;
- }
- if (!Util.isArray(graphics)) {
- graphics = [graphics];
- }
- for (var i = graphics.length - 1; i >= 0; i--) {
- var graphic = graphics[i]; //如果我们传入的grapchic在graphics数组中没有的话,则不进行删除,
- //并将其放入未删除的数组中。
- var findex = Util.indexOf(this.graphics, graphic);
- if (findex === -1) {
- continue;
- }
- this.graphics.splice(findex, 1);
- } //删除完成后重新设置 setGraphics,以更新
- this.update();
- },
- /**
- * @function L.supermap.graphicLayer.prototype.setStyle
- * @description 设置图层要素整体样式。
- * @param {Object} styleOptions - 样式对象。
- * @param {Array.<number>} [styleOptions.color=[0, 0, 0, 255]] - 点颜色。
- * @param {number} [styleOptions.radius=10] - 点半径。
- * @param {number} [styleOptions.opacity=0.8] - 不透明度。
- * @param {Array} [styleOptions.highlightColor] - 高亮颜色,目前只支持 rgba 数组。
- * @param {number} [styleOptions.radiusScale=1] - 点放大倍数。
- * @param {number} [styleOptions.radiusMinPixels=0] - 半径最小值(像素)。
- * @param {number} [styleOptions.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - 半径最大值(像素)。
- * @param {number} [styleOptions.strokeWidth=1] - 边框大小。
- * @param {boolean} [styleOptions.outline=false] - 是否显示边框。
- */
- setStyle: function setStyle(styleOptions) {
- var _opt = this.options;
- var styleOpt = {
- color: _opt.color,
- radius: _opt.radius,
- opacity: _opt.opacity,
- highlightColor: _opt.highlightColor,
- radiusScale: _opt.radiusScale,
- radiusMinPixels: _opt.radiusMinPixels,
- radiusMaxPixels: _opt.radiusMaxPixels,
- strokeWidth: _opt.strokeWidth,
- outline: _opt.outline
- };
- this.options = external_L_default().Util.extend(this.options, styleOpt, styleOptions);
- this.defaultStyle = this._getDefaultStyle(this.options);
- this.update();
- },
- /**
- * @function L.supermap.graphicLayer.prototype.update
- * @description 更新图层,数据或者样式改变后调用。
- */
- update: function update() {
- this._layerRenderer.update(this.graphics);
- },
- /**
- * @function L.supermap.graphicLayer.prototype.clear
- * @description 释放图层资源。
- */
- clear: function clear() {
- this.removeGraphics();
- },
- /**
- * @function L.supermap.graphicLayer.prototype.getRenderer
- * @description 获取渲染器。
- * @returns {Object} 内部渲染器。
- */
- getRenderer: function getRenderer() {
- return this._renderer;
- },
- /**
- * @function L.supermap.graphicLayer.prototype.getState
- * @description 获取当前地图及图层状态。
- * @returns {Object} 地图及图层状态,包含地图状态信息和本图层相关状态。
- */
- getState: function getState() {
- var map = this._map;
- var width = map.getSize().x;
- var height = map.getSize().y;
- var center = map.getCenter();
- var longitude = center.lng;
- var latitude = center.lat;
- var zoom = map.getZoom();
- var maxZoom = map.getMaxZoom();
- var mapViewport = {
- longitude: longitude,
- latitude: latitude,
- zoom: zoom,
- maxZoom: maxZoom,
- pitch: 0,
- bearing: 0
- };
- var state = {};
- for (var key in mapViewport) {
- state[key] = mapViewport[key];
- }
- state.width = width;
- state.height = height;
- var options = this.options;
- state.color = options.color;
- state.radius = options.radius;
- state.opacity = options.opacity;
- state.highlightColor = options.highlightColor;
- state.radiusScale = options.radiusScale;
- state.radiusMinPixels = options.radiusMinPixels;
- state.radiusMaxPixels = options.radiusMaxPixels;
- state.strokeWidth = options.strokeWidth;
- state.outline = options.outline;
- return state;
- },
- _resize: function _resize() {
- var size = this._map.getSize();
- this._container.width = size.x;
- this._container.height = size.y;
- this._container.style.width = size.x + 'px';
- this._container.style.height = size.y + 'px';
- var mapOffset = this._map.containerPointToLayerPoint([0, 0]);
- external_L_default().DomUtil.setPosition(this._container, mapOffset);
- this._update();
- },
- _moveEnd: function _moveEnd() {
- if (this._layerRenderer instanceof GraphicWebGLRenderer) {
- this._update();
- }
- },
- //使用canvas渲染或webgl渲染
- _createRenderer: function _createRenderer() {
- var map = this._map;
- var width = map.getSize().x;
- var height = map.getSize().y;
- var _renderer;
- if (this.options.render === Renderer[0]) {
- _renderer = new GraphicCanvasRenderer(this, {
- width: width,
- height: height,
- renderer: map.getRenderer(this)
- });
- } else {
- var optDefault = external_L_default().Util.setOptions({}, defaultProps);
- var opt = external_L_default().Util.setOptions({
- options: optDefault
- }, this.options);
- opt = external_L_default().Util.setOptions(this, opt);
- opt.container = map.getPane('overlayPane');
- opt.width = width;
- opt.height = height;
- _renderer = new GraphicWebGLRenderer(this, opt);
- }
- _renderer.defaultStyle = this.defaultStyle;
- this._layerRenderer = _renderer;
- return this._layerRenderer.getRenderer();
- },
- /**
- * @private
- * @override
- */
- _update: function _update() {
- if (this._map) {
- this._updatePath();
- }
- },
- /**
- * @private
- * @override
- */
- _updatePath: function _updatePath() {
- var graphics = this._getGraphicsInBounds();
- this._renderer.drawGraphics(graphics, this.defaultStyle);
- },
- /**
- * @private
- * @override
- */
- _project: function _project() {
- var me = this;
- me._getGraphicsInBounds().map(function (graphic) {
- var point = me._map.latLngToLayerPoint(graphic.getLatLng());
- var w = me._clickTolerance();
- var p = [graphic._anchor + w, graphic._anchor + w];
- graphic._pxBounds = new (external_L_default()).Bounds(point.subtract(p), point.add(p));
- return graphic;
- });
- me._pxBounds = external_L_default().bounds(external_L_default().point(0, 0), external_L_default().point(this._container.width, this._container.height));
- },
- _getDefaultStyle: function _getDefaultStyle(options) {
- var target = {};
- if (options.color) {
- target.fill = true;
- var color = this.toRGBA(options.color);
- target.color = color;
- target.fillColor = color;
- }
- if (options.opacity) {
- target.opacity = options.opacity;
- target.fillOpacity = options.opacity;
- }
- if (options.radius) {
- target.radius = options.radius;
- }
- if (options.strokeWidth) {
- target.weight = options.strokeWidth;
- }
- if (options.outline) {
- target.stroke = options.outline;
- }
- return new CircleStyle(target).getStyle();
- },
- toRGBA: function toRGBA(colorArray) {
- return "rgba(".concat(colorArray[0], ",").concat(colorArray[1], ",").concat(colorArray[2], ",").concat((colorArray[3] || 255) / 255, ")");
- },
- _getGraphicsInBounds: function _getGraphicsInBounds() {
- var me = this;
- var graphicsInBounds = [];
- var viewBounds = me._map.getBounds();
- this.graphics.map(function (graphic) {
- if (viewBounds.contains(graphic.getLatLng())) {
- graphicsInBounds.push(graphic);
- }
- return graphic;
- });
- return graphicsInBounds;
- },
- _handleClick: function _handleClick(evt) {
- this._layerRenderer._handleClick(evt);
- },
- /**
- * @private
- * @override
- */
- beforeAdd: (external_L_default()).Util.falseFn,
- /**
- * @private
- * @override
- */
- _containsPoint: function _containsPoint(p) {
- return this._layerRenderer.containsPoint(p);
- }
- });
- var graphicLayer = function graphicLayer(graphics, options) {
- return new GraphicLayer(graphics, options);
- };
- (external_L_default()).supermap.graphicLayer = graphicLayer;
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/GraphThemeLayer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.graphThemeLayer
- * @classdesc 统计专题图图层。
- * @category Visualization Theme
- * @extends L.supermap.ThemeLayer
- * @description 统计专题图通过为每个要素绘制统计图表来反映其对应的专题值的大小。它可同时表示多个字段属性信息,在区域本身与各区域之间形成横向和纵向的对比。
- * 统计专题图多用于具有相关数量特征的地图上,比如表示不同地区多年的粮食产量、GDP、人口等,不同时段客运量、地铁流量等。
- * 目前提供的统计图类型有:柱状图(Bar),折线图(Line),饼图(Pie),三维柱状图(Bar3D),点状图(Point),环状图(Ring)。
- * @param {string} name - 专题图表名称。
- * @param {string} chartsType - 图表类型。目前可用:"Bar","Bar3D","Line","Point","Pie","Ring"。
- * @param {Object} options - 待设置的参数。
- * @param {boolean} [options.isOverLay=true] - 是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表。
- * @param {string} options.themeFields - 指定创建专题图字段。
- * @param {boolean} [options.alwaysMapCRS=false] - 要素坐标是否和地图坐标系一致,要素默认是经纬度坐标。
- * @param {Object} [options.cache] - 缓存。
- * @param {Object} [options.charts] - 图表。
- * @param {string} [options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
- * @param {number} [options.opacity=1] - 图层透明度。
- * @param {Array} [options.TFEvents] - 专题要素事件临时存储。专题要素事件临时存储。
- * @param {Object} options.chartsSetting - 各类型图表的 chartsSetting 对象可设属性请参考具体图表模型类的注释中对 chartsSetting 对象可设属性的描述。chartsSetting 对象通常都具有以下 5 个基础可设属性:</br>
- * @param {number} options.chartsSetting.width - 专题要素(图表)宽度。
- * @param {number} options.chartsSetting.height - 专题要素(图表)高度。
- * @param {Array.<number>} options.chartsSetting.codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
- * @param {number} [options.chartsSetting.XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
- * @param {number} [options.chartsSetting.YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
- * @param {Array.<number>} [options.chartsSetting.dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值,长度为 4 的一维数组。
- * @param {number} [options.chartsSetting.decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
- * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权描述信息。
- */
- var GraphThemeLayer = ThemeLayer.extend({
- options: {
- //是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表,默认值:true。
- isOverLay: true
- },
- initialize: function initialize(name, chartsType, options) {
- var newArgs = [];
- newArgs.push(name);
- newArgs.push(options);
- ThemeLayer.prototype.initialize.apply(this, newArgs);
- this.chartsType = chartsType;
- this.themeFields = options && options.themeFields ? options.themeFields : null;
- this.charts = options && options.charts ? options.charts : [];
- this.cache = options && options.cache ? options.cache : {};
- this.chartsSetting = options && options.chartsSetting ? options.chartsSetting : {};
- },
- /**
- * @function L.supermap.GraphThemeLayer.prototype.setChartsType
- * @description 设置图表类型,此函数可动态改变图表类型。在调用此函数前请通过 chartsSetting 为新类型的图表做相关配置。图表类型,目前支持:"Bar", "Bar3D", "Line","Point","Pie","Ring"。
- * @param {string} chartsType - 图表类型。目前可用:"Bar", "Bar3D", "Line","Point","Pie","Ring"。
- */
- setChartsType: function setChartsType(chartsType) {
- this.chartsType = chartsType;
- this.redraw();
- },
- /**
- * @function L.supermap.GraphThemeLayer.prototype.addFeatures
- * @description 向专题图图层中添加数据。
- * @param {(SuperMap.ServerFeature|L.supermap.themeFeature|GeoJSONObject)} features - 待添加的要素。
- */
- addFeatures: function addFeatures(features) {
- var me = this;
- /**
- * @event L.supermap.GraphThemeLayer#beforefeaturesadded
- * @description 向专题图图层中添加数据之前触发。
- * @property {(SuperMap.ServerFeature|L.supermap.themeFeature|GeoJSONObject)} features - 待添加的要素。
- */
- me.fire("beforefeaturesadded", {
- features: features
- }); //转换 features 形式
- this.features = this.toiClientFeature(features); //绘制专题要素
- if (!me.renderer) {
- return;
- }
- if (me._map) {
- me.redrawThematicFeatures(me._map.getBounds());
- } else {
- me.redrawThematicFeatures();
- }
- },
- /**
- * @function L.supermap.GraphThemeLayer.prototype.redrawThematicFeatures
- * @description 重绘所有专题要素 此方法包含绘制专题要素的所有步骤,包含用户数据到专题要素的转换,压盖处理,缓存等步骤。地图漫游时调用此方法进行图层刷新。
- * @param {L.bounds} bounds - 重绘的范围。
- */
- redrawThematicFeatures: function redrawThematicFeatures(bounds) {
- var me = this; //清除当前所有可视元素
- me.renderer.clearAll();
- var features = me.features;
- if (this.options.alwaysMapCRS && bounds && bounds instanceof (external_L_default()).LatLngBounds) {
- var crs = this._map.options.crs;
- bounds = external_L_default().bounds(crs.project(bounds.getSouthWest()), crs.project(bounds.getNorthEast()));
- }
- bounds = CommontypesConversion.toSuperMapBounds(bounds);
- for (var i = 0, len = features.length; i < len; i++) {
- var feature = features[i]; // 要素范围判断
- var feaBounds = feature.geometry.getBounds(); //剔除当前视图(地理)范围以外的数据
- if (bounds && !bounds.intersectsBounds(feaBounds)) {
- continue;
- }
- var cache = me.cache; // 用feature id 做缓存标识
- var cacheField = feature.id; // 数据对应的图表是否已缓存,没缓存则重新创建图表
- if (!cache[cacheField]) {
- cache[cacheField] = cacheField;
- var chart = me.createThematicFeature(feature); // 压盖处理权重值
- var isValidOverlayWeightField = me.overlayWeightField && feature.attributes[me.overlayWeightField] && !isNaN(feature.attributes[me.overlayWeightField]);
- if (chart && isValidOverlayWeightField) {
- chart["__overlayWeight"] = feature.attributes[me.overlayWeightField];
- }
- if (chart) {
- me.charts.push(chart);
- }
- }
- }
- me.drawCharts();
- },
- /**
- * @function L.supermap.GraphThemeLayer.prototype.createThematicFeature
- * @description 创建专题要素(图表)。
- * @param {Object} feature - 待创建的要素。
- */
- createThematicFeature: function createThematicFeature(feature) {
- var me = this;
- var thematicFeature; // 检查图表创建条件并创建图形
- if (Theme_Theme[me.chartsType] && me.themeFields && me.chartsSetting) {
- thematicFeature = new Theme_Theme[me.chartsType](feature, me, me.themeFields, me.chartsSetting);
- } // thematicFeature 是否创建成功
- if (!thematicFeature) {
- return false;
- } // 对专题要素执行图形装载
- thematicFeature.assembleShapes();
- return thematicFeature;
- },
- /**
- * @function L.supermap.GraphThemeLayer.prototype.drawCharts
- * @description 绘制图表。包含压盖处理。
- */
- drawCharts: function drawCharts() {
- var me = this;
- if (!me.renderer) {
- return;
- } // 图表权重值处理
- if (me.overlayWeightField) {
- me._sortChart();
- }
- if (me.options && !me.options.isOverLay) {
- // 不进行避让
- me._addOverlayShape();
- } else {
- //进行避让
- me._addNoOverlayShape();
- } // 绘制图形
- me.renderer.render();
- },
- /**
- * @function L.supermap.GraphThemeLayer.prototype.getShapesByFeatureID
- * @description 通过 FeatureID 获取 feature 关联的所有图形。如果不传入此参数,函数将返回所有图形。
- * @param {number} featureID - 要素 ID。
- */
- getShapesByFeatureID: function getShapesByFeatureID(featureID) {
- var me = this,
- list = [];
- var shapeList = me.renderer.getAllShapes();
- if (!featureID) {
- return shapeList;
- }
- for (var i = 0, len = shapeList.length; i < len; i++) {
- var si = shapeList[i];
- if (si.refDataID && featureID === si.refDataID) {
- list.push(si);
- }
- }
- return list;
- },
- /**
- * @function L.supermap.GraphThemeLayer.prototype.isQuadrilateralOverLap
- * @description 判断两个四边形是否有压盖。
- * @param {Array.<Object>} quadrilateral - 四边形节点数组。
- * @example
- * [{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}];
- * @param {Array.<Object>} quadrilateral2 - 第二个四边形节点数组。
- */
- isQuadrilateralOverLap: function isQuadrilateralOverLap(quadrilateral, quadrilateral2) {
- var me = this;
- var quadLen = quadrilateral.length,
- quad2Len = quadrilateral2.length;
- if (quadLen !== 5 || quad2Len !== 5) {
- return null;
- } //不是四边形
- var OverLap = false; //如果两四边形互不包含对方的节点,则两个四边形不相交
- for (var i = 0; i < quadLen; i++) {
- if (me.isPointInPoly(quadrilateral[i], quadrilateral2)) {
- OverLap = true;
- break;
- }
- }
- for (var _i = 0; _i < quad2Len; _i++) {
- if (me.isPointInPoly(quadrilateral2[_i], quadrilateral)) {
- OverLap = true;
- break;
- }
- } //加上两矩形十字相交的情况
- for (var _i2 = 0; _i2 < quadLen - 1; _i2++) {
- if (OverLap) {
- break;
- }
- for (var j = 0; j < quad2Len - 1; j++) {
- var isLineIn = Util.lineIntersection(quadrilateral[_i2], quadrilateral[_i2 + 1], quadrilateral2[j], quadrilateral2[j + 1]);
- if (isLineIn.CLASS_NAME === "SuperMap.Geometry.Point") {
- OverLap = true;
- break;
- }
- }
- }
- return OverLap;
- },
- /**
- * @function L.supermap.GraphThemeLayer.prototype.isPointInPoly
- * @description 判断一个点是否在多边形里面(射线法)。
- * @param {Object} pt - 需要判定的点对象,该对象含有属性 x(横坐标),属性 y(纵坐标)。
- * @param {Array.<Object>} poly - 多边形节点数组。
- * 例如一个四边形:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
- */
- isPointInPoly: function isPointInPoly(pt, poly) {
- for (var isIn = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) {
- (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);
- }
- return isIn;
- },
- /**
- * @function L.supermap.GraphThemeLayer.prototype.isChartInMap
- * @description 判断图表是否在地图里。
- * @param {SuperMap.Bounds} mapPxBounds - 地图像素范围。
- * @param {Array.<Object>} chartPxBounds - 图表范围的四边形节点数组。
- * 例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
- */
- isChartInMap: function isChartInMap(mapPxBounds, chartPxBounds) {
- var mb = mapPxBounds;
- var isIn = false;
- for (var i = 0, len = chartPxBounds.length; i < len; i++) {
- var cb = chartPxBounds[i];
- if (cb.x >= mb.left && cb.x <= mb.right && cb.y >= mb.top && cb.y <= mb.bottom) {
- isIn = true;
- break;
- }
- }
- return isIn;
- },
- /**
- * @function L.supermap.GraphThemeLayer.prototype.clearCache
- * @description 清除缓存数据。
- */
- clearCache: function clearCache() {
- this.cache = {};
- this.charts = [];
- },
- /**
- * @function L.supermap.GraphThemeLayer.prototype.removeFeatures
- * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素(数据)。
- * @param {Array.<SuperMap.Feature.Vector>} features - 待删除的要素。
- */
- removeFeatures: function removeFeatures(features) {
- // eslint-disable-line no-unused-vars
- var me = this;
- me.clearCache();
- ThemeLayer.prototype.removeFeatures.apply(me, arguments);
- },
- /**
- * @function L.supermap.GraphThemeLayer.prototype.removeAllFeatures
- * @description 清除当前图层所有的矢量要素。
- */
- removeAllFeatures: function removeAllFeatures() {
- var me = this;
- me.clearCache();
- ThemeLayer.prototype.removeAllFeatures.apply(me, arguments);
- },
- /**
- * @function L.supermap.GraphThemeLayer.prototype.redraw
- * @description 重绘该图层,成功则返回 true,否则返回 false。
- */
- redraw: function redraw() {
- var me = this;
- me.clearCache();
- return ThemeLayer.prototype.redraw.apply(me, arguments);
- },
- /**
- * @function L.supermap.GraphThemeLayer.prototype.clear
- * @description 清除图层。清除的内容包括数据(features) 、专题要素、缓存。
- */
- clear: function clear() {
- var me = this;
- if (me.renderer) {
- me.renderer.clearAll();
- me.renderer.refresh();
- }
- me.removeAllFeatures();
- me.clearCache();
- },
- /**
- * @function L.supermap.GraphThemeLayer.prototype.getWeightFieldValue
- * @description 获取权重字段的值。
- * @param {SuperMap.Feature.Vector} feature - 矢量要素。
- * @param {Array.<string>} weightField - 字段名数组。
- * @param {number} defaultValue - 当通过 weightField 获取不到权重值时,使用 defaultValue 作为权重值。
- */
- getWeightFieldValue: function getWeightFieldValue(feature, weightField, defaultValue) {
- if (typeof defaultValue === "undefined" || isNaN(defaultValue)) {
- defaultValue = 0;
- }
- if (!feature.attributes) {
- return defaultValue;
- }
- var fieldValue = feature.attributes[weightField];
- if (typeof fieldValue === "undefined" || isNaN(fieldValue)) {
- fieldValue = defaultValue;
- }
- return fieldValue;
- },
- _sortChart: function _sortChart() {
- var me = this;
- if (!me.charts) {
- return;
- }
- me.charts.sort(function (cs, ce) {
- if (typeof cs["__overlayWeight"] === "undefined" && typeof ce["__overlayWeight"] === "undefined") {
- return 0;
- } else if (typeof cs["__overlayWeight"] !== "undefined" && typeof ce["__overlayWeight"] === "undefined") {
- return -1;
- } else if (typeof cs["__overlayWeight"] === "undefined" && typeof ce["__overlayWeight"] !== "undefined") {
- return 1;
- } else if (typeof cs["__overlayWeight"] !== "undefined" && typeof ce["__overlayWeight"] !== "undefined") {
- return parseFloat(cs["__overlayWeight"]) < parseFloat(ce["__overlayWeight"]) ? 1 : -1;
- }
- return 0;
- });
- },
- _addOverlayShape: function _addOverlayShape() {
- var me = this;
- var charts = me.charts;
- for (var m = 0, len_m = charts.length; m < len_m; m++) {
- var chart_m = charts[m]; // 图形参考位置 (reSetLocation 会更新 chartBounds)
- var shapeROP_m = chart_m.resetLocation(); // 添加图形
- var shapes_m = chart_m.shapes;
- for (var n = 0, slen_n = shapes_m.length; n < slen_n; n++) {
- shapes_m[n].refOriginalPosition = shapeROP_m;
- me.renderer.addShape(shapes_m[n]);
- }
- }
- },
- _addNoOverlayShape: function _addNoOverlayShape() {
- var me = this; // 压盖判断所需 chartsBounds 集合
- var mapBounds = me._map.getBounds();
- var crs = this._map.options.crs;
- if (this.options.alwaysMapCRS) {
- mapBounds = external_L_default().bounds(crs.project(mapBounds.getSouthWest()), crs.project(mapBounds.getNorthEast()));
- }
- mapBounds = CommontypesConversion.toSuperMapBounds(mapBounds);
- var charts = me.charts;
- var chartsBounds = []; // 获取地图像素 bounds
- var mapPxLT = me.getLocalXY(new LonLat(mapBounds.left, mapBounds.top));
- var mapPxRB = me.getLocalXY(new LonLat(mapBounds.right, mapBounds.bottom));
- var mBounds = new Bounds(mapPxLT[0], mapPxRB[1], mapPxRB[0], mapPxLT[1]); // 压盖处理 & 添加图形
- for (var i = 0, len = charts.length; i < len; i++) {
- var chart = charts[i]; // 图形参考位置 (reSetLocation 会更新 chartBounds)
- var shapeROP = chart.resetLocation(); // 图表框
- var cbs = chart.chartBounds;
- var cBounds = [{
- "x": cbs.left,
- "y": cbs.top
- }, {
- "x": cbs.left,
- "y": cbs.bottom
- }, {
- "x": cbs.right,
- "y": cbs.bottom
- }, {
- "x": cbs.right,
- "y": cbs.top
- }, {
- "x": cbs.left,
- "y": cbs.top
- }]; // 地图范围外不绘制
- if (mBounds && !me.isChartInMap(mBounds, cBounds)) {
- continue;
- } // 是否压盖
- var isOverlay = false;
- for (var j = 0; j < chartsBounds.length; j++) {
- //压盖判断
- if (me.isQuadrilateralOverLap(cBounds, chartsBounds[j])) {
- isOverlay = true;
- break;
- }
- }
- if (isOverlay) {
- continue;
- } else {
- chartsBounds.push(cBounds);
- } // 添加图形
- var shapes = chart.shapes;
- for (var _j = 0, slen = shapes.length; _j < slen; _j++) {
- shapes[_j].refOriginalPosition = shapeROP;
- me.renderer.addShape(shapes[_j]);
- }
- }
- }
- });
- var graphThemeLayer = function graphThemeLayer(name, chartsType, options) {
- return new GraphThemeLayer(name, chartsType, options);
- };
- (external_L_default()).supermap.graphThemeLayer = graphThemeLayer;
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/RankSymbolThemeLayer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.rankSymbolThemeLayer
- * @classdesc 符号专题图图层。
- * @category Visualization Theme
- * @description 符号专题图通过为每个要素绘制符号大小来反映其对应的专题值的大小;它只能表示单个个字段属性信息。
- * 符号专题图多用于具有相关数量特征的地图上,比如表示不同地区粮食产量、GDP、人口等。
- * 即通过制作一个符号专题图,就可以清晰展示各个区域相关 Value 的分布差异等。
- * 目前提供的符号图形有:圆形(后续进行扩展、心形、五角星、多角心、图片等)。
- * @extends {L.supermap.GraphThemeLayer}
- * @param {string} name - 专题图层名。
- * @param {SuperMap.ChartType} symbolType - 符号类型。目前支持:"Circle"。
- * @param {Object} options - 参数。
- * @param {boolean} [options.isOverLay=true] - 是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表。
- * @param {string} options.themeFields - 指定创建专题图字段。
- * @param {boolean} [options.alwaysMapCRS=false] - 要素坐标是否和地图坐标系一致,要素默认是经纬度坐标。
- * @param {string} [options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
- * @param {number} [options.opacity=1] - 图层透明度。
- * @param {Array} [options.TFEvents] - 专题要素事件临时存储。
- * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权描述信息。
- */
- var RankSymbolThemeLayer = GraphThemeLayer.extend({
- /**
- * @member {Object} L.supermap.rankSymbolThemeLayer.prototype.symbolSetting
- * @description 符号 Circle 配置对象。
- * @property {Array} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
- * @property {number} [maxR] - 圆形的最大半径。
- * @property {number} [minR] - 圆形的最小半径。
- * @property {string} [fillColor] - 圆形的填充色,如:fillColor: "#FFB980"。
- * @property {Object} [circleStyle] - 圆形的基础 style,此参数控制圆形基础样式,优先级低于 circleStyleByFields 和 circleStyleByCodomain。
- * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
- * @property {Object} [circleHoverStyle] - 圆形 hover 状态时的样式,circleHoverAble 为 true 时有效。
- * @property {boolean} [circleHoverAble=true] - 是否允许圆形使用 hover 状态。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
- * @property {boolean} [circleClickAble=true] - 是否允许圆形被点击。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
- */
- initialize: function initialize(name, symbolType, options) {
- // eslint-disable-line no-unused-vars
- GraphThemeLayer.prototype.initialize.apply(this, arguments);
- this.symbolType = symbolType;
- this.symbolSetting = {};
- },
- /**
- * @function L.supermap.rankSymbolThemeLayer.prototype.setSymbolType
- * @description 设置符号类型,此函数可动态改变图表类型。在调用此函数前请通过 symbolSetting 为新类型的图表做相关配置。
- * @param {SuperMap.ChartType} symbolType - 目前支持:"Circle"。
- *
- */
- //todo 这里怎么又是supermap的类型
- setSymbolType: function setSymbolType(symbolType) {
- this.symbolType = symbolType;
- this.redraw();
- },
- /**
- * @function L.supermap.rankSymbolThemeLayer.prototype.createThematicFeature
- * @description 创建专题要素(图形)。
- * @param {SuperMap.Feature.Vector} feature - 要创建的专题图形要素。
- * @returns {SuperMap.Feature.Theme} 专题图形。
- */
- createThematicFeature: function createThematicFeature(feature) {
- var me = this;
- var thematicFeature; // 检查图形创建条件并创建图形
- if (Theme_Theme[me.symbolType] && me.themeField && me.symbolSetting) {
- thematicFeature = new Theme_Theme[me.symbolType](feature, me, [me.themeField], me.symbolSetting);
- } // thematicFeature 是否创建成功
- if (!thematicFeature) {
- return false;
- } // 对专题要素执行图形装载
- thematicFeature.assembleShapes();
- return thematicFeature;
- }
- });
- var rankSymbolThemeLayer = function rankSymbolThemeLayer(name, symbolType, options) {
- return new RankSymbolThemeLayer(name, symbolType, options);
- };
- (external_L_default()).supermap.rankSymbolThemeLayer = rankSymbolThemeLayer;
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/SVGRenderer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.SVGRenderer
- * @classdesc 矢量图层缩放渲染器类。
- * @category Visualization VectorTile
- * @private
- * @extends {L.SVG}
- * @param {Object} tileCoord - 切片坐标系。
- * @param {number} tileSize - 切片大小。
- * @param {Object} options - 渲染参数。
- */
- var SVGRenderer = external_L_default().SVG.extend({
- initialize: function initialize(tileCoord, tileSize, options) {
- external_L_default().SVG.prototype.initialize.call(this, options);
- this._tileCoord = tileCoord;
- this._size = tileSize;
- this._initContainer();
- this._container.setAttribute('width', this._size.x);
- this._container.setAttribute('height', this._size.y);
- this._container.setAttribute('viewBox', [0, 0, this._size.x, this._size.y].join(' '));
- this._layers = {};
- },
- /**
- * @function L.supermap.SVGRenderer.prototype.getCoord
- * @description 获取坐标。
- */
- getCoord: function getCoord() {
- return this._tileCoord;
- },
- /**
- * @function L.supermap.SVGRenderer.prototype.getContainer
- * @description 获取容器。
- */
- getContainer: function getContainer() {
- return this._container;
- },
- onAdd: (external_L_default()).Util.falseFn,
- /**
- * @function L.supermap.SVGRenderer.prototype.addTo
- * @description 添加到地图。
- * @param {L.Map} map - map 对象。
- */
- addTo: function addTo(map) {
- this._map = map;
- if (this.options.interactive) {
- for (var i in this._layers) {
- var layer = this._layers[i];
- layer._path.style.pointerEvents = 'auto';
- this._map._targets[external_L_default().stamp(layer._path)] = layer;
- }
- }
- },
- /**
- * @function L.supermap.SVGRenderer.prototype.removeFrom
- * @description 从地图移除。
- * @param {L.Map} map - map 对象。
- */
- removeFrom: function removeFrom(map) {
- var _map = map || this._map;
- if (this.options.interactive) {
- for (var i in this._layers) {
- var layer = this._layers[i];
- delete _map._targets[external_L_default().stamp(layer._path)];
- }
- }
- delete this._map;
- },
- _addPath: function _addPath(layer) {
- if (!this._rootGroup) {
- this._initContainer();
- }
- if (!this._rootGroup) {
- this._rootGroup = this._container;
- }
- this._rootGroup.appendChild(layer._path);
- this._layers[external_L_default().stamp(layer)] = layer;
- },
- _updateIcon: function _updateIcon(layer) {
- var path = layer._path = external_L_default().SVG.create('image'),
- options = layer.options,
- iconUrl = options.iconUrl;
- if (options.iconSize) {
- var size = external_L_default().point(options.iconSize),
- anchor = size && size.divideBy(2, true),
- p = layer._point.subtract(anchor);
- path.setAttribute('x', p.x);
- path.setAttribute('y', p.y);
- path.setAttribute('width', size.x + 'px');
- path.setAttribute('height', size.y + 'px');
- } else {
- var img = new Image();
- img.src = iconUrl;
- external_L_default().DomEvent.on(img, 'load', function () {
- var size = external_L_default().point([img.width, img.height]),
- anchor = size && size.divideBy(2, true),
- p = layer._point.subtract(anchor);
- path.setAttribute('x', p.x);
- path.setAttribute('y', p.y);
- path.setAttribute('width', size.x + 'px');
- path.setAttribute('height', size.y + 'px');
- });
- }
- path.setAttribute('href', iconUrl);
- }
- });
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/CanvasRenderer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.CanvasRenderer
- * @private
- * @classdesc 画布渲染器。
- * @category Visualization VectorTile
- * @extends {L.Canvas}
- * @param {Object} tileCoord - 切片坐标系
- * @param {number} tileSize - 切片大小
- * @param {Object} options - 渲染器参数
- */
- var CanvasRenderer = external_L_default().Canvas.extend({
- initialize: function initialize(tileCoord, tileSize, options) {
- external_L_default().Canvas.prototype.initialize.call(this, options);
- this._tileCoord = tileCoord;
- this._size = tileSize;
- this._initContainer();
- this._container.setAttribute('width', this._size.x);
- this._container.setAttribute('height', this._size.y);
- this._layers = {};
- this._drawnLayers = {};
- this._drawing = true;
- if (options.interactive) {
- this._container.style.pointerEvents = 'auto';
- }
- },
- /**
- * @function L.supermap.CanvasRenderer.prototype.getCoord
- * @description 获取坐标。
- */
- getCoord: function getCoord() {
- return this._tileCoord;
- },
- /**
- * @function L.supermap.CanvasRenderer.prototype.getContainer
- * @description 获取容器。
- */
- getContainer: function getContainer() {
- return this._container;
- },
- /**
- * @function L.supermap.CanvasRenderer.prototype.getOffset
- * @description 停止渲染。
- */
- getOffset: function getOffset() {
- return this._tileCoord.scaleBy(this._size).subtract(this._map.getPixelOrigin());
- },
- onAdd: (external_L_default()).Util.falseFn,
- /**
- * @function L.supermap.CanvasRenderer.prototype.addTo
- * @description 添加到地图。
- * @param {L.Map} map - map 对象。
- */
- addTo: function addTo(map) {
- this._map = map;
- },
- /**
- * @function L.supermap.CanvasRenderer.prototype.removeFrom
- * @description 从地图移除。
- * @param {L.Map} map - map 对象。
- */
- removeFrom: function removeFrom(map) {
- // eslint-disable-line no-unused-vars
- delete this._map;
- },
- _updateDashArray: function _updateDashArray(layer) {
- var array = layer.options.dashArray;
- if (array && typeof array === "string") {
- var parts = array.split(','),
- dashArray = [],
- i;
- for (i = 0; i < parts.length; i++) {
- dashArray.push(Number(parts[i]));
- }
- layer.options._dashArray = dashArray;
- } else {
- layer.options._dashArray = array;
- }
- },
- _onClick: function _onClick(e) {
- var point = this._map.mouseEventToLayerPoint(e).subtract(this.getOffset()),
- layer,
- clickedLayer;
- for (var id in this._layers) {
- layer = this._layers[id];
- if (layer.options.interactive && layer._containsPoint(point) && !this._map._draggableMoved(layer)) {
- clickedLayer = layer;
- }
- }
- if (clickedLayer) {
- external_L_default().DomEvent.stop(e);
- this._fireEvent([clickedLayer], e);
- }
- },
- _onMouseMove: function _onMouseMove(e) {
- if (!this._map || this._map.dragging.moving() || this._map._animatingZoom) {
- return;
- }
- var point = this._map.mouseEventToLayerPoint(e).subtract(this.getOffset());
- this._handleMouseHover(e, point);
- },
- _updateIcon: function _updateIcon(layer) {
- if (!this._drawing) {
- return;
- }
- var options = layer.options,
- ctx = this._ctx,
- img = layer._getImage();
- if (options.iconSize && img.complete) {
- var size = external_L_default().point(options.iconSize),
- anchor = size && size.divideBy(2, true),
- p = layer._point.subtract(anchor);
- ctx.drawImage(img, p.x, p.y, size.x, size.y);
- } else {
- external_L_default().DomEvent.on(img, 'load', function () {
- var size = external_L_default().point([img.width, img.height]),
- anchor = size && size.divideBy(2, true),
- p = layer._point.subtract(anchor);
- ctx.drawImage(img, p.x, p.y, size.x, size.y);
- });
- }
- this._drawnLayers[layer._leaflet_id] = layer;
- }
- });
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/VectorFeatureType.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @constant L.supermap.VectorFeatureType
- * @description 矢量图层要素类型,和 SuperMap.CartoStyleMap 中的类型相对应。
- * @category Visualization VectorTile
- * @private
- */
- var VectorFeatureType = {
- LABEL: "LABEL",
- //label实际处理成TEXT
- TEXT: "TEXT",
- POINT: "POINT",
- LINE: "LINE",
- REGION: "REGION"
- };
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/Symbolizer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.Symbolizer
- * @description 符号类。
- * @category Visualization VectorTile
- * @private
- * @extends {L.Class}
- * @param {Object} feature — 要素。
- */
- var Symbolizer = external_L_default().Class.extend({
- initialize: function initialize(feature) {
- this.properties = feature.properties;
- this.type = feature.type;
- this.layerName = feature.layerName;
- },
- /**
- * @function L.supermap.Symbolizer.prototype.render
- * @description 绘制线符号。
- * @param {Object} renderer - 渲染器。
- * @param {string} style - 符号样式。
- */
- render: function render(renderer, style) {
- this._renderer = renderer;
- this._container = renderer._container;
- this.options = style;
- renderer._initPath(this);
- renderer._updateStyle(this);
- var elem = this.getElement();
- if (elem && this.layerName) {
- external_L_default().DomUtil.addClass(elem, this.layerName);
- }
- },
- /**
- * @function L.supermap.Symbolizer.prototype.updateStyle
- * @description 更新替换符号样式。
- * @param {Object} renderer - 渲染器。
- * @param {string} style - 符号样式。
- */
- updateStyle: function updateStyle(renderer, style) {
- this.options = style;
- renderer._updateStyle(this);
- },
- /**
- * @function L.supermap.Symbolizer.prototype.getElement
- * @description 获取文本信息。
- */
- getElement: function getElement() {
- return this._path || this._renderer._container;
- },
- _getPixelBounds: function _getPixelBounds() {
- var parts = this._parts;
- var bounds = external_L_default().bounds([]);
- for (var i = 0; i < parts.length; i++) {
- var part = parts[i];
- for (var j = 0; j < part.length; j++) {
- bounds.extend(part[j]);
- }
- }
- var w = this._clickTolerance(),
- p = new (external_L_default()).Point(w, w);
- bounds.min._subtract(p);
- bounds.max._add(p);
- return bounds;
- },
- _clickTolerance: (external_L_default()).Path.prototype._clickTolerance
- });
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/TextSymbolizer.js
- function TextSymbolizer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { TextSymbolizer_typeof = function _typeof(obj) { return typeof obj; }; } else { TextSymbolizer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return TextSymbolizer_typeof(obj); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.TextSymbolizer
- * @classdesc 文本符号类。
- * @category Visualization VectorTile
- * @private
- * @extends {L.Path}
- * @param {Object} feature - 要素。
- * @param {number} pxPerExtent - 文本符号大小。
- */
- var TextSymbolizer = external_L_default().Path.extend({
- /**
- * @member L.supermap.TextSymbolizer.prototype.includes
- * @description 包含符号。
- */
- includes: Symbolizer.prototype,
- options: {
- color: 'white',
- fillColor: 'black',
- fill: true,
- fillOpacity: 1,
- opacity: 0.6,
- weight: 1,
- rotation: 0.0,
- stroke: true,
- fontFamily: "Arial Unicode MS Regular",
- fontSize: 14,
- fontWeight: 'normal',
- textAlign: 'center',
- offsetX: 1,
- offsetY: 1
- },
- initialize: function initialize(feature, pxPerExtent) {
- Symbolizer.prototype.initialize.call(this, feature);
- this._makeFeatureParts(feature, pxPerExtent);
- this.options.offsetX = pxPerExtent || 1;
- this.options.offsetY = pxPerExtent || 1;
- },
- /**
- * @function L.supermap.TextSymbolizer.prototype.render
- * @description 绘制点符号。
- * @param {Object} renderer - 渲染器。
- * @param {string} style - 符号样式。
- */
- render: function render(renderer, style) {
- //原本类型就是text的情况
- if (this.properties.texts) {
- this._text = this.properties.texts[0];
- } //类型是label的情况
- if (!this._text) {
- var attributes = this.properties.attributes;
- this._text = attributes && this.properties.textField ? attributes[this.properties.textField] || "" : "";
- }
- var options = this.options;
- this._pxBounds = external_L_default().bounds(this._point, this._point);
- Symbolizer.prototype.render.apply(this, [renderer, style]);
- this.options = external_L_default().Util.extend(options, style);
- this._updatePath();
- },
- _makeFeatureParts: function _makeFeatureParts(feat, pxPerExtent) {
- pxPerExtent = pxPerExtent || {
- x: 1,
- y: 1
- };
- var coord = feat.geometry[0];
- if (TextSymbolizer_typeof(coord[0]) === 'object' && 'x' in coord[0]) {
- this._point = external_L_default().point(coord[0]).scaleBy(pxPerExtent);
- this._empty = (external_L_default()).Util.falseFn;
- } else {
- this._point = external_L_default().point(coord).scaleBy(pxPerExtent);
- this._empty = (external_L_default()).Util.falseFn;
- }
- },
- /**
- * @function L.supermap.TextSymbolizer.prototype.makeInteractive
- * @description 设置交互。
- */
- makeInteractive: function makeInteractive() {
- this._updateBounds();
- },
- /**
- * @function L.supermap.TextSymbolizer.prototype.updateStyle
- * @description 更新替换符号样式。
- * @param {Object} renderer - 渲染器。
- * @param {string} style - 符号样式。
- */
- updateStyle: function updateStyle(renderer, style) {
- this._updateBounds();
- return Symbolizer.prototype.updateStyle.call(this, renderer, style);
- },
- _updateBounds: function _updateBounds() {
- var w = this._renderer._getTextWidth(this);
- var p = [w / 2, w / 2];
- this._pxBounds = external_L_default().bounds(this._point.subtract(p), this._point.add(p));
- },
- _updatePath: function _updatePath() {
- this._renderer._updateText(this);
- },
- _containsPoint: function _containsPoint(point) {
- // eslint-disable-line no-unused-vars
- return false;
- }
- });
- CanvasRenderer.include({
- _getTextWidth: function _getTextWidth(layer) {
- return this._ctx.measureText(layer._text).width;
- },
- _updateText: function _updateText(layer) {
- if (!this._drawing || layer._empty()) {
- return;
- }
- var container = this.getContainer();
- var size = this._map.getSize();
- container.width = size.x;
- container.height = size.y;
- container.style.width = size.x + 'px';
- container.style.height = size.y + 'px';
- var ctx = this._ctx,
- options = layer.options,
- offsetX = options.offsetX || 1,
- offsetY = options.offsetY || 1,
- p = layer._point.subtract(external_L_default().point(offsetX, offsetY));
- if (!options.fill) {
- return;
- }
- this._drawnLayers[layer._leaflet_id] = layer;
- ctx.fillRect(0, 0, size.x, size.y);
- ctx.font = [options.fontWeight ? options.fontWeight : "normal", options.fontSize ? options.fontSize : "14px", options.fontFamily ? options.fontFamily : "Arial Unicode MS Regular,Microsoft Yahei"].join(" ");
- ctx.textAlign = options.textAlign;
- ctx.lineWidth = options.weight;
- ctx.fillStyle = options.fillColor;
- ctx.fillText(layer._text, p.x, p.y);
- ctx.strokeStyle = options.color;
- ctx.strokeText(layer._text, p.x, p.y);
- ctx.rotate(options.rotation);
- }
- });
- SVGRenderer.include({
- _getTextWidth: function _getTextWidth(layer) {
- return layer._path.getComputedTextLength() || 0;
- },
- _initPath: function _initPath(layer) {
- var path;
- if (TextSymbolizer && layer instanceof TextSymbolizer) {
- path = layer._path = external_L_default().SVG.create("text");
- path.textContent = layer._text;
- } else {
- path = layer._path = external_L_default().SVG.create("path");
- }
- if (layer.options.className) {
- external_L_default().DomUtil.addClass(path, layer.options.className);
- }
- if (layer.options.interactive) {
- external_L_default().DomUtil.addClass(path, 'leaflet-interactive');
- }
- this._updateStyle(layer);
- this._layers[external_L_default().stamp(layer)] = layer;
- },
- _updateText: function _updateText(layer) {
- var path = layer._path,
- options = layer.options,
- offsetX = options.offsetX || 1,
- offsetY = options.offsetY || 1,
- p = layer._point.subtract(external_L_default().point(offsetX, offsetY));
- path.setAttribute('x', p.x);
- path.setAttribute('y', p.y);
- options.rotation = options.rotation || 0;
- path.setAttribute('transform', 'rotate(' + options.rotation / Math.PI * 180 + ' ' + p.x + ' ' + p.y + ')');
- path.setAttribute('text-anchor', options.textAlign === 'center' ? 'middle' : options.textAlign);
- path.style.fontSize = options.fontSize;
- path.style.fontFamily = options.fontFamily;
- path.style.fontWeight = options.fontWeight || "normal";
- path.style.glyphOrientationVertical = options.rotation || '';
- if (options.stroke) {
- path.setAttribute('stroke', options.color);
- path.setAttribute('stroke-linecap', 'round');
- path.setAttribute('stroke-linejoin', 'round');
- path.setAttribute('stroke-opacity', options.opacity);
- path.setAttribute('stroke-width', options.weight > 1 ? options.weight / 10 : options.weight);
- } else {
- path.setAttribute('stroke', 'none');
- }
- if (options.fill) {
- path.setAttribute('fill', options.fillColor || options.color);
- path.setAttribute('fill-opacity', options.fillOpacity);
- } else {
- path.setAttribute('fill', 'none');
- }
- }
- });
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/PointSymbolizer.js
- function PointSymbolizer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { PointSymbolizer_typeof = function _typeof(obj) { return typeof obj; }; } else { PointSymbolizer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return PointSymbolizer_typeof(obj); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.PointSymbolizer
- * @classdesc 点符号类。
- * @category Visualization VectorTile
- * @private
- * @extends {L.CircleMarker}
- * @param {Object} feature - 点要素。
- * @param {number} pxPerExtent - 点符号大小。
- */
- var PointSymbolizer = external_L_default().CircleMarker.extend({
- /**
- * @member L.supermap.PointSymbolizer.prototype.includes
- * @description 包含符号。
- */
- includes: Symbolizer.prototype,
- statics: {
- iconCache: {}
- },
- initialize: function initialize(feature, pxPerExtent) {
- Symbolizer.prototype.initialize.call(this, feature);
- this._makeFeatureParts(feature, pxPerExtent);
- },
- getLatLng: undefined,
- /**
- * @function L.supermap.PointSymbolizer.prototype.render
- * @description 绘制点符号。
- * @param {Object} renderer - 渲染器。
- * @param {string} style - 符号样式。
- */
- render: function render(renderer, style) {
- Symbolizer.prototype.render.call(this, renderer, style);
- this._radius = style.radius || (external_L_default()).CircleMarker.prototype.options.radius;
- this._updatePath();
- },
- _makeFeatureParts: function _makeFeatureParts(feat, pxPerExtent) {
- pxPerExtent = pxPerExtent || {
- x: 1,
- y: 1
- };
- var coord = feat.geometry[0];
- if (PointSymbolizer_typeof(coord[0]) === 'object' && 'x' in coord[0]) {
- this._point = external_L_default().point(coord[0]).scaleBy(pxPerExtent);
- this._empty = (external_L_default()).Util.falseFn;
- } else {
- this._point = external_L_default().point(coord).scaleBy(pxPerExtent);
- this._empty = (external_L_default()).Util.falseFn;
- }
- },
- /**
- * @function L.supermap.PointSymbolizer.prototype.makeInteractive
- * @description 设置交互。
- */
- makeInteractive: function makeInteractive() {
- this._updateBounds();
- },
- /**
- * @function L.supermap.PointSymbolizer.prototype.updateStyle
- * @description 更新替换符号样式。
- * @param {Object} renderer - 渲染器。
- * @param {string} style - 符号样式。
- */
- updateStyle: function updateStyle(renderer, style) {
- this._radius = style.radius || this._radius;
- this._updateBounds();
- return Symbolizer.prototype.updateStyle.call(this, renderer, style);
- },
- _updateBounds: function _updateBounds() {
- var icon = this.options.iconUrl;
- if (icon && this.options.iconSize) {
- var size = external_L_default().point(this.options.iconSize),
- anchor = size && size.divideBy(2, true),
- p = this._point.subtract(anchor);
- this._pxBounds = new (external_L_default()).Bounds(p, p.add(size));
- } else {
- external_L_default().CircleMarker.prototype._updateBounds.call(this);
- }
- },
- _updatePath: function _updatePath() {
- if (this.options.iconUrl) {
- this._renderer._updateIcon(this);
- } else {
- external_L_default().CircleMarker.prototype._updatePath.call(this);
- }
- },
- _getImage: function _getImage() {
- if (!this.options.iconUrl) {
- return null;
- }
- var url = this.options.iconUrl,
- img = PointSymbolizer.iconCache[url];
- if (!img) {
- var iconSize = this.options.iconSize || [50, 50];
- img = PointSymbolizer.iconCache[url] = this._createIcon(url, iconSize);
- }
- return img;
- },
- _createIcon: function _createIcon(url, iconSize) {
- var src = url;
- if (!src) {
- throw new Error('iconUrl not set in Icon options (see the docs).');
- }
- var img = document.createElement('img'),
- name = "icon";
- img.src = src;
- img.className = 'leaflet-marker-' + name + ' ' + (this.layerName || ''); // var options = this.options;
- var sizeOption = iconSize;
- if (typeof sizeOption === 'number') {
- sizeOption = [sizeOption, sizeOption];
- }
- if (sizeOption) {
- var size = external_L_default().point(sizeOption),
- anchor = external_L_default().point(size && size.divideBy(2, true));
- if (size) {
- img.style.width = size.x + 'px';
- img.style.height = size.y + 'px';
- }
- if (anchor) {
- img.style.marginLeft = -anchor.x + 'px';
- img.style.marginTop = -anchor.y + 'px';
- }
- }
- img.onload = function () {
- if (!sizeOption) {
- img.style.width = this.width + 'px';
- img.style.height = this.height + 'px';
- }
- };
- return img;
- },
- _containsPoint: function _containsPoint(p) {
- var icon = this.options.iconUrl;
- if (icon) {
- return this._pxBounds.contains(p);
- } else {
- return external_L_default().CircleMarker.prototype._containsPoint.call(this, p);
- }
- }
- });
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/SymbolizerPolyBase.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.PolyBase
- * @classdesc 多边形基类。
- * @category Visualization VectorTile
- * @private
- */
- //@type {{_makeFeatureParts: PolyBase._makeFeatureParts, makeInteractive: PolyBase.makeInteractive}}
- var PolyBase = {
- _makeFeatureParts: function _makeFeatureParts(feat, pxPerExtent) {
- pxPerExtent = pxPerExtent || {
- x: 1,
- y: 1
- };
- var rings = feat.geometry;
- var coord;
- this._parts = [];
- for (var i = 0; i < rings.length; i++) {
- var ring = rings[i];
- var part = [];
- for (var j = 0; j < ring.length; j++) {
- coord = ring[j];
- part.push(external_L_default().point(coord).scaleBy(pxPerExtent));
- }
- this._parts.push(part);
- }
- },
- /**
- * @function L.supermap.PolyBase.prototype.makeInteractive
- * @description 设置交互。
- */
- makeInteractive: function makeInteractive() {
- this._pxBounds = this._getPixelBounds();
- }
- };
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/LineSymbolizer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.LineSymbolizer
- * @classdesc 线符号类。
- * @category Visualization VectorTile
- * @private
- * @extends {L.Polyline}
- * @param {Object} feature - 线要素。
- * @param {number} pxPerExtent - 线长。
- */
- var LineSymbolizer = external_L_default().Polyline.extend({
- /**
- * @member L.supermap.LineSymbolizer.prototype.includes
- * @description 包含符号。
- */
- includes: [Symbolizer.prototype, PolyBase],
- initialize: function initialize(feature, pxPerExtent) {
- Symbolizer.prototype.initialize.call(this, feature);
- this._makeFeatureParts(feature, pxPerExtent);
- },
- /**
- * @function L.supermap.LineSymbolizer.prototype.render
- * @description 绘制线符号。
- * @param {Object} renderer - 渲染器。
- * @param {string} style - 符号样式。
- */
- render: function render(renderer, style) {
- style.fill = false;
- Symbolizer.prototype.render.call(this, renderer, style);
- this._updatePath();
- },
- /**
- * @function L.supermap.LineSymbolizer.prototype.updateStyle
- * @description 更新替换符号样式。
- * @param {Object} renderer - 渲染器。
- * @param {string} style - 符号样式。
- */
- updateStyle: function updateStyle(renderer, style) {
- style.fill = false;
- Symbolizer.prototype.updateStyle.call(this, renderer, style);
- }
- });
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/RegionSymbolizer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.RegionSymbolizer
- * @classdesc 面符号类。
- * @category Visualization VectorTile
- * @private
- * @extends {L.Polygon}
- * @param {Object} feature - 面要素。
- * @param {number} pxPerExtent - 面积像素大小。
- */
- var RegionSymbolizer = external_L_default().Polygon.extend({
- /**
- * @member L.supermap.RegionSymbolizer.prototype.includes
- * @description 包含符号。
- */
- includes: [Symbolizer.prototype, PolyBase],
- initialize: function initialize(feature, pxPerExtent) {
- Symbolizer.prototype.initialize.call(this, feature);
- this._makeFeatureParts(feature, pxPerExtent);
- },
- /**
- * @function L.supermap.RegionSymbolizer.prototype.render
- * @description 绘制面符号。
- * @param {Object} renderer - 渲染器。
- * @param {string} style - 符号样式。
- */
- render: function render(renderer, style) {
- Symbolizer.prototype.render.call(this, renderer, style);
- this._updatePath();
- }
- });
- // EXTERNAL MODULE: ./node_modules/pbf/index.js
- var node_modules_pbf = __webpack_require__(943);
- var pbf_default = /*#__PURE__*/__webpack_require__.n(node_modules_pbf);
- // EXTERNAL MODULE: ./node_modules/@mapbox/vector-tile/index.js
- var vector_tile = __webpack_require__(721);
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/VectorTilePBF.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.VectorTilePBF
- * @classdesc 矢量瓦片 PBF(MVT) 表述出图。
- * @category Visualization VectorTile
- * @private
- * @extends {L.Class}
- * @param {string} url - 矢量瓦片 PBF(MVT) 表述出图服务地址。
- */
- var VectorTilePBF = external_L_default().Class.extend({
- initialize: function initialize(url) {
- this.url = url;
- },
- /**
- * @function L.supermap.VectorTilePBF.prototype.getTile
- * @description 获取瓦片 PBF(MVT)。
- * @returns {Promise} 返回包含矢量瓦片信息的 Promise 对象。
- */
- getTile: function getTile() {
- var me = this;
- return FetchRequest.get(me.url, null, {
- timeout: 10000
- }).then(function (response) {
- if (!response.ok) {
- return {
- layers: []
- };
- }
- return response.blob().then(function (blob) {
- var reader = new FileReader();
- return new Promise(function (resolve) {
- reader.addEventListener("loadend", function () {
- var pbf = new (pbf_default())(reader.result);
- return resolve(new vector_tile.VectorTile(pbf));
- });
- reader.readAsArrayBuffer(blob);
- });
- });
- }).then(function (json) {
- return me._processVectorTileSpec(json);
- });
- },
- _processVectorTileSpec: function _processVectorTileSpec(vectorTile) {
- var layers = [];
- for (var layerName in vectorTile.layers) {
- var feats = [];
- for (var i = 0; i < vectorTile.layers[layerName].length; i++) {
- var feat = vectorTile.layers[layerName].feature(i);
- feat.geometry = feat.loadGeometry();
- feat.layerName = layerName;
- feat.properties = {
- attributes: external_L_default().Util.extend({}, feat.properties),
- id: feat.id
- };
- switch (feat.type) {
- case 1:
- feat.type = VectorFeatureType.POINT;
- break;
- case 2:
- feat.type = VectorFeatureType.LINE;
- break;
- case 3:
- feat.type = VectorFeatureType.REGION;
- break;
- default:
- break;
- }
- feats.push(feat);
- }
- var layer = {};
- layer.features = feats;
- layer.layerName = layerName;
- layer.extent = vectorTile.layers[layerName].extent;
- layers.push(layer);
- }
- return layers;
- }
- });
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/VectorTileJSON.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.VectorTileJSON
- * @classdesc iServer 矢量瓦片 JSON 表述出图。
- * @category Visualization VectorTile
- * @private
- * @extends {L.Class}
- * @param {string} url - 矢量瓦片 JSON 表述服务地址。
- */
- var VectorTileJSON = external_L_default().Class.extend({
- initialize: function initialize(url) {
- this.url = url;
- },
- /**
- * @function L.supermap.VectorTileJSON.prototype.getTile
- * @description 获取瓦片。
- * @returns {Promise} 返回包含矢量瓦片信息的 Promise 对象。
- */
- getTile: function getTile() {
- var me = this;
- return FetchRequest.get(me.url, null, {
- timeout: 10000
- }).then(function (response) {
- return response.json();
- }).then(function (json) {
- return me._processRecordSets(json, me);
- });
- },
- _processRecordSets: function _processRecordSets(records, scope) {
- var recordsets = records.recordsets; // 如果iServer支持了tileFeature geojson表述则不需要此步骤
- recordsets = scope._convertToGeoJSON(recordsets);
- if (!recordsets) {
- return null;
- } //类似VT标准的数据格式,并为每个要素添加一个layerName字段
- for (var i = 0; i < recordsets.length; i++) {
- var recordset = recordsets[i];
- for (var j = 0; j < recordset.features.length; j++) {
- var feature = recordset.features[j];
- feature = scope._convertToVectorLayerFeature(feature, scope);
- feature.layerName = recordset.layerName;
- recordset.features[j] = feature;
- }
- recordset.extent = 256;
- delete recordset.fieldTypes;
- delete recordset.fields;
- }
- return recordsets;
- },
- _convertToVectorLayerFeature: function _convertToVectorLayerFeature(feature, scope) {
- if (!feature.geometry) {
- return;
- }
- var newFeature = {};
- var geom = feature.geometry,
- type = geom.type,
- coords = geom.coordinates,
- tags = feature.properties,
- id = tags.id,
- i,
- j,
- rings,
- projectedRing;
- if (type === 'Point') {
- newFeature = tags && tags.texts ? scope._createFeature(id, VectorFeatureType.TEXT, [coords], tags) : scope._createFeature(id, VectorFeatureType.POINT, [coords], tags);
- } else if (type === 'MultiPoint') {
- newFeature = scope._createFeature(id, VectorFeatureType.POINT, coords, tags);
- } else if (type === 'LineString') {
- newFeature = scope._createFeature(id, VectorFeatureType.LINE, [coords], tags);
- } else if (type === 'MultiLineString' || type === 'Polygon') {
- rings = [];
- for (i = 0; i < coords.length; i++) {
- projectedRing = coords[i];
- if (type === 'Polygon') {
- projectedRing.outer = i === 0;
- }
- rings.push(projectedRing);
- }
- var featureType = type === 'Polygon' ? VectorFeatureType.REGION : VectorFeatureType.LINE;
- newFeature = scope._createFeature(id, featureType, rings, tags);
- } else if (type === 'MultiPolygon') {
- rings = [];
- for (i = 0; i < coords.length; i++) {
- for (j = 0; j < coords[i].length; j++) {
- projectedRing = coords[i][j];
- projectedRing.outer = j === 0;
- rings.push(projectedRing);
- }
- }
- newFeature = scope._createFeature(id, VectorFeatureType.REGION, rings, tags);
- } else {
- throw new Error('Illegal GeoJSON object');
- }
- return newFeature;
- },
- _convertToGeoJSON: function _convertToGeoJSON(recordsets) {
- if (!recordsets) {
- return;
- }
- for (var i = 0; i < recordsets.length; i++) {
- var recordset = recordsets[i];
- for (var j = 0; j < recordset.features.length; j++) {
- var feature = recordset.features[j];
- var points = [];
- var startIndex = 0;
- for (var k = 0; k < feature.geometry.parts.length; k++) {
- var partPointsLength = feature.geometry.parts[k] * 2;
- for (var l = 0, index = startIndex; l < partPointsLength; l += 2, index += 2) {
- var x = feature.geometry.points[index];
- var y = feature.geometry.points[index + 1];
- points.push({
- x: x,
- y: y
- });
- }
- startIndex += partPointsLength;
- }
- feature.geometry.points = points;
- }
- recordset.features = toGeoJSON(recordset.features).features;
- }
- return recordsets;
- },
- _createFeature: function _createFeature(id, type, geometry, properties) {
- return {
- id: id,
- type: type,
- geometry: geometry,
- properties: properties
- };
- }
- });
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/VectorTileFormat.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @constant L.supermap.vectorTileFormat
- * @category Visualization TileVector
- * @classdesc 矢量瓦片格式。
- */
- var VectorTileFormat = {
- JSON: "JSON",
- MVT: "MVT",
- PBF: "PBF"
- };
- (external_L_default()).supermap.VectorTileFormat = VectorTileFormat;
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/VectorTile.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.VectorTile
- * @classdesc 矢量瓦片图层基类。
- * @category Visualization VectorTile
- * @private
- * @extends {L.Class}
- * @param {Object} options - 矢量瓦片类构造可选参数。
- * @param {string} [options.layer] - 图层名称。
- * @param {(number|L.Point)} [options.tileSize=256] - 瓦片大小。
- * @param {string} [options.format] - 返回值类型。
- * @param {Object} [options.coords] - 坐标系统对象。
- * @param {Object} [options.renderer] - 渲染器对象。
- * @param {Function} done - 回调函数。
- */
- var VectorTile = external_L_default().Class.extend({
- initialize: function initialize(options, done) {
- this.layer = options.layer;
- this.tileSize = options.layer.getTileSize();
- this.format = options.format;
- this.coords = options.coords;
- this.renderer = options.renderer;
- this.done = done;
- this.layer._textVectorTiles = {};
- },
- /**
- * @function L.supermap.VectorTile.prototype.renderTile
- * @description 渲染切片。
- */
- renderTile: function renderTile() {
- var me = this,
- layer = me.layer,
- coords = me.coords;
- var tileFeatureUrl = layer._getTileUrl(coords);
- var format = [VectorTileFormat.MVT, VectorTileFormat.PBF];
- var tileFeaturePromise;
- if (format.indexOf(me.format.toUpperCase()) > -1) {
- tileFeaturePromise = new VectorTilePBF(tileFeatureUrl);
- } else {
- tileFeaturePromise = new VectorTileJSON(tileFeatureUrl);
- }
- tileFeaturePromise.getTile().then(function (tileFeature) {
- me.render(tileFeature, coords);
- });
- },
- /**
- * @function L.supermap.VectorTile.prototype.render
- * @description 渲染切片要素。
- * @param {Object} tileFeature - 要渲染的切片要素。
- * @param {Object} coords - 切片坐标参数对象。
- */
- render: function render(tileFeature, coords) {
- if (!tileFeature) {
- return;
- }
- var me = this,
- renderer = me.renderer,
- tileLayer = me.layer;
- for (var k = 0; k < tileFeature.length; k++) {
- var layer = tileFeature[k],
- layerName = layer.layerName;
- tileLayer._dataLayerNames[layerName] = true;
- var pxPerExtent = me.tileSize.divideBy(layer.extent);
- var layerStyleInfo = tileLayer.getLayerStyleInfo(layer.layerName);
- for (var i = 0; i < layer.features.length; i++) {
- var feat = layer.features[i];
- if (!feat) {
- continue;
- } //标签图层处理为文本
- if (layerStyleInfo && layerStyleInfo.type === VectorFeatureType.LABEL && feat.type === VectorFeatureType.POINT && feat.properties.attributes) {
- feat.type = VectorFeatureType.TEXT;
- }
- var styleOptions = me._getStyleOptions(coords, feat, layerName, me);
- if (!styleOptions.length) {
- continue;
- }
- var featureLayer = me._createFeatureLayer(feat, pxPerExtent);
- if (!featureLayer) {
- continue;
- } // 保存文本图层单独绘制,避免被压盖
- var param = {
- scope: me,
- coords: coords,
- renderer: renderer
- };
- if (me._extractTextLayer(feat, featureLayer, styleOptions, param)) {
- continue;
- }
- for (var j = 0; j < styleOptions.length; j++) {
- var style = me._validateStyle(styleOptions[j], feat.type);
- featureLayer.render(renderer, style);
- renderer._addPath(featureLayer);
- }
- if (tileLayer.options.interactive) {
- featureLayer.makeInteractive();
- }
- var featureKey = tileLayer._getFeatureKey(feat.id, layerName);
- renderer._features[featureKey] = {
- layerName: layerName,
- feature: featureLayer
- };
- }
- }
- if (tileLayer._map) {
- renderer.addTo(tileLayer._map);
- }
- external_L_default().Util.requestAnimFrame(me.done.bind(coords, null, me.layer._vectorTiles[me.layer._tileCoordsToKey(coords)]));
- },
- // 保存文本图层单独绘制,避免被压盖
- _extractTextLayer: function _extractTextLayer(feat, featureLayer, style, param) {
- if (feat.type !== VectorFeatureType.TEXT) {
- return false;
- }
- var me = param.scope,
- coords = param.coords,
- tileLayer = me.layer,
- key = tileLayer._tileCoordsToKey(coords);
- var id = feat.id,
- layerName = feat.layerName;
- var textTileLayers = tileLayer._textVectorTiles[key];
- if (!textTileLayers) {
- textTileLayers = {
- layers: {},
- coords: coords,
- renderer: param.renderer
- };
- } // 不同瓦片可能请求到同一个文本图层,为避免重复绘制,只保存绘制最后一个
- textTileLayers.layers[id] = {
- layer: featureLayer,
- style: style,
- layerName: layerName
- };
- tileLayer._textVectorTiles[key] = textTileLayers;
- return true;
- },
- _getStyleOptions: function _getStyleOptions(coords, feature, layerName, scope) {
- var me = scope;
- var tileLayer = me.layer;
- var styleOptions = tileLayer.getVectorTileLayerStyle(coords, feature) || me._defaultStyle(feature.type); //根据id和layerName识别唯一要素
- var id = feature.id,
- styleKey = tileLayer._getFeatureKey(id, layerName),
- styleOverride = tileLayer._overriddenStyles[styleKey];
- styleOptions = styleOverride ? styleOverride : styleOptions;
- styleOptions = styleOptions instanceof Function ? styleOptions(feature.properties, coords.z) : styleOptions;
- styleOptions = !(styleOptions instanceof Array) ? [styleOptions] : styleOptions;
- return styleOptions;
- },
- _createFeatureLayer: function _createFeatureLayer(feat, pxPerExtent) {
- var layer;
- switch (feat.type) {
- case VectorFeatureType.POINT:
- layer = new PointSymbolizer(feat, pxPerExtent);
- break;
- case VectorFeatureType.LINE:
- layer = new LineSymbolizer(feat, pxPerExtent);
- break;
- case VectorFeatureType.REGION:
- layer = new RegionSymbolizer(feat, pxPerExtent);
- break;
- case VectorFeatureType.TEXT:
- layer = new TextSymbolizer(feat, pxPerExtent);
- break;
- default:
- break;
- }
- var vectorLayer = this.layer;
- if (layer && vectorLayer.options.interactive) {
- layer.addEventParent(vectorLayer);
- }
- return layer;
- },
- //矫正一些参数
- _validateStyle: function _validateStyle(style, type) {
- //默认leaflet path的边宽为3,矩形颜色填充透明度为0.2,跟iClient不一样,故作调整
- (external_L_default()).Path.prototype.options.weight = 1;
- (external_L_default()).Path.prototype.options.fillOpacity = 1;
- switch (type) {
- case VectorFeatureType.POINT:
- return external_L_default().extend({}, (external_L_default()).CircleMarker.prototype.options, style);
- case VectorFeatureType.LINE:
- return external_L_default().extend({}, (external_L_default()).Polyline.prototype.options, style);
- case VectorFeatureType.REGION:
- return external_L_default().extend({}, (external_L_default()).Polygon.prototype.options, style);
- case VectorFeatureType.TEXT:
- return external_L_default().extend({}, TextSymbolizer.prototype.options, style);
- default:
- break;
- }
- },
- //如果cartoCSS和layerInfo都没有得到样式,则使用该默认样式
- _defaultStyle: function _defaultStyle(type) {
- var defaultOptions = (external_L_default()).Path.prototype.options;
- defaultOptions.weight = 1;
- defaultOptions.fillOpacity = 1;
- defaultOptions.radius = 3;
- switch (type) {
- case VectorFeatureType.POINT:
- return external_L_default().extend({}, defaultOptions, (external_L_default()).CircleMarker.prototype.options);
- case VectorFeatureType.LINE:
- return external_L_default().extend({}, defaultOptions, (external_L_default()).Polyline.prototype.options);
- case VectorFeatureType.REGION:
- return external_L_default().extend({}, defaultOptions, (external_L_default()).Polygon.prototype.options);
- case VectorFeatureType.TEXT:
- return external_L_default().extend({}, defaultOptions, TextSymbolizer.prototype.options);
- default:
- break;
- }
- }
- });
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/VectorGrid.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * Inspired by https://github.com/Leaflet/Leaflet.VectorGrid
- */
- /**
- * @class L.supermap.VectorGrid
- * @classdesc 矢量瓦片图层基类。
- * @category Visualization VectorTile
- * @extends {L.GridLayer}
- * @param {Object} options - 矢量瓦片图层基类参数。
- * @param {Object} [options.vectorTileLayerStyles] - 矢量网片图层风格。
- * @param {string} [options.renderer='SVG'] - 渲染器类型。
- * @param {L.supermap.VectorTileFormat} [options.format=VectorTileFormat.JSON] - 矢量瓦片格式。
- * @param {boolean} [options.interactive=true] - 是否可交互。
- * @param {number} [options.maxZoom=23] - 最大缩放级别。
- */
- var VectorGrid = external_L_default().GridLayer.extend({
- options: {
- vectorTileLayerStyles: null,
- //SVG or Canvas
- renderer: "SVG",
- format: VectorTileFormat.JSON,
- interactive: true,
- maxZoom: 23
- },
- initialize: function initialize(options) {
- var me = this;
- external_L_default().setOptions(me, options);
- external_L_default().GridLayer.prototype.initialize.call(me, options);
- me._vectorTiles = {}; //交互事件使用,键值为id_layerName
- me._overriddenStyles = {};
- me.vectorTileLayerStyles = me.options.vectorTileLayerStyles;
- me.on('tileunload', function (e) {
- var key = me._tileCoordsToKey(e.coords),
- tile = me._vectorTiles[key];
- if (tile && me._map) {
- tile.removeFrom(me._map);
- }
- delete me._vectorTiles[key];
- }, me);
- me.on('tileerror ', me._renderText, me);
- me.on('load', me._renderText, me);
- me._dataLayerNames = {};
- },
- /**
- * @private
- * @function L.supermap.VectorGrid.prototype.createTile
- * @description 创建切片图层。
- * @param {Object} coords - 切片坐标参数对象。
- * @param {Function} done - todo。
- */
- createTile: function createTile(coords, done) {
- var me = this;
- var tileSize = me.getTileSize();
- var renderer = null;
- if (me.options.renderer === "Canvas") {
- renderer = new CanvasRenderer(coords, tileSize, me.options);
- } else {
- renderer = new SVGRenderer(coords, tileSize, me.options);
- }
- me._vectorTiles[me._tileCoordsToKey(coords)] = renderer;
- renderer._features = {};
- new VectorTile({
- layer: me,
- format: me.options.format,
- coords: coords,
- renderer: renderer
- }, done).renderTile();
- return renderer.getContainer();
- },
- /**
- * @function L.supermap.VectorGrid.prototype.getStyles
- * @description 获取图层样式。
- * @returns {Object} 所有图层的样式。
- */
- getStyles: function getStyles() {
- return this.vectorTileLayerStyles;
- },
- /**
- * @function L.supermap.VectorGrid.prototype.getStyle
- * @description 获取指定图层样式。
- * @param {string} layerName - 图层名称。
- * @returns {Object} 指定图层的样式。
- */
- getStyle: function getStyle(layerName) {
- return this.vectorTileLayerStyles && this.vectorTileLayerStyles[layerName];
- },
- /**
- * @function L.supermap.VectorGrid.prototype.setFeatureStyle
- * @description 设置要素风格,需要 ID 和 layerName 才能确定一个要素。
- * @param {number} id - 要素 ID。
- * @param {string} layerName - 图层名称。
- * @param {(Array|Function)} layerStyle - 图层样式。
- * @returns {this} this
- */
- setFeatureStyle: function setFeatureStyle(id, layerName, layerStyle) {
- var featureKey = this._getFeatureKey(id, layerName);
- this._overriddenStyles[featureKey] = layerStyle;
- for (var tileKey in this._vectorTiles) {
- var tile = this._vectorTiles[tileKey];
- var features = tile._features;
- var data = features[featureKey];
- if (data) {
- var feat = data.feature;
- this._updateStyles(feat, tile, layerStyle);
- }
- }
- return this;
- },
- /**
- * @function L.supermap.VectorGrid.prototype.resetFeatureStyle
- * @description 重绘要素风格,需要 ID 和 layerName 才能确定一个要素。
- * @param {number} id - 要素 ID。
- * @param {string} layerName - 图层名称。
- * @returns {this} this
- */
- resetFeatureStyle: function resetFeatureStyle(id, layerName) {
- var featureKey = this._getFeatureKey(id, layerName);
- delete this._overriddenStyles[featureKey];
- for (var tileKey in this._vectorTiles) {
- var tile = this._vectorTiles[tileKey];
- var data = tile._features[featureKey];
- if (data) {
- var feat = data.feature;
- var styleOptions = this.vectorTileLayerStyles[data.layerName];
- this._updateStyles(feat, tile, styleOptions);
- }
- }
- return this;
- },
- /**
- * @function L.supermap.VectorGrid.prototype.getDataLayerNames
- * @description 获取数据图层名字。
- * @returns {Array} 返回数据图层名数组。
- */
- getDataLayerNames: function getDataLayerNames() {
- return Object.keys(this._dataLayerNames);
- },
- _removeAllTiles: function _removeAllTiles() {
- external_L_default().GridLayer.prototype._removeAllTiles.call(this);
- this._textVectorTiles = {};
- },
- _renderText: function _renderText() {
- var textVectorTiles = this._textVectorTiles;
- for (var key in textVectorTiles) {
- var textTiles = textVectorTiles[key];
- var renderer = textTiles.renderer;
- for (var layerId in textTiles.layers) {
- var tile = textTiles.layers[layerId];
- var styleOptions = tile.style,
- featureLayer = tile.layer;
- for (var j = 0; j < styleOptions.length; j++) {
- featureLayer.render(renderer, styleOptions[j]);
- renderer._addPath(featureLayer);
- }
- if (this.options.interactive) {
- featureLayer.makeInteractive();
- }
- }
- }
- },
- _getFeatureKey: function _getFeatureKey(id, layerName) {
- id = id || 0;
- layerName = layerName || "null";
- return id + "_" + layerName;
- },
- _updateStyles: function _updateStyles(feat, renderer, styleOptions) {
- styleOptions = styleOptions instanceof Function ? styleOptions(feat.properties, renderer.getCoord().z) : styleOptions;
- if (!(styleOptions instanceof Array)) {
- styleOptions = [styleOptions];
- }
- for (var j = 0; j < styleOptions.length; j++) {
- var style = this._extendStyle(styleOptions[j], feat.type);
- feat.updateStyle(renderer, style);
- }
- },
- //矫正一些参数
- _extendStyle: function _extendStyle(style, type) {
- switch (type) {
- case VectorFeatureType.POINT:
- return external_L_default().extend({}, (external_L_default()).CircleMarker.prototype.options, style);
- case VectorFeatureType.LINE:
- return external_L_default().extend({}, (external_L_default()).Polyline.prototype.options, style);
- case VectorFeatureType.REGION:
- return external_L_default().extend({}, (external_L_default()).Polygon.prototype.options, style);
- case VectorFeatureType.TEXT:
- return external_L_default().extend({}, TextSymbolizer.prototype.options, style);
- default:
- break;
- }
- }
- });
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/TileVectorLayer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.tiledVectorLayer
- * @classdesc SuperMap iServer 的矢量瓦片图层。
- * @category Visualization VectorTile
- * @extends L.supermap.VectorGrid
- * @example
- * L.supermap.tiledVectorLayer(url).addTo(map);
- * @param {string} url - 图层数据服务地址。
- * @param {Object} options - 图层参数。
- * @param {string} options.layerNames - 指定图层的名称列表,支持的类型为矢量图层。
- * @param {string} options.layersID - 获取进行切片的地图图层 ID。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型。
- * @param {string} [options.cartoCSS] - 客户端 CartoCSS 样式字符串。
- * @param {boolean} [options.serverCartoCSSStyle=true] - 是否使用服务端 CartoCSS 样式。
- * @param {boolean} [options.processCharacters=false] - 设置客户端 CartoCSS 样式时是否进行特定字符转换。
- * @param {L.Proj.CRS} [options.crs] - 坐标系统类。
- * @param {boolean} [options.returnAttributes=false] - 是否返回 attributes。
- * @param {string} [options.expands] - expands。
- * @param {boolean} [options.cacheEnabled=true] - 是否使用服务器缓存出图。
- * @param {Object} [options.tileTemplate] - 瓦片模板,如果设置了此参数,则按此模板出图,URL 无效(对接第三方瓦片)。
- * @param {string} [options.subdomains] - 子域名。
- * @param {num} [options.timeout=10000] - timeout。
- * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>`] - 版权信息。
- */
- var TileVectorLayer = VectorGrid.extend({
- options: {
- //服务器类型<SuperMap.ServerType>iServer|iPortal|Online
- serverType: null,
- crs: null,
- //客户端cartocss样式
- cartoCSS: null,
- // 指定图层的名称列表。支持的类型为矢量图层
- layerNames: null,
- //获取进行切片的地图图层 ID
- layersID: null,
- //是否服务端CartoCSS样式,默认使用
- serverCartoCSSStyle: true,
- //设置客户端CartoCSS样式时是否进行特定字符转换
- processCharacters: false,
- returnAttributes: false,
- /*各图层扩展的像素值。
- *例如:
- * 0_15:0_5,1_10:表示顶级0图层的0、1子图层扩展的像素分别为5、10像素;顶级0图层下,除0、1图层外的子图层的扩展像素都为15像素。
- * 0:0_5,1_10:表示顶级0图层的0、1子图层扩展的像素分别为5、10像素;顶级0图层下,其他除0、1图层外的子图层的扩展像素为根据该图层默认样式计算得出的默认值。
- */
- expands: null,
- cacheEnabled: false,
- //瓦片模板,如果设置了此参数,则按此模板出图,url无效(对接第三方瓦片)
- tileTemplate: null,
- subdomains: 'abc',
- timeout: 10000,
- attribution: core_Attributions.Common.attribution
- },
- initialize: function initialize(url, options) {
- options = options || {};
- options.noWrap = options.noWrap == null ? true : options.noWrap;
- external_L_default().setOptions(this, options);
- VectorGrid.prototype.initialize.call(this, options);
- external_L_default().stamp(this);
- var me = this;
- if (!url || url.indexOf("http") < 0) {
- url = "";
- return this;
- }
- me.url = url;
- if (url.indexOf("/") === url.length - 1) {
- url = url.substr(0, url.length - 1);
- me.url = url;
- }
- this.cartoCSSToLeaflet = new CartoCSSToLeaflet(me.url);
- me.initLayersInfo();
- if (!me.options.serverCartoCSSStyle && me.options.cartoCSS) {
- me.setClientCartoCSS(me.options.cartoCSS);
- }
- },
- /**
- * @private
- * @function L.supermap.tiledVectorLayer.prototype.onAdd
- * @description 添加地图。
- * @param {L.Map} map - 待添加的地图。
- */
- onAdd: function onAdd(map) {
- this._crs = this.options.crs || map.options.crs;
- this._map = map;
- this._initLayerUrl();
- if (this.options.tileTemplate || !this.options.serverCartoCSSStyle) {
- this._initGrid();
- }
- },
- /**
- * @private
- * @function L.supermap.tiledVectorLayer.prototype.initLayersInfo
- * @description 获取服务器 layers 资源下的风格信息(当 CartoCSS 中不存在相应图层渲染信息时使用)。
- */
- initLayersInfo: function initLayersInfo() {
- var me = this;
- var layersUrl = Util.urlPathAppend(me.url, "layers");
- FetchRequest.get(layersUrl, null, {
- timeout: me.options.timeout
- }).then(function (response) {
- return response.json();
- }).then(function (json) {
- me.layersInfoInitialized = true;
- me.layersInfo = json;
- if (!me.layersInfo) {
- return;
- }
- var layersInfo = {};
- for (var i = 0, len = me.layersInfo.length; i < len; i++) {
- var layers = me.layersInfo[i].subLayers.layers;
- for (var j = 0, len1 = layers.length; j < len1; j++) {
- layers[j].layerIndex = len1 - j;
- layersInfo[layers[j].name] = layers[j];
- }
- }
- me.layersInfo = layersInfo;
- me.cartoCSSToLeaflet.layersInfo = layersInfo;
- if (me.options.serverCartoCSSStyle) {
- me.getVectorStylesFromServer();
- }
- })["catch"](function (ex) {
- console.error('error', ex);
- });
- },
- /**
- * @function L.supermap.tiledVectorLayer.prototype.getLayerStyleInfo
- * @description 获取图层样式信息。
- * @param {string} layerName - 图层名称。
- */
- getLayerStyleInfo: function getLayerStyleInfo(layerName) {
- var me = this,
- layerInfo_simple;
- me.layersStyles = me.layersStyles || {};
- layerInfo_simple = me.layersStyles[layerName];
- if (layerInfo_simple) {
- return layerInfo_simple;
- }
- if (!me.layersInfo) {
- return {};
- }
- var layerInfo = me.layersInfo[layerName];
- if (!layerInfo) {
- return null;
- }
- layerInfo_simple = {
- layerIndex: layerInfo.layerIndex,
- ugcLayerType: layerInfo.ugcLayerType
- };
- switch (layerInfo.ugcLayerType) {
- case "VECTOR":
- layerInfo_simple.layerStyle = layerInfo.style ? layerInfo.style : null;
- break;
- case "THEME":
- var theme = layerInfo.theme; //标注图层特别标明
- layerInfo_simple.layerStyle = theme ? theme.defaultStyle : null;
- if (theme && theme.type === "LABEL") {
- layerInfo_simple.type = theme.type;
- layerInfo_simple.textField = theme.labelExpression;
- }
- break;
- default:
- //SVTile发布出来的地图没有ugcLayerType属性
- if (layerInfo.style) {
- layerInfo_simple.layerStyle = layerInfo.style;
- }
- break;
- }
- me.layersStyles[layerName] = layerInfo_simple;
- return layerInfo_simple;
- },
- /*
- * @function L.supermap.tiledVectorLayer.prototype.getVectorStylesFromServer
- * @description 等待服务器的 carto 返回之后拼接本地配置的 cartoCSS,并调用 onAdd 出图。
- */
- getVectorStylesFromServer: function getVectorStylesFromServer() {
- var me = this;
- var vectorStyleUrl = Util.urlPathAppend(me.url, "tileFeature/vectorstyles");
- FetchRequest.get(vectorStyleUrl, null, {
- timeout: me.options.timeout
- }).then(function (response) {
- return response.json();
- }).then(function (styles) {
- if (!styles || !styles.style) {
- return null;
- }
- if (styles.style && styles.type === 'cartoCSS') {
- me.setServerCartoCSS(styles.style);
- }
- if (me.options) {
- me.setClientCartoCSS(me.options.cartoCSS);
- }
- me._initGrid();
- })["catch"](function (ex) {
- console.error('error', ex);
- });
- },
- /**
- * @private
- * @function L.supermap.tiledVectorLayer.prototype.setServerCartoCSS
- * @description 设置服务端获取到的 cartoCSS 样式,cartoCSS 请求回来之后自动调用。
- */
- setServerCartoCSS: function setServerCartoCSS(cartoCSSStr) {
- this.cartoCSSToLeaflet.pretreatedCartoCSS(cartoCSSStr, true);
- },
- /**
- * @function L.supermap.tiledVectorLayer.prototype.setClientCartoCSS
- * @description 客户端设置 cartoCSS 样式。
- */
- setClientCartoCSS: function setClientCartoCSS(cartoCSSStr) {
- var processCharacters = false;
- if (this.options.processCharacters) {
- processCharacters = this.options.processCharacters;
- }
- this.cartoCSSToLeaflet.pretreatedCartoCSS(cartoCSSStr, processCharacters);
- },
- /**
- * @private
- * @function L.supermap.tiledVectorLayer.prototype.getVectorTileLayerStyle
- * @description 获取图层风格信息,当 CartoCSS 中包含有对该图层的渲染信息时,优先获取,否则获取 layers 资源下 layerSytle 的渲染信息。
- * @param {Object} coords - 图层坐标参数对象。
- * @param {Object} feature - 要获取的要素。
- */
- getVectorTileLayerStyle: function getVectorTileLayerStyle(coords, feature) {
- if (!feature) {
- return null;
- }
- var me = this,
- layerName = feature.layerName,
- layerStyleInfo = me.getLayerStyleInfo(layerName); //处理标签图层
- if (layerStyleInfo && layerStyleInfo.textField) {
- var textField = layerStyleInfo.textField;
- if (textField && textField.indexOf('.')) {
- var arr = textField.split('.');
- textField = arr && arr.length > 0 && arr[arr.length - 1];
- }
- feature.properties.textField = textField;
- }
- me.vectorTileLayerStyles = me.vectorTileLayerStyles || {};
- var style = me.vectorTileLayerStyles[layerName];
- if (style) {
- feature = this._mergeFeatureTextField(feature, style);
- return style;
- } // SuperMap.CartoCSSToLeaflet内部做了客户端配置的cartoCSS和服务端cartoCSS的拼接处理
- // 客户端配置的cartoCSS会覆盖相应图层的服务端cartoCSS
- var scale = this.getScaleFromCoords(coords);
- var shaders = this.cartoCSSToLeaflet.pickShader(layerName) || [];
- style = [];
- for (var itemKey in shaders) {
- var shader = shaders[itemKey];
- for (var j = 0; j < shader.length; j++) {
- var serverStyle = this.cartoCSSToLeaflet.getValidStyleFromCarto(coords.z, scale, shader[j], feature, this.options.serverCartoCSSStyle);
- if (serverStyle) {
- style.push(serverStyle);
- }
- }
- }
- feature = this._mergeFeatureTextField(feature, style); //次优先级是layers资源的默认的样式,最低优先级是CartoDefaultStyle的样式
- if (feature.type === "TEXT" || style.length === 0) {
- style = this.cartoCSSToLeaflet.getValidStyleFromLayerInfo(feature, layerStyleInfo);
- if (feature.type === "TEXT") {
- style.textName = "[" + feature.properties.textField + "]";
- }
- }
- me.vectorTileLayerStyles[layerName] = style;
- return style;
- },
- /**
- * @function L.supermap.tiledVectorLayer.prototype.getScale
- * @description 通过缩放级别获取比例尺。
- * @param {number} zoom - 缩放级别。
- * @returns {number} 比例尺。
- */
- getScale: function getScale(zoom) {
- var me = this; //返回当前比例尺
- var z = zoom || me._map.getZoom();
- return me.scales[z];
- },
- /**
- * @function L.supermap.tiledVectorLayer.prototype.getScaleFromCoords
- * @description 通过行列号获取比例尺。
- * @param {Object} coords - 行列号。
- * @returns {number} 比例尺。
- */
- getScaleFromCoords: function getScaleFromCoords(coords) {
- var me = this,
- scale;
- if (me.scales && me.scales[coords.z]) {
- return me.scales[coords.z];
- }
- me.scales = me.scales || {};
- scale = me.getDefaultScale(coords);
- me.scales[coords.z] = scale;
- return scale;
- },
- /**
- * @private
- * @function L.supermap.tiledVectorLayer.prototype.getDefaultScale
- * @description 根据行列号获取默认比例尺。
- * @param {Object} coords - 行列号。
- * @returns {number} 默认比例尺。
- */
- getDefaultScale: function getDefaultScale(coords) {
- var me = this,
- crs = me._crs;
- if (crs.scales) {
- return crs.scales[coords.z];
- } else {
- var tileBounds = me._tileCoordsToBounds(coords);
- var ne = crs.project(tileBounds.getNorthEast());
- var sw = crs.project(tileBounds.getSouthWest());
- var tileSize = me.options.tileSize;
- var resolution = Math.max(Math.abs(ne.x - sw.x) / tileSize, Math.abs(ne.y - sw.y) / tileSize);
- var mapUnit = Unit.METER;
- if (crs.code) {
- var array = crs.code.split(':');
- if (array && array.length > 1) {
- var code = parseInt(array[1]);
- mapUnit = code && code >= 4000 && code <= 5000 ? Unit.DEGREE : Unit.METER;
- }
- }
- return resolutionToScale(resolution, 96, mapUnit);
- }
- },
- _mergeFeatureTextField: function _mergeFeatureTextField(feature, style) {
- //如果设置了使用服务端cartocss样式,则文本专题图图层优先从carto中读取文本字段的key
- if (!this.options.serverCartoCSSStyle || !style || feature.type !== "TEXT") {
- return feature;
- }
- var tempStyle = style;
- if (!external_L_default().Util.isArray(style)) {
- tempStyle = [style];
- }
- for (var i = 0; i < tempStyle.length; i++) {
- var textName = tempStyle[i].textName;
- if (textName && feature.properties) {
- feature.properties.textField = textName.substring(1, textName.length - 1);
- }
- }
- return feature;
- },
- _getTileUrl: function _getTileUrl(coords) {
- var me = this,
- tileTemplate = me.options.tileTemplate;
- if (!tileTemplate) {
- return me._getDefaultTileUrl(coords);
- }
- return me._getTileTemplateUrl(coords);
- },
- _getTileTemplateUrl: function _getTileTemplateUrl(coords) {
- var me = this,
- tileTemplate = me.options.tileTemplate;
- var data = {
- s: me._getSubdomain(coords),
- x: coords.x,
- y: coords.y,
- z: coords.z
- };
- if (me._map && !me._map.options.crs.infinite) {
- var invertedY = me._globalTileRange.max.y - coords.y;
- if (me.options.tms) {
- data['y'] = invertedY;
- }
- data['-y'] = invertedY;
- }
- var tileUrl = external_L_default().Util.template(tileTemplate, external_L_default().extend(data, me.options));
- return tileUrl;
- },
- _initGrid: function _initGrid() {
- VectorGrid.prototype.onAdd.call(this, this._map);
- },
- _getSubdomain: (external_L_default()).TileLayer.prototype._getSubdomain,
- _getDefaultTileUrl: function _getDefaultTileUrl(coords) {
- var x = coords.x,
- y = coords.y;
- var tileUrl = this._tileUrl + "&x=" + x + "&y=" + y;
- var scale = this.getScaleFromCoords(coords);
- tileUrl += "&scale=" + scale;
- return tileUrl;
- },
- _initLayerUrl: function _initLayerUrl() {
- var options = this.options;
- if (!this.url) {
- return;
- }
- var format = options.format.toString().toLowerCase();
- this._tileUrl = Util.urlPathAppend(this.url, "tileFeature." + format);
- this._tileUrl = Util.urlAppend(this._tileUrl, encodeURI(this._createURLParam(options)));
- },
- _createURLParam: function _createURLParam(options) {
- var params = []; //添加安全认证信息
- var credential = this._getCredential();
- if (credential) {
- params.push(credential);
- }
- if (options.layersID) {
- params.push("layersID=" + options.layersID);
- }
- if (options.layerNames) {
- if (!external_L_default().Util.isArray(options.layerNames)) {
- options.layerNames = [options.layerNames];
- }
- var layerNamesString = '[' + options.layerNames.join(',') + ']';
- params.push("layerNames=" + layerNamesString);
- } //切片的起始参考点,默认为地图范围的左上角。
- var crs = this._crs;
- if (crs.options && crs.options.origin) {
- params.push("origin=" + JSON.stringify({
- x: crs.options.origin[0],
- y: crs.options.origin[1]
- }));
- } else if (crs.projection && crs.projection.bounds) {
- var bounds = crs.projection.bounds;
- var tileOrigin = external_L_default().point(bounds.min.x, bounds.max.y);
- params.push("origin=" + JSON.stringify({
- x: tileOrigin.x,
- y: tileOrigin.y
- }));
- }
- if (options.expands) {
- params.push("expands=" + options.expands);
- }
- params.push("returnAttributes=" + options.returnAttributes);
- params.push("cacheEnabled=" + options.cacheEnabled);
- var tileSize = this.options.tileSize;
- params.push("width=" + tileSize);
- params.push("height=" + tileSize);
- return params.join("&");
- },
- //获取token或key表达式
- _getCredential: function _getCredential(url) {
- var credential, value;
- switch (this.options.serverType) {
- case ServerType.IPORTAL:
- value = SecurityManager.getToken(url);
- credential = value ? new Credential(value, "token") : null;
- if (!credential) {
- value = SecurityManager.getKey(url);
- credential = value ? new Credential(value, "key") : null;
- }
- break;
- case ServerType.ONLINE:
- value = SecurityManager.getKey(url);
- credential = value ? new Credential(value, "key") : null;
- break;
- default:
- //iserver or others
- value = SecurityManager.getToken(url);
- credential = value ? new Credential(value, "token") : null;
- break;
- }
- if (credential) {
- return credential.getUrlParameters();
- }
- return null;
- }
- });
- var tiledVectorLayer = function tiledVectorLayer(url, options) {
- return new TileVectorLayer(url, options);
- };
- (external_L_default()).supermap.tiledVectorLayer = tiledVectorLayer;
- ;// CONCATENATED MODULE: external "function(){try{return turf}catch(e){return {}}}()"
- var external_function_try_return_turf_catch_e_return_namespaceObject = function(){try{return turf}catch(e){return {}}}();
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/TurfLayer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.turfLayer
- * @classdesc Turf 图层。
- * @category Visualization Turf
- * @extends {L.Layer}
- * @param {Object} options - 可选参数。
- * @param {string} [options.attribution='<span>© <a href='https://turfjs.org/' title='turfjs' target='_blank'>turfjs</a></span>'] - 版权信息。
- */
- var TurfLayer = external_L_default().GeoJSON.extend({
- turfMap: {
- "Measurement.along": ["line", "distance", "units"],
- "Measurement.area": ["geojson"],
- "Measurement.bbox": ["geojson"],
- "Measurement.bboxPolygon": ["bbox"],
- "Measurement.bearing": ["start", "end", "final"],
- "Measurement.center": ["geojson", "properties"],
- "Measurement.centerOfMass": ["geojson", "properties"],
- "Measurement.centroid": ["geojson", "properties"],
- "Measurement.destination": ["origin", "distance", "bearing", "units"],
- "Measurement.distance": ["from", "to", "units"],
- "Measurement.envelope": ["geojson"],
- "Measurement.length": ["geojson", "units"],
- "Measurement.midpoint": ["point1", "point2"],
- "Measurement.pointOnFeature": ["geojson"],
- "Measurement.polygonTangents": ["point", "polygon"],
- "Measurement.rhumbBearing": ["start", "end", "final"],
- "Measurement.rhumbDestination": ["origin", "distance", "bearing", "units"],
- "Measurement.rhumbDistance": ["from", "to", "units"],
- "Measurement.square": ["bbox"],
- "Measurement.greatCircle": ["start", "end", "properties", "npoints", "offset"],
- "CoordinateMutation.cleanCoords": ["geojson", "mutate"],
- "CoordinateMutation.flip": ["geojson", "mutate"],
- "CoordinateMutation.rewind": ["geojson", "reverse", "mutate"],
- "CoordinateMutation.round": ["num", "precision"],
- "CoordinateMutation.truncate": ["geojson", "precision", "coordinates", "mutate"],
- "Transformation.bboxClip": ["feature", "bbox"],
- "Transformation.bezierSpline": ["line", "resolution", "sharpness"],
- "Transformation.buffer": ["geojson", "radius", "units", "steps"],
- "Transformation.circle": ["center", "radius", "steps", "units", "properties"],
- "Transformation.clone": ["geojson"],
- "Transformation.concave": ["points", "maxEdge", "units"],
- "Transformation.convex": ["geojson", "concavity"],
- "Transformation.difference": ["polygon1", "polygon2"],
- "Transformation.dissolve": ["featureCollection", "propertyName"],
- "Transformation.intersect": ["poly1", "poly2"],
- "Transformation.lineOffset": ["geojson", "distance", "units"],
- "Transformation.simplify": ["feature", "tolerance", "highQuality"],
- "Transformation.tesselate": ["poly"],
- "Transformation.transformRotate": ["geojson", "angle", "pivot", "mutate"],
- "Transformation.transformTranslate": ["geojson", "distance", "direction", "units", "zTranslation", "mutate"],
- "Transformation.transformScale": ["geojson", "factor", "origin", "mutate"],
- "Transformation.union": ["A"],
- "Transformation.voronoi": ["points", "bbox"],
- "featureConversion.combine": ["fc"],
- "featureConversion.explode": ["geojson"],
- "featureConversion.flatten": ["geojson"],
- "featureConversion.lineStringToPolygon": ["lines", "properties", "autoComplete", "orderCoords"],
- "featureConversion.polygonize": ["geojson"],
- "featureConversion.polygonToLineString": ["polygon", "properties"],
- "Misc.kinks": ["featureIn"],
- "Misc.lineArc": ["center", "radius", "bearing1", "bearing2", "steps", "units"],
- "Misc.lineChunk": ["geojson", "segmentLength", "units", "reverse"],
- "Misc.lineIntersect": ["line1", "line2"],
- "Misc.lineOverlap": ["line1", "line2"],
- "Misc.lineSegment": ["geojson"],
- "Misc.lineSlice": ["startPt", "stopPt", "line"],
- "Misc.lineSliceAlong": ["line", "startDist", "stopDist", "units"],
- "Misc.lineSplit": ["line", "splitter"],
- "Misc.mask": ["polygon", "mask"],
- "Misc.pointOnLine": ["lines", "pt", "units"],
- "Misc.sector": ["center", "radius", "bearing1", "bearing2", "steps", "units"],
- "Misc.shortestPath": ["start", "end", "obstacles", "units", "resolution"],
- "Misc.unkinkPolygon": ["geojson"],
- "Helper.featureCollection": ["features", "bbox", "id"],
- "Helper.feature": ["geometry", "properties", "bbox", "id"],
- "Helper.geometryCollection": ["geometries", "properties", "bbox", "id"],
- "Helper.lineString": ["coordinates", "properties", "bbox", "id"],
- "Helper.multiLineString": ["coordinates", "properties", "bbox", "id"],
- "Helper.multiPoint": ["coordinates", "properties", "bbox", "id"],
- "Helper.multiPolygon": ["coordinates", "properties", "bbox", "id"],
- "Helper.point": ["coordinates", "properties", "bbox", "id"],
- "Helper.polygon": ["coordinates", "properties", "bbox", "id"],
- "Data.sample": ["featurecollection", "num"],
- "Interpolation.interpolate": ["points", "cellSize", "gridType", "property", "units", "weight"],
- "Interpolation.isobands": ["pointGrid", "breaks", "zProperty", "commonProperties", "breaksProperties"],
- "Interpolation.isolines": ["pointGrid", "breaks", "zProperty", "commonProperties", "breaksProperties"],
- "Interpolation.planepoint": ["point", "triangle"],
- "Interpolation.tin": ["points", "z"],
- "Joins.pointsWithinPolygon": ["points", "polygons"],
- "Joins.tag": ["points", "polygons", "field", "outField", "mask", "properties"],
- "Grids.hexGrid": ["bbox", "cellSide", "units", "triangles"],
- "Grids.pointGrid": ["bbox", "cellSide", "units", "mask", "properties"],
- "Grids.squareGrid": ["bbox", "cellSide", "units", "mask", "properties"],
- "Grids.triangleGrid": ["bbox", "cellSide", "units", "mask", "properties"],
- "Classification.nearestPoint": ["targetPoint", "points"],
- "Aggregation.collect": ["polygons", "points", "inProperty", "outProperty"],
- "Aggregation.clustersDbscan": ["points", "maxDistance", "units", "minPoints", "mutate"],
- "Aggregation.clustersKmeans": ["points", "numberOfClusters", "mutate"],
- "Meta.coordAll": ["geojson"],
- "Meta.coordEach": ["geojson", "callback", "excludeWrapCoord"],
- "Meta.coordReduce": ["geojson", "callback", "initialValue", "excludeWrapCoord"],
- "Meta.featureEach": ["geojson", "callback"],
- "Meta.featureReduce": ["geojson", "callback", "initialValue"],
- "Meta.flattenEach": ["geojson", "callback"],
- "Meta.flattenReduce": ["geojson", "callback", "initialValue"],
- "Meta.getCoord": ["coord"],
- "Meta.getCoords": ["coords"],
- "Meta.getGeom": ["geojson"],
- "Meta.getGeomType": ["geojson", "name"],
- "Meta.geomEach": ["geojson", "callback"],
- "Meta.geomReduce": ["geojson", "callback", "initialValue"],
- "Meta.propEach": ["geojson", "callback"],
- "Meta.propReduce": ["geojson", "callback", "initialValue"],
- "Meta.segmentEach": ["geojson", "callback"],
- "Meta.segmentReduce": ["geojson", "callback", "initialValue"],
- "Meta.getCluster": ["geojson", "filter"],
- "Meta.clusterEach": ["geojson", "property", "callback"],
- "Meta.clusterReduce": ["geojson", "property", "callback", "initialValue"],
- "Assertions.collectionOf": ["featureCollection", "type", "name"],
- "Assertions.containsNumber": ["coordinates"],
- "Assertions.geojsonType": ["value", "type", "name"],
- "Assertions.featureOf": ["feature", "type", "name"],
- "Booleans.booleanClockwise": ["line"],
- "Booleans.booleanContains": ["feature1", "feature2"],
- "Booleans.booleanCrosses": ["feature1", "feature2"],
- "Booleans.booleanDisjoint": ["feature1", "feature2"],
- "Booleans.booleanEqual": ["feature1", "feature2"],
- "Booleans.booleanOverlap": ["feature1", "feature2"],
- "Booleans.booleanParallel": ["feature1", "feature2"],
- "Booleans.booleanPointInPolygon": ["point", "polygon", "ignoreBoundary"],
- "Booleans.booleanPointOnLine": ["point", "linestring", "ignoreEndVertices"],
- "UnitConversion.bearingToAngle": ["bearing"],
- "UnitConversion.convertArea": ["area", "originalUnit", "finalUnit"],
- "UnitConversion.convertLength": ["length", "originalUnit", "finalUnit"],
- "UnitConversion.degreesToradians": ["degrees"],
- "UnitConversion.lengthToRadians": ["distance", "units"],
- "UnitConversion.lengthToDegrees": ["distance", "units"],
- "UnitConversion.radiansToLength": ["radians", "units"],
- "UnitConversion.radiansToDegrees": ["radians"],
- "UnitConversion.toMercator": ["geojson", "mutate"],
- "UnitConversion.toWgs84": ["geojson", "mutate"]
- },
- options: {
- attribution: core_Attributions.Turf.attribution
- },
- initialize: function initialize(options) {
- options = options || {};
- external_L_default().Util.setOptions(this, options);
- external_L_default().stamp(this);
- this._layers = {};
- },
- // 5.0.0 及以上版本参数配置
- turfOptionMap: {
- "Measurement.along": ["line", "distance", {
- units: ""
- }],
- "Measurement.bboxPolygon": ["bbox", {
- properties: "",
- id: ""
- }],
- "Measurement.bearing": ["start", "end", {
- "final": ""
- }],
- "Measurement.center": ["geojson", {
- properties: ""
- }],
- "Measurement.destination": ["origin", "distance", "bearing", {
- units: "",
- properties: ""
- }],
- "Measurement.distance": ["from", "to", {
- units: ""
- }],
- "Measurement.length": ["geojson", {
- units: ""
- }],
- "Measurement.rhumbBearing": ["start", "end", {
- "final": ""
- }],
- "Measurement.rhumbDestination": ["origin", "distance", "bearing", {
- units: "",
- properties: ""
- }],
- "Measurement.rhumbDistance": ["from", "to", {
- units: ""
- }],
- "Measurement.greatCircle": ["start", "end", {
- properties: "",
- npoints: "",
- offset: ""
- }],
- "CoordinateMutation.cleanCoords": ["geojson", {
- mutate: ""
- }],
- "CoordinateMutation.flip": ["geojson", {
- mutate: ""
- }],
- "CoordinateMutation.rewind": ["geojson", {
- mutate: "",
- reverse: ""
- }],
- "CoordinateMutation.truncate": ["geojson", {
- precision: "",
- coordinates: "",
- mutate: ""
- }],
- "Transformation.bezierSpline": ["line", {
- resolution: "",
- sharpness: ""
- }],
- "Transformation.buffer": ["geojson", "radius", {
- units: "",
- steps: ""
- }],
- "Transformation.circle": ["center", "radius", {
- units: "",
- steps: "",
- properties: ""
- }],
- "Transformation.concave": ["points", {
- maxEdge: "",
- units: ""
- }],
- "Transformation.convex": ["geojson", {
- concavity: ""
- }],
- "Transformation.dissolve": ["featureCollection", {
- propertyName: ""
- }],
- "Transformation.lineOffset": ["geojson", "distance", {
- units: ""
- }],
- "Transformation.simplify": ["geojson", {
- tolerance: "",
- highQuality: ""
- }],
- "Transformation.transformRotate": ["geojson", "angle", {
- pivot: "",
- mutate: ""
- }],
- "Transformation.transformTranslate": ["geojson", "distance", "direction", {
- units: "",
- zTranslation: "",
- mutate: ""
- }],
- "Transformation.transformScale": ["geojson", "factor", {
- origin: "",
- mutate: ""
- }],
- "Transformation.voronoi": ["points", {
- bbox: ""
- }],
- "featureConversion.lineStringToPolygon": ["lines", {
- properties: "",
- autoComplete: "",
- orderCoords: ""
- }],
- "featureConversion.polygonToLineString": ["polygon", {
- properties: ""
- }],
- "Misc.lineArc": ["center", "radius", "bearing1", "bearing2", {
- steps: "",
- units: ""
- }],
- "Misc.lineChunk": ["geojson", "segmentLength", {
- units: "",
- reverse: ""
- }],
- "Misc.lineOverlap": ["line1", "line2", {
- tolerance: ""
- }],
- "Misc.lineSliceAlong": ["line", "startDist", "stopDist", {
- units: ""
- }],
- "Misc.pointOnLine": ["lines", "pt", {
- units: ""
- }],
- "Misc.sector": ["center", "radius", "bearing1", "bearing2", {
- units: "",
- steps: "",
- properties: ""
- }],
- "Misc.shortestPath": ["start", "end", {
- obstacles: "",
- units: "",
- resolution: ""
- }],
- "Helper.feature": ["geometry", "properties", {
- bbox: "",
- id: ""
- }],
- "Helper.geometryCollection": ["geometries", "properties", {
- bbox: "",
- id: ""
- }],
- "Helper.lineString": ["coordinates", "properties", {
- bbox: "",
- id: ""
- }],
- "Helper.multiLineString": ["coordinates", "properties", {
- bbox: "",
- id: ""
- }],
- "Helper.multiPoint": ["coordinates", "properties", {
- bbox: "",
- id: ""
- }],
- "Helper.multiPolygon": ["coordinates", "properties", {
- bbox: "",
- id: ""
- }],
- "Helper.point": ["coordinates", "properties", {
- bbox: "",
- id: ""
- }],
- "Helper.polygon": ["coordinates", "properties", {
- bbox: "",
- id: ""
- }],
- "Interpolation.interpolate": ["points", "cellSize", {
- gridType: "",
- property: "",
- units: "",
- weight: ""
- }],
- "Interpolation.isobands": ["pointGrid", "breaks", {
- zProperty: "",
- commonProperties: "",
- breaksProperties: ""
- }],
- "Interpolation.isolines": ["pointGrid", "breaks", {
- zProperty: "",
- commonProperties: "",
- breaksProperties: ""
- }],
- "Grids.hexGrid": ["bbox", "cellSide", {
- units: "",
- triangles: "",
- properties: "",
- mask: ""
- }],
- "Grids.pointGrid": ["bbox", "cellSide", {
- units: "",
- mask: "",
- properties: ""
- }],
- "Grids.squareGrid": ["bbox", "cellSide", {
- units: "",
- mask: "",
- properties: ""
- }],
- "Grids.triangleGrid": ["bbox", "cellSide", {
- units: "",
- mask: "",
- properties: ""
- }],
- "Aggregation.clustersDbscan": ["points", "maxDistance", {
- units: "",
- minPoints: "",
- mutate: ""
- }],
- "Aggregation.clustersKmeans": ["points", {
- numberOfClusters: "",
- mutate: ""
- }],
- "Booleans.booleanPointInPolygon": ["point", "polygon", {
- ignoreBoundary: ""
- }],
- "Booleans.booleanPointOnLine": ["point", "linestring", {
- ignoreEndVertices: ""
- }],
- "UnitConversion.toMercator": ["geojson", {
- mutate: ""
- }],
- "UnitConversion.toWgs84": ["geojson", {
- mutate: ""
- }]
- },
- /**
- * @function L.supermap.turfLayer.prototype.process
- * @description 执行 Turf.js 提供的相关空间分析方法。
- * @param {string} type - Turf.js 提供的空间分析方法名。
- * @param {Object} args - Turf.js 提供的空间分析方法对应的参数对象。
- * @param {Function} callback - 空间分析完成执行的回调函数,返回执行的结果。
- * @param {boolean} [addFeaturesToMap=true] - 是否添加到 map。
- */
- process: function process(type, args, callback, addFeaturesToMap) {
- // 兼容版本4到5
- var result;
- try {
- result = external_function_try_return_turf_catch_e_return_namespaceObject[type.split('.')[1]].apply(this, this.parse(type, args));
- } catch (e) {
- result = external_function_try_return_turf_catch_e_return_namespaceObject[type.split('.')[1]].apply(this, this.parseOption(type, args));
- }
- addFeaturesToMap = addFeaturesToMap == null ? true : addFeaturesToMap;
- if (addFeaturesToMap) {
- this.addData([result]);
- }
- if (callback) {
- callback(result);
- }
- },
- parse: function parse(type, args) {
- if (type === 'Transformation.union') {
- return args['A'];
- }
- var result = [];
- var tempArgs = this.turfMap[type];
- if (tempArgs) {
- tempArgs.map(function (key) {
- result.push(args[key]);
- return args[key];
- });
- }
- return result;
- },
- parseOption: function parseOption(type, args) {
- var result = [];
- var tempArgs = this.turfOptionMap[type];
- tempArgs.map(function (key) {
- if (key instanceof Object) {
- var options = key;
- Object.keys(options).forEach(function (k) {
- options[k] = args[k];
- });
- result.push(options);
- } else {
- result.push(args[key]);
- }
- return args;
- });
- return result;
- }
- });
- var turfLayer = function turfLayer(options) {
- return new TurfLayer(options);
- };
- (external_L_default()).supermap.turfLayer = turfLayer;
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/HeatMapLayer.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.heatMapFeature
- * @category Visualization HeatMap
- * @classdesc 客户端专题图要素类。
- * 支持的 geometry 参数类型为 {@link L.Point}、{@link L.LatLng}、{@link L.CircleMarker}。
- * @extends {L.Class}
- * @param {(L.Point|L.LatLng|L.CircleMarker)} geometry - 要素图形。
- * @param {Object} attributes - 要素属性。
- */
- var HeatMapFeature = external_L_default().Class.extend({
- initialize: function initialize(geometry, attributes) {
- this.geometry = geometry;
- this.attributes = attributes;
- },
- /**
- * @function L.supermap.themeFeature.prototype.toFeature
- * @description 转为内部矢量要素。
- * @returns {SuperMap.Feature.Vector} 内部矢量要素。
- */
- toFeature: function toFeature() {
- var geometry = this.geometry;
- var points = [];
- if (geometry instanceof (external_L_default()).LatLng) {
- points = [geometry.lng, geometry.lat];
- } else if (geometry instanceof (external_L_default()).Point) {
- points = [geometry.x, geometry.y];
- } else if (geometry instanceof (external_L_default()).CircleMarker) {
- var latLng = geometry.getLatLng();
- points = [latLng.lng, latLng.lat];
- } else {
- points = geometry;
- }
- if (points.length === 2) {
- geometry = new Point(points[0], points[1]);
- }
- return new Vector(geometry, this.attributes);
- }
- });
- var heatMapFeature = function heatMapFeature(geometry, attributes) {
- return new HeatMapFeature(geometry, attributes);
- };
- (external_L_default()).supermap.heatMapFeature = heatMapFeature;
- /**
- * @class L.supermap.heatMapLayer
- * @classdesc 热力图层类。
- * @category Visualization HeatMap
- * @param {string} name - 图层名称。
- * @param {boolean} [loadWhileAnimating=true] - 是否实时重绘。(当绘制大数据量要素的情况下会出现卡顿,建议把该参数设为 false)。
- * @param {Array.<string>} [colors=['blue', 'cyan', 'lime', 'yellow', 'red']] - 颜色线性渐变数组,颜色值必须为 canvas 所支持的。
- * @param {Object} options - 构造参数。
- * @param {L.Map} options.map - leaflet 的 map 对象。
- * @param {string} [options.id] - 专题图层 ID,默认使用 CommonUtil.createUniqueID("heatMapLayer_") 创建专题图层 ID。
- * @param {boolean} [options.alwaysMapCRS=false] - 要素坐标是否和地图坐标系一致,要素默认是经纬度坐标。
- * @param {string} [options.featureWeight] - 对应 feature 属性中的热点权重字段名称,权重值类型为 float。
- * @param {number} [options.radius=50] - 热点渲染的最大半径(热点像素半径),单位为 px,当 useGeoUnit 参数 为 true 时,单位使用当前图层地理坐标单位。热点显示的时候以精确点为中心点开始往四周辐射衰减,其衰减半径和权重值成比列。
- * @param {number} [options.opacity=1] - 图层透明度。
- * @param {boolean} [options.useGeoUnit=false] - 使用地理单位,即默认热点半径默认使用像素单位。 当设置为 true 时,热点半径和图层地理坐标保持一致。
- * @param {number} [options.blur] - 模糊量,,单位为 px。默认值为半径的二分之一。
- * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权信息。
- *
- * @extends {L.Layer}
- * @fires L.supermap.heatMapLayer#featuresremoved
- * @fires L.supermap.heatMapLayer#changelayer
- */
- var HeatMapLayer = external_L_default().Layer.extend({
- options: {
- //要素坐标是否和地图坐标系一致,默认为false,要素默认是经纬度坐标。
- alwaysMapCRS: false,
- //热力图默认参数:
- id: Util.createUniqueID("heatMapLayer_"),
- featureWeight: null,
- opacity: 1,
- colors: ['blue', 'cyan', 'lime', 'yellow', 'red'],
- useGeoUnit: false,
- radius: 50,
- attribution: core_Attributions.Common.attribution
- },
- initialize: function initialize(name, options) {
- external_L_default().Util.setOptions(this, options);
- this.name = name;
- this.features = [];
- this.maxWeight = null;
- this.minWeight = null;
- this.rootCanvas = null;
- this.canvasContext = null;
- this.maxWidth = null;
- this.maxHeight = null; //热力图参数:
- this.id = this.options.id;
- /*
- * options.featureWeight对应 feature 属性中的热点权重字段名称,权重值类型为float
- * //例如:
- * //feature.attributes中表示权重的字段为height,则在HeatMapLayer的featureWeight参数赋值为"height"
- * feature1.attributes.height = 7.0;
- * feature2.attributes.height = 6.0;
- * var heatMapLayer = new L.supermap.HeatMapLayer("heatmaplayer",{"featureWeight":"height"});
- * heatMapLayer.addFeatures([feature1,feature2]);
- * @type {null}
- */
- this.featureWeight = this.options.featureWeight;
- this.colors = this.options.colors;
- this.useGeoUnit = this.options.useGeoUnit;
- this.opacity = this.options.opacity;
- this.radius = this.options.radius;
- this.blur = this.options.blur;
- this.movingOffset = [0, 0];
- },
- /**
- * @function L.supermap.heatMapLayer.prototype.onRemove
- * @description 删除某个地图。
- * @param {L.Map} map - 要删除的地图。
- * @private
- */
- onRemove: function onRemove(map) {
- var me = this;
- external_L_default().DomUtil.remove(me.rootCanvas);
- map.off("mousemove", me.mouseMoveHandler);
- },
- /**
- * @function L.supermap.heatMapLayer.prototype.onAdd
- * @description 添加专题图。
- * @param {L.Map} map - 要添加的地图。
- * @private
- */
- onAdd: function onAdd(map) {
- var me = this;
- me._map = map;
- me._createCanvasContainer();
- if (!me.rootCanvas) {
- map.removeLayer(me);
- return;
- } //初始化渲染器
- var size = map.getSize();
- me.rootCanvas.width = me.maxWidth = size.x;
- me.rootCanvas.height = me.maxHeight = size.y;
- me._updateOpacity();
- me.mouseMoveHandler = function (e) {
- var xy = e.layerPoint;
- me.currentMousePosition = external_L_default().point(xy.x + me.movingOffset[0], xy.y + me.movingOffset[1]);
- };
- map.on("mousemove", me.mouseMoveHandler);
- me.update();
- },
- /**
- * @function L.supermap.heatMapLayer.prototype.addFeatures
- * @description 添加热点信息。
- * @param {(GeoJSONObject|L.supermap.heatMapFeature)} features - 待添加的要素数组。
- *
- * @example
- * var geojson = {
- * "type": "FeatureCollection",
- * "features": [
- * {
- * "type": "feature",
- * "geometry": {
- * "type": "Point", //只支持point类型
- * "coordinates": [0, 0]
- * },
- * "properties": {
- * "height": Math.random()*9,
- * "geoRadius": useGeoRadius?radius:null
- * }
- * }
- * ]
- * };
- * var heatMapLayer = new L.supermap.heatMapLayer("heatmaplayer",{"id":"heatmap"});
- * heatMapLayer.addFeatures(geojson);
- */
- addFeatures: function addFeatures(features) {
- this.features = this.toiClientFeature(features);
- this.refresh();
- },
- /**
- * @function L.supermap.heatMapLayer.prototype.refresh
- * @description 强制刷新当前热点显示,在图层热点数组发生变化后调用,更新显示。
- */
- refresh: function refresh() {
- if (this.features.length === 0) {
- return;
- }
- if (this._map) {
- var extent = this._map.getBounds();
- this.updateHeatPoints(extent);
- }
- },
- /**
- * @function L.supermap.heatMapLayer.prototype.updateHeatPoints
- * @description 刷新热点图显示。
- * @param {L.LngLatBounds} bounds - 当前显示范围。
- */
- updateHeatPoints: function updateHeatPoints(bounds) {
- if (this.features && this.features.length > 0) {
- this.convertFastToPixelPoints(bounds);
- } else {
- this.canvasContext.clearRect(0, 0, this.maxWidth, this.maxWidth);
- }
- },
- /**
- * @function L.supermap.heatMapLayer.prototype.convertFastToPixelPoints
- * @description 过滤位于当前显示范围内的热点,并转换其为当前分辨率下的像素坐标。
- * @param {L.LngLatBounds} bounds - 当前显示范围。
- * @private
- */
- convertFastToPixelPoints: function convertFastToPixelPoints(bounds) {
- var data = [],
- x,
- y,
- k,
- resolution,
- maxTemp,
- minTemp,
- maxWeightTemp; //获取当前像素下的地理范围
- var dw = bounds.getEast() - bounds.getWest();
- var dh = bounds.getNorth() - bounds.getSouth();
- var mapCanvas = this._map.getSize();
- if (dw / mapCanvas.x > dh / mapCanvas.y) {
- resolution = dw / mapCanvas.x;
- } else {
- resolution = dh / mapCanvas.y;
- } //热点半径
- this.useRadius = this.useGeoUnit ? parseInt(this.radius / resolution) : this.radius;
- for (var i = 0; i < this.features.length; i++) {
- var feature = this.features[i];
- var point = feature.geometry;
- var pixelPoint = this.getLocalXY(new LonLat(point.x, point.y));
- if (this.featureWeight) {
- pixelPoint.weight = feature.attributes[this.featureWeight]; //point.value;
- if (!this.maxWeight) {
- //找出最大最小权重值
- maxTemp = maxTemp ? maxTemp : pixelPoint.weight;
- minTemp = minTemp ? minTemp : pixelPoint.weight;
- maxTemp = Math.max(maxTemp, pixelPoint.weight);
- minTemp = Math.min(minTemp, pixelPoint.weight);
- }
- } else {
- pixelPoint.weight = 1;
- }
- x = Math.floor(pixelPoint[0]);
- y = Math.floor(pixelPoint[1]);
- k = pixelPoint.weight;
- data.push([x, y, k]);
- } //无最大权重设置
- if (!this.maxWeight) {
- if (maxTemp && minTemp) {
- maxWeightTemp = (maxTemp + minTemp) / 2;
- } else {
- maxWeightTemp = 1;
- }
- this.draw(data, maxWeightTemp);
- } else {
- this.draw(data, this.maxWeight);
- }
- },
- /**
- * @function L.supermap.heatMapLayer.prototype.draw
- * @description 绘制热点图。
- * @param {Array} data - convertToPixelPoints 方法计算出的点。
- * @param {number} maxWeight - 最大权重。
- * @private
- */
- draw: function draw(data, maxWeight) {
- if (this.maxHeight > 0 && this.maxWidth > 0) {
- var ctx = this.canvasContext; //清空
- this.canvasContext.clearRect(0, 0, this.maxWidth, this.maxHeight);
- this.drawCircle(this.useRadius);
- this.createGradient();
- for (var i = 0; i < data.length; i++) {
- var p = data[i];
- this.canvasContext.globalAlpha = Math.max(p[2] / maxWeight, 0.05);
- this.canvasContext.drawImage(this.circle, p[0] - this.useRadius, p[1] - this.useRadius);
- }
- var colored = ctx.getImageData(0, 0, this.maxWidth, this.maxHeight);
- this.colorize(colored.data, this.grad);
- ctx.putImageData(colored, 0, 0);
- } else {
- return false;
- }
- },
- /**
- * @function L.supermap.heatMapLayer.prototype.colorize
- * @description 根据渐变色重置热点图 rgb 值。
- * @param {Array} pixels 像素 RGBA 值。
- * @param {Array} gradient 渐变 canvas.getImageData.data。
- * @private
- */
- colorize: function colorize(pixels, gradient) {
- for (var i = 0, j; i < pixels.length; i += 4) {
- j = pixels[i + 3] * 4;
- if (j) {
- pixels[i] = gradient[j];
- pixels[i + 1] = gradient[j + 1];
- pixels[i + 2] = gradient[j + 2];
- }
- }
- },
- /**
- * @function L.supermap.heatMapLayer.drawCircle
- * @description 绘制热点半径圆。
- * @param {number} r - 热点半径。
- * @private
- */
- drawCircle: function drawCircle(r) {
- var blur = this.blur || r / 2;
- var circle = this.circle = document.createElement('canvas'),
- ctx = circle.getContext("2d");
- circle.height = 2 * r;
- circle.width = 2 * r;
- ctx.shadowOffsetX = ctx.shadowOffsetY = 2 * r;
- ctx.shadowBlur = blur;
- ctx.shadowColor = "#000000";
- ctx.beginPath();
- ctx.arc(-r, -r, r / 2, 0, Math.PI * 2, true);
- ctx.closePath();
- ctx.fill();
- },
- /**
- * @function L.supermap.heatMapLayer.createGradient
- * @description 根据 this.canvasColors 设置渐变并 getImageData。
- * @private
- */
- createGradient: function createGradient() {
- var colors = this.colors;
- var canvas = document.createElement('canvas'),
- ctx = canvas.getContext("2d"),
- gradient = ctx.createLinearGradient(0, 0, 0, 256);
- canvas.height = 256;
- canvas.width = 1;
- var index = 1;
- for (var i = 0, len = colors.length; i < len; i++) {
- gradient.addColorStop(index / len, colors[i]);
- index++;
- }
- ctx.fillStyle = gradient;
- ctx.fillRect(0, 0, 1, 256);
- this.grad = ctx.getImageData(0, 0, 1, 256).data;
- },
- /**
- * @function L.supermap.heatMapLayer.prototype.update
- * @description 更新图层。
- */
- update: function update() {
- var mapOffset = this._map.containerPointToLayerPoint([0, 0]);
- external_L_default().DomUtil.setPosition(this.rootCanvas, mapOffset);
- var me = this;
- me.refresh();
- if (me.currentMousePosition) {
- me.currentMousePosition = external_L_default().point(me.currentMousePosition.x - me.movingOffset[0], me.currentMousePosition.y - me.movingOffset[1]);
- }
- me.movingOffset = [0, 0];
- me._zoom = me._map.getZoom();
- me._center = me._map.getCenter();
- },
- /**
- * @function L.supermap.heatMapLayer.prototype.getLocalXY
- * @description 地理坐标转为像素坐标。
- * @param {Array} coordinate - 地理坐标。
- */
- getLocalXY: function getLocalXY(coordinate) {
- if (!this._map) {
- return coordinate;
- }
- var coor = coordinate;
- if (external_L_default().Util.isArray(coordinate)) {
- coor = external_L_default().point(coordinate[0], coordinate[1]);
- }
- if (!(coordinate instanceof (external_L_default()).Point)) {
- if (coordinate instanceof Point || coordinate instanceof GeoText) {
- coor = external_L_default().point(coordinate.x, coordinate.y);
- } else {
- coor = external_L_default().point(coordinate.lon, coordinate.lat);
- }
- }
- var point = this._map.latLngToContainerPoint(!this.options.alwaysMapCRS ? external_L_default().latLng(coor.y, coor.x) : this._map.options.crs.unproject(coor));
- return [point.x, point.y];
- },
- /**
- * @function L.supermap.heatMapLayer.prototype.setOpacity
- * @description 设置图层的不透明度,取值 [0-1] 之间。
- * @param {number} opacity - 不透明度。
- */
- setOpacity: function setOpacity(opacity) {
- var me = this;
- if (opacity === me.options.opacity) {
- return;
- }
- if (opacity) {
- me.options.opacity = opacity;
- }
- me._updateOpacity();
- },
- /**
- * @function L.supermap.heatMapLayer.prototype.removeFeatures
- * @description 移除指定的热点信息。
- * @param {Array.<SuperMap.Feature.Vector>} features - 热点信息数组。
- */
- removeFeatures: function removeFeatures(features) {
- if (!features || features.length === 0 || !this.features || this.features.length === 0) {
- return;
- }
- if (features === this.features) {
- return this.removeAllFeatures();
- }
- if (!Util.isArray(features)) {
- features = [features];
- }
- var heatPoint,
- index,
- heatPointsFailedRemoved = [];
- for (var i = 0, len = features.length; i < len; i++) {
- heatPoint = features[i];
- index = Util.indexOf(this.features, heatPoint); //找不到视为删除失败
- if (index === -1) {
- heatPointsFailedRemoved.push(heatPoint);
- continue;
- } //删除热点
- this.features.splice(index, 1);
- }
- var succeed = heatPointsFailedRemoved.length == 0 ? true : false; //派发删除features成功的事件
- /**
- * @event L.supermap.heatMapLayer#featuresremoved
- * @description 删除features成功后触发。
- * @property {Array.<SuperMap.Feature.Vector>} features - 事件对象。
- * @property {boolean} succeed - 删除是否成功,false 为失败,true 为成功。
- */
- this._map.fire("featuresremoved", {
- features: heatPointsFailedRemoved,
- succeed: succeed
- });
- this.refresh();
- },
- /**
- * @function L.supermap.heatMapLayer.prototype.removeAllFeatures
- * @description 移除全部的热点信息。
- */
- removeAllFeatures: function removeAllFeatures() {
- this.features = [];
- this.refresh();
- },
- /**
- * @function L.supermap.heatMapLayer.prototype._createCanvasContainer
- * @description 创建热力图绘制容器。
- * @private
- */
- _createCanvasContainer: function _createCanvasContainer() {
- //构建绘图面板
- var parentContainer = this.getPane();
- var animated = this._map.options.zoomAnimation && (external_L_default()).Browser.any3d;
- var className = 'heatMapLayer leaflet-layer leaflet-zoom-' + (animated ? 'animated' : 'hide');
- this.rootCanvas = external_L_default().DomUtil.create("canvas", className, parentContainer);
- var originProp = external_L_default().DomUtil.testProp(['transformOrigin', 'WebkitTransformOrigin', 'msTransformOrigin']);
- this.rootCanvas.id = this.id;
- this.rootCanvas.style[originProp] = '50% 50%';
- this.rootCanvas.style.position = "absolute";
- this.rootCanvas.style.zIndex = 200;
- Util.modifyDOMElement(this.rootCanvas, null, null, null, null, null, null, this.opacity);
- this.canvasContext = this.rootCanvas.getContext('2d');
- },
- _updateOpacity: function _updateOpacity() {
- var me = this;
- Util.modifyDOMElement(me.rootCanvas, null, null, null, null, null, null, me.options.opacity);
- if (me._map !== null) {
- /**
- * @event L.supermap.heatMapLayer#changelayer
- * @description 图层透明度更新成功之后触发。
- * @property {L.supermap.heatMapLayer} layer - 图层。
- * @property {string} property - 改变的图层属性。
- */
- me._map.fire("changelayer", {
- layer: me,
- property: "opacity"
- });
- }
- },
- /**
- * @function L.supermap.heatMapLayer.prototype.getEvents
- * @description 获取图层事件。
- * @returns {Object} 返回图层支持的事件。
- * @private
- */
- getEvents: function getEvents() {
- var me = this;
- var events = {
- zoomend: me._reset,
- moveend: me._reset,
- resize: me._resize
- };
- if (this._map._zoomAnimated) {
- events.zoomanim = me._zoomAnim;
- }
- return events;
- },
- /**
- * @function L.supermap.heatMapLayer.prototype.toiClientFeature
- * @description 转为 iClient 要素。
- * @param {(GeoJSONObject|L.supermap.heatMapFeature)} features - 待添加的要素数组。
- * @returns {SuperMap.Feature.Vector} 转换后的 iClient 要素。
- */
- toiClientFeature: function toiClientFeature(features) {
- if (!external_L_default().Util.isArray(features)) {
- features = [features];
- }
- var featuresTemp = [];
- for (var i = 0, len = features.length; i < len; i++) {
- //支持ThemeFeature类型的feature
- //支持传入ThemeFeature类型,ThemeFeature.geometry instanceof L.LatLng | ThemeFeature.geometry instanceof L.Point
- if (features[i] instanceof HeatMapFeature) {
- featuresTemp.push(features[i].toFeature());
- } else if (["FeatureCollection", "Feature", "Geometry"].indexOf(features[i].type) != -1) {
- var format = new GeoJSON();
- featuresTemp = featuresTemp.concat(format.read(features[i]));
- } else if (features[i].geometry && features[i].geometry.parts) {
- //iServer服务器返回数据格式 todo 暂未找到更好的参数判断,暂用 geometry.parts 试用
- featuresTemp.push(ServerFeature.fromJson(features[i]).toFeature());
- } else {
- throw new Error("Features's type does not match, please check.");
- }
- }
- return featuresTemp;
- },
- _zoomAnim: function _zoomAnim(e) {
- var scale = this._map.getZoomScale(e.zoom),
- offset = this._map._getCenterOffset(e.center)._multiplyBy(-scale).subtract(this._map._getMapPanePos());
- if ((external_L_default()).DomUtil.setTransform) {
- external_L_default().DomUtil.setTransform(this.rootCanvas, offset, scale);
- } else {
- this.rootCanvas.style[(external_L_default()).DomUtil.TRANSFORM] = external_L_default().DomUtil.getTranslateString(offset) + ' scale(' + scale + ')';
- }
- },
- //缩放移动重绘
- _reset: function _reset() {
- var me = this;
- me.update();
- var size = me._map.getSize();
- var mapOffset = this._map.containerPointToLayerPoint([0, 0]);
- external_L_default().DomUtil.setPosition(this.rootCanvas, mapOffset);
- if (parseFloat(me.rootCanvas.width) !== parseFloat(size.x)) {
- me.rootCanvas.width = size.x;
- }
- if (parseFloat(me.rootCanvas.height) !== parseFloat(size.y)) {
- me.rootCanvas.height = size.y;
- }
- me.refresh();
- },
- //通知渲染器的尺寸变化
- _resize: function _resize() {
- var me = this;
- var newSize = me._map.getSize();
- me.maxWidth = newSize.x;
- me.maxHeight = newSize.y;
- }
- });
- var heatMapLayer = function heatMapLayer(name, options) {
- return new HeatMapLayer(name, options);
- };
- (external_L_default()).supermap.heatMapLayer = heatMapLayer;
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/carto/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/mapv/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/theme/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/leaflet/overlay/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/leaflet/services/AddressMatchService.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.addressMatchService
- * @constructs L.supermap.addressMatchService
- * @classdesc 地址匹配服务。
- * @category iServer AddressMatch
- * @extends {L.supermap.ServiceBase}
- * @example
- * L.supermap.addressMatchService(url,options)
- * .code(function(result){
- * //doSomething
- * })
- * @param {string} url - 地址匹配服务地址。
- * @param {Object} options - 参数。
- * @param {string} [options.proxy] - 服务代理地址。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
- * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var AddressMatchService_AddressMatchService = ServiceBase.extend({
- initialize: function initialize(url, options) {
- ServiceBase.prototype.initialize.call(this, url, options);
- },
- /**
- * @function L.supermap.addressMatchService.prototype.code
- * @description 获取正向地址匹配结果。
- * @param {SuperMap.GeoCodingParameter} params - 正向匹配参数。
- * @param {RequestCallback} callback - 请求结果的回调函数。
- */
- code: function code(params, callback) {
- var me = this;
- var addressMatchService = new AddressMatchService(this.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- addressMatchService.code(Util.urlPathAppend(me.url, 'geocoding'), params);
- },
- /**
- * @function L.supermap.addressMatchService.prototype.decode
- * @description 获取反向地址匹配结果。
- * @param {SuperMap.GeoDecodingParameter} params - 反向匹配参数。
- * @param {RequestCallback} callback - 请求结果的回调函数。
- */
- decode: function decode(params, callback) {
- var me = this;
- var addressMatchService = new AddressMatchService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- addressMatchService.decode(Util.urlPathAppend(me.url, 'geodecoding'), params);
- }
- });
- var addressMatchService = function addressMatchService(url, options) {
- return new AddressMatchService_AddressMatchService(url, options);
- };
- (external_L_default()).supermap.addressMatchService = addressMatchService;
- ;// CONCATENATED MODULE: ./src/leaflet/services/ChartService.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.chartService
- * @classdesc 海图服务。
- * @category iServer Map Chart
- * @extends {L.supermap.ServiceBase}
- * @example
- * L.supermap.chartService(url)
- * .queryChart(param,function(result){
- * //doSomething
- * })
- * @param {string} url - 与客户端交互的海图服务地址。
- * @param {Object} options - 参数。
- * @param {string} [options.proxy] - 服务代理地址。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
- * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var ChartService = ServiceBase.extend({
- initialize: function initialize(url, options) {
- ServiceBase.prototype.initialize.call(this, url, options);
- },
- /**
- * @function L.supermap.chartService.prototype.queryChart
- * @description 查询海图。
- * @param {SuperMap.ChartQueryParameters} params - 海图查询所需参数类。
- * @param {RequestCallback} callback - 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果格式类型。
- */
- queryChart: function queryChart(params, callback, resultFormat) {
- var me = this,
- param = me._processParams(params),
- format = me._processFormat(resultFormat);
- var chartQueryService = new ChartQueryService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: format
- });
- chartQueryService.processAsync(param);
- },
- /**
- * @function L.supermap.chartService.prototype.getChartFeatureInfo
- * @description 获取海图物标信息。
- * @param {RequestCallback} callback 回调函数。
- */
- getChartFeatureInfo: function getChartFeatureInfo(callback) {
- var me = this,
- url = me.url.concat();
- url = Util.urlPathAppend(url, 'chartFeatureInfoSpecs');
- var chartFeatureInfoSpecsService = new ChartFeatureInfoSpecsService(url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- chartFeatureInfoSpecsService.processAsync();
- },
- _processParams: function _processParams(params) {
- if (!params) {
- return {};
- }
- params.returnContent = params.returnContent == null ? true : params.returnContent;
- if (params.chartQueryFilterParameters && !external_L_default().Util.isArray(params.chartQueryFilterParameters)) {
- params.chartQueryFilterParameters = [params.chartQueryFilterParameters];
- }
- if (params.bounds) {
- params.bounds = CommontypesConversion.toSuperMapBounds(params.bounds);
- }
- },
- _processFormat: function _processFormat(resultFormat) {
- return resultFormat ? resultFormat : DataFormat.GEOJSON;
- }
- });
- var chartService = function chartService(url, options) {
- return new ChartService(url, options);
- };
- (external_L_default()).supermap.chartService = chartService;
- ;// CONCATENATED MODULE: ./src/leaflet/services/FieldService.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.fieldService
- * @classdesc 字段服务类。
- * @category iServer Data Field
- * @extends {L.supermap.ServiceBase}
- * @example
- * L.supermap.fieldService(url).getFields(function(result){
- * //doSomething
- * });
- * @param {string} url - 字段服务地址。
- * @param {Object} options - 参数。
- * @param {string} [options.proxy] - 服务代理地址。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
- * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var FieldService = ServiceBase.extend({
- initialize: function initialize(url, options) {
- ServiceBase.prototype.initialize.call(this, url, options);
- },
- /**
- * @function L.supermap.fieldService.prototype.getFields
- * @description 字段查询服务。
- * @param {SuperMap.FieldParameters} params - 字段信息查询参数类。
- * @param {RequestCallback} callback - 回调函数。
- */
- getFields: function getFields(params, callback) {
- var me = this;
- var getFieldsService = new GetFieldsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- datasource: params.datasource,
- dataset: params.dataset
- });
- getFieldsService.processAsync();
- },
- /**
- * @function L.supermap.fieldService.prototype.getFieldStatisticsInfo
- * @description 字段统计服务。
- * @param {SuperMap.FieldStatisticsParameters} params - 字段统计信息查询参数类。
- * @param {RequestCallback} callback - 回调函数。
- */
- getFieldStatisticsInfo: function getFieldStatisticsInfo(params, callback) {
- if (!(params instanceof FieldStatisticsParameters)) {
- return;
- }
- var me = this,
- fieldName = params.fieldName,
- modes = params.statisticMode;
- if (modes && !external_L_default().Util.isArray(modes)) {
- modes = [modes];
- }
- me.currentStatisticResult = {
- fieldName: fieldName
- };
- me._statisticsCallback = callback; //针对每种统计方式分别进行请求
- modes.forEach(function (mode) {
- me.currentStatisticResult[mode] = null;
- me._fieldStatisticRequest(params.datasource, params.dataset, fieldName, mode);
- });
- },
- _fieldStatisticRequest: function _fieldStatisticRequest(dataSourceName, dataSetName, fieldName, statisticMode) {
- var me = this;
- var statisticService = new FieldStatisticService(me.url, {
- eventListeners: {
- scope: me,
- processCompleted: me._processCompleted,
- processFailed: me._statisticsCallback
- },
- datasource: dataSourceName,
- dataset: dataSetName,
- field: fieldName,
- statisticMode: statisticMode,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers
- });
- statisticService.processAsync();
- },
- _processCompleted: function _processCompleted(fieldStatisticResult) {
- var me = this;
- var getAll = true,
- result = fieldStatisticResult.result;
- if (this.currentStatisticResult) {
- if (null == me.currentStatisticResult[result.mode]) {
- this.currentStatisticResult[result.mode] = result.result;
- }
- }
- for (var mode in me.currentStatisticResult) {
- if (null == me.currentStatisticResult[mode]) {
- getAll = false;
- break;
- }
- }
- if (getAll) {
- me._statisticsCallback({
- result: me.currentStatisticResult
- });
- }
- }
- });
- var fieldService = function fieldService(url, options) {
- return new FieldService(url, options);
- };
- (external_L_default()).supermap.fieldService = fieldService;
- ;// CONCATENATED MODULE: ./src/leaflet/services/GridCellInfosService.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.gridCellInfosService
- * @classdesc 数据栅格查询服务。
- * @category iServer Data Grid
- * @extends {L.supermap.ServiceBase}
- * @example
- * L.supermap.gridCellInfosService(url)
- * .getGridCellInfos(param,function(result){
- * //doSomething
- * })
- * @param {string} url - 数据栅格查询服务地址。
- * @param {Object} options - 参数。
- * @param {string} [options.proxy] - 服务代理地址。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
- * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var GridCellInfosService = ServiceBase.extend({
- initialize: function initialize(url, options) {
- ServiceBase.prototype.initialize.call(this, url, options);
- },
- /**
- * @function L.supermap.gridCellInfosService.prototype.getGridCellInfos
- * @param {SuperMap.GetGridCellInfosParameters} params - 数据服务栅格查询参数类。
- * @param {RequestCallback} callback - 回调函数。
- */
- getGridCellInfos: function getGridCellInfos(params, callback) {
- if (!(params instanceof GetGridCellInfosParameters)) {
- return;
- }
- var me = this;
- var gridCellQueryService = new GetGridCellInfosService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- gridCellQueryService.processAsync(params);
- }
- });
- var gridCellInfosService = function gridCellInfosService(url, options) {
- return new GridCellInfosService(url, options);
- };
- (external_L_default()).supermap.gridCellInfosService = gridCellInfosService;
- ;// CONCATENATED MODULE: ./src/leaflet/services/GeoprocessingService.js
- /**
- * @class L.supermap.geoprocessingService
- * @classdesc 地理处理服务接口类。
- * @version 10.1.0
- * @category iServer GeoprocessingService
- * @extends L.supermap.ServiceBase
- * @example
- * //为了安全访问受保护的地理处理服务,必须通过传递iserver令牌(token),才能正确访问相关资源。
- * SuperMap.SecurityManager.registerToken(serviceUrl, token);
- * var geoprocessingService = new L.supermap.geoprocessingService("http://localhost:8090/iserver/services/geoprocessing/restjsr/gp/v2")
- geoprocessingService.submitJob(identifier,params, environments, function(serverResult) {
- console.log(serverResult.result);
- var jobID = serverResult.result.jobID;
- var options = {
- interval: 5000,
- statusCallback: function(state) {
- console.log("Job Status: ", state);
- }
- };
- geoprocessingService.waitForJobCompletion(jobID, identifier, options, function(serverResult) {
- console.log(serverResult);
- })
- })
- *
- * @param {string} url - 服务地址。
- * @param {Object} options - 参数。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 iServer|iPortal|online。
- */
- var GeoprocessingService_GeoprocessingService = ServiceBase.extend({
- initialize: function initialize(url, options) {
- options = options || {};
- external_L_default().setOptions(this, options);
- ServiceBase.prototype.initialize.call(this, url, options);
- this.headers = {};
- this.crossOrigin = true;
- this.withCredentials = true;
- this.proxy = true;
- },
- /**
- * @function L.supermap.geoprocessingService.prototype.getTools
- * @description 获取地理处理工具列表。
- * @param {RequestCallback} callback 请求结果的回调函数。
- */
- getTools: function getTools(callback) {
- var geoprocessingJobsService = new GeoprocessingService(this.url, {
- proxy: this.options.proxy,
- withCredentials: this.options.withCredentials,
- crossOrigin: this.options.crossOrigin,
- headers: this.options.headers,
- serverType: this.options.serverType,
- eventListeners: {
- scope: this,
- processCompleted: callback,
- processFailed: callback
- }
- });
- geoprocessingJobsService.getTools();
- },
- /**
- * @function L.supermap.geoprocessingService.prototype.getTool
- * @description 获取工具的ID、名称、描述、输入参数、环境参数和输出结果等相关参数。
- * @param {string} identifier - 地理处理工具ID。
- * @param {RequestCallback} callback 请求结果的回调函数。
- */
- getTool: function getTool(identifier, callback) {
- var geoprocessingJobsService = new GeoprocessingService(this.url, {
- proxy: this.options.proxy,
- withCredentials: this.options.withCredentials,
- crossOrigin: this.options.crossOrigin,
- headers: this.options.headers,
- serverType: this.options.serverType,
- eventListeners: {
- scope: this,
- processCompleted: callback,
- processFailed: callback
- }
- });
- geoprocessingJobsService.getTool(identifier);
- },
- /**
- * @function L.supermap.geoprocessingService.prototype.execute
- * @description 同步执行地理处理工具。
- * @param {string} identifier - 地理处理工具ID。
- * @param {Object} parameter - 地理处理工具的输入参数。
- * @param {Object} environment - 地理处理工具的环境参数。
- * @param {RequestCallback} callback 回调函数。
- */
- execute: function execute(identifier, parameter, environment, callback) {
- var geoprocessingJobsService = new GeoprocessingService(this.url, {
- proxy: this.options.proxy,
- withCredentials: this.options.withCredentials,
- crossOrigin: this.options.crossOrigin,
- headers: this.options.headers,
- serverType: this.options.serverType,
- eventListeners: {
- scope: this,
- processCompleted: callback,
- processFailed: callback
- }
- });
- geoprocessingJobsService.execute(identifier, parameter, environment);
- },
- /**
- * @function L.supermap.geoprocessingService.prototype.submitJob
- * @description 异步执行地理处理工具。
- * @param {string} identifier - 地理处理工具ID。
- * @param {Object} parameter - 地理处理工具的输入参数。
- * @param {Object} environment - 地理处理工具的环境参数。
- * @param {RequestCallback} callback 回调函数。
- */
- submitJob: function submitJob(identifier, parameter, environment, callback) {
- var geoprocessingJobsService = new GeoprocessingService(this.url, {
- proxy: this.options.proxy,
- withCredentials: this.options.withCredentials,
- crossOrigin: this.options.crossOrigin,
- headers: this.options.headers,
- serverType: this.options.serverType,
- eventListeners: {
- scope: this,
- processCompleted: callback,
- processFailed: callback
- }
- });
- geoprocessingJobsService.submitJob(identifier, parameter, environment);
- },
- /**
- * @function L.supermap.geoprocessingService.prototype.waitForJobCompletion
- * @description 获取地理处理异步执行状态信息。
- * @param {string} jobId - 地理处理任务ID。
- * @param {string} identifier - 地理处理工具ID。
- * @param {Object} options - 状态信息参数。
- * @param {number} options.interval - 定时器时间间隔。
- * @param {RequestCallback} options.statusCallback - 任务状态的回调函数。
- * @param {Callback} callback 回调函数。
- */
- waitForJobCompletion: function waitForJobCompletion(jobId, identifier, options, callback) {
- var geoprocessingJobsService = new GeoprocessingService(this.url, {
- proxy: this.options.proxy,
- withCredentials: this.options.withCredentials,
- crossOrigin: this.options.crossOrigin,
- headers: this.options.headers,
- serverType: this.options.serverType,
- eventListeners: {
- scope: this,
- processCompleted: callback,
- processFailed: callback
- }
- });
- geoprocessingJobsService.waitForJobCompletion(jobId, identifier, options);
- },
- /**
- * @function L.supermap.geoprocessingService.prototype.getJobInfo
- * @description 获取地理处理任务的执行信息。
- * @param {string} identifier - 地理处理工具ID。
- * @param {string} jobId - 地理处理任务ID。
- * @param {RequestCallback} callback 回调函数。
- */
- getJobInfo: function getJobInfo(identifier, jobId, callback) {
- var geoprocessingJobsService = new GeoprocessingService(this.url, {
- proxy: this.options.proxy,
- withCredentials: this.options.withCredentials,
- crossOrigin: this.options.crossOrigin,
- headers: this.options.headers,
- serverType: this.options.serverType,
- eventListeners: {
- scope: this,
- processCompleted: callback,
- processFailed: callback
- }
- });
- geoprocessingJobsService.getJobInfo(identifier, jobId);
- },
- /**
- * @function L.supermap.geoprocessingService.prototype.cancelJob
- * @description 取消地理处理任务的异步执行。
- * @param {string} identifier - 地理处理工具ID。
- * @param {string} jobId - 地理处理任务ID。
- * @param {RequestCallback} callback 回调函数。
- */
- cancelJob: function cancelJob(identifier, jobId, callback) {
- var geoprocessingJobsService = new GeoprocessingService(this.url, {
- proxy: this.options.proxy,
- withCredentials: this.options.withCredentials,
- crossOrigin: this.options.crossOrigin,
- headers: this.options.headers,
- serverType: this.options.serverType,
- eventListeners: {
- scope: this,
- processCompleted: callback,
- processFailed: callback
- }
- });
- geoprocessingJobsService.cancelJob(identifier, jobId);
- },
- /**
- * @function L.supermap.geoprocessingService.prototype.getJobs
- * @description 获取地理处理服务任务列表。
- * @param {string} identifier - 地理处理工具ID。(传参代表identifier算子的任务列表,不传参代表所有任务的列表)
- * @param {RequestCallback} callback 回调函数。
- */
- getJobs: function getJobs(identifier, callback) {
- var geoprocessingJobsService = new GeoprocessingService(this.url, {
- proxy: this.options.proxy,
- withCredentials: this.options.withCredentials,
- crossOrigin: this.options.crossOrigin,
- headers: this.options.headers,
- serverType: this.options.serverType,
- eventListeners: {
- scope: this,
- processCompleted: callback,
- processFailed: callback
- }
- });
- geoprocessingJobsService.getJobs(identifier);
- },
- /**
- * @function L.supermap.geoprocessingService.prototype.getResults
- * @description 地理处理工具异步执行的结果,支持结果过滤。
- * @param {string} identifier - 地理处理工具ID。
- * @param {string} jobId - 地理处理任务ID。
- * @param {string} filter - 输出异步结果的id。(可选,传入filter参数时对该地理处理工具执行的结果进行过滤获取,不填参时显示所有的执行结果)
- * @param {RequestCallback} callback 请求结果的回调函数。
- */
- getResults: function getResults(identifier, jobId, filter, callback) {
- var geoprocessingJobsService = new GeoprocessingService(this.url, {
- proxy: this.options.proxy,
- withCredentials: this.options.withCredentials,
- crossOrigin: this.options.crossOrigin,
- headers: this.options.headers,
- serverType: this.options.serverType,
- eventListeners: {
- scope: this,
- processCompleted: callback,
- processFailed: callback
- }
- });
- geoprocessingJobsService.getResults(identifier, jobId, filter);
- }
- });
- var geoprocessingService = function geoprocessingService(url, options) {
- return new GeoprocessingService_GeoprocessingService(url, options);
- };
- (external_L_default()).supermap.geoprocessingService = geoprocessingService;
- ;// CONCATENATED MODULE: ./src/leaflet/services/LayerInfoService.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.layerInfoService
- * @classdesc 图层信息类。
- * @category iServer Map Layer
- * @extends {L.supermap.ServiceBase}
- * @example
- * L.supermap.layerInfoService(url).getLayersInfo(function(result){
- * //doSomething
- * })
- * @param {string} url - 与服务端交互的地图服务地址。请求地图服务 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}"。
- * @param {Object} options - 参数。
- * @param {string} [options.proxy] - 服务代理地址。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
- * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var LayerInfoService = ServiceBase.extend({
- initialize: function initialize(url, options) {
- ServiceBase.prototype.initialize.call(this, url, options);
- },
- /**
- * @function L.supermap.layerInfoService.prototype.getLayersInfo
- * @description 获取图层信息。
- * @param {RequestCallback} callback - 获取信息完成后的回调函数。
- */
- getLayersInfo: function getLayersInfo(callback) {
- var me = this;
- var getLayersInfoService = new GetLayersInfoService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- processCompleted: callback,
- processFailed: callback
- }
- });
- getLayersInfoService.processAsync();
- },
- /**
- * @function L.supermap.layerInfoService.prototype.setLayerInfo
- * @description 设置图层信息服务。可以实现临时图层中子图层的修改。
- * @param {SuperMap.SetLayerInfoParameters} params - 图层信息相关参数。
- * @param {RequestCallback} callback - 回调函数。
- */
- setLayerInfo: function setLayerInfo(params, callback) {
- if (!(params instanceof SetLayerInfoParameters)) {
- return;
- }
- var me = this,
- resourceID = params.resourceID,
- tempLayerName = params.tempLayerName,
- layerInfoParams = params.layerInfo;
- if (!resourceID || !tempLayerName) {
- return;
- }
- var url = Util.urlPathAppend(me.url, "tempLayersSet/".concat(resourceID, "/").concat(tempLayerName));
- var setLayerInfoService = new SetLayerInfoService(url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- processCompleted: callback,
- processFailed: callback
- }
- });
- setLayerInfoService.processAsync(layerInfoParams);
- },
- /**
- * @function L.supermap.layerInfoService.prototype.setLayersInfo
- * @description 设置图层信息。可以实现创建新的临时图层和对现有临时图层的修改。
- * @param {SuperMap.SetLayersInfoParameters} params - 图层信息设置参数,包括临时图层。
- * @param {RequestCallback} callback - 回调函数。
- */
- setLayersInfo: function setLayersInfo(params, callback) {
- if (!(params instanceof SetLayersInfoParameters)) {
- return;
- }
- var me = this,
- resourceID = params.resourceID,
- isTempLayers = params.isTempLayers ? params.isTempLayers : false,
- layersInfo = params.layersInfo;
- if (isTempLayers && !resourceID || !layersInfo) {
- return;
- }
- var setLayersInfoService = new SetLayersInfoService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- processCompleted: callback,
- processFailed: callback
- },
- resourceID: resourceID,
- isTempLayers: isTempLayers
- });
- setLayersInfoService.processAsync(layersInfo);
- },
- /**
- * @function L.supermap.layerInfoService.prototype.setLayerStatus
- * @description 负责将子图层显示控制参数传递到服务端,并获取服务端返回的图层显示状态。
- * @param {SuperMap.SetLayerStatusParameters} params - 图层信息显示控制参数。
- * @param {RequestCallback} callback - 回调函数。
- */
- setLayerStatus: function setLayerStatus(params, callback) {
- if (!(params instanceof SetLayerStatusParameters)) {
- return;
- }
- var me = this;
- var setLayerStatusService = new SetLayerStatusService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- processCompleted: callback,
- processFailed: callback
- }
- });
- setLayerStatusService.processAsync(params);
- }
- });
- var layerInfoService = function layerInfoService(url, options) {
- return new LayerInfoService(url, options);
- };
- (external_L_default()).supermap.layerInfoService = layerInfoService;
- ;// CONCATENATED MODULE: ./src/leaflet/services/MeasureService.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.measureService
- * @classdesc 量算服务类。
- * @category iServer Map Measure
- * @augments {L.supermap.ServiceBase}
- * @example
- * 用法:
- * L.supermap.measureService(url).measureDistance({
- * geometry:xxx
- * },function(result){
- * //doSomething
- * })
- * @param {string} url - 服务访问的地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World。
- * @param {Object} options - 参数。
- * @param {string} [options.proxy] - 服务代理地址。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
- * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {L.supermap.ServiceBase}
- */
- var MeasureService_MeasureService = ServiceBase.extend({
- initialize: function initialize(url, options) {
- ServiceBase.prototype.initialize.call(this, url, options);
- },
- /**
- * @function L.supermap.measureService.prototype.measureDistance
- * @description 测距。
- * @param {SuperMap.MeasureParameters} params - 测量相关参数类。
- * @param {RequestCallback} callback - 回调函数。
- */
- measureDistance: function measureDistance(params, callback) {
- this.measure(MeasureMode.DISTANCE, params, callback);
- return this;
- },
- /**
- * @function L.supermap.measureService.prototype.measureArea
- * @description 测面积。
- * @param {SuperMap.MeasureParameters} params - 测量相关参数类。
- * @param {RequestCallback} callback - 回调函数。
- */
- measureArea: function measureArea(params, callback) {
- this.measure(MeasureMode.AREA, params, callback);
- return this;
- },
- /**
- * @function L.supermap.measureService.measure
- * @param {SuperMap.MeasureMode} [type=SuperMap.MeasureMode.DISTANCE] - 量算模式。
- * @param {SuperMap.MeasureParameters} params - 测量相关参数类。
- * @param {RequestCallback} callback - 回调函数。
- */
- measure: function measure(type, params, callback) {
- if (!(params instanceof MeasureParameters)) {
- return;
- }
- var me = this;
- if (params.geometry) {
- params.geometry = toSuperMapGeometry(params.geometry);
- }
- var measureService = new MeasureService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- measureMode: type,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- measureService.processAsync(params);
- }
- });
- var measureService = function measureService(url, options) {
- return new MeasureService_MeasureService(url, options);
- };
- (external_L_default()).supermap.measureService = measureService;
- ;// CONCATENATED MODULE: ./src/leaflet/services/NetworkAnalyst3DService.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.networkAnalyst3DService
- * @classdesc 3D 网络分析服务类。
- * @category iServer FacilityAnalyst3D
- * @extends {L.supermap.ServiceBase}
- * @example
- * L.supermap.networkAnalyst3DService(url)
- * .sinksFacilityAnalyst(params,function(result){
- * //doSomething
- * })
- * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
- * "http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
- * @param {Object} options - 参数。
- * @param {string} [options.proxy] - 服务代理地址。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
- * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var NetworkAnalyst3DService = ServiceBase.extend({
- initialize: function initialize(url, options) {
- ServiceBase.prototype.initialize.call(this, url, options);
- },
- /**
- * @function L.supermap.networkAnalyst3DService.prototype.sinksFacilityAnalyst
- * @description 汇查找服务。
- * @param {SuperMap.FacilityAnalystSinks3DParameters} params - 最近设施分析参数类(汇查找资源)。
- * @param {RequestCallback} callback - 回调函数。
- */
- sinksFacilityAnalyst: function sinksFacilityAnalyst(params, callback) {
- var me = this;
- var facilityAnalystSinks3DService = new FacilityAnalystSinks3DService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- facilityAnalystSinks3DService.processAsync(params);
- },
- /**
- * @function L.supermap.networkAnalyst3DService.prototype.sourcesFacilityAnalyst
- * @description 源查找服务。
- * @param {SuperMap.FacilityAnalystSources3DParameters} params - 最近设施分析参数类(源查找服务)。
- * @param {RequestCallback} callback - 回调函数。
- * @returns {this} this
- */
- sourcesFacilityAnalyst: function sourcesFacilityAnalyst(params, callback) {
- var me = this;
- var facilityAnalystSources3DService = new FacilityAnalystSources3DService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- facilityAnalystSources3DService.processAsync(params);
- },
- /**
- * @function L.supermap.networkAnalyst3DService.prototype.traceUpFacilityAnalyst
- * @description 上游追踪资源服务。
- * @param {SuperMap.FacilityAnalystTraceup3DParameters} params - 上游追踪资源参数类。
- * @param {RequestCallback} callback - 回调函数。
- * @returns {this} this
- */
- traceUpFacilityAnalyst: function traceUpFacilityAnalyst(params, callback) {
- var me = this;
- var facilityAnalystTraceup3DService = new FacilityAnalystTraceup3DService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- facilityAnalystTraceup3DService.processAsync(params);
- },
- /**
- * @function L.supermap.networkAnalyst3DService.prototype.traceDownFacilityAnalyst
- * @description 下游追踪资源服务。
- * @param {SuperMap.FacilityAnalystTracedown3DParameters} params - 下游追踪资源服务参数类。
- * @param {RequestCallback} callback - 回调函数。
- */
- traceDownFacilityAnalyst: function traceDownFacilityAnalyst(params, callback) {
- var me = this;
- var facilityAnalystTracedown3DService = new FacilityAnalystTracedown3DService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- facilityAnalystTracedown3DService.processAsync(params);
- },
- /**
- * @function L.supermap.networkAnalyst3DService.prototype.upstreamFacilityAnalyst
- * @description 上游关键设施查找服务。
- * @param {SuperMap.FacilityAnalystUpstream3DParameters} params - 上游关键设施查找服务参数类。
- * @param {RequestCallback} callback - 回调函数。
- */
- upstreamFacilityAnalyst: function upstreamFacilityAnalyst(params, callback) {
- var me = this;
- var facilityAnalystUpstream3DService = new FacilityAnalystUpstream3DService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- facilityAnalystUpstream3DService.processAsync(params);
- }
- });
- var networkAnalyst3DService = function networkAnalyst3DService(url, options) {
- return new NetworkAnalyst3DService(url, options);
- };
- (external_L_default()).supermap.networkAnalyst3DService = networkAnalyst3DService;
- ;// CONCATENATED MODULE: ./src/leaflet/services/NetworkAnalystService.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.networkAnalystService
- * @classdesc 网络分析服务类。
- * @category iServer NetworkAnalyst
- * @augments L.supermap.ServiceBase
- * @example
- * L.supermap.networkAnalystService(url)
- * .findPath(params,function(result){
- * //doSomething
- * })
- * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
- * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源}。<br>
- * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet"。
- * @param {Object} options - 参数。
- * @param {string} [options.proxy] - 服务代理地址。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
- * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {L.supermap.ServiceBase}
- */
- var NetworkAnalystService = ServiceBase.extend({
- initialize: function initialize(url, options) {
- ServiceBase.prototype.initialize.call(this, url, options);
- },
- /**
- * @function L.supermap.networkAnalystService.prototype.burstPipelineAnalyst
- * @description 爆管分析服务:即将给定弧段或节点作为爆管点来进行分析,返回关键结点 ID 数组,普通结点 ID 数组及其上下游弧段 ID 数组。
- * @param {SuperMap.BurstPipelineAnalystParameters} params - 爆管分析服务参数类。
- * @param {RequestCallback} callback - 回调函数。
- */
- burstPipelineAnalyst: function burstPipelineAnalyst(params, callback) {
- var me = this;
- var burstPipelineAnalystService = new BurstPipelineAnalystService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- burstPipelineAnalystService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.networkAnalystService.prototype.computeWeightMatrix
- * @description 耗费矩阵分析服务:根据交通网络分析参数中的耗费字段返回一个耗费矩阵。该矩阵是一个二维数组,用来存储任意两点间的资源消耗。
- * @param {SuperMap.ComputeWeightMatrixParameters} params - 耗费矩阵分析服务参数类。
- * @param {RequestCallback} callback - 回调函数。
- */
- computeWeightMatrix: function computeWeightMatrix(params, callback) {
- var me = this;
- var computeWeightMatrixService = new ComputeWeightMatrixService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- computeWeightMatrixService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.networkAnalystService.prototype.findClosestFacilities
- * @description 最近设施分析服务:指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
- * @param {SuperMap.FindClosestFacilitiesParameters} params - 最近设施分析服务参数类。
- * @param {RequestCallback} callback - 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- findClosestFacilities: function findClosestFacilities(params, callback, resultFormat) {
- var me = this;
- var findClosestFacilitiesService = new FindClosestFacilitiesService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- findClosestFacilitiesService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.networkAnalystService.prototype.streamFacilityAnalyst
- * @description 上游/下游 关键设施查找资源服务:查找给定弧段或节点的上游/下游中的关键设施结点,返回关键结点 ID 数组及其下游弧段 ID 数组。
- * @param {SuperMap.FacilityAnalystStreamParameters} params - 上游/下游 关键设施查找资源服务参数类。
- * @param {RequestCallback} callback - 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- streamFacilityAnalyst: function streamFacilityAnalyst(params, callback, resultFormat) {
- var me = this;
- var facilityAnalystStreamService = new FacilityAnalystStreamService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- facilityAnalystStreamService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.networkAnalystService.prototype.findLocation
- * @description 选址分区分析服务:确定一个或多个待建设施的最佳或最优位置。
- * @param {SuperMap.FindLocationParameters} params - 选址分区分析服务参数类。
- * @param {RequestCallback} callback - 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- findLocation: function findLocation(params, callback, resultFormat) {
- var me = this;
- var findLocationService = new FindLocationService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- findLocationService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.networkAnalystService.prototype.findPath
- * @description 最佳路径分析服务:在网络数据集中指定一些节点,按照节点的选择顺序,顺序访问这些节点从而求解起止点之间阻抗最小的路经。
- * @param {SuperMap.FindPathParameters} params - 最佳路径分析服务参数类。
- * @param {RequestCallback} callback - 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- findPath: function findPath(params, callback, resultFormat) {
- var me = this;
- var findPathService = new FindPathService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- findPathService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.networkAnalystService.prototype.findTSPPaths
- * @description 旅行商分析服务:路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
- * @param {SuperMap.FindTSPPathsParameters} params - 旅行商分析服务参数类。
- * @param {RequestCallback} callback - 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- findTSPPaths: function findTSPPaths(params, callback, resultFormat) {
- var me = this;
- var findTSPPathsService = new FindTSPPathsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- findTSPPathsService.processAsync(me._processParams(params));
- },
- /**
- * @function l.supermap.networkAnalystService.prototype.findMTSPPaths
- * @description 多旅行商分析服务:也称为物流配送,是指在网络数据集中,给定 M 个配送中心点和 N 个配送目的地(M,N 为大于零的整数)。查找经济有效的配送路径,并给出相应的行走路线。
- * @param {SuperMap.FindMTSPPathsParameters} params - 多旅行商分析服务参数类。
- * @param {RequestCallback} callback - 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- findMTSPPaths: function findMTSPPaths(params, callback, resultFormat) {
- var me = this;
- var findMTSPPathsService = new FindMTSPPathsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- findMTSPPathsService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.networkAnalystService.prototype.findServiceAreas
- * @description 服务区分析服务:以指定服务站点为中心,在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
- * @param {SuperMap.FindServiceAreasParameters} params - 服务区分析服务参数类。
- * @param {RequestCallback} callback - 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- findServiceAreas: function findServiceAreas(params, callback, resultFormat) {
- var me = this;
- var findServiceAreasService = new FindServiceAreasService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- findServiceAreasService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.networkAnalystService.prototype.updateEdgeWeight
- * @description 更新边的耗费权重服务。
- * @param {SuperMap.UpdateEdgeWeightParameters} params - 更新边的耗费权重服务参数类。
- * @param {RequestCallback} callback -回调函数。
- */
- updateEdgeWeight: function updateEdgeWeight(params, callback) {
- var me = this;
- var updateEdgeWeightService = new UpdateEdgeWeightService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- updateEdgeWeightService.processAsync(params);
- },
- /**
- * @function L.supermap.networkAnalystService.prototype.updateTurnNodeWeight
- * @description 转向耗费权重更新服务。
- * @param {SuperMap.UpdateTurnNodeWeightParameters} params - 转向耗费权重更新服务参数类。
- * @param {RequestCallback} callback - 回调函数。
- */
- updateTurnNodeWeight: function updateTurnNodeWeight(params, callback) {
- var me = this;
- var updateTurnNodeWeightService = new UpdateTurnNodeWeightService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- updateTurnNodeWeightService.processAsync(params);
- },
- _processParams: function _processParams(params) {
- if (!params) {
- return {};
- }
- if (params.centers && external_L_default().Util.isArray(params.centers)) {
- params.centers.map(function (point, key) {
- params.centers[key] = point instanceof (external_L_default()).LatLng ? {
- x: point.lng,
- y: point.lat
- } : point;
- return params.centers[key];
- });
- }
- if (params.nodes && external_L_default().Util.isArray(params.nodes)) {
- params.nodes.map(function (point, key) {
- params.nodes[key] = point instanceof (external_L_default()).LatLng ? {
- x: point.lng,
- y: point.lat
- } : point;
- return params.nodes[key];
- });
- }
- if (params.event && params.event instanceof (external_L_default()).LatLng) {
- params.event = {
- x: params.event.lng,
- y: params.event.lat
- };
- }
- if (params.facilities && external_L_default().Util.isArray(params.facilities)) {
- params.facilities.map(function (point, key) {
- params.facilities[key] = point instanceof (external_L_default()).LatLng ? {
- x: point.lng,
- y: point.lat
- } : point;
- return params.facilities[key];
- });
- }
- if (params.parameter && params.parameter.barrierPoints) {
- var barrierPoints = params.parameter.barrierPoints;
- if (external_L_default().Util.isArray(barrierPoints)) {
- barrierPoints.map(function (point, key) {
- params.parameter.barrierPoints[key] = point instanceof (external_L_default()).LatLng ? {
- x: point.lng,
- y: point.lat
- } : point;
- return params.parameter.barrierPoints[key];
- });
- } else {
- params.parameter.barrierPoints = [barrierPoints instanceof (external_L_default()).LatLng ? {
- x: barrierPoints.lng,
- y: barrierPoints.lat
- } : barrierPoints];
- }
- }
- return params;
- },
- _processFormat: function _processFormat(resultFormat) {
- return resultFormat ? resultFormat : DataFormat.GEOJSON;
- }
- });
- var networkAnalystService = function networkAnalystService(url, options) {
- return new NetworkAnalystService(url, options);
- };
- (external_L_default()).supermap.networkAnalystService = networkAnalystService;
- ;// CONCATENATED MODULE: ./src/leaflet/services/ProcessingService.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.processingService
- * @classdesc 分布式分析服务类。
- * @category iServer ProcessingService
- * @extends L.supermap.ServiceBase
- * @example
- * L.supermap.processingService(url)
- * .getKernelDensityJobs(function(result){
- * //doSomething
- * })
- * @param {string} url - 分布式分析服务地址。
- * @param {Object} options - 参数。
- * @param {string} [options.proxy] - 服务代理地址。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
- * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var ProcessingService = ServiceBase.extend({
- initialize: function initialize(url, options) {
- options = options || {};
- external_L_default().setOptions(this, options);
- ServiceBase.prototype.initialize.call(this, url, options);
- this.kernelDensityJobs = {};
- this.summaryMeshJobs = {};
- this.queryJobs = {};
- this.summaryRegionJobs = {};
- this.vectorClipJobs = {};
- this.overlayGeoJobs = {};
- this.buffersJobs = {};
- this.topologyValidatorJobs = {};
- this.summaryAttributesJobs = {};
- },
- /**
- * @function L.supermap.processingService.prototype.getKernelDensityJobs
- * @description 获取密度分析的列表。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- getKernelDensityJobs: function getKernelDensityJobs(callback, resultFormat) {
- var me = this,
- format = me._processFormat(resultFormat);
- var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: format
- });
- kernelDensityJobsService.getKernelDensityJobs();
- },
- /**
- * @function L.supermap.processingService.prototype.getKernelDensityJob
- * @description 获取某一个密度分析。
- * @param {string} id - 空间分析的 ID。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- getKernelDensityJob: function getKernelDensityJob(id, callback, resultFormat) {
- var me = this,
- format = me._processFormat(resultFormat);
- var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: format
- });
- kernelDensityJobsService.getKernelDensityJob(id);
- },
- /**
- * @function L.supermap.processingService.prototype.addKernelDensityJob
- * @description 新建一个密度分析。
- * @param {SuperMap.KernelDensityJobParameter} params - 创建一个空间分析的请求参数。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- addKernelDensityJob: function addKernelDensityJob(params, callback, seconds, resultFormat) {
- var me = this,
- param = me._processParams(params),
- format = me._processFormat(resultFormat);
- var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback,
- processRunning: function processRunning(job) {
- me.kernelDensityJobs[job.id] = job.state;
- }
- },
- format: format
- });
- kernelDensityJobsService.addKernelDensityJob(param, seconds);
- },
- /**
- * @function L.supermap.processingService.prototype.getKernelDensityJobState
- * @description 获取密度分析的状态。
- * @param {string} id - 密度分析 ID。
- * @returns {Object} 密度分析的状态。
- */
- getKernelDensityJobState: function getKernelDensityJobState(id) {
- return this.kernelDensityJobs[id];
- },
- /**
- * @function L.supermap.processingService.prototype.getSummaryMeshJobs
- * @description 获取点聚合分析的列表。
- * @param {RequestCallback} callback - 请求结果的回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- getSummaryMeshJobs: function getSummaryMeshJobs(callback, resultFormat) {
- var me = this,
- format = me._processFormat(resultFormat);
- var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: format
- });
- summaryMeshJobsService.getSummaryMeshJobs();
- },
- /**
- * @function L.supermap.processingService.prototype.getSummaryMeshJob
- * @description 获取某一个点聚合分析。
- * @param {string} id - 空间分析的 ID。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- getSummaryMeshJob: function getSummaryMeshJob(id, callback, resultFormat) {
- var me = this,
- format = me._processFormat(resultFormat);
- var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: format
- });
- summaryMeshJobsService.getSummaryMeshJob(id);
- },
- /**
- * @function L.supermap.processingService.prototype.addSummaryMeshJob
- * @description 新建一个点聚合分析。
- * @param {SuperMap.SummaryMeshJobParameter} params - 点聚合分析任务参数类。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- addSummaryMeshJob: function addSummaryMeshJob(params, callback, seconds, resultFormat) {
- var me = this,
- param = me._processParams(params),
- format = me._processFormat(resultFormat);
- var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback,
- processRunning: function processRunning(job) {
- me.summaryMeshJobs[job.id] = job.state;
- }
- },
- format: format
- });
- summaryMeshJobsService.addSummaryMeshJob(param, seconds);
- },
- /**
- * @function L.supermap.processingService.prototype.getSummaryMeshJobState
- * @description 获取点聚合分析的状态。
- * @param {string} id - 点聚合分析的 ID。
- * @returns {Object} 点聚合分析的状态。
- */
- getSummaryMeshJobState: function getSummaryMeshJobState(id) {
- return this.summaryMeshJobs[id];
- },
- /**
- * @function L.supermap.processingService.prototype.getQueryJobs
- * @description 获取单对象查询分析的列表。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- getQueryJobs: function getQueryJobs(callback, resultFormat) {
- var me = this,
- format = me._processFormat(resultFormat);
- var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: format
- });
- singleObjectQueryJobsService.getQueryJobs();
- },
- /**
- * @function L.supermap.processingService.prototype.getQueryJob
- * @description 获取某一个单对象查询分析。
- * @param {string} id - 空间分析的 ID。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- getQueryJob: function getQueryJob(id, callback, resultFormat) {
- var me = this,
- format = me._processFormat(resultFormat);
- var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: format
- });
- singleObjectQueryJobsService.getQueryJob(id);
- },
- /**
- * @function L.supermap.processingService.prototype.addQueryJob
- * @description 新建一个单对象查询分析。
- * @param {SuperMap.SingleObjectQueryJobsParameter} params - 创建一个空间分析的请求参数。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- addQueryJob: function addQueryJob(params, callback, seconds, resultFormat) {
- var me = this,
- param = me._processParams(params),
- format = me._processFormat(resultFormat);
- var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback,
- processRunning: function processRunning(job) {
- me.queryJobs[job.id] = job.state;
- }
- },
- format: format
- });
- singleObjectQueryJobsService.addQueryJob(param, seconds);
- },
- /**
- * @function L.supermap.processingService.prototype.getQueryJobState
- * @description 获取单对象查询分析的状态。
- * @param {string} id - 单对象查询分析的 ID。
- * @returns {Object} 单对象查询分析的状态。
- */
- getQueryJobState: function getQueryJobState(id) {
- return this.queryJobs[id];
- },
- /**
- * @function L.supermap.processingService.prototype.getSummaryRegionJobs
- * @description 获取区域汇总分析的列表。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- getSummaryRegionJobs: function getSummaryRegionJobs(callback, resultFormat) {
- var me = this,
- format = me._processFormat(resultFormat);
- var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: format
- });
- summaryRegionJobsService.getSummaryRegionJobs();
- },
- /**
- * @function L.supermap.processingService.prototype.getSummaryRegionJob
- * @description 获取某一个区域汇总分析。
- * @param {string} id - 区域汇总分析的 ID。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- getSummaryRegionJob: function getSummaryRegionJob(id, callback, resultFormat) {
- var me = this,
- format = me._processFormat(resultFormat);
- var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: format
- });
- summaryRegionJobsService.getSummaryRegionJob(id);
- },
- /**
- * @function L.supermap.processingService.prototype.addSummaryRegionJob
- * @description 新建一个区域汇总分析。
- * @param {SuperMap.SummaryRegionJobParameter} params - 创建一个区域汇总分析的请求参数。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- addSummaryRegionJob: function addSummaryRegionJob(params, callback, seconds, resultFormat) {
- var me = this,
- param = me._processParams(params),
- format = me._processFormat(resultFormat);
- var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback,
- processRunning: function processRunning(job) {
- me.summaryRegionJobs[job.id] = job.state;
- }
- },
- format: format
- });
- summaryRegionJobsService.addSummaryRegionJob(param, seconds);
- },
- /**
- * @function L.supermap.processingService.prototype.getSummaryRegionJobState
- * @description 获取区域汇总分析的状态。
- * @param {string} id - 区域汇总分析的 ID。
- * @returns {Object} 区域汇总分析的状态。
- */
- getSummaryRegionJobState: function getSummaryRegionJobState(id) {
- return this.summaryRegionJobs[id];
- },
- /**
- * @function L.supermap.processingService.prototype.getVectorClipJobs
- * @description 获取矢量裁剪分析的列表。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- getVectorClipJobs: function getVectorClipJobs(callback, resultFormat) {
- var me = this,
- format = me._processFormat(resultFormat);
- var vectorClipJobsService = new VectorClipJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: format
- });
- vectorClipJobsService.getVectorClipJobs();
- },
- /**
- * @function L.supermap.processingService.prototype.getVectorClipJob
- * @description 获取某一个矢量裁剪分析。
- * @param {string} id - 空间分析的 ID。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- getVectorClipJob: function getVectorClipJob(id, callback, resultFormat) {
- var me = this,
- format = me._processFormat(resultFormat);
- var vectorClipJobsService = new VectorClipJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: format
- });
- vectorClipJobsService.getVectorClipJob(id);
- },
- /**
- * @function L.supermap.processingService.prototype.addVectorClipJob
- * @description 新建一个矢量裁剪分析。
- * @param {SuperMap.VectorClipJobsParameter} params - 创建一个空间分析的请求参数。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- addVectorClipJob: function addVectorClipJob(params, callback, seconds, resultFormat) {
- var me = this,
- param = me._processParams(params),
- format = me._processFormat(resultFormat);
- var vectorClipJobsService = new VectorClipJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback,
- processRunning: function processRunning(job) {
- me.vectorClipJobs[job.id] = job.state;
- }
- },
- format: format
- });
- vectorClipJobsService.addVectorClipJob(param, seconds);
- },
- /**
- * @function L.supermap.processingService.prototype.getVectorClipJobState
- * @description 获取矢量裁剪分析的状态。
- * @param {string} id - 矢量裁剪分析的 ID。
- * @returns {Object} 矢量裁剪分析的状态。
- */
- getVectorClipJobState: function getVectorClipJobState(id) {
- return this.vectorClipJobs[id];
- },
- /**
- * @function L.supermap.processingService.prototype.getOverlayGeoJobs
- * @description 获取叠加分析的列表。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- getOverlayGeoJobs: function getOverlayGeoJobs(callback, resultFormat) {
- var me = this,
- format = me._processFormat(resultFormat);
- var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: format
- });
- overlayGeoJobsService.getOverlayGeoJobs();
- },
- /**
- * @function L.supermap.processingService.prototype.getOverlayGeoJob
- * @description 获取某一个叠加分析。
- * @param {string} id - 空间分析的 ID。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- getOverlayGeoJob: function getOverlayGeoJob(id, callback, resultFormat) {
- var me = this,
- format = me._processFormat(resultFormat);
- var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: format
- });
- overlayGeoJobsService.getOverlayGeoJob(id);
- },
- /**
- * @function L.supermap.processingService.prototype.addOverlayGeoJob
- * @description 新建一个叠加分析。
- * @param {SuperMap.OverlayGeoJobParameter} params - 创建一个空间分析的请求参数。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- addOverlayGeoJob: function addOverlayGeoJob(params, callback, seconds, resultFormat) {
- var me = this,
- param = me._processParams(params),
- format = me._processFormat(resultFormat);
- var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback,
- processRunning: function processRunning(job) {
- me.overlayGeoJobs[job.id] = job.state;
- }
- },
- format: format
- });
- overlayGeoJobsService.addOverlayGeoJob(param, seconds);
- },
- /**
- * @function L.supermap.processingService.prototype.getoverlayGeoJobState
- * @description 获取叠加分析的状态。
- * @param {string} id - 叠加分析的 ID。
- * @returns {Object} 叠加分析的状态
- */
- getoverlayGeoJobState: function getoverlayGeoJobState(id) {
- return this.overlayGeoJobs[id];
- },
- /**
- * @function L.supermap.processingService.prototype.getBuffersJobs
- * @description 获取缓冲区分析的列表。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- getBuffersJobs: function getBuffersJobs(callback, resultFormat) {
- var me = this,
- format = me._processFormat(resultFormat);
- var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: format
- });
- buffersAnalystJobsService.getBuffersJobs();
- },
- /**
- * @function L.supermap.processingService.prototype.getBuffersJob
- * @description 获取某一个缓冲区分析。
- * @param {string} id - 空间分析的id。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- getBuffersJob: function getBuffersJob(id, callback, resultFormat) {
- var me = this,
- format = me._processFormat(resultFormat);
- var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: format
- });
- buffersAnalystJobsService.getBuffersJob(id);
- },
- /**
- * @function L.supermap.processingService.prototype.addBuffersJob
- * @description 新建一个缓冲区分析。
- * @param {SuperMap.CreateBufferAnalystJobsParameter} params - 创建一个空间分析的请求参数。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- addBuffersJob: function addBuffersJob(params, callback, seconds, resultFormat) {
- var me = this,
- param = me._processParams(params),
- format = me._processFormat(resultFormat);
- var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback,
- processRunning: function processRunning(job) {
- me.buffersJobs[job.id] = job.state;
- }
- },
- format: format
- });
- buffersAnalystJobsService.addBuffersJob(param, seconds);
- },
- /**
- * @function L.supermap.processingService.prototype.getBuffersJobState
- * @description 获取缓冲区分析的状态。
- * @param {string} id - 缓冲区分析的 ID。
- * @returns {Object} 缓冲区分析的状态
- */
- getBuffersJobState: function getBuffersJobState(id) {
- return this.buffersJobs[id];
- },
- /**
- * @function L.supermap.processingService.prototype.getTopologyValidatorJobs
- * @description 获取拓扑检查分析的列表。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- getTopologyValidatorJobs: function getTopologyValidatorJobs(callback, resultFormat) {
- var me = this,
- format = me._processFormat(resultFormat);
- var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: format
- });
- topologyValidatorJobsService.getTopologyValidatorJobs();
- },
- /**
- * @function L.supermap.processingService.prototype.getTopologyValidatorJob
- * @description 获取某一个拓扑检查分析。
- * @param {string} id - 空间分析的 ID。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- getTopologyValidatorJob: function getTopologyValidatorJob(id, callback, resultFormat) {
- var me = this,
- format = me._processFormat(resultFormat);
- var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: format
- });
- topologyValidatorJobsService.getTopologyValidatorJob(id);
- },
- /**
- * @function L.supermap.processingService.prototype.addTopologyValidatorJob
- * @description 新建一个拓扑检查分析。
- * @param {SuperMap.TopologyValidatorJobsParameter} params - 创建一个空间分析的请求参数。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- addTopologyValidatorJob: function addTopologyValidatorJob(params, callback, seconds, resultFormat) {
- var me = this,
- param = me._processParams(params),
- format = me._processFormat(resultFormat);
- var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback,
- processRunning: function processRunning(job) {
- me.topologyValidatorJobs[job.id] = job.state;
- }
- },
- format: format
- });
- topologyValidatorJobsService.addTopologyValidatorJob(param, seconds);
- },
- /**
- * @function L.supermap.processingService.prototype.getTopologyValidatorJobState
- * @description 获取拓扑检查分析的状态。
- * @param {string} id - 拓扑检查分析的 ID。
- * @returns {Object} 拓扑检查分析的状态。
- */
- getTopologyValidatorJobState: function getTopologyValidatorJobState(id) {
- return this.topologyValidatorJobs[id];
- },
- /**
- * @function L.supermap.processingService.prototype.getSummaryAttributesJobs
- * @description 获取属性汇总分析的列表。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- getSummaryAttributesJobs: function getSummaryAttributesJobs(callback, resultFormat) {
- var me = this,
- format = me._processFormat(resultFormat);
- var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: format
- });
- summaryAttributesJobsService.getSummaryAttributesJobs();
- },
- /**
- * @function L.supermap.processingService.prototype.getSummaryAttributesJob
- * @description 获取某一个属性汇总分析。
- * @param {string} id - 空间分析的 ID。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- getSummaryAttributesJob: function getSummaryAttributesJob(id, callback, resultFormat) {
- var me = this,
- format = me._processFormat(resultFormat);
- var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: format
- });
- summaryAttributesJobsService.getSummaryAttributesJob(id);
- },
- /**
- * @function L.supermap.processingService.prototype.addSummaryAttributesJob
- * @description 新建一个属性汇总分析。
- * @param {SuperMap.SummaryAttributesJobsParameter} params - 创建一个空间分析的请求参数。
- * @param {RequestCallback} callback 请求结果的回调函数。
- * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- addSummaryAttributesJob: function addSummaryAttributesJob(params, callback, seconds, resultFormat) {
- var me = this,
- param = me._processParams(params),
- format = me._processFormat(resultFormat);
- var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback,
- processRunning: function processRunning(job) {
- me.summaryAttributesJobs[job.id] = job.state;
- }
- },
- format: format
- });
- summaryAttributesJobsService.addSummaryAttributesJob(param, seconds);
- },
- /**
- * @function L.supermap.processingService.prototype.getSummaryAttributesJobState
- * @description 获取属性汇总分析的状态。
- * @param {string} id - 属性汇总分析的 ID。
- * @returns {Object} 属性汇总分析的状态。
- */
- getSummaryAttributesJobState: function getSummaryAttributesJobState(id) {
- return this.summaryAttributesJobs[id];
- },
- _processFormat: function _processFormat(resultFormat) {
- return resultFormat ? resultFormat : DataFormat.GEOJSON;
- },
- _processParams: function _processParams(params) {
- if (!params) {
- return {};
- }
- if (params.bounds) {
- params.bounds = CommontypesConversion.toSuperMapBounds(params.bounds);
- }
- if (params.query) {
- params.query = CommontypesConversion.toSuperMapBounds(params.query);
- }
- if (params.geometryQuery) {
- params.geometryQuery = CommontypesConversion.toProcessingParam(params.geometryQuery);
- }
- if (params.geometryClip) {
- params.geometryClip = CommontypesConversion.toProcessingParam(params.geometryClip);
- }
- return params;
- }
- });
- var processingService = function processingService(url, options) {
- return new ProcessingService(url, options);
- };
- (external_L_default()).supermap.processingService = processingService;
- ;// CONCATENATED MODULE: ./src/leaflet/services/QueryService.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.queryService
- * @classdesc 地图查询服务类。
- * @category iServer Map QueryResults
- * @extends {L.supermap.ServiceBase}
- * @param {string} url - 地图查询服务访问地址。
- * @param {Object} options - 参数。
- * @param {string} [options.proxy] - 服务代理地址。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
- * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @example
- * L.supermap.queryService(url).queryByBounds(param,function(result){
- * //doSomething
- * })
- */
- var QueryService_QueryService = ServiceBase.extend({
- initialize: function initialize(url, options) {
- ServiceBase.prototype.initialize.call(this, url, options);
- },
- /**
- * @function L.supermap.queryService.prototype.queryByBounds
- * @description bounds 查询地图服务。
- * @param {SuperMap.QueryByBoundsParameters} params - 通过 Bounds 查询的相关参数类。
- * @param {RequestCallback} callback - 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
- */
- queryByBounds: function queryByBounds(params, callback, resultFormat) {
- var me = this;
- var queryService = new QueryByBoundsService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- queryService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.queryService.prototype.queryByDistance
- * @description 地图距离查询服务。
- * @param {SuperMap.QueryByDistanceParameters} params - Distance 查询相关参数类。
- * @param {RequestCallback} callback 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
- */
- queryByDistance: function queryByDistance(params, callback, resultFormat) {
- var me = this;
- var queryByDistanceService = new QueryByDistanceService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- queryByDistanceService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.queryService.prototype.queryBySQL
- * @description 地图 SQL 查询服务。
- * @param {SuperMap.QueryBySQLParameters} params - SQL 查询相关参数类。
- * @param {RequestCallback} callback 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
- */
- queryBySQL: function queryBySQL(params, callback, resultFormat) {
- var me = this;
- var queryBySQLService = new QueryBySQLService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- queryBySQLService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.queryService.prototype.queryByGeometry
- * @description 地图几何查询服务。
- * @param {SuperMap.QueryByGeometryParameters} params - Geometry 查询相关参数类。
- * @param {RequestCallback} callback 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
- */
- queryByGeometry: function queryByGeometry(params, callback, resultFormat) {
- var me = this;
- var queryByGeometryService = new QueryByGeometryService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- queryByGeometryService.processAsync(me._processParams(params));
- },
- _processParams: function _processParams(params) {
- if (!params) {
- return {};
- }
- params.returnContent = params.returnContent == null ? true : params.returnContent;
- if (params.queryParams && !external_L_default().Util.isArray(params.queryParams)) {
- params.queryParams = [params.queryParams];
- }
- if (params.bounds) {
- params.bounds = CommontypesConversion.toSuperMapBounds(params.bounds);
- }
- if (params.geometry) {
- if (params.geometry instanceof (external_L_default()).Point) {
- params.geometry = new Point(params.geometry.x, params.geometry.y);
- } else {
- params.geometry = toSuperMapGeometry(params.geometry);
- }
- }
- return params;
- },
- _processFormat: function _processFormat(resultFormat) {
- return resultFormat ? resultFormat : DataFormat.GEOJSON;
- }
- });
- var queryService = function queryService(url, options) {
- return new QueryService_QueryService(url, options);
- };
- (external_L_default()).supermap.queryService = queryService;
- ;// CONCATENATED MODULE: ./src/leaflet/services/SpatialAnalystService.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.spatialAnalystService
- * @classdesc 空间分析服务类。
- * @category iServer SpatialAnalyst
- * @description 提供:地区太阳辐射、缓冲区分析、点密度分析、动态分段分析、空间关系分析、插值分析、栅格代数运算、叠加分析、路由定位、路由测量计算、表面分析、地形曲率计算、泰森多边形分析。
- * @extends L.supermap.ServiceBase
- * @example
- * L.supermap.spatialAnalystService(url)
- * .bufferAnalysis(params,function(result){
- * //doSomething
- * })
- * @param {string} url - 空间分析服务地址。
- * @param {Object} options - 参数。
- * @param {string} [options.proxy] - 服务代理地址。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
- * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- * @extends {L.supermap.ServiceBase}
- */
- var SpatialAnalystService = ServiceBase.extend({
- initialize: function initialize(url, options) {
- ServiceBase.prototype.initialize.call(this, url, options);
- },
- /**
- * @function L.supermap.spatialAnalystService.prototype.getAreaSolarRadiationResult
- * @description 地区太阳辐射。
- * @param {SuperMap.AreaSolarRadiationParameters} params - 地区太阳辐射参数类
- * @param {RequestCallback} callback 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- getAreaSolarRadiationResult: function getAreaSolarRadiationResult(params, callback, resultFormat) {
- var me = this;
- var areaSolarRadiationService = new AreaSolarRadiationService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- areaSolarRadiationService.processAsync(params);
- },
- /**
- * @function L.supermap.spatialAnalystService.prototype.bufferAnalysis
- * @description 缓冲区分析。
- * @param {SuperMap.DatasetBufferAnalystParameters} params - 数据集缓冲区分析参数类。
- * @param {RequestCallback} callback 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- bufferAnalysis: function bufferAnalysis(params, callback, resultFormat) {
- var me = this;
- var bufferAnalystService = new BufferAnalystService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- bufferAnalystService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.spatialAnalystService.prototype.densityAnalysis
- * @description 点密度分析。
- * @param {SuperMap.DensityKernelAnalystParameters} params - 核密度分析参数类。
- * @param {RequestCallback} callback 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- densityAnalysis: function densityAnalysis(params, callback, resultFormat) {
- var me = this;
- var densityAnalystService = new DensityAnalystService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- densityAnalystService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.spatialAnalystService.prototype.generateSpatialData
- * @description 动态分段分析。
- * @param {SuperMap.GenerateSpatialDataParameters} params - 动态分段操作参数类。
- * @param {RequestCallback} callback 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- generateSpatialData: function generateSpatialData(params, callback, resultFormat) {
- var me = this;
- var generateSpatialDataService = new GenerateSpatialDataService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- generateSpatialDataService.processAsync(params);
- },
- /**
- * @function L.supermap.spatialAnalystService.prototype.geoRelationAnalysis
- * @description 空间关系分析。
- * @param {SuperMap.GeoRelationAnalystParameters} params - 空间关系分析服务参数类。
- * @param {RequestCallback} callback 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- geoRelationAnalysis: function geoRelationAnalysis(params, callback, resultFormat) {
- var me = this;
- var geoRelationAnalystService = new GeoRelationAnalystService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- geoRelationAnalystService.processAsync(params);
- },
- /**
- * @function L.supermap.spatialAnalystService.prototype.interpolationAnalysis
- * @description 插值分析。
- * @param {SuperMap.InterpolationRBFAnalystParameters} params - 样条插值(径向基函数插值法)分析参数类。
- * @param {RequestCallback} callback 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- interpolationAnalysis: function interpolationAnalysis(params, callback, resultFormat) {
- var me = this;
- var interpolationAnalystService = new InterpolationAnalystService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- interpolationAnalystService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.spatialAnalystService.prototype.mathExpressionAnalysis
- * @description 栅格代数运算。
- * @param {SuperMap.MathExpressionAnalysisParameters} params - 栅格代数运算参数类。
- * @param {RequestCallback} callback 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- mathExpressionAnalysis: function mathExpressionAnalysis(params, callback, resultFormat) {
- var me = this;
- var mathExpressionAnalysisService = new MathExpressionAnalysisService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- mathExpressionAnalysisService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.spatialAnalystService.prototype.overlayAnalysis
- * @description 叠加分析。
- * @param {SuperMap.DatasetOverlayAnalystParameters|SuperMap.GeometryOverlayAnalystParameters} params - 叠加分析参数类,支持批量几何要素叠加分析。
- * @param {RequestCallback} callback 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- overlayAnalysis: function overlayAnalysis(params, callback, resultFormat) {
- var me = this;
- var overlayAnalystService = new OverlayAnalystService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- overlayAnalystService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.spatialAnalystService.prototype.routeCalculateMeasure
- * @description 路由测量计算。
- * @param {SuperMap.RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
- * @param {RequestCallback} callback 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- routeCalculateMeasure: function routeCalculateMeasure(params, callback, resultFormat) {
- var me = this;
- var routeCalculateMeasureService = new RouteCalculateMeasureService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- routeCalculateMeasureService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.spatialAnalystService.prototype.routeLocate
- * @description 路由定位。
- * @param {SuperMap.RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
- * @param {RequestCallback} callback 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- routeLocate: function routeLocate(params, callback, resultFormat) {
- var me = this;
- var routeLocatorService = new RouteLocatorService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- routeLocatorService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.spatialAnalystService.prototype.surfaceAnalysis
- * @description 表面分析。
- * @param {SuperMap.SurfaceAnalystParameters} params - 表面分析参数类。
- * @param {RequestCallback} callback 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- surfaceAnalysis: function surfaceAnalysis(params, callback, resultFormat) {
- var me = this;
- var surfaceAnalystService = new SurfaceAnalystService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- surfaceAnalystService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.spatialAnalystService.prototype.terrainCurvatureCalculate
- * @description 地形曲率计算。
- * @param {SuperMap.TerrainCurvatureCalculationParameters} params - 地形曲率计算参数类。
- * @param {RequestCallback} callback 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- terrainCurvatureCalculate: function terrainCurvatureCalculate(params, callback, resultFormat) {
- var me = this;
- var terrainCurvatureCalculationService = new TerrainCurvatureCalculationService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- terrainCurvatureCalculationService.processAsync(params);
- },
- /**
- * @function L.supermap.spatialAnalystService.prototype.thiessenAnalysis
- * @description 泰森多边形分析。
- * @param {SuperMap.DatasetThiessenAnalystParameters} params - 数据集泰森多边形分析参数类。
- * @param {RequestCallback} callback 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- thiessenAnalysis: function thiessenAnalysis(params, callback, resultFormat) {
- var me = this;
- var thiessenAnalystService = new ThiessenAnalystService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- });
- thiessenAnalystService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.spatialAnalystService.prototype.geometrybatchAnalysis
- * @description 批量空间分析。
- * @param {Array} params -批量分析参数对象数组;包括:</br>
- * @param {string} params.analystName - 空间分析方法的名称。包括:</br>
- * "buffer","overlay","interpolationDensity","interpolationidw","interpolationRBF","interpolationKriging","isoregion","isoline"
- * @param {Object} param - 空间分析类型对应的请求参数,包括:</br>
- * {SuperMap.GeometryBufferAnalystParameters} 缓冲区分析参数类。</br>
- * {SuperMap.GeometryOverlayAnalystParameters} 叠加分析参数类。</br>
- * {SuperMap.InterpolationAnalystParameters} 插值分析参数类。</br>
- * {SuperMap.SurfaceAnalystParameters} 表面分析参数类。</br>
- * @param {RequestCallback} callback - 回调函数。
- * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
- */
- geometrybatchAnalysis: function geometrybatchAnalysis(params, callback, resultFormat) {
- var me = this;
- var geometryBatchAnalystService = new GeometryBatchAnalystService(me.url, {
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- },
- format: me._processFormat(resultFormat)
- }); //处理批量分析中各个分类类型的参数:
- var analystParameters = [];
- for (var i = 0; i < params.length; i++) {
- var tempParameter = params[i];
- analystParameters.push({
- analystName: tempParameter.analystName,
- param: me._processParams(tempParameter.param)
- });
- }
- geometryBatchAnalystService.processAsync(analystParameters);
- },
- _processParams: function _processParams(params) {
- if (!params) {
- return {};
- }
- if (params.bounds) {
- params.bounds = CommontypesConversion.toSuperMapBounds(params.bounds);
- }
- if (params.inputPoints) {
- for (var i = 0; i < params.inputPoints.length; i++) {
- var inputPoint = params.inputPoints[i];
- if (external_L_default().Util.isArray(inputPoint)) {
- params.inputPoints[i] = {
- x: inputPoint[0],
- y: inputPoint[1],
- tag: inputPoint[2]
- };
- }
- }
- }
- if (params.points) {
- for (var _i = 0; _i < params.points.length; _i++) {
- var point = params.points[_i];
- if (external_L_default().Util.isArray(point)) {
- params.points[_i] = {
- x: point[0],
- y: point[1]
- };
- } else if (point instanceof (external_L_default()).LatLng) {
- params.points[_i] = {
- x: point.lng,
- y: point.lat
- };
- } else {
- params.points[_i] = {
- x: point.x,
- y: point.y
- };
- }
- }
- }
- if (params.point) {
- if (external_L_default().Util.isArray(params.point)) {
- params.point = {
- x: params.point[0],
- y: params.point[1]
- };
- } else if (params.point instanceof (external_L_default()).LatLng) {
- params.point = {
- x: params.point.lng,
- y: params.point.lat
- };
- } else {
- params.point = {
- x: params.point.x,
- y: params.point.y
- };
- }
- }
- if (params.extractRegion) {
- params.extractRegion = toSuperMapGeometry(params.extractRegion);
- }
- if (params.extractParameter && params.extractParameter.clipRegion) {
- params.extractParameter.clipRegion = toSuperMapGeometry(params.extractParameter.clipRegion);
- }
- if (params.clipParam && params.clipParam.clipRegion) {
- params.clipParam.clipRegion = toSuperMapGeometry(params.clipParam.clipRegion);
- } //支持格式:Vector Layers; GeoJson
- if (params.sourceGeometry) {
- var SRID = null;
- if (params.sourceGeometrySRID) {
- SRID = params.sourceGeometrySRID;
- }
- params.sourceGeometry = toSuperMapGeometry(params.sourceGeometry);
- if (SRID) {
- params.sourceGeometry.SRID = SRID;
- }
- delete params.sourceGeometry.sourceGeometrySRID;
- }
- if (params.operateGeometry) {
- params.operateGeometry = toSuperMapGeometry(params.operateGeometry);
- } //支持传入多个几何要素进行叠加分析:
- if (params.sourceGeometries) {
- var sourceGeometries = [];
- for (var k = 0; k < params.sourceGeometries.length; k++) {
- sourceGeometries.push(toSuperMapGeometry(params.sourceGeometries[k]));
- }
- params.sourceGeometries = sourceGeometries;
- } //支持传入多个几何要素进行叠加分析:
- if (params.operateGeometries) {
- var operateGeometries = [];
- for (var j = 0; j < params.operateGeometries.length; j++) {
- operateGeometries.push(toSuperMapGeometry(params.operateGeometries[j]));
- }
- params.operateGeometries = operateGeometries;
- }
- if (params.sourceRoute) {
- if (params.sourceRoute instanceof (external_L_default()).Polyline) {
- var target = {};
- target.type = "LINEM";
- target.parts = [params.sourceRoute.getLatLngs().length];
- target.points = [];
- for (var _i2 = 0; _i2 < params.sourceRoute.getLatLngs().length; _i2++) {
- var _point = params.sourceRoute.getLatLngs()[_i2];
- target.points = target.points.concat({
- x: _point.lng,
- y: _point.lat,
- measure: _point.alt
- });
- }
- params.sourceRoute = target;
- }
- }
- if (params.operateRegions && external_L_default().Util.isArray(params.operateRegions)) {
- params.operateRegions.map(function (geometry, key) {
- params.operateRegions[key] = toSuperMapGeometry(geometry);
- return params.operateRegions[key];
- });
- } // if (params.sourceRoute && params.sourceRoute.components && L.Util.isArray(params.sourceRoute.components)) {
- // params.sourceRoute.components.map(function (geometry, key) {
- // params.sourceRoute.components[key] = Util.toSuperMapGeometry(geometry);
- // });
- // }
- return params;
- },
- _processFormat: function _processFormat(resultFormat) {
- return resultFormat ? resultFormat : DataFormat.GEOJSON;
- }
- });
- var spatialAnalystService = function spatialAnalystService(url, options) {
- return new SpatialAnalystService(url, options);
- };
- (external_L_default()).supermap.spatialAnalystService = spatialAnalystService;
- ;// CONCATENATED MODULE: ./src/leaflet/services/ThemeService.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.themeService
- * @classdesc 专题图服务类。
- * @category iServer Map Theme
- * @extends {L.supermap.ServiceBase}
- * @example
- * L.supermap.themeService(url,{
- * projection:projection
- * }).getThemeInfo(params,function(result){
- * //doSomething
- * });
- * @param {string} url - 服务的访问地址。
- * @param {Object} options - 参数。
- * @param {string} [options.proxy] - 服务代理地址。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
- * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var ThemeService_ThemeService = ServiceBase.extend({
- initialize: function initialize(url, options) {
- ServiceBase.prototype.initialize.call(this, url, options);
- },
- /**
- * @function L.supermap.themeService.prototype.getThemeInfo
- * @description 获取专题图信息。
- * @param {SuperMap.ThemeParameters} params - 专题图参数类。
- * @param {RequestCallback} callback 回调函数。
- */
- getThemeInfo: function getThemeInfo(params, callback) {
- var me = this;
- var themeService = new ThemeService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- themeService.processAsync(params);
- }
- });
- var themeService = function themeService(url, options) {
- return new ThemeService_ThemeService(url, options);
- };
- (external_L_default()).supermap.themeService = themeService;
- ;// CONCATENATED MODULE: ./src/leaflet/services/TrafficTransferAnalystService.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.trafficTransferAnalystService
- * @classdesc 交通换乘分析服务类。
- * @category iServer TrafficTransferAnalyst
- * @example
- * L.supermap.trafficTransferAnalystService(url).queryStop(params,function(result){
- * //doSomething
- * })
- * @extends {L.supermap.ServiceBase}
- * @param {string} url - 服务地址。
- * @param {Object} options - 参数。
- * @param {string} [options.proxy] - 服务代理地址。
- * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
- * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var TrafficTransferAnalystService = ServiceBase.extend({
- initialize: function initialize(url, options) {
- ServiceBase.prototype.initialize.call(this, url, options);
- },
- /**
- * @function L.supermap.trafficTransferAnalystService.prototype.queryStop
- * @description 站点查询服务。
- * @param {SuperMap.StopQueryParameters} params - 站点查询参数类。
- * @param {RequestCallback} callback 回调函数。
- */
- queryStop: function queryStop(params, callback) {
- var me = this;
- var stopQueryService = new StopQueryService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- stopQueryService.processAsync(params);
- },
- /**
- * @function L.supermap.trafficTransferAnalystService.prototype.analysisTransferPath
- * @description 交通换乘线路查询服务。
- * @param {SuperMap.TransferPathParameters} params - 交通换乘线路查询参数类。
- * @param {RequestCallback} callback 回调函数。
- */
- analysisTransferPath: function analysisTransferPath(params, callback) {
- var me = this;
- var transferPathService = new TransferPathService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- transferPathService.processAsync(me._processParams(params));
- },
- /**
- * @function L.supermap.trafficTransferAnalystService.prototype.analysisTransferSolution
- * @description 交通换乘方案查询服务。
- * @param {SuperMap.TransferSolutionParameters} params - 交通换乘方案查询参数类。
- * @param {RequestCallback} callback 回调函数。
- */
- analysisTransferSolution: function analysisTransferSolution(params, callback) {
- var me = this;
- var transferSolutionService = new TransferSolutionService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- transferSolutionService.processAsync(me._processParams(params));
- },
- _processParams: function _processParams(params) {
- if (!params) {
- return {};
- }
- if (params.points && external_L_default().Util.isArray(params.points)) {
- params.points.map(function (point, key) {
- params.points[key] = point instanceof (external_L_default()).LatLng ? {
- x: point.lng,
- y: point.lat
- } : point;
- return params.points[key];
- });
- }
- return params;
- }
- });
- var trafficTransferAnalystService = function trafficTransferAnalystService(url, options) {
- return new TrafficTransferAnalystService(url, options);
- };
- (external_L_default()).supermap.trafficTransferAnalystService = trafficTransferAnalystService;
- ;// CONCATENATED MODULE: ./src/leaflet/services/WebPrintingJobService.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.WebPrintingJobService
- * @classdesc Web 打印服务类。
- * 提供:创建 Web 打印任务,获取 Web 打印任务内容,获取 Web 打印输出文档流,获取 Web 打印服务的布局模板信息。
- * @category iServer WebPrintingJob
- * @example
- * L.supermap.webPrintingJobService(url)
- * .createWebPrintingJob(param,function(result){
- * //doSomething
- * })
- * @extends {L.supermap.ServiceBase}
- * @version 10.1.0
- * @param {string} url - 资源根地址。请求打印地图服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/webprinting/rest/webprinting/v1。
- * @param {Object} options - 服务交互时所需的可选参数。
- * @param {string} [options.proxy] - 服务代理地址。
- * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
- * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
- * @param {Object} [options.headers] - 请求头。
- */
- var WebPrintingJobService = ServiceBase.extend({
- initialize: function initialize(url, options) {
- ServiceBase.prototype.initialize.call(this, url, options);
- },
- /**
- * @function L.supermap.webPrintingJobService.prototype.createWebPrintingJob
- * @description 创建 Web 打印任务。
- * @param {SuperMap.WebPrintingJobParameters} params - 打印的相关参数类。
- * @param {RequestCallback} callback - 回调函数。
- */
- createWebPrintingJob: function createWebPrintingJob(params, callback) {
- if (!params) {
- return;
- }
- var me = this;
- console.log(me.url);
- var webPrintingService = new WebPrintingService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- webPrintingService.createWebPrintingJob(me._processParams(params));
- },
- /**
- * @function L.supermap.webPrintingJobService.prototype.getPrintingJob
- * @description 获取 Web 打印输出文档任务。
- * @param {String} jobId - Web 打印输入文档任务 Id。
- * @param {RequestCallback} callback - 回调函数。
- */
- getPrintingJob: function getPrintingJob(jobId, callback) {
- var me = this;
- var webPrintingService = new WebPrintingService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- webPrintingService.getPrintingJob(jobId);
- },
- /**
- * @function L.supermap.webPrintingJobService.prototype.getPrintingJobResult
- * @description 获取 Web 打印任务的输出文档。
- * @param {String} jobId - Web 打印输入文档任务 Id。
- * @param {RequestCallback} callback - 回调函数。
- */
- getPrintingJobResult: function getPrintingJobResult(jobId, callback) {
- var me = this;
- var webPrintingService = new WebPrintingService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- webPrintingService.getPrintingJobResult(jobId);
- },
- /**
- * @function L.supermap.webPrintingJobService.prototype.getLayoutTemplates
- * @description 查询 Web 打印服务所有可用的模板信息。
- * @param {RequestCallback} callback - 回调函数。
- */
- getLayoutTemplates: function getLayoutTemplates(callback) {
- var me = this;
- var webPrintingService = new WebPrintingService(me.url, {
- proxy: me.options.proxy,
- withCredentials: me.options.withCredentials,
- crossOrigin: me.options.crossOrigin,
- headers: me.options.headers,
- serverType: me.options.serverType,
- eventListeners: {
- scope: me,
- processCompleted: callback,
- processFailed: callback
- }
- });
- webPrintingService.getLayoutTemplates();
- },
- _processParams: function _processParams(params) {
- if (params.layoutOptions && params.layoutOptions.littleMapOptions) {
- params.layoutOptions.littleMapOptions.center = this._toPointObject(params.layoutOptions.littleMapOptions.center);
- }
- if (params.exportOptions) {
- params.exportOptions.center = this._toPointObject(params.exportOptions.center);
- }
- return params;
- },
- _toPointObject: function _toPointObject(point) {
- if (external_L_default().Util.isArray(point)) {
- return {
- x: point[0],
- y: point[1]
- };
- } else if (point instanceof SuperMap.Geometry.Point || point instanceof (external_L_default()).Point) {
- return {
- x: point.x,
- y: point.y
- };
- } else if (point instanceof (external_L_default()).LatLng) {
- return {
- x: point.lng,
- y: point.lat
- };
- }
- return point;
- }
- });
- var webPrintingJobService = function webPrintingJobService(url, options) {
- return new WebPrintingJobService(url, options);
- };
- (external_L_default()).supermap.webPrintingJobService = webPrintingJobService;
- ;// CONCATENATED MODULE: ./src/leaflet/services/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/leaflet/components/ComponentsViewBase.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.components.componentsViewBase
- * @classdesc Lealfet 组件基类。
- * @category Components Common
- * @version 9.1.1
- * @param {Object} options - 参数。
- * @param {string} [options.position='topright'] - 组件在地图中显示的位置,包括:'topleft','topright','bottomleft' 和 'bottomright',继承自 leaflet control。
- * @param {function} [options.style] - 设置图层点线面默认样式,点样式返回 maker 或者 circleMaker;线和面返回 L.path 样式。
- * @param {function} [options.onEachFeature] - 在创建和设置样式后,将为每个创建的要素调用一次的函数。用于将事件和弹出窗口附加到要素。默认情况下,对新创建的图层不执行任何操作。
- * @extends {L.Control}
- */
- var ComponentsViewBase = external_L_default().Control.extend({
- options: {
- //控件位置 继承自leaflet control
- position: 'topright',
- //默认样式,以支持组件设置图层基本样式
- style: function style(feature, latLng) {
- if (latLng
- /*&& feature instanceof L.latLng || feature.geometry.type.toLowerCase() === "point"*/
- ) {
- return external_L_default().circleMarker(latLng, {
- fillColor: 'blue',
- weight: 1,
- opacity: 1,
- color: 'blue',
- fillOpacity: 0.6
- });
- } else {
- return {
- fillColor: 'blue',
- weight: 1,
- opacity: 1,
- color: 'blue',
- fillOpacity: 0.6
- };
- }
- },
- onEachFeature: null
- },
- initialize: function initialize(options) {
- external_L_default().setOptions(this, options); //组件事件处理对象://todo 确认一些公开或私有的成员变量
- this._event = new (external_L_default()).Evented(); //组件根 dom 元素:
- this.rootContainer = null; //图层参数,主要配置组件返回数据图层的样式和事件等
- },
- /**
- * @function L.supermap.components.componentsViewBase.prototype.onAdd
- * @description 向地图添加组件。
- */
- onAdd: function onAdd(map) {
- //子类实现此方法
- this.map = map;
- this.rootContainer = this._initView();
- return this.rootContainer;
- },
- /**
- * @function L.supermap.components.componentsViewBase.prototype.on
- * @param {string} eventType - 监听的事件类型。
- * @param {Function} callback - 监听事件的回调函数。
- */
- on: function on(eventType, callback) {
- this._event.on(eventType, callback);
- },
- /**
- * @function L.supermap.components.componentsViewBase.prototype.off
- * @description 事件关闭。
- * @param {string} eventType - 监听的事件名。
- * @param {Function} callback - 监听事件的回调函数。
- */
- off: function off(eventType, callback) {
- this._event.off(eventType, callback);
- },
- /**
- * @function L.supermap.components.componentsViewBase.prototype._initView
- * @description 初始化组件 UI。
- * @private
- */
- _initView: function _initView() {//子类实现此方法
- },
- /**
- * @function L.supermap.components.componentsViewBase.prototype._preventMapEvent
- * @description 阻止 map 默认事件。
- * @private
- */
- _preventMapEvent: function _preventMapEvent(div, map) {
- if (!div || !map) {
- return;
- }
- div.addEventListener('mouseover', function () {
- map.dragging.disable();
- map.scrollWheelZoom.disable();
- map.doubleClickZoom.disable();
- });
- div.addEventListener('mouseout', function () {
- map.dragging.enable();
- map.scrollWheelZoom.enable();
- map.doubleClickZoom.enable();
- });
- }
- });
- var componentsViewBase = function componentsViewBase(options) {
- return new ComponentsViewBase(options);
- };
- (external_L_default()).supermap.components.componentsViewBase = componentsViewBase;
- ;// CONCATENATED MODULE: ./src/leaflet/components/openfile/OpenFileViewModel.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.components.openFileViewModel
- * @classdesc 打开本地文件组件功能类,目前只支持WGS84经纬度坐标。
- * @version 9.1.1
- * @category Components OpenFile
- * @param {L.Map} map - leaflet map 对象。
- * @fires L.supermap.components.openFileViewModel#filesizeexceed
- * @fires L.supermap.components.openFileViewModel#errorfileformat
- * @fires L.supermap.components.openFileViewModel#openfilesucceeded
- * @fires L.supermap.components.openFileViewModel#openfilefailed
- * @extends {L.Evented}
- */
- var OpenFileViewModel = external_L_default().Evented.extend({
- initialize: function initialize() {
- this.fileModel = new FileModel();
- },
- /**
- * @function L.supermap.components.openFileViewModel.prototype.readFile
- * @description 选中文件并加载到底图。
- * @param {Object} fileEventObject - 通过文件选择框打开的本地文件对象。
- */
- readFile: function readFile(fileEventObject) {
- var inputDom = fileEventObject.target;
- var file = inputDom.files[0]; //文件大小限制
- if (file.size > this.fileModel.FileConfig.fileMaxSize) {
- // document.alert("File supports up to 10M.");
- /**
- * @event L.supermap.components.openFileViewModel#filesizeexceed
- * @description 超出文件大小限制后触发。
- * @property {string} messageType - 警告类型。
- * @property {string} message - 警告内容。
- */
- this.fire("filesizeexceed", {
- messageType: "warring",
- message: Lang.i18n('msg_fileSizeExceeded')
- });
- return false;
- }
- var filePath = inputDom.value;
- var fileName = file.name;
- var fileType = ComponentsUtil.getFileType(fileName); //文件格式不支持
- if (!fileType) {
- // document.alert("Unsupported data type.");
- /**
- * @event L.supermap.components.openFileViewModel#errorfileformat
- * @description 文件格式不支持时触发。
- * @property {string} messageType - 警告类型。
- * @property {string} message - 警告内容。
- */
- this.fire("errorfileformat", {
- messageType: "failure",
- message: Lang.i18n('msg_fileTypeUnsupported')
- });
- return false;
- } //文件类型限制
- if (fileName !== "") {
- //给control 一份数据
- //todo MVVM模式 应该是数据变化触发数据变化的事件
- this.fileModel.set("loadFileObject", {
- file: file,
- filePath: filePath,
- fileName: fileName,
- fileType: fileType
- }); //响应选中文件添加到地图
- this._readData();
- }
- },
- /**
- * @function L.supermap.components.openFileViewModel.prototype._readData
- * @description 数据文件中的数据。
- * @private
- */
- _readData: function _readData() {
- var _this = this;
- //todo 需要测试另外两个
- var me = this;
- var type = this.fileModel.loadFileObject.fileType;
- FileReaderUtil.readFile(type, {
- file: this.fileModel.loadFileObject.file,
- path: this.fileModel.loadFileObject.filePath
- }, function (data) {
- //将数据统一转换为 geoJson 格式加载到底图
- FileReaderUtil.processDataToGeoJson(type, data, function (geojson) {
- if (geojson) {
- /**
- * @event L.supermap.components.openFileViewModel#openfilesucceeded
- * @description 打开文件成功。
- * @property {GeoJSONObject} result - GeoJSON 格式数据。
- * @property {string} layerName - 图层名。
- */
- _this.fire("openfilesucceeded", {
- result: geojson,
- layerName: _this.fileModel.loadFileObject.fileName.split('.')[0]
- });
- }
- }, function (e) {
- me.fire("openfilefailed", {
- messageType: "failure",
- message: e
- });
- }, _this);
- }, function () {
- /**
- * @event L.supermap.components.openFileViewModel#openfilefailed
- * @description 打开文件失败。
- * @property {string} messageType - 警告类型。
- * @property {string} message - 警告内容。
- */
- me.fire("openfilefailed", {
- messageType: "failure",
- message: Lang.i18n('msg_openFileFail')
- });
- }, this);
- }
- });
- var openFileViewModel = function openFileViewModel(options) {
- return new OpenFileViewModel(options);
- };
- (external_L_default()).supermap.components.openFileViewModel = openFileViewModel;
- (external_L_default()).supermap.components.util = ComponentsUtil;
- ;// CONCATENATED MODULE: ./src/leaflet/components/openfile/OpenFileView.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.components.openFile
- * @classdesc 打开文件组件,用于打开本地数据文件并加载到地图,目前支持打开 .csv|.xls|.xlsx|.geojson|.json 格式文件,只支持WGS84经纬度坐标。
- * @version 9.1.1
- * @param {Object} options - 可选参数。
- * @param {string} [options.position='topright'] - 组件在地图中显示的位置,包括:'topleft','topright','bottomleft' 和 'bottomright',继承自 leaflet control。
- * @param {function} [options.style] - 设置图层点线面默认样式,点样式返回 maker 或者 circleMaker;线和面返回 L.path 样式。
- * @param {function} [options.onEachFeature] - 在创建和设置样式后,将为每个创建的要素调用一次的函数。用于将事件和弹出窗口附加到要素。默认情况下,对新创建的图层不执行任何操作。
- * @fires L.supermap.components.openFile#openfilesucceeded
- * @fires L.supermap.components.openFile#openfilefailed
- * @extends {L.supermap.components.componentsViewBase}
- * @category Components OpenFile
- */
- var OpenFileView = ComponentsViewBase.extend({
- options: {
- //绑定的底图图层
- layer: null
- },
- initialize: function initialize(options) {
- ComponentsViewBase.prototype.initialize.apply(this, [options]); //初始化 ViewModel:
- this.viewModel = new OpenFileViewModel();
- },
- /**
- * @function L.supermap.components.openFile.prototype.setViewStyle
- * @description 改变组件样式。
- * @param {string} styleName - css 样式名。
- * @param {string} value - css 样式值。
- */
- setViewStyle: function setViewStyle(styleName, value) {
- this.rootContainer.style[styleName] = value;
- },
- /**
- * @function L.supermap.components.openFile.prototype._initView
- * @description 创建打开本地文件数据组件。
- * @returns {HTMLElement}
- * @private
- * @override
- */
- _initView: function _initView() {
- var _this = this;
- //初始化 view
- var uploadContent = external_L_default().DomUtil.create('div', 'component-openfile');
- uploadContent.id = 'openFile';
- this.fileSelect = external_L_default().DomUtil.create('div', '', uploadContent);
- this.label = external_L_default().DomUtil.create('label', 'component-openfile__span--select', this.fileSelect);
- this.label.htmlFor = "input_file";
- external_L_default().DomUtil.create('div', 'supermapol-icons-upload', this.label);
- var fileSpan = external_L_default().DomUtil.create('span', 'component-openfile__span', this.label);
- fileSpan.appendChild(document.createTextNode(Lang.i18n('text_chooseFile')));
- this.fileInput = external_L_default().DomUtil.create('input', 'component-openfile__input', this.fileSelect);
- this.fileInput.id = "input_file";
- this.fileInput.type = "file";
- this.fileInput.accept = ".json,.geojson,.csv,.xls,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel";
- this.fileInput.onchange = function (fileEventObject) {
- _this.messageBox.closeView();
- _this.viewModel.readFile(fileEventObject);
- }; //增加提示框:
- this.messageBox = new MessageBox(); //添加监听
- this.viewModel.on("filesizeexceed", function (e) {
- _this.messageBox.showView(e.message, e.messageType);
- });
- this.viewModel.on("errorfileformat", function (e) {
- _this.messageBox.showView(e.message, e.messageType);
- });
- this.viewModel.on("openfilefailed", function (e) {
- _this.messageBox.showView(e.message, e.messageType);
- /**
- * @event L.supermap.components.openFile#openfilefailed
- * @description 打开文件失败。
- * @property {Object} e - 事件对象。
- */
- _this._event.fire("openfilefailed", e);
- });
- this.viewModel.on("readdatafail", function (e) {
- _this.messageBox.showView(e.message, e.messageType);
- });
- this.viewModel.on("openfilesucceeded", function (e) {
- /**
- * @event L.supermap.components.openFile#openfilesucceeded
- * @description 打开文件成功。
- * @property {Object} e - 事件对象。
- */
- _this._event.fire("openfilesucceeded", e);
- }); // 阻止 map 默认事件
- this._preventMapEvent(uploadContent, this.map);
- return uploadContent;
- }
- });
- var openFileView = function openFileView(options) {
- return new OpenFileView(options);
- };
- (external_L_default()).supermap.components.openFile = openFileView;
- ;// CONCATENATED MODULE: ./src/leaflet/components/search/CityConfig.js
- var config = {
- HOT: {
- HOT: ["北京市", "上海市", "广州市", "深圳市", "南京市", "杭州市", "天津市", "重庆市", "成都市", "青岛市", "苏州市", "无锡市", "常州市", "温州市", "武汉市", "长沙市", "南昌市", "三亚市", "合肥市", "石家庄市"]
- },
- AB: {
- A: ["阿拉善盟", "鞍山市", "安庆市", "安阳市", "阿坝藏族羌族自治州", "安顺市", "阿里地区", "安康市", "阿克苏地区", "阿勒泰地区", "阿拉尔市"],
- B: ["北京市", "保定市", "包头市", "巴彦淖尔市", "本溪市", "白山市", "白城市", "蚌埠市", "亳州市", "滨州市", "北海市", "百色市", "白沙黎族自治县", "保亭黎族苗族自治县", "巴中市", "毕节地区", "保山市", "宝鸡市", "白银市", "博尔塔拉蒙古自治州", "巴音郭楞蒙古自治州", "北区"]
- },
- CD: {
- C: ["重庆市", "成都市", "常州市", "长沙市", "承德市", "沧州市", "长治市", "赤峰市", "朝阳市", "长春市", "滁州市", "巢湖市", "池州市", "常德市", "郴州市", "潮州市", "崇左市", "澄迈县", "昌江黎族自治县", "楚雄彝族自治州", "昌都地区", "昌吉回族自治州"],
- D: ["大同市", "大连市", "丹东市", "大庆市", "大兴安岭地区", "东营市", "德州市", "东莞市", "儋州市", "东方市", "定安县", "德阳市", "达州市", "大理白族自治州", "德宏傣族景颇族自治州", "迪庆藏族自治州", "定西市", "东区", "大埔区", "大堂区"]
- },
- EFG: {
- E: ["鄂尔多斯市", "鄂州市", "恩施土家族苗族自治州"],
- F: ["抚顺市", "阜新市", "阜阳市", "福州市", "抚州市", "佛山市", "防城港市"],
- G: ["广州市", "赣州市", "桂林市", "贵港市", "广元市", "广安市", "贵阳市", "固原市", "高雄市", "高雄县", "甘南藏族自治州", "甘孜藏族自治州"]
- },
- H: {
- H: ["杭州市", "合肥市", "邯郸市", "衡水市", "呼和浩特市", "呼伦贝尔市", "葫芦岛市", "哈尔滨市", "鹤岗市", "黑河市", "淮安市", "湖州市", "淮南市", "淮北市", "黄山市", "菏泽市", "鹤壁市", "黄石市", "黄冈市", "衡阳市", "怀化市", "惠州市", "河源市", "贺州市", "河池市", "海口市", "红河哈尼族彝族自治州", "汉中市", "海东地区", "海北藏族自治州", "黄南藏族自治州", "海南藏族自治州", "果洛藏族自治州", "海西蒙古族藏族自治州", "哈密地区", "和田地区", "花莲县", "黄大仙区", "花地玛堂区"]
- },
- J: {
- J: ["晋城市", "晋中市", "锦州市", "吉林市", "鸡西市", "佳木斯市", "嘉兴市", "金华市", "景德镇市", "九江市", "吉安市", "济南市", "济宁市", "焦作市", "济源市", "荆门市", "荆州市", "江门市", "湛江市", "揭阳市", "嘉峪关市", "金昌市", "酒泉市", "基隆市", "嘉义市", "嘉义县", "九龙城区", "嘉模堂区"]
- },
- KL: {
- K: ["开封市", "昆明市", "克拉玛依市", "克孜勒苏柯尔克孜自治州", "喀什地区"],
- L: ["廊坊市", "临汾市", "吕梁市", "辽阳市", "辽源市", "连云港市", "丽水市", "六安市", "龙岩市", "莱芜市", "临沂市", "聊城市", "洛阳市", "漯河市", "娄底市", "柳州市", "来宾市", "临高县", "乐东黎族自治县", "陵水黎族自治县", "泸州市", "乐山市", "凉山彝族自治州", "六盘水市", "丽江市", "临沧市", "拉萨市", "林芝地区", "兰州市", "陇南市", "临夏回族自治州"]
- },
- MNP: {
- M: ["牡丹江市", "马鞍山市", "茂名市", "梅州市", "绵阳市", "眉山市", "苗栗县"],
- N: ["南京市", "南昌市", "南通市", "宁波市", "南平市", "宁德市", "南阳市", "南宁市", "南沙群岛", "内江市", "南充市", "怒江傈傈族自治州", "那曲地区", "南投县"],
- P: ["盘锦市", "莆田市", "萍乡市", "平顶山市", "濮阳市", "攀枝花市", "平凉市", "屏东县", "澎湖县"]
- },
- QR: {
- Q: ["青岛市", "秦皇岛市", "齐齐哈尔市", "黔西南布依族苗族自治州", "七台河市", "衢州市", "泉州市", "潜江市", "清远市", "钦州市", "琼海市", "曲靖市", "庆阳市", "荃湾区", "黔东南苗族侗族自治州", "黔南布依族苗族自治州", "琼中黎族苗族自治县"],
- R: ["日照市", "日喀则地区"]
- },
- S: {
- S: ["上海市", "深圳市", "苏州市", "石家庄市", "三亚市", "朔州市", "沈阳市", "四平市", "松原市", "双鸭山市", "绥化市", "宿迁市", "绍兴市", "宿州市", "三明市", "上饶市", "三门峡市", "商丘市", "十堰市", "随州市", "邵阳市", "韶关市", "汕头市", "汕尾市", "三亚市", "遂宁市", "思茅市", "山南地区", "商洛市", "石嘴山市", "石河子市", "深水埗区", "沙田区", "神农架林区", "圣安多尼堂区", "圣方济各堂区"]
- },
- T: {
- T: ["天津市", "唐山市", "太原市", "通辽市", "铁岭市", "通化市", "泰州市", "台州市", "铜陵市", "泰安市", "天门市", "屯昌县", "铜仁地区", "铜川市", "天水市", "吐鲁番地区", "塔城地区", "图木舒克市", "台北市", "台中市", "台南市", "台北县", "桃园县", "台中县", "台南县", "台东县", "屯门区"]
- },
- W: {
- W: ["无锡市", "温州市", "武汉市", "乌海市", "乌兰察布市", "芜湖市", "潍坊市", "威海市", "梧州市", "五指山市", "文昌市", "万宁市", "文山壮族苗族自治州", "渭南市", "武威市", "吴忠市", "乌鲁木齐市", "五家渠市", "湾仔区", "望德堂区"]
- },
- X: {
- X: ["邢台市", "忻州市", "兴安盟", "徐州市", "宣城市", "厦门市", "新余市", "新乡市", "许昌市", "信阳市", "襄樊市", "孝感市", "咸宁市", "仙桃市", "湘潭市", "西安市", "咸阳市", "西宁市", "新竹市", "新竹县", "西贡区", "锡林郭勒盟", "西沙群岛", "湘西土家族苗族自治州", "西双版纳傣族自治州"]
- },
- Y: {
- Y: ["阳泉市", "运城市", "营口市", "延边朝鲜族自治州", "伊春市", "盐城市", "扬州市", "鹰潭市", "宜春市", "烟台市", "宜昌市", "岳阳市", "益阳市", "永州市", "阳江市", "云浮市", "玉林市", "宜宾市", "雅安市", "玉溪市", "延安市", "榆林市", "玉树藏族自治州", "银川市", "伊犁哈萨克自治州", "宜兰县", "云林县", "油尖旺区", "元朗区"]
- },
- Z: {
- Z: ["郑州市", "张家口市", "镇江市", "舟山市", "漳州市", "淄博市", "枣庄市", "周口市", "驻马店市", "株洲市", "张家界市", "珠海市", "肇庆市", "中山市", "自贡市", "资阳市", "遵义市", "昭通市", "张掖市", "中卫市", "彰化县", "中西区", "中沙群岛的岛礁及其海域"]
- }
- };
- ;// CONCATENATED MODULE: ./src/leaflet/components/commonmodels/GeoJsonLayersModel.js
- function GeoJsonLayersModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function GeoJsonLayersModel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function GeoJsonLayersModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoJsonLayersModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoJsonLayersModel_defineProperties(Constructor, staticProps); return Constructor; }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- // import {
- // CommonUtil
- // } from '@supermap/iclient-common';
- /**
- * @class L.supermap.components.GeoJsonLayersDataModel
- * @description 多图层数据模型 todo 看看如何完善
- * @category Components Common
- * @private
- * @param {Array.<Object>} layers - 图层数组。
- * @param {L.supermap.components.geoJSONLayerWithName} layers.layerObject - 含有 layerName 与 GeoJSON 图层的对象。
- * @fires L.supermap.components.GeoJsonLayersDataModel#newlayeradded
- */
- var GeoJsonLayersDataModel = /*#__PURE__*/function () {
- function GeoJsonLayersDataModel(layers) {
- GeoJsonLayersModel_classCallCheck(this, GeoJsonLayersDataModel);
- this.layers = [];
- if (layers && layers.length > 0) {
- this.addLayers(layers);
- }
- this.currentLayerDataModel = null;
- }
- GeoJsonLayersModel_createClass(GeoJsonLayersDataModel, [{
- key: "addLayers",
- value: function addLayers(layers, success, failed, context) {
- for (var i = 0; i < layers.length; i++) {
- var layerName = layers[i].layerName;
- if (layers[i].layer instanceof (external_L_default()).GeoJSON) {
- var geoJsonLayerDataModel = new GeoJsonLayerDataModel(layers[i].layer); //赋给 GeoJsonLayersDataModel 对象 layerName 属性,每个图层名对应一个 layerDataModel 对象
- this.layers[layerName] = geoJsonLayerDataModel;
- success && success.call(context, {
- layerName: layerName,
- layer: geoJsonLayerDataModel
- });
- } else {
- failed && failed.call(context, "");
- }
- }
- }
- /**
- * @function L.supermap.components.GeoJsonLayersDataModel.prototype.setCurrentLayerDataModel
- * @description 设置当前选中的图层。
- * @param {string} layerName - 选中的图层名。
- */
- }, {
- key: "setCurrentLayerDataModel",
- value: function setCurrentLayerDataModel(layerName) {
- if (this.layers[layerName]) {
- this.currentLayerDataModel = this.layers[layerName];
- }
- }
- }]);
- return GeoJsonLayersDataModel;
- }();
- (external_L_default()).supermap.components.GeoJsonLayersDataModel = GeoJsonLayersDataModel;
- /**
- * @class L.supermap.components.GeoJsonLayerDataModel
- * @classdesc 图层数据模型,用于图层要素数据及属性管理等。
- * @param {L.GeoJSON} layer - GeoJSON 图层。
- * 注:leaflet没有 feature 的概念
- */
- var GeoJsonLayerDataModel = /*#__PURE__*/function () {
- function GeoJsonLayerDataModel(layer) {
- GeoJsonLayersModel_classCallCheck(this, GeoJsonLayerDataModel);
- //图层对象
- this.layer = layer; //要素图层数组
- this.features = layer.getLayers(); //图层属性字段
- this.attributeNames = []; //这里一个图层默认共用一套属性字段
- if (this.features[0].feature.properties) {
- for (var field in this.features[0].feature.properties) {
- this.attributeNames.push(field);
- }
- } //指定图层操作属性字段
- this.operatingAttributeNames = []; //图层属性对象
- this.attributes = {};
- }
- /**
- * @function GeoJsonLayerDataModel.prototype.setOperatingAttributeNames
- * @description 指定操作字段。
- * @param {Array.<string>} operatingAttr - 查询属性字段数组,该数组为 this.attributeNames 的子集。
- */
- GeoJsonLayersModel_createClass(GeoJsonLayerDataModel, [{
- key: "setOperatingAttributeNames",
- value: function setOperatingAttributeNames(operatingAttr) {
- this.operatingAttributeNames = operatingAttr;
- }
- /**
- * @function GeoJsonLayerDataModel.prototype.getAllAttributeNames
- * @description 获取图层所有属性字段。
- * @returns {Array.<string>} - 返回图层所有属性字段。
- */
- }, {
- key: "getAllAttributeNames",
- value: function getAllAttributeNames() {
- return this.attributeNames;
- }
- /**
- * @function GeoJsonLayerDataModel.prototype.getAttributeNamesByType
- * @description 获取指定类型的图层属性字段。
- * @param {string} [type] - 需要获取的图层属性字段的类型。目前可选 "Num",若不传此参数,则默认返回所有字段。
- * @returns {Array.<string>} - 返回指定类型的图层属性字段。
- */
- }, {
- key: "getAttributeNamesByType",
- value: function getAttributeNamesByType(type) {
- //图层属性字段
- if (this.features[0].feature.properties) {
- var properties = this.features[0].feature.properties;
- var attributeNames = [];
- if (type === 'Num') {
- for (var field in properties) {
- if (!isNaN(properties[field])) {
- attributeNames.push(field);
- }
- }
- } else {
- attributeNames = this.attributeNames;
- }
- return attributeNames;
- }
- }
- /**
- * @function GeoJsonLayerDataModel.prototype.getAllFeatures
- * @description 获取图层所有要素
- * @returns {Array.<Object>} - 返回图层要素
- */
- }, {
- key: "getAllFeatures",
- value: function getAllFeatures() {
- return this.features;
- }
- /**
- * @function GeoJsonLayerDataModel.prototype.getAttributeValueByAttributeName
- * @description 通过属性字段名获取属性值
- * @param {string} attributeName - 图层要素属性字段名
- * @returns {Object} - 图层要素属性值对象
- */
- }, {
- key: "getAttributeValueByAttributeName",
- value: function getAttributeValueByAttributeName(attributeName) {
- //如果图层属性对象中已存在该属性,则直接返回
- if (this.attributes[attributeName]) {
- return this.attributes[attributeName];
- } //若图层属性对象还未存储该属性,则遍历每个feature 读取其属性值,并存储到图层属性对象中
- this.attributes[attributeName] = [];
- for (var i = 0; i < this.features.length; i++) {
- this.attributes[attributeName].push([this.features[i].feature.properties[attributeName]]);
- }
- return this.attributes[attributeName];
- } //getAttributeValueByAttributeName(feature,attributeName)
- //getAllFeatures()
- //todo getFeatureByID()
- //getFeaturesByKeywords(keyword,searchAttributeNames)
- //getAllAttributeValues(attributeName) ??
- //getAllAttributeNames()
- /**
- * @function GeoJsonLayerDataModel.prototype.getFeaturesByKeyWord
- * @description 通过关键字查找要素对象
- * @param {string} keyWord - 查询关键字
- * @returns {Array.<Object>} - 返回要素对象数组
- */
- }, {
- key: "getFeaturesByKeyWord",
- value: function getFeaturesByKeyWord(keyWord) {
- var features = [],
- keyReg = new RegExp(keyWord.toLowerCase());
- var self = this;
- this.features.forEach(function (feature) {
- if (!feature.feature.properties) {
- return null;
- }
- var fAttr = feature.feature.properties;
- var operatingAttributeNames; //若设置了过滤字段,则按过滤字段查询
- if (self.operatingAttributeNames.length > 0) {
- operatingAttributeNames = self.operatingAttributeNames;
- } else {
- //若未设置了过滤字段,则按图层字段查询
- operatingAttributeNames = self.attributeNames;
- } //遍历要素,查询符合条件的要素
- for (var i = 0, len = operatingAttributeNames.length; i < len; i++) {
- if (fAttr[operatingAttributeNames[i]] && keyReg.test(fAttr[operatingAttributeNames[i]].toString().toLowerCase())) {
- var filterAttributeName = operatingAttributeNames[i];
- var filterAttributeValue = fAttr[operatingAttributeNames[i]]; //将查询出的属性字段及属性值赋给 feature 并返回
- feature.filterAttribute = {
- filterAttributeName: filterAttributeName,
- filterAttributeValue: filterAttributeValue
- };
- features.push(feature);
- break;
- }
- }
- });
- return features;
- }
- }]);
- return GeoJsonLayerDataModel;
- }();
- ;// CONCATENATED MODULE: ./src/leaflet/components/search/SearchViewModel.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.components.searchViewModel
- * @classdesc 图层查询组件功能类。
- * @version 9.1.1
- * @category Components Search
- * @param {L.Map} map - Leaflet Map 对象。
- * @param {Object} options - 可选参
- * @param {Object} [options.cityGeoCodingConfig] - 城市地址匹配服务配置,包括:{addressUrl:"",key:""},默认为 online 本地搜索服务。
- * @fires L.supermap.components.searchViewModel#newlayeradded
- * @fires L.supermap.components.searchViewModel#searchlayersucceeded
- * @fires L.supermap.components.searchViewModel#searchfailed
- * @fires L.supermap.components.searchViewModel#geocodesucceeded
- * @extends {L.Evented}
- */
- var SearchViewModel = external_L_default().Evented.extend({
- options: {
- cityGeoCodingConfig: {
- addressUrl: "https://www.supermapol.com/iserver/services/localsearch/rest/searchdatas/China/poiinfos",
- key: "fvV2osxwuZWlY0wJb8FEb2i5"
- }
- },
- initialize: function initialize(map, options) {
- if (map) {
- /**
- * @member {L.Map} L.supermap.components.searchViewModel.prototype.map
- * @description 当前组件所在的地图。
- */
- this.map = map;
- } else {
- return new Error("Cannot find map, fileModel.map cannot be null.");
- }
- external_L_default().Util.setOptions(this, options); //初始化Model
- this.dataModel = new GeoJsonLayersDataModel(); //初始话地址匹配服务
- this.geoCodeParam = {
- keyWords: '北京市',
- city: "北京市",
- pageSize: this.options.pageSize,
- pageNum: this.options.pageNum
- }; //查询缓存
- this.searchCache = {};
- },
- /**
- * @function L.supermap.components.searchViewModel.prototype.search
- * @description 查询。
- * @param {string} keyWords - 查询的关键字。
- * @param {string} [searchLayerName] - 执行的查询类型,支执行矢量图层属性查询,当为 "geocode" 则执行地址匹配。
- */
- search: function search(keyWord, searchLayerName) {
- if (!searchLayerName) {
- this.searchFromCityLocalSearchService(keyWord);
- } else {
- this.searchFromLayer(keyWord, searchLayerName);
- }
- },
- /**
- * @function L.supermap.components.searchViewModel.prototype.searchFromLayer
- * @description 图层属性查询。
- * @param {string} searchLayerName - 查询的图层名。
- * @param {string} keyWord - 图层属性搜索关键字。
- */
- searchFromLayer: function searchFromLayer(keyWord, searchLayerName) {
- if (this.dataModel.layers[searchLayerName]) {
- var resultFeatures = this.dataModel.layers[searchLayerName].getFeaturesByKeyWord(keyWord);
- if (resultFeatures && resultFeatures.length > 0) {
- /**
- * @event L.supermap.components.searchViewModel#searchlayersucceeded
- * @description 图层属性查询成功后触发。
- * @property {Object} result - 图层数据。
- */
- this.fire("searchlayersucceeded", {
- result: resultFeatures
- });
- } else {
- /**
- * @event L.supermap.components.searchViewModel#searchfailed
- * @description 图层属性查询失败后触发。
- * @property {string} searchType - 图层属性查询状态。
- */
- this.fire("searchfailed", {
- searchType: "searchLayersField"
- });
- }
- }
- },
- /**
- * @function L.supermap.components.searchViewModel.prototype.searchFromCityLocalSearchService
- * @description 城市地址匹配查询。
- * @param {string} keyWords - 城市地址匹配查询关键字。
- */
- searchFromCityLocalSearchService: function searchFromCityLocalSearchService(keyWords) {
- //todo 是否保留缓存?请求过的数据保留一份缓存?
- if (this.searchCache[keyWords]) {
- /**
- * @event L.supermap.components.searchViewModel#geocodesucceeded
- * @description 城市地址匹配成功后触发。
- * @property {Object} result - 城市匹配成功后返回的数据。
- */
- this.fire("geocodesucceeded", {
- result: this.searchCache[keyWords]
- });
- } else {
- this.geoCodeParam.keyWords = keyWords || this.geoCodeParam.city;
- var self = this;
- var url = this._getSearchUrl(this.geoCodeParam);
- FetchRequest.get(url).then(function (response) {
- return response.json();
- }).then(function (geocodingResult) {
- if (geocodingResult.error || geocodingResult.poiInfos.length === 0) {
- self.fire("searchfailed", {
- searchType: "searchGeocodeField"
- });
- return;
- }
- if (geocodingResult.poiInfos) {
- var geoJsonResult = self._dataToGeoJson(geocodingResult.poiInfos, self.geoCodeParam);
- self.fire("geocodesucceeded", {
- result: geoJsonResult
- });
- }
- });
- }
- },
- /**
- * @function L.supermap.components.searchViewModel.prototype.addSearchLayers
- * @description 添加新的可查询图层。
- * @param {Array.<L.GeoJSON>} layers - 新添加的图层对象。
- */
- addSearchLayers: function addSearchLayers(layers) {
- var _this = this;
- this.dataModel.addLayers(layers, function (e) {
- /**
- * @event L.supermap.components.searchViewModel#newlayeradded
- * @description 添加查询图层事件。
- * @property {Object} result - 事件返回的新的查询图层对象。
- * @property {string} layerName - 事件返回的新的查询图层对象名。
- */
- _this.fire("newlayeradded", {
- layerName: e.layerName
- });
- }, null, this);
- },
- /**
- * @function L.supermap.components.searchViewModel.prototype.panToLayer
- * @description 缩放到指定图层。
- * @param {string} layerName - 指定缩放的图层名。
- */
- panToLayer: function panToLayer(layerName) {
- if (this.dataModel.layers[layerName]) {
- this.map.flyToBounds(this.dataModel.layers[layerName].layer.getBounds());
- }
- },
- /**
- * @function L.supermap.components.searchViewModel.prototype.panToCity
- * @description 缩放到指定城市。
- * @param {string} city - 指定缩放的城市名。
- */
- panToCity: function panToCity(city) {
- this.geoCodeParam.keyWords = city;
- this.geoCodeParam.city = city;
- var self = this;
- var url = this._getSearchUrl(this.geoCodeParam);
- FetchRequest.get(url).then(function (response) {
- return response.json();
- }).then(function (geocodingResult) {
- if (geocodingResult.poiInfos.length > 0) {
- //缩放至城市
- var center = external_L_default().latLng(geocodingResult.poiInfos[0].location.y, geocodingResult.poiInfos[0].location.x);
- self.map.setView(center, 8);
- } else {
- self.fire("searchfailed", {
- searchType: "cityGeocodeField"
- });
- }
- });
- },
- /**
- * @description 将地址匹配返回的数据转为 GeoJSON 格式数据。
- * @param data
- * @private
- */
- _dataToGeoJson: function _dataToGeoJson(data, geoCodeParam) {
- var features = [];
- for (var i = 0; i < data.length; i++) {
- var feature = {
- type: "Feature",
- geometry: {
- type: "Point",
- coordinates: [data[i].location.x, data[i].location.y]
- },
- properties: {
- name: data[i].name || geoCodeParam.keyWords,
- address: data[i].formatedAddress || data[i].address
- }
- };
- features.push(feature);
- }
- return features;
- },
- /**
- * @function L.supermap.components.searchViewModel.prototype._getSearchUrl
- * @description 获取地理编码查询地址。
- * @param {Object} geoCodeParam - 地理编码查询参数。
- * @private
- */
- _getSearchUrl: function _getSearchUrl(geoCodeParam) {
- var url = this.options.cityGeoCodingConfig.addressUrl + ".json?keywords=".concat(geoCodeParam.keyWords, "&city=").concat(geoCodeParam.city, "&pageSize=").concat(geoCodeParam.pageSize, "&pageNum=").concat(geoCodeParam.pageNum, "&key=").concat(this.options.cityGeoCodingConfig.key);
- return url;
- }
- });
- var searchViewModel = function searchViewModel(options) {
- return new SearchViewModel(options);
- };
- (external_L_default()).supermap.components.searchViewModel = searchViewModel;
- ;// CONCATENATED MODULE: ./src/leaflet/components/search/SearchView.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.components.search
- * @classdesc 图层查询组件。
- * @category Components Search
- * @version 9.1.1
- * @param {Object} options - 可选参数。
- * @param {Object|Array.<string>} [options.cityConfig] - 城市地址匹配配置,默认为全国城市,与 options.cityGeoCodingConfig 支持匹配的服务对应;
- * 配置两种格式:{key1:{A:[],B:[]}, key2:{C:[],D:[]}} 或 ["成都市","北京市"],用户可根据自己的项目需求进行配置
- * @param {Object} [options.cityGeoCodingConfig] - 城市地址匹配服务配置,包括:{addressUrl:"",key:""} 默认为 online 地址匹配服务,与 options.cityConfig 对应
- * @param {boolean} [options.isGeoCoding=true] - 是否支持城市地址匹配功能。
- * @param {number} [options.pageSize=10] - 地址匹配查询返回记录结果数,最大设置为 20。
- * @param {number} [options.pageNum=1] - 地址匹配查询分页页码,默认 1 代表第一页。
- * @param {number} [options.perPageDataNum=8] - 每页显示个数,最大值为 8。
- * @param {string} [options.position='topright'] - 组件在地图中显示的位置,包括:'topleft','topright','bottomleft' 和 'bottomright',继承自 leaflet control。
- * @param {function} [options.style] - 设置图层点线面默认样式,点样式返回 maker 或者 circleMaker;线和面返回 L.path 样式。
- * @param {function} [options.onEachFeature] - 在创建和设置样式后,将为每个创建的要素调用一次的函数。用于将事件和弹出窗口附加到要素。默认情况下,对新创建的图层不执行任何操作。
- * @extends {L.supermap.components.componentsViewBase}
- * @fires L.supermap.components.search#searchlayersucceeded
- * @fires L.supermap.components.search#searchfailed
- * @fires L.supermap.components.search#geocodesucceeded
- */
- var SearchView = ComponentsViewBase.extend({
- options: {
- cityConfig: config,
- cityGeoCodingConfig: {
- addressUrl: "https://www.supermapol.com/iserver/services/localsearch/rest/searchdatas/China/poiinfos",
- key: "fvV2osxwuZWlY0wJb8FEb2i5"
- },
- isGeoCoding: true,
- pageSize: 10,
- pageNum: 1,
- perPageDataNum: 8
- },
- initialize: function initialize(options) {
- ComponentsViewBase.prototype.initialize.apply(this, [options]); //当前选中查询的图层名:
- this.currentSearchLayerName = "";
- this.isSearchLayer = false;
- this.perPageDataNum = this.options.perPageDataNum;
- },
- /*------以下是一些接口-----*/
- /**
- * @function L.supermap.components.search.prototype.onAdd
- * @description 向底图添加组件。
- * @private
- * @override
- */
- onAdd: function onAdd(map) {
- //初始化组件业务逻辑执行对象 viewModel
- this.viewModel = new SearchViewModel(map, this.options);
- return ComponentsViewBase.prototype.onAdd.apply(this, [map]);
- },
- /**
- * @function L.supermap.components.search.prototype.addSearchLayer
- * @description 添加可查询的图层。
- * @param {Array.<L.GeoJSON>|L.GeoJSON} layers - 可查询的图层。
- */
- addSearchLayer: function addSearchLayer(layers) {
- //将可查询图层数据传入vm处理
- this.viewModel.addSearchLayers(layers);
- },
- /*----------以下是创建 dom 元素的方法---------*/
- /**
- * @function L.supermap.components.search.prototype._initView
- * @description 创建地址匹配或图层要素查询组件。
- * @override
- * @returns {HTMLElement}
- * @private
- */
- _initView: function _initView() {
- var _this = this;
- // self 便于 this 对象的使用
- var self = this;
- var div = document.createElement("div");
- div.setAttribute("class", "component-search-container"); //外框
- var poiContainer = document.createElement("div");
- poiContainer.setAttribute("class", "component-search"); //主体
- //---------下拉框:
- var poiSettings = document.createElement("div");
- poiSettings.setAttribute("class", "component-search__settings"); //下拉框
- var poiSearchName = document.createElement("div"); //由View 维护,进行交互操作
- poiSearchName.setAttribute("class", "component-search__settings__name"); //poiSettings.innerHTML 通过下拉框选项改变
- poiSettings.appendChild(poiSearchName); //下拉标记
- var triangleIcon = document.createElement("span");
- triangleIcon.setAttribute("class", "supermapol-icons-solid-down-triangle");
- poiSettings.appendChild(triangleIcon); //城市地址匹配页面, 以及图层查询页面
- //城市地址匹配页面:
- var citySelect = null;
- if (this.options.isGeoCoding) {
- var cityTabsPageObj = new CityTabsPage({
- config: this.options.cityConfig
- });
- citySelect = cityTabsPageObj.getElement(); //点选城市名,修改显示,并执行定位城市查询【城市列表列表点击事件】
- cityTabsPageObj.content.onclick = function (e) {
- if (e.target.nodeName === "SPAN" && e.target.innerText) {
- _this.viewModel.panToCity(e.target.innerHTML);
- _this.messageBox.closeView();
- poiSearchName.removeChild(poiSearchName.firstChild);
- poiSearchName.insertBefore(document.createTextNode(e.target.innerHTML), poiSearchName.firstChild);
- _this.isSearchLayer = false;
- }
- }; //支持城市地址匹配,则初始化显示配置的第一个城市名:
- poiSearchName.appendChild(document.createTextNode(cityTabsPageObj.content.getElementsByTagName("span")[0].innerText));
- } //图层查询页面:写法是为了为了代码可读性
- var layersSelect = function () {
- var layersSelect = document.createElement("div");
- layersSelect.setAttribute("class", "component-search__layers");
- var layersContent = document.createElement("div");
- layersContent.setAttribute("class", "component-search-layers-content");
- layersSelect.appendChild(layersContent); //header todo 两个选项的功能暂没用到,先关闭,后续用到再打开
- var layersHeader = document.createElement("div");
- layersHeader.setAttribute("class", "component-search__layers__header"); //加载搜索条件
- var loadBtn = document.createElement("div");
- loadBtn.setAttribute("class", "load-btn");
- layersHeader.appendChild(loadBtn);
- var loadIcon = document.createElement("span");
- loadIcon.setAttribute("class", "supermapol-icons-poi-load");
- loadBtn.appendChild(loadIcon);
- var loadBtnText = document.createElement("span");
- loadBtnText.appendChild(document.createTextNode(Lang.i18n("text_loadSearchCriteria")));
- loadBtn.appendChild(loadBtnText); //保存搜索条件
- var saveBtn = document.createElement("div");
- saveBtn.setAttribute("class", "save-btn");
- layersHeader.appendChild(saveBtn);
- var icon = document.createElement("span");
- icon.setAttribute("class", "supermapol-icons-poi-save");
- saveBtn.appendChild(icon);
- var saveBtnText = document.createElement("span");
- saveBtnText.appendChild(document.createTextNode(Lang.i18n("text_saveSearchCriteria")));
- saveBtn.appendChild(saveBtnText); //body
- var layerSelectOptions = document.createElement("div");
- layerSelectOptions.setAttribute("class", "component-search__layers__body"); //选中查询图层监听
- //选择查询图层【图层列表点击事件】
- layerSelectOptions.onclick = function (e) {
- //先进行清除操作
- self.clearSearchResult();
- var selectLayerOption = null;
- if (e.target.classList[0] === "component-search__layers__itme__singleselect") {
- selectLayerOption = e.target;
- } else if (e.target.classList[0] === "component-single-default-img" || e.target.classList[0] === "single-label") {
- selectLayerOption = e.target.parentNode;
- } else {
- return;
- }
- if (document.getElementsByClassName("component-single-checked-img").length > 0) {
- document.getElementsByClassName("component-single-checked-img")[0].setAttribute("class", "component-single-default-img");
- }
- selectLayerOption.firstChild.setAttribute("class", "component-single-checked-img");
- self.currentSearchLayerName = selectLayerOption.lastChild.innerText;
- self.isSearchLayer = true;
- poiSearchName.removeChild(poiSearchName.firstChild);
- poiSearchName.insertBefore(document.createTextNode(self.currentSearchLayerName), poiSearchName.firstChild);
- self.viewModel.panToLayer(self.currentSearchLayerName);
- self.messageBox.closeView();
- };
- layersContent.appendChild(layerSelectOptions); //读取当前图层数据,并展现
- //只有调用添加查询图层接口才能添加图层选项
- return layersSelect;
- }(); //配置开启 城市匹配功能则添加
- var navTabs = [];
- if (citySelect) {
- navTabs.push({
- title: Lang.i18n("title_searchCity"),
- content: citySelect
- });
- }
- navTabs.push({
- title: Lang.i18n("title_searchLayer"),
- content: layersSelect
- });
- var navTabsPageObject = new NavTabsPage({
- tabs: navTabs
- });
- var navTabsPage = navTabsPageObject.getElement();
- navTabsPageObject.closeView();
- poiContainer.appendChild(navTabsPage);
- poiSettings.onclick = function () {
- if (navTabsPage.hidden) {
- navTabsPageObject.showView();
- } else {
- navTabsPageObject.closeView();
- }
- };
- poiContainer.appendChild(poiSettings); //初始时,下拉框若没赋值显示信息,则再次赋值:
- if (!poiSearchName.innerText) {
- poiSearchName.appendChild(document.createTextNode(Lang.i18n("text_label_chooseSearchLayers")));
- } //---------下拉框 END
- //---------搜索输入框:
- var poiInputContainer = document.createElement("div");
- poiInputContainer.setAttribute("class", "component-search__input");
- var poiInput = document.createElement("input");
- poiInput.type = "text";
- poiInput.placeholder = Lang.i18n("text_label_searchTips");
- poiInputContainer.appendChild(poiInput); //由View 维护,进行交互操作
- this.poiInput = poiInput; //清除输入内容按钮:
- var poiInputClose = document.createElement("span");
- poiInputClose.setAttribute("class", "supermapol-icons-close");
- poiInputClose.hidden = true;
- poiInputContainer.appendChild(poiInputClose);
- poiContainer.appendChild(poiInputContainer); //---------搜索输入框 END
- //--------搜索按钮:
- var searchBtn = document.createElement("div");
- searchBtn.setAttribute("class", "component-search-icon supermapol-icons-search"); //查询结果页面
- var resultDomObj = new PaginationContainer();
- this._resultDomObj = resultDomObj; //查询要素或匹配要素【搜索按钮点击事件】
- searchBtn.onclick = function () {
- //若是遮挡结果显示,则关闭
- resultDomObj.closeView();
- _this.clearSearchResult();
- _this.messageBox.closeView();
- navTabsPageObject.closeView();
- var keyWord = _this.poiInput.value.trim();
- if (keyWord === "") {
- _this.messageBox.showView(Lang.i18n('msg_searchKeywords'));
- return;
- }
- if (_this.isSearchLayer) {
- _this.viewModel.search(keyWord, _this.currentSearchLayerName);
- } else {
- _this.viewModel.search(keyWord);
- }
- }; //【输入框输入内容回车事件】
- poiInput.onkeypress = function (e) {
- //.which属性判断按下的是哪个键,回车键的键位序号为13
- if (e.which == 13) {
- //手动触发 searchBtn 得点击事件,执行查询操作
- var evt = document.createEvent("HTMLEvents");
- evt.initEvent("click", false, true);
- searchBtn.dispatchEvent(evt);
- }
- };
- poiContainer.appendChild(searchBtn); //--------搜索按钮 END
- var resultContainer = function createResultPage() {
- var resultContainer = resultDomObj.getElement();
- resultContainer.style.position = "absolute";
- resultContainer.style.top = "44px";
- resultContainer.style.right = "0"; //先关闭结果界面,当有数据时再打开
- resultDomObj.closeView(); //【结果列表点击事件】,以支持联动map上对应要素:
- resultDomObj.content.onclick = function (e) {
- var selectFeatureOption = null;
- if (e.target.parentNode.className === "component-search-result-info") {
- selectFeatureOption = e.target.parentNode.parentNode;
- } else if (e.target.parentNode.className === "component-search__resultitme") {
- selectFeatureOption = e.target.parentNode;
- } else if (e.target.className === "component-search__resultitme") {
- selectFeatureOption = e.target;
- } else {
- return;
- } //修改
- if (document.getElementsByClassName("component-search__resultitme-selected").length > 0) {
- document.getElementsByClassName("component-search__resultitme-selected")[0].classList.remove("component-search__resultitme-selected");
- }
- selectFeatureOption.firstChild.classList.add("component-search__resultitme-selected");
- var filter = selectFeatureOption.children[1].firstChild.innerText; //联动地图上要素响应
- self._linkageFeature(filter);
- };
- return resultContainer;
- }();
- poiContainer.appendChild(resultContainer); //清除输入框内容【输入框删除按钮点击事件】
- poiInputClose.onclick = function (e) {
- _this.clearSearchResult();
- poiInput.value = "";
- e.target.hidden = true;
- resultDomObj.closeView();
- }; //【输入框输入内容事件】
- poiInput.oninput = function () {
- poiInputClose.hidden = false;
- }; //添加提示框
- this.messageBox = new MessageBox(); //绑定 VM 的监听
- this._addViewModelListener();
- div.appendChild(poiContainer); //阻止 map 默认事件
- this._preventMapEvent(div, this.map);
- return div;
- },
- /**
- * @function L.supermap.components.search.prototype._createSearchLayerItem
- * @description 创建查询图层选项。
- * @private
- */
- _createSearchLayerItem: function _createSearchLayerItem(layerName) {
- var layerOption = document.createElement("div");
- layerOption.setAttribute("class", "component-search__layers__itme"); // 创建圆形单选框
- var singleSelect = document.createElement("div");
- singleSelect.setAttribute("class", "component-search__layers__itme__singleselect");
- var singleIcon = document.createElement("div");
- singleIcon.setAttribute("class", "component-single-default-img");
- singleSelect.appendChild(singleIcon);
- var singleLabel = document.createElement("span");
- singleLabel.setAttribute("class", "single-label");
- singleLabel.innerHTML = layerName;
- singleSelect.appendChild(singleLabel);
- layerOption.appendChild(singleSelect); //attributes-select todo 暂不支持该功能
- // const attributesSelect = (new ComponentSelect(layer.layer.attributeNames)).getElement();
- //选择查询的字段 todo 限制图层查找属性功能待属性选择框优化后完善
- /*attributesSelect.onchange = (e) => {
- this.searchAttributes = e.target.value;
- };*/
- // layerOption.appendChild(attributesSelect);
- document.getElementsByClassName("component-search__layers__body")[0].appendChild(layerOption);
- },
- /**
- * @function L.supermap.components.search.prototype._createResultItem
- * @description 创建查询结果列表。
- * @private
- */
- _createResultItem: function _createResultItem(featureType, properties) {
- var item = document.createElement("div");
- item.setAttribute("class", "component-search__resultitme");
- var icon = document.createElement("div");
- if (featureType === "Point" || featureType === "MultiPoint") {
- icon.setAttribute("class", "supermapol-icons-marker-layer component-search-result-icon");
- } else if (featureType === "LineString" || featureType === "MultiLineString ") {
- icon.setAttribute("class", "supermapol-icons-line-layer component-search-result-icon");
- } else if (featureType === "Polygon" || featureType === "MultiPolygon") {
- icon.setAttribute("class", "supermapol-icons-polygon-layer component-search-result-icon");
- } else {
- icon.setAttribute("class", "supermapol-icons-point-layer component-search-result-icon");
- }
- item.appendChild(icon);
- var info = document.createElement("div");
- info.setAttribute("class", "component-search-result-info");
- var info1 = document.createElement("div");
- info.appendChild(info1);
- var info2 = document.createElement("div"); //分地址匹配和图层搜索的两种数据展现形式:
- if (properties.name) {
- info1.innerHTML = properties.name;
- info2.innerHTML = properties.address;
- info.appendChild(info2);
- } else {
- info1.innerHTML = properties.filterAttributeName + ": " + properties.filterAttributeValue;
- }
- item.appendChild(info); //暂时删除复选框UI
- var check = document.createElement("div");
- check.setAttribute("class", "component-checkbox component-checkbox-default-img"); // item.appendChild(check);
- return item;
- },
- /*----------对 VM 的一些事件监听 ----------*/
- /**
- * @function L.supermap.components.search.prototype._addViewModelListener
- * @description 绑定对 VM 的事件监听。
- * @private
- */
- _addViewModelListener: function _addViewModelListener() {
- var _this2 = this;
- //----可查询图层变化监听
- this.viewModel.on("searchlayerschanged", function (layers) {
- for (var i = 0; i < layers.length; i++) {
- _this2._createSearchLayerItem(layers[i]);
- }
- }); //----可查询图层变化监听
- this.viewModel.on("newlayeradded", function (e) {
- _this2._createSearchLayerItem(e.layerName);
- }); //----图层查询结果监听
- this.viewModel.on("searchlayersucceeded", function (e) {
- var data = e.result;
- _this2.clearSearchResult();
- _this2.searchResultLayer = external_L_default().featureGroup(data, {
- pointToLayer: _this2.options.style,
- style: _this2.options.style
- }).bindPopup(function (layer) {
- if (layer.feature.properties) {
- return new AttributesPopContainer({
- attributes: layer.feature.properties
- }).getElement();
- }
- }).addTo(_this2.map);
- _this2.searchResultLayer.eachLayer(function (layer) {
- _this2.options.onEachFeature ? _this2.options.onEachFeature(layer.toGeoJSON(), layer) : _this2._featureOnclickEvent.bind(_this2)(layer.toGeoJSON(), layer);
- });
- _this2.searchLayersData = data; //查询结果列表:
- _this2._prepareResultData(data);
- /**
- * @event L.supermap.components.search#searchlayersucceeded
- * @description 图层查询成功后触发。
- * @property {Object} result - 事件返回的 GeoJSON 格式数据对象。
- */
- _this2._event.fire("searchlayersucceeded", {
- result: _this2.searchResultLayer.toGeoJSON()
- });
- }); //----地址匹配服务监听
- this.viewModel.on("geocodesucceeded", function (e) {
- var data = e.result; //先清空当前有的地址匹配图层
- _this2.clearSearchResult();
- _this2.searchResultLayer = external_L_default().geoJSON(data, {
- pointToLayer: _this2.options.style,
- style: _this2.options.style,
- onEachFeature: _this2.options.onEachFeature || _this2._featureOnclickEvent.bind(_this2)
- }).bindPopup(function (layer) {
- if (layer.feature.properties) {
- return new AttributesPopContainer({
- attributes: layer.feature.properties
- }).getElement();
- }
- }).addTo(_this2.map);
- _this2.searchLayersData = data; //查询结果列表:
- _this2._prepareResultData(data);
- /**
- * @event L.supermap.components.search#geocodesucceeded
- * @description 地址匹配服务成功后触发。
- * @property {Object} result - 事件返回的 GeoJSON 格式数据对象。
- */
- _this2._event.fire("geocodesucceeded", {
- result: data
- });
- }); //----地址匹配或图层查询失败监听
- this.viewModel.on("searchfailed", function (e) {
- var message = "";
- if (e.searchType === "searchGeocodeField") {
- message = Lang.i18n("msg_searchGeocodeField");
- } else if (e.searchType === "cityGeocodeField") {
- message = Lang.i18n("msg_cityGeocodeField");
- } else {
- message = Lang.i18n("msg_getFeatureField");
- }
- _this2.messageBox.showView(message);
- /**
- * @event L.supermap.components.search#searchfailed
- * @description 图层属性查询失败后触发。
- * @property {string} message - 失败原因。
- */
- _this2._event.fire("searchfailed", {
- message: message
- });
- });
- },
- /*-------以下是一些辅助性功能函数 -------*/
- /**
- * @function L.supermap.components.search.prototype._prepareResultData
- * @description 准备需要填入结果展示页面里的数据。
- * @param {Array.<Feature>} data - 图层查询或地址匹配返回的要素数据数组。
- * @private
- */
- _prepareResultData: function _prepareResultData(data) {
- this.currentResult = data; //向下取舍,这只页码
- var pageCounts = Math.ceil(data.length / this.perPageDataNum);
- this._resultDomObj.setPageLink(pageCounts); //初始结果页面内容:
- this._createResultListByPageNum(1, data);
- this._resultDomObj.showView(); //给页面模板设置联动事件
- this._resultDomObj.setLinkageEvent(_linkageEvent);
- var self = this;
- function _linkageEvent(page) {
- self._createResultListByPageNum(page, self.currentResult);
- }
- },
- /**
- * @function L.supermap.components.search.prototype._createResultListByPageNum
- * @description 根据页面值填充内容。
- * @param {number} page - 页数。
- * @param {Array.<Feature>} data - 图层查询或地址匹配返回的要素数据数组。
- * @private
- */
- _createResultListByPageNum: function _createResultListByPageNum(page, data) {
- var start = 0,
- end;
- if (page === 1 && data.length < this.perPageDataNum) {
- //data数据不满8个时:
- end = data.length - 1;
- } else if (page * this.perPageDataNum > data.length) {
- //最后一页且数据不满8个时
- start = this.perPageDataNum * (page - 1);
- end = data.length - 1;
- } else {
- //中间页面的情况
- start = this.perPageDataNum * (page - 1);
- end = page * this.perPageDataNum - 1;
- }
- var content = document.createElement("div");
- for (var i = start; i <= end; i++) {
- var properties = void 0,
- featureType = "Point";
- if (data[i].filterAttribute) {
- featureType = data[i].feature.geometry.type;
- properties = data[i].filterAttribute;
- } else {
- properties = data[i].properties;
- }
- content.appendChild(this._createResultItem(featureType, properties));
- }
- this._resultDomObj.setContent(content);
- this._resultDomObj.showView(); //查询完成默认选中第一个结果:
- content.firstChild.getElementsByClassName("component-search-result-icon")[0].classList.add("component-search__resultitme-selected");
- var filter = content.firstChild.getElementsByClassName("component-search-result-info")[0].firstChild.innerText;
- !this._selectMarkerFeature && this._linkageFeature(filter);
- },
- /**
- * @function L.supermap.components.search.prototype._flyToBounds
- * @param {L.Bounds} bounds - 当前图层范围。
- * @description 移动到图层。
- * @private
- */
- _flyToBounds: function _flyToBounds(bounds) {
- var sw = bounds.getSouthWest();
- var ne = bounds.getNorthEast();
- if (sw.lat === ne.lat && sw.lng === ne.lng) {
- this.map.flyTo(sw);
- } else {
- // this.map.fitBounds(this.searchResultLayer.getBounds());
- this.map.fitBounds(bounds);
- }
- },
- /**
- * @function L.supermap.components.search.prototype._linkageFeature
- * @description 点击结果列表联动地图上要素响应。
- * @private
- */
- _linkageFeature: function _linkageFeature(filter) {
- var _this3 = this;
- var filterValue = "";
- if (this.isSearchLayer) {
- filterValue = filter.split(":")[1].trim();
- } else {
- filterValue = filter;
- }
- this._selectFeature && this._selectFeature.addTo(this.map);
- this.searchResultLayer.eachLayer(function (layer) {
- // this._resetLayerStyleToDefault(layer);
- if (!filterValue || layer.filterAttribute && layer.filterAttribute.filterAttributeValue === filterValue || layer.feature.properties && layer.feature.properties.name === filterValue) {
- layer.remove();
- _this3._setSelectedLayerStyle(layer);
- /*layer.bindPopup(function () {
- return (new AttributesPopContainer(layer.feature.properties)).getElement()
- }, {closeOnClick: false}).openPopup().addTo(this.map);*/
- //若这个图层只有一个点的话,则直接 flyTo 到点:
- }
- });
- },
- /**
- * @function L.supermap.components.search.prototype.clearSearchResult
- * @description 清空当前查询的结果等。
- */
- clearSearchResult: function clearSearchResult() {
- if (this.searchResultLayer) {
- this.map.closePopup(); //若当前是查询图层的结果,则不删除图层,只修改样式
- !this.isSearchLayer && this.map.removeLayer(this.searchResultLayer);
- this._selectMarkerFeature && this.map.removeLayer(this._selectMarkerFeature);
- this._selectFeaturethis && this.map.removeLayer(this._selectFeature);
- this._selectMarkerFeature = null;
- this._selectFeature = null;
- this.searchResultLayer = null;
- this.currentResult = null;
- }
- },
- /**
- * @function L.supermap.components.search.prototype._featureOnclickEvent
- * @description 要素点击事件
- * @param {L.layer} layer - 需要设置选中样式的图层。
- * @private
- */
- _featureOnclickEvent: function _featureOnclickEvent(feature, layer) {
- var _this4 = this;
- layer.on('click', function () {
- var pageEles1 = document.getElementsByClassName('component-pagination__link')[0];
- _this4._resultDomObj._changePageEvent({
- target: pageEles1.children[0].children[0]
- });
- _this4._selectFeature && _this4._selectFeature.addTo(_this4.map);
- layer.remove();
- var page, dataIndex;
- for (var i = 0; i < _this4.searchLayersData.length; i++) {
- var item = _this4.searchLayersData[i];
- if (item.properties && item.properties.name === feature.properties.name || item.filterAttribute && item.filterAttribute.filterAttributeName + ": " + item.filterAttribute.filterAttributeValue === layer.filterAttribute.filterAttributeName + ": " + layer.filterAttribute.filterAttributeValue) {
- dataIndex = i % _this4.perPageDataNum;
- page = parseInt(i / _this4.perPageDataNum) + 1;
- break;
- }
- }
- if (page > 1) {
- for (var _i = 1; _i < page; _i++) {
- var pageEles = void 0;
- pageEles = document.getElementsByClassName('component-pagination__link')[0];
- _this4._resultDomObj._changePageEvent({
- target: pageEles.children[pageEles.children.length - 2].children[0]
- });
- }
- }
- var pageList = document.getElementsByClassName('component-search-result-info');
- var target = pageList[dataIndex].children[0];
- if (target.innerHTML === feature.properties.name || target.innerHTML === layer.filterAttribute.filterAttributeName + ": " + layer.filterAttribute.filterAttributeValue) {
- var selectFeatureOption = pageList[dataIndex].parentNode; //修改
- if (document.getElementsByClassName("component-search__resultitme-selected").length > 0) {
- document.getElementsByClassName("component-search__resultitme-selected")[0].classList.remove("component-search__resultitme-selected");
- }
- selectFeatureOption.firstChild.classList.add("component-search__resultitme-selected");
- _this4._setSelectedLayerStyle(layer);
- }
- }, this);
- },
- /**
- * @function L.supermap.components.search.prototype._setSelectedLayerStyle
- * @description 设置图层选中样式。
- * @param {L.layer} layer - 需要设置选中样式的图层。
- * @private
- */
- _setSelectedLayerStyle: function _setSelectedLayerStyle(layer) {
- this._selectMarkerFeature && this._selectMarkerFeature.remove();
- this._selectMarkerFeature = null;
- this._selectFeature = layer; //circleMarker 需要变成 marker 的样式:
- this._selectMarkerFeature = external_L_default().geoJSON(layer.toGeoJSON(), {
- //点选中样式, todo marker 显示位置需要调整
- pointToLayer: function pointToLayer(geoJsonPoint, latlng) {
- return external_L_default().marker(latlng, {
- icon: external_L_default().divIcon({
- className: 'component-select-marker-icon',
- iconAnchor: [15, 0]
- })
- });
- },
- //线和面选中样式:
- style: {
- fillColor: 'red',
- weight: 1,
- opacity: 1,
- color: 'red',
- fillOpacity: 0.2
- }
- }).addTo(this.map);
- this._selectMarkerFeature.bindPopup(function () {
- return new AttributesPopContainer({
- attributes: layer.feature.properties
- }).getElement();
- }, {
- closeOnClick: false
- }).openPopup().addTo(this.map);
- this._flyToBounds(this.searchResultLayer.getBounds());
- var center;
- if (layer.getLatLng) {
- center = layer.getLatLng();
- } else if (layer.getCenter) {
- center = layer.getCenter();
- }
- this.map.setView(center);
- }
- });
- var searchView = function searchView(options) {
- return new SearchView(options);
- };
- (external_L_default()).supermap.components.search = searchView;
- ;// CONCATENATED MODULE: ./src/leaflet/components/dataflow/DataFlowViewModel.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.components.dataFlowViewModel
- * @classdesc 数据流组件功能类。
- * @version 9.1.1
- * @category Components DataFlow
- * @param {L.Map} map - 当前组件所在的地图。
- * @param {Object} [dataFlowLayerOptions] - 数据流服务返回数据数据展示样式,默认采用 ViewModel 默认样式。
- * @param {Object} options - 可选参数。
- * @param {Function} [options.style] - 定义点、线、面要素样式。参数为{@link L.Path-option}。</br>
- `function (feature) {
- return {
- fillColor: "red",
- fillOpacity: 1,
- radius: 6,
- weight: 0
- };
- }`
- * @param {Function} [options.onEachFeature] - 在创建和设置样式后,将为每个创建的要素调用一次的函数。 用于将事件和弹出窗口附加到要素。 默认情况下,对新创建的图层不执行任何操作。
- * @fires L.supermap.components.dataFlowViewModel#dataflowservicesubscribed
- * @fires L.supermap.components.dataFlowViewModel#subscribesucceeded
- * @fires L.supermap.components.dataFlowViewModel#subscribefailed
- * @fires L.supermap.components.dataFlowViewModel#dataupdated
- * @extends {L.Evented}
- */
- var DataFlowViewModel = external_L_default().Evented.extend({
- options: {
- _defaultLayerOptions: {
- //style 返回 marker样式或者 L.path 样式
- style: null,
- onEachFeature: function onEachFeature(feature, layer) {
- var content = "属性信息如下:<br>";
- for (var key in feature.properties) {
- content += key + ": " + feature.properties[key] + "<br>";
- }
- layer.bindPopup(content);
- }
- }
- },
- initialize: function initialize(map) {
- var dataFlowLayerOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
- if (map) {
- /**
- * @member {L.Map} L.supermap.components.dataFlowViewModel.prototype.map
- * @description 当前组件所在的地图。
- */
- this.map = map;
- } else {
- return new Error("Cannot find map, fileModel.map cannot be null.");
- } //合并用户的 dataFlowLayerOptions
- external_L_default().Util.extend(this.options._defaultLayerOptions, dataFlowLayerOptions); //点样式也存储在style里
- this.options._defaultLayerOptions.pointToLayer = this.options._defaultLayerOptions.style;
- /**
- * @member {boolean} [L.supermap.components.dataFlowViewModel.prototype.popupsStatus=true]
- * @description 图层 popup 打开 "true" 或关闭 "false" 的状态。
- */
- this.popupsStatus = true;
- /**
- * @member {boolean} [L.supermap.components.dataFlowViewModel.prototype.dataFlowStatus=false]
- * @description 数据流服务当前状态,订阅 "true" 或未订阅 "false" 的状态。
- */
- this.dataFlowStatus = false;
- /**
- * @member {string} [L.supermap.components.dataFlowViewModel.prototype.dataFlowUrl=""]
- * @description 数据流地址。
- */
- this.dataFlowUrl = "";
- /**
- * @member {Array.<Object>} [L.supermap.components.dataFlowViewModel.prototype.currentFeatures]
- * @description 当前订阅数据流返回的要素数组。
- */
- this.currentFeatures = [];
- /**
- * @member {L.supermap.dataFlowLayer} [L.supermap.components.dataFlowViewModel.prototype.dataFlowLayer=null]
- * @description 当前 dataFlowLayer 图层对象。
- */
- this.dataFlowLayer = null;
- },
- /**
- * @function L.supermap.components.dataFlowViewModel.prototype.subscribe
- * @description 订阅数据流。
- * @param {string} dataFlowUrl - 数据流服务地址。
- */
- subscribe: function subscribe(dataFlowUrl) {
- var _this = this;
- //若当前数据流服务没变,则不进行重新订阅 todo 或者没点击暂停
- if (this.dataFlowUrl === dataFlowUrl) {
- if (this.dataFlowStatus) {
- /**
- * @event L.supermap.components.dataFlowViewModel#dataflowservicesubscribed
- * @description 数据流订阅成功后触发。
- */
- this.fire("dataflowservicesubscribed");
- return;
- }
- } else {
- this.dataFlowUrl = dataFlowUrl;
- }
- this.dataFlowStatus = true; //移除已有图层
- if (this.dataFlowLayer) {
- this.dataFlowLayer.remove();
- this.dataFlowLayer = null;
- } //创建DataFlowLayer,创建DataFlowLayer订阅iServer dataflow服务并将结果加载到地图上
- var dataFlowLayer = new DataFlowLayer(dataFlowUrl, this.options._defaultLayerOptions);
- dataFlowLayer.on('subscribesucceeded', function (result) {
- /**
- * @event L.supermap.components.dataFlowViewModel#subscribesucceeded
- * @description 数据流订阅成功后触发。
- * @property {Object} result - 返回的数据。
- */
- _this.fire("subscribesucceeded", {
- result: result
- });
- });
- dataFlowLayer.on('subscribefailed', function (result) {
- /**
- * @event L.supermap.components.dataFlowViewModel#subscribefailed
- * @description 数据流订阅失败后触发。
- * @property {Object} result - 返回的数据。
- */
- _this.fire("subscribefailed", {
- result: result
- });
- });
- dataFlowLayer.on('dataupdated', function (result) {
- //派发出订阅返回的数据:
- /**
- * @event L.supermap.components.dataFlowViewModel#dataupdated
- * @description 数据返回成功之后触发。
- * @property {Object} result - 返回的数据。
- */
- _this.fire("dataupdated", {
- result: result
- }); //若数据超出当前视图范围,则移动到数据所在视图范围:
- var layerBounds = result.layer.getBounds(),
- mapBounds = CommontypesConversion.toSuperMapBounds(_this.map.getBounds()),
- layerBoundsSuperMap = CommontypesConversion.toSuperMapBounds(layerBounds);
- if (!mapBounds.intersectsBounds(layerBoundsSuperMap)) {
- if (layerBoundsSuperMap.left === layerBoundsSuperMap.right && layerBoundsSuperMap.top === layerBoundsSuperMap.bottom) {
- _this.map.setView(layerBounds.getCenter());
- } else {
- _this.map.flyToBounds(layerBounds);
- }
- }
- if (_this.popupsStatus) {
- _this.openPopups();
- }
- });
- dataFlowLayer.addTo(this.map);
- this.dataFlowLayer = dataFlowLayer;
- },
- /**
- * @function L.supermap.components.dataFlowViewModel.prototype.cancelSubscribe
- * @description 取消订阅的数据流。
- */
- cancelSubscribe: function cancelSubscribe() {
- if (this.dataFlowLayer) {
- this.dataFlowStatus = false;
- this.dataFlowLayer.dataService.unSubscribe();
- this.dataFlowLayer.remove();
- this.dataFlowLayer = null;
- }
- },
- /**
- * @function L.supermap.components.dataFlowViewModel.prototype.openPopups
- * @description 打开图层要素弹窗。
- */
- openPopups: function openPopups() {
- this.popupsStatus = true;
- if (this.dataFlowLayer) {
- var layers = this.dataFlowLayer.getLayers();
- for (var i = 0; i < layers.length; i++) {
- for (var j = 0; j < layers[i].getLayers().length; j++) {
- layers[i].getLayers()[j].openPopup();
- }
- }
- }
- },
- /**
- * @function L.supermap.components.dataFlowViewModel.prototype.closePopups
- * @description 关闭图层要素弹窗。
- */
- closePopups: function closePopups() {
- this.popupsStatus = false;
- if (this.dataFlowLayer) {
- var layers = this.dataFlowLayer.getLayers();
- for (var i = 0; i < layers.length; i++) {
- for (var j = 0; j < layers[i].getLayers().length; j++) {
- layers[i].getLayers()[j].closePopup();
- }
- }
- }
- }
- });
- var dataFlowViewModel = function dataFlowViewModel(options) {
- return new DataFlowViewModel(options);
- };
- (external_L_default()).supermap.components.dataFlowViewModel = dataFlowViewModel;
- ;// CONCATENATED MODULE: ./src/leaflet/components/dataflow/DataFlowView.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.components.dataFlow
- * @classdesc 数据流组件。
- * @version 9.1.1
- * @category Components DataFlow
- * @param {Object} options - 可选参数。
- * @param {string} [options.position='topright'] - 组件在地图中显示的位置,包括:'topleft','topright','bottomleft' 和 'bottomright',继承自 leaflet control。
- * @param {Function} [options.style] - 设置图层点线面默认样式,点样式返回 maker 或者 circleMaker;线和面返回 L.path 样式。<br>
- `function (feature) {
- return {
- fillColor: "red",
- fillOpacity: 1,
- radius: 6,
- weight: 0
- };
- }`
- * @param {function} [options.onEachFeature] - 在创建和设置样式后,将为每个创建的要素调用一次的函数。用于将事件和弹出窗口附加到要素。默认情况下,对新创建的图层不执行任何操作。
- * @fires L.supermap.components.dataFlow#dataupdated
- * @extends {L.supermap.components.componentsViewBase}
- */
- var DataFlowView = ComponentsViewBase.extend({
- initialize: function initialize(options) {
- ComponentsViewBase.prototype.initialize.apply(this, [options]);
- },
- /**
- * @function L.supermap.components.dataFlow.prototype.onAdd
- * @description 向底图添加组件
- * @override
- * @private
- */
- onAdd: function onAdd(map) {
- //为了避免空对象为复写默认配置的现象,先判断参数是否为空
- var options = {};
- if (this.options.style) {
- options.style = this.options.style;
- }
- if (this.options.onEachFeature) {
- options.style = this.options.onEachFeature;
- }
- this.viewModel = new DataFlowViewModel(map, options);
- return ComponentsViewBase.prototype.onAdd.apply(this, [map]);
- },
- /**
- * @function L.supermap.components.dataFlow.prototype._initView
- * @description 创建打开本地文件数据组件
- * @returns {HTMLElement}
- * @private
- * @override
- */
- _initView: function _initView() {
- var _this = this;
- var containerObj = new CommonContainer({
- title: Lang.i18n("title_dataFlowService")
- });
- var container = containerObj.getElement();
- var componentContent = containerObj.getContentElement();
- componentContent.style.padding = "10px 18px";
- var dataFlowContainer1 = document.createElement("div");
- dataFlowContainer1.setAttribute("class", "component-dataflow__container"); //输入框
- var dataFlowInputContainer = document.createElement("div");
- dataFlowInputContainer.setAttribute("class", "component-input-default");
- var dataFlowInput = document.createElement("input");
- dataFlowInput.setAttribute("class", "component-input-default");
- dataFlowInput.type = "text";
- dataFlowInput.placeholder = Lang.i18n('text_input_value_inputDataFlowUrl');
- dataFlowInput.title = Lang.i18n('text_input_value_inputDataFlowUrl');
- dataFlowInputContainer.appendChild(dataFlowInput); //删除输入值按钮:
- var inputClearBtn = document.createElement("span");
- inputClearBtn.setAttribute("class", "supermapol-icons-close");
- inputClearBtn.hidden = true; //---清除输入值【清除按钮点击事件】
- inputClearBtn.onclick = function (e) {
- dataFlowInput.value = "";
- e.target.hidden = true;
- }; //---输入框值改变,打开清除按钮【输入框内容改变事件】
- dataFlowInput.oninput = function () {
- inputClearBtn.hidden = false;
- };
- dataFlowInputContainer.appendChild(inputClearBtn);
- dataFlowContainer1.appendChild(dataFlowInputContainer);
- componentContent.appendChild(dataFlowContainer1); //复选框条件
- var dataFlowContainer2 = document.createElement("div");
- dataFlowContainer2.setAttribute("class", "component-dataflow__container");
- var checkboxContainer = document.createElement("div");
- checkboxContainer.setAttribute("class", "component-checkbox-container");
- var attributesCheckbox = document.createElement("div");
- attributesCheckbox.setAttribute("class", "component-checkbox-default component-checkbox-selected-img");
- attributesCheckbox.checked = true;
- checkboxContainer.appendChild(attributesCheckbox);
- var checkboxLabel = document.createElement("div");
- checkboxLabel.setAttribute("class", "component-label component-label-selected");
- checkboxLabel.innerHTML = Lang.i18n('text_displayFeaturesInfo');
- checkboxContainer.appendChild(checkboxLabel); //----是否显示属性框【属性框复选框点击事件】
- attributesCheckbox.onclick = function (e) {
- e.target.checked = !e.target.checked;
- if (e.target.checked) {
- checkboxLabel.setAttribute("class", "component-label component-label-selected");
- e.target.setAttribute("class", "component-checkbox-default component-checkbox-selected-img");
- _this.viewModel.openPopups();
- } else {
- checkboxLabel.setAttribute("class", "component-label");
- e.target.setAttribute("class", "component-checkbox-default component-checkbox-default-img");
- _this.viewModel.closePopups();
- }
- };
- dataFlowContainer2.appendChild(checkboxContainer);
- componentContent.appendChild(dataFlowContainer2); //订阅按钮,取消按钮:
- var dataFlowContainer3 = document.createElement("div");
- dataFlowContainer3.setAttribute("class", "component-dataflow__container component-init-center");
- var subscribe = document.createElement("button");
- subscribe.setAttribute("class", "component-button-default");
- subscribe.innerHTML = Lang.i18n('text_subscribe'); //----订阅服务【订阅按钮点击事件】
- subscribe.onclick = function () {
- var urlDataFlow = dataFlowInput.value;
- if (urlDataFlow === "") {
- _this.messageBox.showView(Lang.i18n('msg_inputDataFlowUrlFirst'));
- return;
- }
- _this.viewModel.subscribe(urlDataFlow);
- };
- dataFlowContainer3.appendChild(subscribe);
- var cancelSubscribe = document.createElement("button");
- cancelSubscribe.setAttribute("class", "component-button-default");
- cancelSubscribe.innerHTML = Lang.i18n('text_cancelSubscribe'); //----取消订阅服务【取消订阅按钮点击事件】
- cancelSubscribe.onclick = function () {
- _this.viewModel.cancelSubscribe();
- };
- dataFlowContainer3.appendChild(cancelSubscribe);
- componentContent.appendChild(dataFlowContainer3); //增加提示框:
- this.messageBox = new MessageBox();
- this.viewModel.on("dataflowservicesubscribed", function () {
- _this.messageBox.showView(Lang.i18n("msg_dataflowservicesubscribed"));
- });
- this.viewModel.on("subscribesucceeded", function () {
- _this.messageBox.showView(Lang.i18n("msg_subscribesucceeded"));
- });
- /**
- * @event L.supermap.components.dataFlow#dataupdated
- * @description 数据流服务成功返回数据后触发。
- * @property {Object} result - 事件返回的数据对象。
- */
- this.viewModel.on("dataupdated", function (result) {
- _this.messageBox.closeView();
- _this._event.fire("dataupdated", result);
- }); //关闭在控件上触发地图的事件响应:
- //阻止 map 默认事件
- this._preventMapEvent(container, this.map);
- return container;
- }
- });
- var dataFlowView = function dataFlowView(options) {
- return new DataFlowView(options);
- };
- (external_L_default()).supermap.components.dataFlow = dataFlowView;
- ;// CONCATENATED MODULE: ./src/leaflet/components/commonmodels/GeoJSONLayerWithName.js
- function GeoJSONLayerWithName_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.components.geoJSONLayerWithName
- * @classdesc 含有 layerName 与 GeoJSON 图层的对象。
- * @private
- * @param {Object} layerObject - 图层对象。
- * @param {string} layerName - 图层名。
- * @param {L.GeoJSON} layer - 图层。
- * @category Components Common
- */
- var GeoJSONLayerWithName = function GeoJSONLayerWithName(layerName, layer) {
- GeoJSONLayerWithName_classCallCheck(this, GeoJSONLayerWithName);
- this.layerName = layerName;
- this.layer = layer;
- };
- var geoJSONLayerWithName = function geoJSONLayerWithName(layerName, layer) {
- return new GeoJSONLayerWithName(layerName, layer);
- };
- (external_L_default()).supermap.components.geoJSONLayerWithName = geoJSONLayerWithName;
- ;// CONCATENATED MODULE: ./src/leaflet/components/clientcomputation/ClientComputationViewModel.js
- function ClientComputationViewModel_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ClientComputationViewModel_typeof = function _typeof(obj) { return typeof obj; }; } else { ClientComputationViewModel_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ClientComputationViewModel_typeof(obj); }
- function ClientComputationViewModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function ClientComputationViewModel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function ClientComputationViewModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) ClientComputationViewModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) ClientComputationViewModel_defineProperties(Constructor, staticProps); return Constructor; }
- function ClientComputationViewModel_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ClientComputationViewModel_setPrototypeOf(subClass, superClass); }
- function ClientComputationViewModel_setPrototypeOf(o, p) { ClientComputationViewModel_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ClientComputationViewModel_setPrototypeOf(o, p); }
- function ClientComputationViewModel_createSuper(Derived) { var hasNativeReflectConstruct = ClientComputationViewModel_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ClientComputationViewModel_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ClientComputationViewModel_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ClientComputationViewModel_possibleConstructorReturn(this, result); }; }
- function ClientComputationViewModel_possibleConstructorReturn(self, call) { if (call && (ClientComputationViewModel_typeof(call) === "object" || typeof call === "function")) { return call; } return ClientComputationViewModel_assertThisInitialized(self); }
- function ClientComputationViewModel_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- function ClientComputationViewModel_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; } }
- function ClientComputationViewModel_getPrototypeOf(o) { ClientComputationViewModel_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ClientComputationViewModel_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.components.clientComputationViewModel
- * @classdesc 客户端计算组件功能类。
- * @version 9.1.1
- * @category Components ClientComputation
- * @param {string} workerUrl - worker 地址,原始位置为 dist/leaflet/workers/TurfWorker.js。
- * @fires L.supermap.components.clientComputationViewModel#analysisfailed
- * @fires L.supermap.components.clientComputationViewModel#analysissucceeded
- * @fires L.supermap.components.clientComputationViewModel#layerloaded
- * @fires L.supermap.components.clientComputationViewModel#layersremoved
- * @extends {L.Evented}
- */
- var ClientComputationViewModel = /*#__PURE__*/function (_L$Evented) {
- ClientComputationViewModel_inherits(ClientComputationViewModel, _L$Evented);
- var _super = ClientComputationViewModel_createSuper(ClientComputationViewModel);
- function ClientComputationViewModel() {
- ClientComputationViewModel_classCallCheck(this, ClientComputationViewModel);
- return _super.apply(this, arguments);
- }
- ClientComputationViewModel_createClass(ClientComputationViewModel, [{
- key: "initialize",
- value: function initialize(workerUrl) {
- this.workerUrl = workerUrl;
- this.turfLayers = [];
- }
- /**
- * @function L.supermap.components.clientComputationViewModel.prototype.getLayersData
- * @description 获取填充到 view 的数据。
- * @param {Array.<L.GeoJSON>} layersArr - 图层数组。
- * @returns {Object} layers 数据。
- */
- }, {
- key: "getLayersData",
- value: function getLayersData(layersArr) {
- var result = {};
- var pointData = {},
- lineData = {},
- polygonData = {};
- for (var i = 0; i < layersArr; i++) {
- layersArr[i] = new GeoJSONLayerWithName(layersArr[i].layerName, layersArr[i].layer);
- }
- this.geoJsonLayersDataModel = new GeoJsonLayersDataModel(layersArr); // 把 layersArr 转成 key = layername 对象,方便获取 fields 时遍历
- var dataObj = [];
- for (var _i = 0; _i < layersArr.length; _i++) {
- dataObj[layersArr[_i].layerName] = {
- fields: layersArr[_i].fields,
- layer: layersArr[_i].layer.toGeoJSON()
- };
- }
- for (var key in this.geoJsonLayersDataModel.layers) {
- var fields = void 0;
- if (dataObj[key].fields) {
- fields = dataObj[key].fields;
- } else {
- fields = this.geoJsonLayersDataModel.layers[key].getAttributeNamesByType("Num");
- }
- var fieldsValue = [];
- for (var _i2 = 0; _i2 < fields.length; _i2++) {
- fieldsValue[fields[_i2]] = this.geoJsonLayersDataModel.layers[key].getAttributeValueByAttributeName(fields[_i2]); // 去空 & 去重 & 转 number
- var arr = fieldsValue[fields[_i2]];
- for (var j = 0; j < arr.length; j++) {
- if (arr[j] == "" || typeof arr[j] == "undefined") {
- arr.splice(j, 1);
- j = j - 1;
- }
- arr[j] = parseFloat(arr[j]);
- }
- fieldsValue[fields[_i2]] = Array.from(new Set(arr.sort(function (a, b) {
- return a - b;
- })));
- }
- var obj = {
- layerName: key,
- fields: fields,
- fieldsValue: fieldsValue,
- features: dataObj[key].layer
- };
- var layersType = dataObj[key].layer.features[0].geometry.type;
- if (layersType === "Point") {
- pointData[key] = obj;
- } else if (layersType === "LineString") {
- lineData[key] = obj;
- } else if (layersType === "Polygon") {
- polygonData[key] = obj;
- }
- }
- result['point'] = pointData;
- result['lineString'] = lineData;
- result['polygon'] = polygonData;
- return result;
- }
- /**
- * @function L.supermap.components.clientComputationViewModel.prototype.analysis
- * @description 进行客户端计算。
- * @param {Object} params - 客户端计算参数。
- * @param {L.Map} map - Leaflet Map 对象。
- */
- }, {
- key: "analysis",
- value: function analysis(params, map) {
- this.geoJsonLayersDataModel.setCurrentLayerDataModel(params.analysisLayers);
- this.worker = new Worker(this.workerUrl);
- var resultData = this.geoJsonLayersDataModel.currentLayerDataModel.layer.toGeoJSON();
- if (params.analysisMethod === "isolines") {
- var fieldsValue = params.analysisFieldsValue.split(",");
- var pointGrid = resultData;
- for (var j = 0; j < fieldsValue.length; j++) {
- fieldsValue[j] = parseFloat(fieldsValue[j]);
- }
- var me = this;
- var analysisParams = {
- "pointGrid": pointGrid,
- "analysisMethod": params.analysisMethod,
- "breaks": fieldsValue,
- "zProperty": params.analysisFields,
- "analysisCellSize": params.analysisCellSize,
- "options": {
- gridType: "point",
- property: params.analysisFields,
- weight: Number(params.analysisBreaks)
- }
- };
- this.worker.postMessage(analysisParams);
- this.worker.onmessage = function (e) {
- if (e.data.features.length === 0) {
- /**
- * @event L.supermap.components.clientComputationViewModel#analysisfailed
- * @description 事件分析失败后触发,返回结果为空。
- */
- me.fire('analysisfailed');
- } else {
- /**
- * @event L.supermap.components.clientComputationViewModel#analysissucceeded
- * @description 事件分析成功后触发。
- * @property {Object} data - 分析成功后的数据。
- */
- me.fire('analysissucceeded', {
- 'data': e.data
- });
- var turfLayer = external_L_default().geoJSON(e.data, {
- style: {
- color: '#1060C2',
- weight: 3
- },
- onEachFeature: function onEachFeature(feature, layer) {
- if (feature.properties) {
- layer.bindPopup(new AttributesPopContainer(feature.properties).getElement());
- }
- layer.on({
- 'mouseover': function mouseover() {
- layer.setStyle({
- color: "#ffffff",
- weight: 5
- });
- },
- 'mouseout': function mouseout() {
- layer.setStyle({
- color: '#1060C2',
- weight: 3
- });
- },
- "click": function click() {
- layer.setStyle({
- color: "#ffffff",
- weight: 5
- });
- }
- });
- }
- }).addTo(map);
- me.turfLayers.push(turfLayer);
- /**
- * @event L.supermap.components.clientComputationViewModel#layerloaded
- * @description 结果图层加载完成后触发。
- * @property {L.GeoJSON} layer - 加载完成后的结果图层。
- * @property {string} name - 加载完成后的结果图层名称。
- */
- me.fire('layerloaded', {
- "layer": turfLayer,
- "name": params.resultLayersName
- });
- me.worker.terminate();
- }
- };
- } else if (params.analysisMethod === "buffer") {
- var _me = this;
- var _analysisParams = {
- "analysisMethod": "buffer",
- "radius": params.radius,
- "unit": params.unit,
- "isSave": params.isSaveStatus,
- "isUnion": params.isUnion,
- 'geoJson': resultData
- };
- this.worker.postMessage(_analysisParams);
- this.worker.onmessage = function (e) {
- var turfLayer = external_L_default().geoJSON(e.data, {
- style: {
- color: "#ffffff",
- fillColor: '#1060C2',
- fillOpacity: .5,
- weight: 1.5
- },
- onEachFeature: function onEachFeature(feature, layer) {
- if (feature.properties) {
- layer.bindPopup(new AttributesPopContainer(feature.properties).getElement());
- }
- layer.on({
- 'mouseover': function mouseover() {
- layer.setStyle({
- color: "#ffffff",
- fillColor: "rgb(46,40,79)",
- fillOpacity: .5,
- weight: 5
- });
- },
- 'mouseout': function mouseout() {
- layer.setStyle({
- color: "#ffffff",
- fillColor: '#1060C2',
- fillOpacity: .5,
- weight: 1.5
- });
- },
- "click": function click() {
- layer.setStyle({
- color: "#ffffff",
- fillColor: "rgb(46,40,79)",
- fillOpacity: .5,
- weight: 2
- });
- }
- });
- }
- }).addTo(map);
- _me.turfLayers.push(turfLayer);
- _me.fire('layerloaded', {
- "layer": turfLayer,
- "name": params.resultLayersName
- });
- _me.worker.terminate();
- };
- }
- }
- /**
- * @function L.supermap.components.clientComputationViewModel.prototype.clearLayers
- * @description 清空分析图层。
- */
- }, {
- key: "clearLayers",
- value: function clearLayers() {
- for (var i in this.turfLayers) {
- this.turfLayers[i].clearLayers();
- }
- /**
- * @event L.supermap.components.clientComputationViewModel#layersremoved
- * @description 图层删除之后触发。
- * @property {Array.<L.GeoJSON>} layer - 需要删除的图层数组。
- */
- this.fire('layersremoved', {
- layers: this.turfLayers
- });
- }
- /**
- * @function L.supermap.components.clientComputationViewModel.prototype.cancelAnalysis
- * @description 取消分析。
- */
- }, {
- key: "cancelAnalysis",
- value: function cancelAnalysis() {
- this.worker.terminate();
- }
- }]);
- return ClientComputationViewModel;
- }((external_L_default()).Evented);
- var clientComputationViewModel = function clientComputationViewModel(options) {
- return new ClientComputationViewModel(options);
- };
- (external_L_default()).supermap.components.clientComputationViewModel = clientComputationViewModel;
- ;// CONCATENATED MODULE: ./src/leaflet/components/clientcomputation/ClientComputationView.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.components.clientComputation
- * @classdesc 客户端计算组件,用于进行叠加图层的客户端计算。
- * @version 9.1.1
- * @param {string} workerUrl - worker 地址,原始位置为 dist/leaflet/workers/TurfWorker.js。
- * @param {Object} options - 可选参数。
- * @param {string} [options.position='topright'] - 组件在地图中显示的位置,包括:'topleft','topright','bottomleft' 和 'bottomright',继承自 leaflet control。
- * @param {function} [options.style] - 设置图层点线面默认样式,点样式返回 maker 或者 circleMaker;线和面返回 L.path 样式。
- * @param {function} [options.onEachFeature] - 在创建和设置样式后,将为每个创建的要素调用一次的函数。用于将事件和弹出窗口附加到要素。默认情况下,对新创建的图层不执行任何操作。
- * @fires L.supermap.components.clientComputation#analysissucceeded
- * @fires L.supermap.components.clientComputation#analysisfailed
- * @fires L.supermap.components.clientComputation#layersremoved
- * @category Components ClientComputation
- * @extends {L.supermap.components.componentsViewBase}
- */
- var ClientComputationView = ComponentsViewBase.extend({
- initialize: function initialize(workerUrl, options) {
- if (!workerUrl) {
- throw new Error('workerUrl is required');
- }
- this.workerUrl = workerUrl;
- ComponentsViewBase.prototype.initialize.apply(this, [options]);
- },
- /**
- * @function L.supermap.components.clientComputation.prototype.onAdd
- * @description 添加控件。
- * @private
- * @override
- */
- onAdd: function onAdd(map) {
- this.map = map;
- return ComponentsViewBase.prototype.onAdd.apply(this, [map]);
- },
- /**
- * @function L.supermap.components.clientComputation.prototype.addLayer
- * @description 添加叠加图层。
- */
- addLayer: function addLayer(layer) {
- this.layers = this.layers || [];
- this.layers.push(layer);
- var fillData = this.viewModel.getLayersData(this.layers);
- this.fillDataToView(fillData);
- },
- /**
- * @function L.supermap.components.clientComputation.prototype.fillDataToView
- * @private
- * @description 填充数据到 view。
- * @param {Object} fillData - 待填充的数据。
- */
- fillDataToView: function fillDataToView(fillData) {
- if (!fillData) {
- return;
- }
- this.fillData = fillData;
- var analysisMethod = document.getElementById('dropDownTop').getAttribute('data-value');
- var currentFillData = {};
- switch (analysisMethod) {
- case 'isolines':
- currentFillData = fillData['point'];
- break;
- case 'buffer':
- currentFillData = fillData['point'];
- break;
- }
- if (JSON.stringify(currentFillData) == '{}') {
- return;
- } // 填充分析图层下拉框
- var layserArr = [];
- for (var layerName in currentFillData) {
- layserArr.push(layerName);
- }
- var layersSelect = document.getElementById('layersSelect');
- var layerSelectName = document.getElementById('layerSelectName'); // 清空 layersSelect;
- layersSelect.innerHTML = '';
- layerSelectName.title = layserArr[0];
- layerSelectName.innerHTML = layserArr[0];
- this._createOptions(layersSelect, layserArr); // 设置 layer select option 点击事件
- this.layerSelectObj.optionClickEvent(layersSelect, layerSelectName, this.layersSelectOnchange); // 当前选中图层数据
- var currentData = currentFillData[layerSelectName.title];
- var fieldsArr = currentData.fields;
- var textAreaData = currentData.fieldsValue; // 设置当前数据
- this.currentData = currentData;
- this.currentFillData = currentFillData; // 填充字段下拉框
- var fieldsSelect = document.getElementById('fieldsSelect'); // 清空 fieldsSelect
- fieldsSelect.innerHTML = '';
- var fieldsSelectNameDiv = document.getElementById('fieldsSelectName');
- fieldsSelectNameDiv.innerHTML = fieldsArr[0];
- fieldsSelectNameDiv.title = fieldsArr[0];
- this._createOptions(fieldsSelect, fieldsArr);
- this.fieldsSelectObj.optionClickEvent(fieldsSelect, fieldsSelectNameDiv, this.fieldsSelectOnchange); // 当前选中字段
- var fieldsSelectName = fieldsSelectNameDiv.title; // 通过当前选中字段 填充 TextArea 初始值
- var getValueTextArea = document.getElementById('getValueTextArea');
- getValueTextArea.value = textAreaData[fieldsSelectName].toString().replace(/,/g, ",\r\n");
- getValueTextArea.setAttribute('data-value', textAreaData[fieldsSelectName]); // 结果图层
- var resultLayersName = document.getElementById('resultLayersName');
- var analysisType = document.getElementById('dropDownTop').getAttribute('data-value');
- switch (analysisType) {
- case 'isolines':
- resultLayersName.value = Lang.i18n('text_label_isolines') + layerSelectName.title;
- break;
- case 'buffer':
- resultLayersName.value = Lang.i18n('text_label_buffer') + layerSelectName.title;
- break;
- }
- },
- /**
- * @function L.supermap.components.clientComputation.prototype._initView
- * @description 创建客户端计算组件。
- * @returns {HTMLElement}
- * @private
- */
- _initView: function _initView() {
- var _this = this;
- //初始化 ViewModel
- this.workerUrl && (this.viewModel = new ClientComputationViewModel(this.workerUrl)); //初始化 view
- // Container
- var container = new CommonContainer({
- title: Lang.i18n('title_clientComputing')
- }).getElement();
- container.classList.add('component-analysis');
- container.children[0].style.fontSize = '12px';
- var analysisOptionsArr = [{
- 'title': Lang.i18n('text_isoline'),
- 'dataValue': 'isolines',
- 'remark': Lang.i18n('text_extractDiscreteValue'),
- 'icon': {
- 'className': 'component-analyst-isoline-img'
- }
- }, {
- 'title': Lang.i18n('text_buffer'),
- 'dataValue': 'buffer',
- 'remark': Lang.i18n('text_specifyTheDistance'),
- 'icon': {
- 'className': 'component-analyst-buffer-img'
- }
- }];
- var componentContentContainer = container.children[1];
- componentContentContainer.classList.add('component-content--scroll');
- componentContentContainer.classList.add('component-content--analysis'); // 下拉框
- var dropDownBox = new DropDownBox(analysisOptionsArr).getElement();
- componentContentContainer.appendChild(dropDownBox);
- var dropDownTopContainer = dropDownBox.children[0].children[0];
- var dropDownItems = dropDownBox.children[0].children[2].children[0];
- dropDownTopContainer.children[0].id = 'dropDownTop'; // analysisContainer
- var analysisTypeContainer = external_L_default().DomUtil.create('div', 'component-analysis__container', componentContentContainer); // 分析图层
- var analysisLayer = external_L_default().DomUtil.create('div', 'component-analysis__container__analysisLayer', analysisTypeContainer);
- var layerSelectControl = external_L_default().DomUtil.create('div', 'component-analysis__selecttool', analysisLayer);
- layerSelectControl.id = 'layerSelectControl';
- var layerOptions = {
- 'optionsArr': [''],
- 'labelName': Lang.i18n('text_label_analysisLayer')
- };
- var layerSelectObj = new Select(layerOptions);
- var layerSelectTool = layerSelectObj.getElement();
- this.layerSelectObj = layerSelectObj;
- layerSelectControl.appendChild(layerSelectTool); // 图层选中div
- var layerSelectName = layerSelectTool.children[1].children[0];
- layerSelectName.id = 'layerSelectName'; // 图层下拉框select
- var layersSelect = layerSelectTool.children[1].children[2].children[0].children[0];
- layersSelect.id = 'layersSelect'; // ISOLINE
- // 提取字段
- var div = external_L_default().DomUtil.create('div', 'component-analysis__container__analysistype', analysisTypeContainer);
- var isolineDiv = external_L_default().DomUtil.create('div', 'component-clientcomputation__isoline', div);
- var fieldsOptions = {
- 'optionsArr': [''],
- 'labelName': Lang.i18n('text_label_extractField'),
- 'optionsClickCb': this.fieldsSelectOnchange
- };
- var fieldsSelectControl = external_L_default().DomUtil.create('div', 'component-analysis__selecttool', isolineDiv);
- var fieldsSelectObj = new Select(fieldsOptions);
- var fieldsSelectTool = fieldsSelectObj.getElement();
- this.fieldsSelectObj = fieldsSelectObj;
- var fieldsSelectName = fieldsSelectTool.children[1].children[0];
- fieldsSelectName.id = 'fieldsSelectName';
- var fieldsSelect = fieldsSelectTool.children[1].children[2].children[0].children[0];
- fieldsSelect.id = 'fieldsSelect';
- fieldsSelectControl.appendChild(fieldsSelectTool); // 提取值
- var textareaContainer = external_L_default().DomUtil.create('div', 'component-analysis__container', isolineDiv);
- var textareaSpan = external_L_default().DomUtil.create('span', 'component-textarea__name', textareaContainer);
- textareaSpan.innerHTML = Lang.i18n('text_label_extractedValue');
- var textareaControl = external_L_default().DomUtil.create('div', 'component-textarea', textareaContainer);
- textareaControl.id = 'getValueText';
- var scrollarea = external_L_default().DomUtil.create('div', '', textareaControl);
- var scrollareaContent = external_L_default().DomUtil.create('div', 'component-scrollarea-content', scrollarea);
- scrollareaContent.setAttribute('tabindex', '1');
- var getValueTextArea = external_L_default().DomUtil.create('textarea', 'component-textarea__content', scrollareaContent);
- getValueTextArea.id = 'getValueTextArea';
- getValueTextArea.setAttribute('rows', '20'); // 距离衰减
- var breaksDiv = external_L_default().DomUtil.create('div', '', isolineDiv);
- var breaksSpan = external_L_default().DomUtil.create('span', '', breaksDiv);
- breaksSpan.innerHTML = Lang.i18n('text_label_distanceAttenuation');
- var breaks = external_L_default().DomUtil.create('input', '', breaksDiv);
- breaks.value = '3'; // 栅格大小
- var cellSizeDiv = external_L_default().DomUtil.create('div', '', isolineDiv);
- var cellSizeSpan = external_L_default().DomUtil.create('span', '', cellSizeDiv);
- cellSizeSpan.innerHTML = Lang.i18n('text_label_gridSize');
- var cellSize = external_L_default().DomUtil.create('input', '', cellSizeDiv);
- cellSize.value = '30'; // BUFFER
- // 缓冲半径
- var bufferDiv = external_L_default().DomUtil.create('div', 'component-clientcomputation__buffer hidden', div);
- var bufferRadius = external_L_default().DomUtil.create('div', 'component-clientcomputation__buffer--radius', bufferDiv);
- var bufferRadiusSpan = external_L_default().DomUtil.create('span', '', bufferRadius);
- bufferRadiusSpan.innerHTML = Lang.i18n('text_label_bufferRadius');
- var bufferRadiusDiv = external_L_default().DomUtil.create('div', '', bufferRadius);
- var bufferRadiusInput = external_L_default().DomUtil.create('input', 'buffer-radius-input', bufferRadiusDiv);
- bufferRadiusInput.id = 'bufferRadiusInput';
- bufferRadiusInput.value = '10';
- bufferRadiusInput.setAttribute('placeholder', Lang.i18n('text_label_defaultkilometers'));
- var bufferUnit = external_L_default().DomUtil.create('div', 'component-clientcomputation__buffer--unit', bufferRadiusDiv);
- bufferUnit.id = 'bufferUnit'; // 半径单位选择下拉框
- var bufferUnitOptions = {
- 'optionsArr': [Lang.i18n('text_option_kilometer')],
- 'labelName': Lang.i18n('text_label_unit')
- };
- var bufferUnitSelectTool = new Select(bufferUnitOptions).getElement();
- var bufferUnitSelectName = bufferUnitSelectTool.children[1].children[0];
- bufferUnitSelectName.id = 'bufferUnitSelectName';
- var bufferUnitSelect = bufferUnitSelectTool.children[1].children[2].children[0].children[0];
- bufferUnitSelect.id = 'bufferUnitSelect';
- bufferUnitSelectTool.children[0].style.display = 'none';
- bufferUnit.appendChild(bufferUnitSelectTool); // 保留原对象字段属性
- var saveFieldDiv = external_L_default().DomUtil.create('div', '', bufferRadius);
- var saveAttrsContainer = external_L_default().DomUtil.create('div', 'component-clientcomputation__buffer--issaveattrs', saveFieldDiv);
- saveAttrsContainer.id = 'saveAttrsContainer';
- var saveAttrsCheckbox = external_L_default().DomUtil.create('div', 'checkbox checkbox-fault', saveAttrsContainer);
- saveAttrsCheckbox.id = 'saveAttrsCheckbox';
- var saveAttrsLabel = external_L_default().DomUtil.create('div', 'lable', saveAttrsContainer);
- saveAttrsLabel.id = 'saveAttrsLabel';
- saveAttrsLabel.innerHTML = Lang.i18n('text_retainOriginal'); // 合并缓冲区
- var isUnionContainer = external_L_default().DomUtil.create('div', 'component-clientcomputation__buffer--isunion', saveFieldDiv);
- isUnionContainer.id = 'isUnionContainer';
- var isUnionCheckbox = external_L_default().DomUtil.create('div', 'checkbox checkbox-fault', isUnionContainer);
- isUnionCheckbox.id = 'isUnionCheckbox';
- var isUnionLabel = external_L_default().DomUtil.create('div', 'lable', isUnionContainer);
- isUnionLabel.innerHTML = Lang.i18n('text_mergeBuffer');
- isUnionLabel.id = 'isUnionLabel'; // 结果图层
- var resultLayerDiv = external_L_default().DomUtil.create('div', 'component-analysis__container__resultLayersName', analysisTypeContainer);
- var resultLayerSpan = external_L_default().DomUtil.create('span', '', resultLayerDiv);
- resultLayerSpan.innerHTML = Lang.i18n('text_label_resultLayerName');
- var resultLayersName = external_L_default().DomUtil.create('input', '', resultLayerDiv);
- resultLayersName.id = 'resultLayersName'; // 分析按钮
- var runBtnContainer = external_L_default().DomUtil.create('div', 'component-analysis__container__analysisbtn', analysisTypeContainer);
- var runBtn = external_L_default().DomUtil.create('div', 'component-analysis__analysisbtn', runBtnContainer);
- var analysisBtn = external_L_default().DomUtil.create('button', 'component-analysis__analysisbtn--analysis', runBtn);
- analysisBtn.innerHTML = Lang.i18n('btn_analyze');
- var analysingContainer = external_L_default().DomUtil.create('div', 'component-analysis__analysisbtn--analysing-container hidden', runBtn);
- var analysisingBtn = external_L_default().DomUtil.create('div', 'component-analysis__analysisbtn--analysising', analysingContainer);
- var svgContainer = external_L_default().DomUtil.create('div', 'component-analysis__svg-container', analysisingBtn);
- svgContainer.id = 'analyse_background';
- svgContainer.innerHTML = "<svg class=\"component-analysis__svg-rotate\" width=\"16px\" height=\"16px\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <path id=\"ring\" fill=\"#FFF\" transform=\"translate(8,8)\" d=\"M 0 0 v -8 A 8 8 0 1 1 -8.00 0 z\"></path>\n <circle cx=\"8\" cy=\"8\" r=\"6\" fill=\"#38ADF5\"></circle>\n <rect class=\"svg-top\" x=\"8\" y=\"0\" rx=\"2\" ry=\"2\" width=\"2\" height=\"2\" style=\"fill: rgb(255, 255, 255); stroke-width: 0;\"></rect>\n <rect class=\"svg-left\" x=\"0\" y=\"8\" rx=\"2\" ry=\"2\" width=\"2\" height=\"2\" style=\"fill: rgb(255, 255, 255); stroke-width: 0;\"></rect>\n </svg>";
- external_L_default().DomUtil.create('span', '', analysisingBtn).innerHTML = Lang.i18n('btn_analyzing');
- var analysisCancelBtn = external_L_default().DomUtil.create('button', 'component-analysis__analysisbtn--cancel', analysingContainer);
- analysisCancelBtn.innerHTML = Lang.i18n('btn_cancelAnalysis');
- var deleteLayersBtn = external_L_default().DomUtil.create('button', 'component-analysis__analysisbtn--analysis component-analysis__analysisbtn--deletelayers', runBtn);
- deleteLayersBtn.innerHTML = Lang.i18n('btn_emptyTheAnalysisLayer');
- var _loop = function _loop(i) {
- // 点击何种分析类型 判断使用图层数据
- dropDownItems.children[i].onclick = function () {
- dropDownTopContainer.innerHTML = dropDownItems.children[i].outerHTML;
- dropDownTopContainer.children[0].id = 'dropDownTop';
- var layersSelect = document.getElementById('layersSelect');
- var layerSelectName = document.getElementById('layerSelectName');
- var analysisMethod = dropDownItems.children[i].getAttribute('data-value');
- var currentFillData = {};
- switch (analysisMethod) {
- case 'buffer':
- isolineDiv.classList.add('hidden');
- bufferDiv.classList.remove('hidden');
- componentContentContainer.style.height = '422px';
- resultLayersName.value = Lang.i18n('text_label_buffer') + layerSelectName.title;
- currentFillData = _this.fillData['point'];
- break;
- case 'isolines':
- isolineDiv.classList.remove('hidden');
- bufferDiv.classList.add('hidden');
- componentContentContainer.style.height = '712px';
- resultLayersName.value = Lang.i18n('text_label_isolines') + layerSelectName.title;
- currentFillData = _this.fillData['point'];
- break;
- } // 清空 layersSelect;
- // 清空 layersSelect;
- if (_this.currentFillData === currentFillData) {
- return;
- }
- layersSelect.innerHTML = '';
- if (JSON.stringify(currentFillData) == '{}') {
- resultLayersName.value = '';
- layerSelectName.title = '';
- layerSelectName.innerHTML = '';
- return;
- }
- var layserArr = [];
- for (var layerName in currentFillData) {
- layserArr.push(layerName);
- }
- layerSelectName.title = layserArr[0];
- layerSelectName.innerHTML = layserArr[0];
- _this._createOptions(layersSelect, layserArr); // 设置 layer select option 点击事件
- _this.layerSelectObj.optionClickEvent(layersSelect, layerSelectName, _this.layersSelectOnchange);
- if (analysisMethod === 'buffer') {
- resultLayersName.value = Lang.i18n('text_label_buffer') + layserArr[0];
- } else if (analysisMethod === 'isolines') {
- resultLayersName.value = Lang.i18n('text_label_isolines') + layserArr[0];
- } // 当前选中图层数据
- _this.currentData = currentFillData[layerSelectName.title];
- _this.currentFillData = currentFillData;
- };
- };
- for (var i = 0; i < dropDownItems.children.length; i++) {
- _loop(i);
- } // 字段下拉框 onchange 事件
- this.fieldsSelectOnchange = fieldsSelectOnchange.bind(this);
- function fieldsSelectOnchange(option) {
- if (this.currentData) {
- var displayData = this.currentData;
- var _fieldsSelectName = option.title;
- getValueTextArea.value = displayData.fieldsValue[_fieldsSelectName].toString().replace(/,/g, ",\r\n");
- getValueTextArea.setAttribute('data-value', displayData.fieldsValue[_fieldsSelectName]);
- }
- } // 选中图层实时改变事件
- this.layersSelectOnchange = layersSelectOnchange.bind(this);
- function layersSelectOnchange(option) {
- if (this.currentData) {
- var _layerSelectName = option.title;
- var displayData = this.currentFillData[_layerSelectName];
- this.currentData = displayData;
- fieldsSelect.innerHTML = '';
- this._createOptions(fieldsSelect, displayData.fields);
- var fieldsSelectNameDiv = document.getElementById('fieldsSelectName');
- var field = displayData.fields[0];
- fieldsSelectNameDiv.title = field;
- fieldsSelectNameDiv.innerHTML = field;
- var _fieldsSelectName2 = field;
- this.fieldsSelectObj.optionClickEvent(fieldsSelect, fieldsSelectNameDiv, this.fieldsSelectOnchange);
- getValueTextArea.value = displayData.fieldsValue[_fieldsSelectName2].toString().replace(/,/g, ",\r\n");
- getValueTextArea.setAttribute('data-value', displayData.fieldsValue[_fieldsSelectName2]);
- var analysisMethod = document.getElementById('dropDownTop').getAttribute('data-value');
- switch (analysisMethod) {
- case 'buffer':
- resultLayersName.value = Lang.i18n('text_label_buffer') + _layerSelectName;
- break;
- case 'isolines':
- resultLayersName.value = Lang.i18n('text_label_isolines') + _layerSelectName;
- break;
- }
- }
- } //复选框事件
- var isSaveStatus = true; //合并缓冲区
- //合并缓冲区,默认不选中,即为false
- var isUnion = false; //选中select
- saveAttrsLabel.classList.add("selected");
- saveAttrsCheckbox.classList.add("checkbox-active");
- saveAttrsContainer.onclick = function () {
- if (isSaveStatus) {
- //将当前状态和样式->不选中的样式和状态
- saveAttrsCheckbox.classList.add("checkbox-fault");
- saveAttrsCheckbox.classList.remove("checkbox-active");
- saveAttrsLabel.classList.remove("selected");
- isSaveStatus = false;
- } else {
- //将当前样式和状态改为选中
- saveAttrsCheckbox.classList.add("checkbox-active");
- saveAttrsCheckbox.classList.remove("checkbox-fault");
- saveAttrsLabel.classList.add("selected");
- isSaveStatus = true; //如果当前状态为选中的状态,则将上一个复选框的样式和状态由选中-不选中
- if (isUnion) {
- //移除dom样式和复选框的状态改变
- isUnionCheckbox.classList.add("checkbox-fault");
- isUnionCheckbox.classList.remove("checkbox-active");
- isUnion = false;
- }
- }
- };
- isUnionContainer.onclick = function () {
- if (isUnion) {
- //将选中状态 由选中->不选中,修改其样式和状态
- isUnionCheckbox.classList.add("checkbox-fault");
- isUnionCheckbox.classList.remove("checkbox-active");
- isUnionLabel.classList.remove("selected");
- isUnion = false;
- } else {
- //将状态由不选中->选中,修改其样式和状态
- isUnionCheckbox.classList.add("checkbox-active");
- isUnionCheckbox.classList.remove("checkbox-fault");
- isUnionLabel.classList.add("selected");
- isUnion = true; //如果当前状态为选中的,将上一个复选框改为不选中的状态
- if (isSaveStatus) {
- //修改当前样式和状态
- saveAttrsCheckbox.classList.add("checkbox-fault");
- saveAttrsCheckbox.classList.remove("checkbox-active");
- isSaveStatus = false;
- }
- }
- }; // 提示框
- this.messageBox = new MessageBox(); // 分析按钮点击事件
- analysisBtn.onclick = function () {
- analysingContainer.style.display = 'block';
- analysisBtn.style.display = 'none';
- var dropDownTop = document.getElementById('dropDownTop');
- var analysisMethod = dropDownTop.getAttribute('data-value');
- var params;
- switch (analysisMethod) {
- case 'isolines':
- params = getIsolinesAnalysisParams();
- break;
- case 'buffer':
- params = getBufferAnalysisParams();
- break;
- }
- _this.viewModel.analysis(params, _this.map);
- _this.viewModel.on('layerloaded', function (e) {
- analysingContainer.style.display = 'none';
- analysisBtn.style.display = 'block';
- /**
- * @event L.supermap.components.clientComputation#analysissucceeded
- * @description 分析完成之后触发。
- * @property {L.GeoJSON} layer - 加载完成后的结果图层。
- * @property {string} name - 加载完成后的结果图层名称。
- */
- _this._event.fire('analysissucceeded', {
- "layer": e.layer,
- "name": e.name
- });
- }); // 若分析的结果为空
- _this.viewModel.on('analysisfailed', function () {
- analysingContainer.style.display = 'none';
- analysisBtn.style.display = 'block';
- _this.messageBox.showView(Lang.i18n('msg_resultIsEmpty'), "failure");
- /**
- * @event L.supermap.components.clientComputation#analysisfailed
- * @description 分析失败之后触发。
- */
- _this._event.fire('analysisfailed');
- });
- }; // 取消按钮点击事件
- analysisCancelBtn.onclick = function () {
- analysingContainer.style.display = 'none';
- analysisBtn.style.display = 'block';
- _this.viewModel.cancelAnalysis();
- }; // 删除按钮点击事件
- deleteLayersBtn.onclick = function () {
- /**
- * @event L.supermap.components.clientComputation#layersremoved
- * @description 结果图层删除后触发。
- * @property {Array.<L.GeoJSON>} layers - 被删除的结果图层。
- */
- _this.viewModel.on('layersremoved', function (e) {
- _this._event.fire('layersremoved', {
- 'layers': e.layers
- });
- });
- _this.viewModel.clearLayers();
- }; // 获取分析数据
- function getIsolinesAnalysisParams() {
- var dropDownTop = document.getElementById('dropDownTop');
- var analysisMethod = dropDownTop.getAttribute('data-value');
- var resultLayersName = document.getElementById('resultLayersName').value;
- var analysisLayers = layerSelectName.title;
- var analysisFields = fieldsSelectName.title;
- var analysisFieldsValue = getValueTextArea.value.replace(/[\r\n]/g, "").split(',').toString();
- var analysisBreaks = breaks.value;
- var analysisCellSize = cellSize.value;
- var param = {
- 'analysisMethod': analysisMethod,
- 'analysisLayers': analysisLayers,
- 'analysisFields': analysisFields,
- 'analysisFieldsValue': analysisFieldsValue,
- 'analysisBreaks': analysisBreaks,
- 'analysisCellSize': analysisCellSize,
- 'resultLayersName': resultLayersName
- };
- return param;
- }
- function getBufferAnalysisParams() {
- var dropDownTop = document.getElementById('dropDownTop');
- var resultLayersName = document.getElementById('resultLayersName').value;
- var analysisLayers = layerSelectName.title;
- var analysisMethod = dropDownTop.getAttribute('data-value');
- var radius = bufferRadiusInput.value;
- var unit = bufferUnitSelectName.title;
- var param = {
- 'analysisMethod': analysisMethod,
- 'analysisLayers': analysisLayers,
- 'radius': radius,
- 'unit': unit,
- 'resultLayersName': resultLayersName,
- 'isSaveStatus': isSaveStatus,
- 'isUnion': isUnion
- };
- return param;
- } // 阻止 map 默认事件
- this._preventMapEvent(container, this.map);
- return container;
- },
- /**
- * @function L.supermap.components.clientComputation.prototype._createOptions
- * @description 创建 select 下拉框的 options。
- * @private
- */
- _createOptions: function _createOptions(container, optionsArr) {
- for (var i in optionsArr) {
- var option = document.createElement('div');
- var optData = optionsArr[i];
- option.className = 'component-selecttool__option';
- option.title = optData;
- option.innerHTML = optData;
- option.setAttribute('data-value', optData);
- container.appendChild(option);
- }
- }
- });
- var clientComputationView = function clientComputationView(options) {
- return new ClientComputationView(options);
- };
- (external_L_default()).supermap.components.clientComputation = clientComputationView;
- ;// CONCATENATED MODULE: ./src/leaflet/components/clientcomputation/ClientComputationLayer.js
- function ClientComputationLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.components.clientComputationLayer
- * @classdesc 客户端计算图层对象。
- * @version 9.1.1
- * @param {Object} layerObject - 图层对象。
- * @param {string} layerObject.layerName - 图层名。
- * @param {L.GeoJSON} layerObject.layer - 图层。
- * @param {Array.<string>} [layerObject.fields] - 字段数组。
- * @category Components ClientComputation
- */
- var ClientComputationLayer = function ClientComputationLayer(layerObject) {
- ClientComputationLayer_classCallCheck(this, ClientComputationLayer);
- this.layerName = layerObject.layerName;
- this.layer = layerObject.layer;
- this.fields = layerObject.fields || null;
- };
- var clientComputationLayer = function clientComputationLayer(layerObject) {
- return new ClientComputationLayer(layerObject);
- };
- (external_L_default()).supermap.components.clientComputationLayer = clientComputationLayer;
- ;// CONCATENATED MODULE: ./src/leaflet/components/distributedanalysis/DistributedAnalysisModel.js
- function DistributedAnalysisModel_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { DistributedAnalysisModel_typeof = function _typeof(obj) { return typeof obj; }; } else { DistributedAnalysisModel_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return DistributedAnalysisModel_typeof(obj); }
- function DistributedAnalysisModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function DistributedAnalysisModel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function DistributedAnalysisModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) DistributedAnalysisModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) DistributedAnalysisModel_defineProperties(Constructor, staticProps); return Constructor; }
- function DistributedAnalysisModel_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) DistributedAnalysisModel_setPrototypeOf(subClass, superClass); }
- function DistributedAnalysisModel_setPrototypeOf(o, p) { DistributedAnalysisModel_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DistributedAnalysisModel_setPrototypeOf(o, p); }
- function DistributedAnalysisModel_createSuper(Derived) { var hasNativeReflectConstruct = DistributedAnalysisModel_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DistributedAnalysisModel_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DistributedAnalysisModel_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DistributedAnalysisModel_possibleConstructorReturn(this, result); }; }
- function DistributedAnalysisModel_possibleConstructorReturn(self, call) { if (call && (DistributedAnalysisModel_typeof(call) === "object" || typeof call === "function")) { return call; } return DistributedAnalysisModel_assertThisInitialized(self); }
- function DistributedAnalysisModel_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- function DistributedAnalysisModel_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; } }
- function DistributedAnalysisModel_getPrototypeOf(o) { DistributedAnalysisModel_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DistributedAnalysisModel_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.components.DistributedAnalysisModel
- * @classdesc 分布式分析组件数据模型。
- * @private
- * @category Components DistributedAnalysis
- * @param {string} processingUrl - 分布式分析地址。
- * @fires L.supermap.components.DistributedAnalysisModel#datasetsloaded
- * @fires L.supermap.components.DistributedAnalysisModel#datasetinfoloaded
- * @extends {L.Evented}
- */
- var DistributedAnalysisModel = /*#__PURE__*/function (_L$Evented) {
- DistributedAnalysisModel_inherits(DistributedAnalysisModel, _L$Evented);
- var _super = DistributedAnalysisModel_createSuper(DistributedAnalysisModel);
- function DistributedAnalysisModel() {
- DistributedAnalysisModel_classCallCheck(this, DistributedAnalysisModel);
- return _super.apply(this, arguments);
- }
- DistributedAnalysisModel_createClass(DistributedAnalysisModel, [{
- key: "initialize",
- value: function initialize(processingUrl) {
- this.processingUrl = processingUrl;
- }
- /**
- * @function L.supermap.components.DistributedAnalysisModel.prototype.getDatasetsName
- * @description 获取所有可进行分布式分析的数据集。
- * @param {string} url - 分布式分析服务地址。
- */
- }, {
- key: "getDatasetsName",
- value: function getDatasetsName() {
- var url = this.processingUrl;
- this.dataset = [];
- this.dataset['datasetNames'] = [];
- this.dataset['childUrl'] = [];
- var host = 'http://' + url.split('/')[2];
- var sharefileUrl = host + '/iserver/services/datacatalog/rest/datacatalog/sharefile.json';
- var datasetsUrl = host + '/iserver/services/datacatalog/rest/datacatalog/relationship/datasets.json';
- var me = this;
- FetchRequest.get(sharefileUrl).then(function (response) {
- return response.json();
- }).then(function (result) {
- me.dataset['datasetNames'] = me.dataset['datasetNames'].concat(result.datasetNames);
- me.dataset['childUrl'] = me.dataset['childUrl'].concat(result.childUriList);
- var _me = me;
- FetchRequest.get(datasetsUrl).then(function (response) {
- return response.json();
- }).then(function (result) {
- _me.dataset['datasetNames'] = _me.dataset['datasetNames'].concat(result.datasetNames);
- _me.dataset['childUrl'] = _me.dataset['childUrl'].concat(result.childUriList);
- var datasetHash = [];
- for (var i in _me.dataset['datasetNames']) {
- datasetHash[_me.dataset.datasetNames[i]] = _me.dataset.childUrl[i];
- }
- /**
- * @event L.supermap.components.DistributedAnalysisModel#datasetsloaded
- * @description 数据集获取完成之后触发。
- * @property {Object} result - 数据集数据。
- * @property {Array.<string>} result.dataset - 数据集名称数组。
- * @property {Object} result.datasetHash - 数据集名称数组与数据集 URL 一一对应的对象。
- */
- _me.fire('datasetsloaded', {
- 'result': {
- 'dataset': _me.dataset,
- 'datasetHash': datasetHash
- }
- });
- });
- });
- }
- /**
- * @function L.supermap.components.DistributedAnalysisModel.prototype.getDatasetInfo
- * @description 获得数据集类型与 fields。
- * @param {string} datasetUrl - 数据集资源地址。
- */
- }, {
- key: "getDatasetInfo",
- value: function getDatasetInfo(datasetUrl) {
- var type;
- var me = this;
- FetchRequest.get(datasetUrl).then(function (response) {
- return response.json();
- }).then(function (data) {
- var datasetInfo = data.datasetInfo;
- if (datasetInfo.datasetType === 'LINE' || datasetInfo.type === 'LINE') {
- type = 'LINE';
- } else if (datasetInfo.datasetType === 'POINT' || datasetInfo.type === 'POINT' || datasetInfo.type === 'CSV') {
- type = 'POINT';
- } else if (datasetInfo.datasetType === 'REGION' || datasetInfo.type === 'REGION') {
- type = 'REGION';
- }
- var fields = [];
- var fieldInfos = datasetInfo.fieldInfos || datasetInfo.fieldInfo || null;
- if (fieldInfos) {
- for (var i in fieldInfos) {
- fields.push(fieldInfos[i].name);
- }
- /**
- * @event L.supermap.components.DistributedAnalysisModel#datasetinfoloaded
- * @description 数据集查询完成之后触发。
- * @property {Object} result - 数据集数据。
- * @property {string} result.type - 数据集类型。
- * @property {Array.<string>} result.fields - 数据集字段。
- */
- me.fire('datasetinfoloaded', {
- 'result': {
- 'type': type,
- 'fields': fields
- }
- });
- } else {
- var fieldsUrl = data.childUriList[0].replace('//fields', '/fields');
- FetchRequest.get(fieldsUrl).then(function (response) {
- return response.json();
- }).then(function (data) {
- var fieldNames = data.fieldNames;
- var fields = [];
- for (var _i in fieldNames) {
- fields.push(fieldNames[_i]);
- }
- me.fire('datasetinfoloaded', {
- 'result': {
- 'type': type,
- 'fields': fields
- }
- });
- });
- }
- });
- }
- }]);
- return DistributedAnalysisModel;
- }((external_L_default()).Evented);
- (external_L_default()).supermap.components.DistributedAnalysisModel = DistributedAnalysisModel;
- ;// CONCATENATED MODULE: ./src/leaflet/components/distributedanalysis/DistributedAnalysisViewModel.js
- function DistributedAnalysisViewModel_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { DistributedAnalysisViewModel_typeof = function _typeof(obj) { return typeof obj; }; } else { DistributedAnalysisViewModel_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return DistributedAnalysisViewModel_typeof(obj); }
- function DistributedAnalysisViewModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function DistributedAnalysisViewModel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function DistributedAnalysisViewModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) DistributedAnalysisViewModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) DistributedAnalysisViewModel_defineProperties(Constructor, staticProps); return Constructor; }
- function DistributedAnalysisViewModel_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) DistributedAnalysisViewModel_setPrototypeOf(subClass, superClass); }
- function DistributedAnalysisViewModel_setPrototypeOf(o, p) { DistributedAnalysisViewModel_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DistributedAnalysisViewModel_setPrototypeOf(o, p); }
- function DistributedAnalysisViewModel_createSuper(Derived) { var hasNativeReflectConstruct = DistributedAnalysisViewModel_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DistributedAnalysisViewModel_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DistributedAnalysisViewModel_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DistributedAnalysisViewModel_possibleConstructorReturn(this, result); }; }
- function DistributedAnalysisViewModel_possibleConstructorReturn(self, call) { if (call && (DistributedAnalysisViewModel_typeof(call) === "object" || typeof call === "function")) { return call; } return DistributedAnalysisViewModel_assertThisInitialized(self); }
- function DistributedAnalysisViewModel_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- function DistributedAnalysisViewModel_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; } }
- function DistributedAnalysisViewModel_getPrototypeOf(o) { DistributedAnalysisViewModel_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DistributedAnalysisViewModel_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.components.distributedAnalysisViewModel
- * @classdesc 分布式分析组件功能类。
- * @version 9.1.1
- * @category Components DistributedAnalysis
- * @param {string} processingUrl - 分布式分析地址。
- * @fires L.supermap.components.distributedAnalysisViewModel#datasetsloaded
- * @fires L.supermap.components.distributedAnalysisViewModel#datasetinfoloaded
- * @fires L.supermap.components.distributedAnalysisViewModel#analysisfailed
- * @fires L.supermap.components.distributedAnalysisViewModel#analysissucceeded
- * @fires L.supermap.components.distributedAnalysisViewModel#layerloaded
- * @fires L.supermap.components.distributedAnalysisViewModel#layersremoved
- * @extends {L.Evented}
- */
- var DistributedAnalysisViewModel = /*#__PURE__*/function (_L$Evented) {
- DistributedAnalysisViewModel_inherits(DistributedAnalysisViewModel, _L$Evented);
- var _super = DistributedAnalysisViewModel_createSuper(DistributedAnalysisViewModel);
- function DistributedAnalysisViewModel() {
- DistributedAnalysisViewModel_classCallCheck(this, DistributedAnalysisViewModel);
- return _super.apply(this, arguments);
- }
- DistributedAnalysisViewModel_createClass(DistributedAnalysisViewModel, [{
- key: "initialize",
- value: function initialize(processingUrl) {
- this.processingUrl = processingUrl;
- }
- /**
- * @function L.supermap.components.distributedAnalysisViewModel.prototype.getDatasetsName
- * @description 获取所有数据集名称。
- * @param {string} url - 分布式分析服务地址。
- */
- }, {
- key: "getDatasetsName",
- value: function getDatasetsName() {
- var processingUrl = this.processingUrl;
- this.resultLayers = [];
- this.datasetNames = [];
- this.distributedAnalysisModel = new DistributedAnalysisModel(processingUrl);
- this.distributedAnalysisModel.getDatasetsName();
- var me = this;
- this.distributedAnalysisModel.on('datasetsloaded', function (e) {
- /**
- * @event L.supermap.components.distributedAnalysisViewModel#datasetsloaded
- * @description 数据集获取完成之后触发。
- * @property {Object} result - 数据集数据。
- */
- me.fire('datasetsloaded', {
- 'result': e.result
- });
- });
- }
- /**
- * @function L.supermap.components.distributedAnalysisViewModel.prototype.getDatasetInfo
- * @description 获得数据集类型与 fields。
- * @param {string} datasetUrl - 数据集资源地址。
- */
- }, {
- key: "getDatasetInfo",
- value: function getDatasetInfo(datasetUrl) {
- // 判断数据集类型
- this.distributedAnalysisModel.getDatasetInfo(datasetUrl);
- var me = this;
- this.distributedAnalysisModel.on('datasetinfoloaded', function (e) {
- var type = e.result.type;
- var fields = e.result.fields;
- /**
- * @event L.supermap.components.distributedAnalysisViewModel#datasetinfoloaded
- * @description 数据集类型与字段获取完成之后触发。
- * @property {Object} result - 数据集数据。
- * @property {string} result.type - 数据集类型。
- * @property {Array.<string>} result.fields - 数据集所含有的字段。
- */
- me.fire('datasetinfoloaded', {
- 'result': {
- 'type': type,
- 'fields': fields
- }
- });
- });
- }
- /**
- * @function L.supermap.components.distributedAnalysisViewModel.prototype.analysis
- * @description 进行分布式分析。
- * @param {Object.<SuperMap.KernelDensityJobParameter|string>} params - 参数。
- * @param {SuperMap.KernelDensityJobParameter} params.analysisParam - 分布式分析参数。
- * @param {string} [params.resultLayerName] - 结果图层名称。
- * @param {L.Map} map - leaflet Map 对象。
- */
- }, {
- key: "analysis",
- value: function analysis(params, map) {
- var processingService = new ProcessingService(this.processingUrl);
- if (params.analysisParam instanceof KernelDensityJobParameter) {
- var kernelDensityJobParameter = params.analysisParam;
- var me = this;
- processingService.addKernelDensityJob(kernelDensityJobParameter, function (serviceResult) {
- if (serviceResult.error) {
- /**
- * @event L.supermap.components.distributedAnalysisViewModel#analysisfailed
- * @description 分析失败后触发。
- */
- me.fire('analysisfailed', {
- 'error': serviceResult.error
- });
- return;
- }
- serviceResult.result.setting.serviceInfo.targetServiceInfos.map(function (info) {
- if (info.serviceType === 'RESTMAP') {
- FetchRequest.get(info.serviceAddress + '/maps').then(function (response) {
- return response.json();
- }).then(function (result) {
- var mapUrl = result[0].path;
- /**
- * @event L.supermap.components.distributedAnalysisViewModel#analysissucceeded
- * @description 分析成功后服务器返回的数据。
- */
- me.fire('analysissucceed', {
- 'result': result
- });
- var layer = external_L_default().supermap.tiledMapLayer(mapUrl, {
- noWrap: true,
- transparent: true
- });
- me.resultLayers.push(layer);
- layer.addTo(map);
- /**
- * @event L.supermap.components.distributedAnalysisViewModel#layerloaded
- * @description 分析结果图层加载完成后触发。
- * @property {L.GeoJSON} layer - 结果图层。
- * @property {string} name - 结果图层名称。
- */
- var date = new Date();
- var resultLayerName = params.resultLayerName || date.getTime();
- me.fire('layerloaded', {
- 'layer': layer,
- 'name': resultLayerName
- });
- });
- }
- return info;
- });
- });
- }
- }
- /**
- * @function L.supermap.components.distributedAnalysisViewModel.prototype.clearLayers
- * @description 清空分析图层。
- */
- }, {
- key: "clearLayers",
- value: function clearLayers() {
- for (var i in this.resultLayers) {
- this.resultLayers[i].remove();
- }
- /**
- * @event L.supermap.components.distributedAnalysisViewModel#layersremoved
- * @description 图层删除后触发。
- * @property {Array.<L.GeoJSON>} layers - 结果图层数组。
- */
- this.fire('layersremoved', {
- 'layers': this.resultLayers
- });
- this.resultLayers = [];
- }
- }]);
- return DistributedAnalysisViewModel;
- }((external_L_default()).Evented);
- var distributedAnalysisViewModel = function distributedAnalysisViewModel(options) {
- return new DistributedAnalysisViewModel(options);
- };
- (external_L_default()).supermap.components.distributedAnalysisViewModel = distributedAnalysisViewModel;
- ;// CONCATENATED MODULE: ./src/leaflet/components/distributedanalysis/DistributedAnalysisView.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.components.distributedAnalysis
- * @classdesc 分布式分析组件。
- * @version 9.1.1
- * @param {string} processingUrl - 分布式分析服务地址。
- * @param {Object} options - 可选参数。
- * @param {string} [options.position='topright'] - 组件在地图中显示的位置,包括:'topleft','topright','bottomleft' 和 'bottomright',继承自 leaflet control。
- * @param {function} [options.style] - 设置图层点线面默认样式,点样式返回 maker 或者 circleMaker;线和面返回 L.path 样式。
- * @param {function} [options.onEachFeature] - 在创建和设置样式后,将为每个创建的要素调用一次的函数。用于将事件和弹出窗口附加到要素。默认情况下,对新创建的图层不执行任何操作。
- * @fires L.supermap.components.distributedAnalysis#analysissucceeded
- * @fires L.supermap.components.distributedAnalysis#analysisfailed
- * @fires L.supermap.components.distributedAnalysis#layersremoved
- * @extends {L.supermap.components.componentsViewBase}
- * @category Components DistributedAnalysis
- */
- var DistributedAnalysisView = ComponentsViewBase.extend({
- initialize: function initialize(processingUrl, options) {
- ComponentsViewBase.prototype.initialize.apply(this, [options]); //初始化 ViewModel:
- this.viewModel = new DistributedAnalysisViewModel(processingUrl);
- },
- /**
- * @function L.supermap.components.distributedAnalysis.prototype.onAdd
- * @description 添加控件。
- * @private
- * @override
- */
- onAdd: function onAdd(map) {
- this._fillDataToView();
- return ComponentsViewBase.prototype.onAdd.apply(this, [map]);
- },
- /**
- * @function L.supermap.components.distributedAnalysis.prototype._fillDataToView
- * @description 填充数据到 view。
- * @private
- */
- _fillDataToView: function _fillDataToView() {
- var _this = this;
- // 获取数据集
- this.viewModel.on('datasetsloaded', function (e) {
- var datasetOptionsArr = e.result.dataset.datasetNames;
- _this.datasetSelect.innerHTML = '';
- _this._createOptions(_this.datasetSelect, datasetOptionsArr);
- _this.datasetSelectObj.optionClickEvent(_this.datasetSelect, _this.datasetSelectName, _this.datasetSelectOnchange);
- _this.dataHash = e.result.datasetHash;
- });
- this.viewModel.getDatasetsName();
- },
- /**
- * @function L.supermap.components.distributedAnalysis.prototype._initView
- * @description 创建分布式分析组件。
- * @returns {HTMLElement}
- * @private
- * @override
- */
- _initView: function _initView() {
- var _this2 = this;
- // 组件 container
- var container = new CommonContainer({
- title: Lang.i18n('title_distributedAnalysis')
- }).getElement();
- container.classList.add('component-analysis');
- container.children[0].style.fontSize = '12px'; // 组件内容 container
- var componentContentContainer = external_L_default().DomUtil.create('div', 'component-content component-content--scroll component-content--analysis', container); // 分析方式下拉框
- var analysisOptionsArr = [{
- 'title': Lang.i18n('text_densityAnalysis'),
- 'dataValue': 'density',
- 'remark': Lang.i18n('text_CalculateTheValuePerUnitArea'),
- 'icon': {
- 'className': 'component-analyst-density-img'
- }
- }];
- var dropDownBox = new DropDownBox(analysisOptionsArr).getElement();
- componentContentContainer.appendChild(dropDownBox); // 选中的 dropDownItem
- var dropDownTop = dropDownBox.children[0].children[0].children[0]; // 各分析参数 container
- var analysisTypeContainer = external_L_default().DomUtil.create('div', 'component-analysis__container', componentContentContainer);
- var analysisType = external_L_default().DomUtil.create('div', 'analysistype', analysisTypeContainer);
- var analysisLayer = external_L_default().DomUtil.create('div', 'component-analysis__container__analysisLayer', analysisType); // 数据集下拉框
- var datasetSelectControl = external_L_default().DomUtil.create('div', 'component-analysis__selecttool', analysisLayer);
- var datasetOptions = {
- 'optionsArr': [Lang.i18n('text_option_selectDataset')],
- 'labelName': Lang.i18n('text_label_dataset'),
- "optionsClickCb": datasetSelectOnchange.bind(this)
- };
- var datasetSelectObj = new Select(datasetOptions);
- var datasetSelectTool = datasetSelectObj.getElement();
- this.datasetSelectObj = datasetSelectObj;
- datasetSelectControl.appendChild(datasetSelectTool); // 选中的 dataset
- var datasetSelectName = datasetSelectTool.children[1].children[0];
- this.datasetSelectName = datasetSelectName; // dataset select container
- var datasetSelect = datasetSelectTool.children[1].children[2].children[0].children[0];
- datasetSelect.children[0].style.display = 'none';
- this.datasetSelect = datasetSelect; // 分析方法下拉框 & 网格面类型下拉框
- var analyseIDW = external_L_default().DomUtil.create('div', 'component-analysis__idw', analysisLayer);
- var analysisOptions = [{
- 'optionsArr': [Lang.i18n('text_option_simplePointDensityAnalysis'), Lang.i18n('text_option_nuclearDensityAnalysis')],
- 'labelName': Lang.i18n('text_label_analyticalMethod') // 'optionsClickCb': analysisMethodSelectOnchange.bind(this)
- }, {
- 'optionsArr': [Lang.i18n('text_option_quadrilateral'), Lang.i18n('text_option_hexagon')],
- 'labelName': Lang.i18n('text_label_meshType')
- }]; // 分析参数 select control
- var analysisSelectControl = external_L_default().DomUtil.create('div', 'component-analysis__idw__selecttool', analyseIDW);
- for (var i in analysisOptions) {
- var selectTool = new Select(analysisOptions[i]).getElement();
- analysisSelectControl.appendChild(selectTool);
- } // 权重选择下拉框
- var weightFieldsSelectOptions = {
- 'optionsArr': [Lang.i18n('text_option_notSet')],
- 'labelName': Lang.i18n('text_label_weightField')
- };
- var weightFieldsSelectObj = new Select(weightFieldsSelectOptions);
- var weightFieldsSelectTool = weightFieldsSelectObj.getElement();
- analysisSelectControl.appendChild(weightFieldsSelectTool);
- this.weightFieldsSelectObj = weightFieldsSelectObj; // 分析方法选中值 & option attr设置
- var analysisMethodSelectName = analysisSelectControl.children[0].children[1].children[0];
- analysisMethodSelectName.setAttribute('data-value', '0');
- var analysisMethodSelect = analysisSelectControl.children[0].children[1].children[2].children[0].children[0];
- var analysisMethodDV = ['0', '1'];
- this._setEleAtribute(analysisMethodDV, 'data-value', analysisMethodSelect.children); // 网格面类型选中值 & option attr设置
- var gridTypeSelectName = analysisSelectControl.children[1].children[1].children[0];
- gridTypeSelectName.setAttribute('data-value', '0');
- var gridTypeSelect = analysisSelectControl.children[1].children[1].children[2].children[0].children[0];
- var gridTypeDV = ['0', '1'];
- this._setEleAtribute(gridTypeDV, 'data-value', gridTypeSelect.children); // 权重值选中值
- var weightFieldsSelectName = analysisSelectControl.children[2].children[1].children[0];
- var weightFieldsSelect = analysisSelectControl.children[2].children[1].children[2].children[0].children[0]; // 分析范围 & 网格大小 & 搜索半径 & 面积单位
- // 分析范围
- var inputOptions = [{
- 'spanName': Lang.i18n('text_label_queryRange'),
- 'value': ''
- }];
- for (var _i in inputOptions) {
- this._creatInputBox(inputOptions[_i], analysisSelectControl);
- }
- var queryRangeInput = analysisSelectControl.children[3].children[1];
- queryRangeInput.setAttribute('placeholder', Lang.i18n('text_label_queryRangeTips'));
- queryRangeInput.title = Lang.i18n('text_label_queryRangeTips'); // 网格大小
- var gridSizeUnitSelectOptions = {
- 'optionsArr': ['Meter', 'Kilometer', 'Yard', 'Foot', 'Mile']
- };
- var gridSizeOptions = {
- 'labelName': Lang.i18n('text_label_gridSizeInMeters'),
- 'selectOptions': gridSizeUnitSelectOptions
- };
- var gridSizeContainer = this._creatUnitSelectBox(gridSizeOptions, analysisSelectControl);
- var gridSizeInput = gridSizeContainer.children[1].children[0];
- gridSizeInput.value = '1000';
- var gridSizeUnitSelectName = gridSizeContainer.children[1].children[1].children[0].children[0].children[0]; // 搜索半径
- var searchRadiusUnitSelectOptions = {
- 'optionsArr': ['Meter', 'Kilometer', 'Yard', 'Foot', 'Mile']
- };
- var searchRadiusOptions = {
- 'labelName': Lang.i18n('text_label_searchRadius'),
- 'selectOptions': searchRadiusUnitSelectOptions
- };
- var searchRadiusContainer = this._creatUnitSelectBox(searchRadiusOptions, analysisSelectControl);
- var searchRadiusInput = searchRadiusContainer.children[1].children[0];
- searchRadiusInput.value = '300';
- var searchRadiusSelectName = searchRadiusContainer.children[1].children[1].children[0].children[0].children[0]; // 面积单位
- var areaUnitSelectOptions = {
- 'labelName': Lang.i18n('text_label_areaUnit'),
- 'optionsArr': ['SquareMile', 'SquareMeter', 'Hectare', 'Acre', 'SquareFoot', 'SquareYard']
- };
- var areaUnitSelectTool = new Select(areaUnitSelectOptions).getElement();
- analysisSelectControl.appendChild(areaUnitSelectTool);
- var areaUnitSelectName = areaUnitSelectTool.children[1].children[0]; // 专题图分段
- var rangeContent = external_L_default().DomUtil.create('div', 'range-content', analysisType);
- var rangeContentOptions = {
- 'optionsArr': [Lang.i18n('text_option_notSet'), Lang.i18n('text_option_equidistantSegmentation'), Lang.i18n('text_option_logarithm'), Lang.i18n('text_option_equalCountingSegment'), Lang.i18n('text_option_squareRootSegmentation')],
- 'labelName': Lang.i18n('text_label_thematicMapSegmentationMode'),
- "optionsClickCb": themeModelSelectOnchange
- };
- rangeContent.appendChild(new Select(rangeContentOptions).getElement());
- var themeModelSelectName = rangeContent.children[0].children[1].children[0];
- themeModelSelectName.setAttribute('data-value', 'NOTSET');
- var themeModelSelect = rangeContent.children[0].children[1].children[2].children[0].children[0];
- var themeModelDataValue = ['NOTSET', 'EQUALINTERVAL', 'LOGARITHM', 'QUANTILE', 'SQUAREROOT'];
- this._setEleAtribute(themeModelDataValue, 'data-value', themeModelSelect.children);
- var rangeContentParamInput = this._creatInputBox({
- 'spanName': Lang.i18n('text_label_thematicMapSegmentationParameters'),
- 'value': '20'
- }, rangeContent);
- rangeContentParamInput.classList.add('hidden');
- var rangeContentModelSelectTool = new Select({
- 'optionsArr': [Lang.i18n('text_option_greenOrangePurpleGradient'), Lang.i18n('text_option_greenOrangeRedGradient'), Lang.i18n('text_option_rainbowGradient'), Lang.i18n('text_option_spectralGradient'), Lang.i18n('text_option_terrainGradient')],
- 'labelName': Lang.i18n('text_label_thematicMapColorGradientMode')
- }).getElement();
- rangeContent.appendChild(rangeContentModelSelectTool);
- rangeContentModelSelectTool.classList.add('hidden');
- var rangeContentModelSelect = rangeContentModelSelectTool.children[1].children[2].children[0].children[0];
- var rangeContentModelSelectName = rangeContentModelSelectTool.children[1].children[0];
- rangeContentModelSelectName.setAttribute('data-value', 'GREENORANGEVIOLET');
- var rangeContentModelDV = ['GREENORANGEVIOLET', 'GREENORANGERED', 'RAINBOW', 'SPECTRUM', 'TERRAIN'];
- this._setEleAtribute(rangeContentModelDV, 'data-value', rangeContentModelSelect.children); // 专题图分段模式下拉框 onchange 事件
- function themeModelSelectOnchange(option) {
- if (option.getAttribute('data-value') !== 'NOTSET') {
- rangeContentParamInput.classList.remove('hidden');
- rangeContentModelSelectTool.classList.remove('hidden');
- } else {
- rangeContentParamInput.classList.add('hidden');
- rangeContentModelSelectTool.classList.add('hidden');
- }
- } // 结果图层
- var resultLayerContainer = external_L_default().DomUtil.create('div', '', analysisType);
- var resultLayerSpan = external_L_default().DomUtil.create('span', '', resultLayerContainer);
- resultLayerSpan.innerHTML = Lang.i18n('text_label_resultLayerName');
- var resultLayerInput = external_L_default().DomUtil.create('input', 'component-distributeanalysis__input', resultLayerContainer); // 分析 & 分析中 & 取消 按钮
- var runBtnContainer = external_L_default().DomUtil.create('div', 'component-analysis__container__analysisbtn', analysisTypeContainer);
- var runBtn = external_L_default().DomUtil.create('div', 'component-analysis__analysisbtn', runBtnContainer);
- var analysisBtn = external_L_default().DomUtil.create('button', 'component-analysis__analysisbtn--analysis', runBtn);
- analysisBtn.innerHTML = Lang.i18n('btn_analyze');
- var analysingContainer = external_L_default().DomUtil.create('div', 'component-analysis__analysisbtn--analysing-container hidden', runBtn);
- var analysisingBtn = external_L_default().DomUtil.create('div', 'component-analysis__analysisbtn--analysising', analysingContainer);
- analysisingBtn.style.width = '200px';
- var svgContainer = external_L_default().DomUtil.create('div', 'component-analysis__svg-container', analysisingBtn);
- svgContainer.innerHTML = "<svg class=\"component-analysis__svg-rotate\" width=\"16px\" height=\"16px\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <path id=\"ring\" fill=\"#FFF\" transform=\"translate(8,8)\" d=\"M 0 0 v -8 A 8 8 0 1 1 -8.00 0 z\"></path>\n <circle cx=\"8\" cy=\"8\" r=\"6\" fill=\"#38ADF5\"></circle>\n <rect class=\"svg-top\" x=\"8\" y=\"0\" rx=\"2\" ry=\"2\" width=\"2\" height=\"2\" style=\"fill: rgb(255, 255, 255); stroke-width: 0;\"></rect>\n <rect class=\"svg-left\" x=\"0\" y=\"8\" rx=\"2\" ry=\"2\" width=\"2\" height=\"2\" style=\"fill: rgb(255, 255, 255); stroke-width: 0;\"></rect>\n </svg>";
- external_L_default().DomUtil.create('span', '', analysisingBtn).innerHTML = Lang.i18n('btn_analyzing'); // 删除按钮
- var deleteLayersBtn = external_L_default().DomUtil.create('button', 'component-analysis__analysisbtn--analysis component-analysis__analysisbtn--deletelayers', runBtn);
- deleteLayersBtn.id = 'deleteLayersBtn';
- deleteLayersBtn.innerHTML = Lang.i18n('btn_emptyTheAnalysisLayer'); // 交互
- // 弹框
- this.messageBox = new MessageBox(); // 数据集下拉框 onchange 事件
- this.datasetSelectOnchange = datasetSelectOnchange.bind(this);
- function datasetSelectOnchange(option) {
- this.messageBox.closeView();
- if (this.dataHash) {
- weightFieldsSelect.innerHTML = ''; // 获取当前选中数据集类型
- var datasetUrl = this.dataHash[option.title]; // 判断当前选中数据集是否支持该选中分析类,并填充分析权重字段
- var _me = this;
- this.viewModel.on('datasetinfoloaded', function (e) {
- weightFieldsSelectName.title = Lang.i18n('text_option_notSet');
- weightFieldsSelectName.innerHTML = Lang.i18n('text_option_notSet');
- weightFieldsSelect.innerHTML = '';
- var analyseType = dropDownTop.getAttribute('data-value');
- var type = e.result.type;
- var fields = e.result.fields;
- if (analyseType === 'density') {
- if (type === 'REGION' || type === 'LINE') {
- _me.messageBox.showView(Lang.i18n('msg_datasetOrMethodUnsupport'), "failure");
- } else {
- _me.messageBox.closeView();
- _me._createOptions(weightFieldsSelect, fields);
- _me.weightFieldsSelectObj.optionClickEvent(weightFieldsSelect, weightFieldsSelectName);
- }
- }
- });
- this.viewModel.getDatasetInfo(datasetUrl);
- }
- } // 分析按钮点击事件
- analysisBtn.onclick = function () {
- _this2.messageBox.closeView();
- var params = getAnalysisParam();
- if (datasetSelectName.title === Lang.i18n('text_option_selectDataset')) {
- _this2.messageBox.showView(Lang.i18n('msg_selectDataset'), "failure");
- } else if (weightFieldsSelectName.title === Lang.i18n('text_option_notSet')) {
- _this2.messageBox.showView(Lang.i18n('msg_setTheWeightField'), "failure");
- } else {
- _this2.messageBox.closeView();
- analysingContainer.style.display = 'block';
- analysisBtn.style.display = 'none';
- _this2.viewModel.on('layerloaded', function (e) {
- analysingContainer.style.display = 'none';
- analysisBtn.style.display = 'block';
- /**
- * @event L.supermap.components.distributedAnalysis#analysissucceeded
- * @description 分析完成后触发。
- * @property {L.GeoJSON} layer - 结果图层。
- * @property {string} name - 结果图层名称。
- */
- _this2._event.fire('analysissucceeded', {
- 'layer': e.layer,
- 'name': e.name
- });
- });
- _this2.viewModel.on('analysisfailed', function (e) {
- _this2.messageBox.showView(Lang.i18n('msg_theFieldNotSupportAnalysis'), "failure");
- analysingContainer.style.display = 'none';
- analysisBtn.style.display = 'block';
- /**
- * @event L.supermap.components.distributedAnalysis#analysisfailed
- * @description 分析失败后触发。
- * @property {string} error - 服务器返回的错误。
- */
- _this2._event.fire('analysisfailed', {
- 'error': e.error
- });
- });
- _this2.viewModel.analysis(params, _this2.map);
- }
- }; // 删除按钮点击事件
- deleteLayersBtn.onclick = function () {
- /**
- * @event L.supermap.components.distributedAnalysis#layersremoved
- * @description 结果图层删除后触发。
- * @property {Array.<L.GeoJSON>} layers - 被删除的结果图层。
- */
- _this2.viewModel.on('layersremoved', function (e) {
- _this2._event.fire('layersremoved', {
- 'layers': e.layers
- });
- });
- _this2.viewModel.clearLayers();
- }; // 获取分析参数
- function getAnalysisParam() {
- var analysisType = dropDownTop.getAttribute('data-value');
- var analysisMethod = analysisMethodSelectName.getAttribute('data-value');
- var gridType = gridTypeSelectName.getAttribute('data-value');
- var queryRange = queryRangeInput.value;
- var gridSizeUnit = gridSizeUnitSelectName.title;
- var searchRadiusUnit = searchRadiusSelectName.title;
- var areaUnit = areaUnitSelectName.title;
- var colorGradientType = rangeContentModelSelectName.getAttribute('data-value');
- var themeModel = themeModelSelectName.getAttribute('data-value');
- var date = new Date();
- var resultLayerName = resultLayerInput.value || date.getTime();
- var mappingParameter;
- if (themeModel === 'NOTSET') {
- mappingParameter = '';
- } else {
- mappingParameter = {
- 'rangeMode': themeModel,
- 'rangeCount': rangeContentParamInput.value,
- 'colorGradientType': colorGradientType
- };
- }
- var analysisParam;
- if (analysisType === 'density') {
- analysisParam = new KernelDensityJobParameter({
- 'datasetName': datasetSelectName.title,
- 'method': analysisMethod,
- 'meshType': gridType,
- 'resolution': gridSizeInput.value,
- 'fields': weightFieldsSelectName.title,
- 'radius': searchRadiusInput.value,
- 'meshSizeUnit': gridSizeUnit,
- 'radiusUnit': searchRadiusUnit,
- 'areaUnit': areaUnit,
- 'query': queryRange,
- 'mappingParameters': new MappingParameters({
- 'rangeMode': mappingParameter.rangeMode,
- 'rangeCount': mappingParameter.rangeCount,
- 'colorGradientType': mappingParameter.colorGradientType
- })
- });
- }
- var params = {
- 'analysisParam': analysisParam,
- 'resultLayerName': resultLayerName
- };
- return params;
- } //阻止 map 默认事件
- this._preventMapEvent(container, this.map);
- return container;
- },
- /**
- * @function L.supermap.components.distributedAnalysis.prototype._createOptions
- * @description 创建下拉框 options。
- * @private
- */
- _createOptions: function _createOptions(container, optionsArr) {
- for (var i in optionsArr) {
- var option = document.createElement('div');
- option.className = 'component-selecttool__option';
- option.title = optionsArr[i];
- option.innerHTML = optionsArr[i];
- option.setAttribute('data-value', optionsArr[i]);
- container.appendChild(option);
- }
- },
- /**
- * @function L.supermap.components.distributedAnalysis.prototype._creatInputBox
- * @description 创建含有 span 的 input 框。
- * @private
- */
- _creatInputBox: function _creatInputBox(inputOptions, parentEle) {
- var div = external_L_default().DomUtil.create('div', '', parentEle);
- var span = external_L_default().DomUtil.create('span', '', div);
- span.innerHTML = inputOptions.spanName;
- var input = external_L_default().DomUtil.create('input', '', div);
- input.value = inputOptions.value;
- input.className = 'component-distributeanalysis__input';
- return div;
- },
- /**
- * @function L.supermap.components.distributedAnalysis.prototype._creatUnitSelectBox
- * @description 创建含有 span 的 input 框。
- * @private
- */
- _creatUnitSelectBox: function _creatUnitSelectBox(options, parentEle) {
- var unitSelectBoxContainer = external_L_default().DomUtil.create('div', 'component-clientcomputation__buffer--radius', parentEle);
- var unitSelectSpan = external_L_default().DomUtil.create('span', '', unitSelectBoxContainer);
- unitSelectSpan.innerHTML = options.labelName;
- var unitSelectInputContainer = external_L_default().DomUtil.create('div', '', unitSelectBoxContainer);
- external_L_default().DomUtil.create('input', 'buffer-radius-input', unitSelectInputContainer);
- var unitSelectUnitContainer = external_L_default().DomUtil.create('div', 'component-clientcomputation__buffer--unit', unitSelectInputContainer);
- var unitSelectOptions = options.selectOptions;
- var unitSelectTool = new Select(unitSelectOptions).getElement();
- unitSelectUnitContainer.appendChild(unitSelectTool);
- return unitSelectBoxContainer;
- },
- /**
- * @function L.supermap.components.distributedAnalysis.prototype._setEleAtribute
- * @description 设置元素的属性名和属性值。
- * @private
- */
- _setEleAtribute: function _setEleAtribute(daraValueArr, attributeName, eleArr) {
- for (var i = 0; i < eleArr.length; i++) {
- eleArr[i].setAttribute(attributeName, daraValueArr[i]);
- }
- }
- });
- var distributedAnalysisView = function distributedAnalysisView(options) {
- return new DistributedAnalysisView(options);
- };
- (external_L_default()).supermap.components.distributedAnalysis = distributedAnalysisView;
- ;// CONCATENATED MODULE: ./src/leaflet/components/dataservicequery/DataServiceQueryViewModel.js
- function DataServiceQueryViewModel_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { DataServiceQueryViewModel_typeof = function _typeof(obj) { return typeof obj; }; } else { DataServiceQueryViewModel_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return DataServiceQueryViewModel_typeof(obj); }
- function DataServiceQueryViewModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function DataServiceQueryViewModel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function DataServiceQueryViewModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) DataServiceQueryViewModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) DataServiceQueryViewModel_defineProperties(Constructor, staticProps); return Constructor; }
- function DataServiceQueryViewModel_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) DataServiceQueryViewModel_setPrototypeOf(subClass, superClass); }
- function DataServiceQueryViewModel_setPrototypeOf(o, p) { DataServiceQueryViewModel_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DataServiceQueryViewModel_setPrototypeOf(o, p); }
- function DataServiceQueryViewModel_createSuper(Derived) { var hasNativeReflectConstruct = DataServiceQueryViewModel_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DataServiceQueryViewModel_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DataServiceQueryViewModel_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DataServiceQueryViewModel_possibleConstructorReturn(this, result); }; }
- function DataServiceQueryViewModel_possibleConstructorReturn(self, call) { if (call && (DataServiceQueryViewModel_typeof(call) === "object" || typeof call === "function")) { return call; } return DataServiceQueryViewModel_assertThisInitialized(self); }
- function DataServiceQueryViewModel_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- function DataServiceQueryViewModel_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; } }
- function DataServiceQueryViewModel_getPrototypeOf(o) { DataServiceQueryViewModel_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DataServiceQueryViewModel_getPrototypeOf(o); }
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.components.dataServiceQueryViewModel
- * @classdesc 数据服务查询组件功能类。
- * @version 9.1.1
- * @category Components DataServiceQuery
- * @param {string} dataserviceUrl - 数据服务地址。
- * @fires L.supermap.components.dataServiceQueryViewModel#getfeaturessucceeded
- * @fires L.supermap.components.dataServiceQueryViewModel#getfeaturesfailed
- * @extends {L.Evented}
- */
- var DataServiceQueryViewModel = /*#__PURE__*/function (_L$Evented) {
- DataServiceQueryViewModel_inherits(DataServiceQueryViewModel, _L$Evented);
- var _super = DataServiceQueryViewModel_createSuper(DataServiceQueryViewModel);
- function DataServiceQueryViewModel() {
- DataServiceQueryViewModel_classCallCheck(this, DataServiceQueryViewModel);
- return _super.apply(this, arguments);
- }
- DataServiceQueryViewModel_createClass(DataServiceQueryViewModel, [{
- key: "initialize",
- value: function initialize(dataserviceUrl) {
- this.dataserviceUrl = dataserviceUrl;
- this.resultLayers = [];
- }
- /**
- * @function L.supermap.components.dataServiceQueryViewModel.prototype.getFeatures
- * @description 获取 features。
- * @param {(SuperMap.GetFeaturesByIDsParameters|SuperMap.GetFeaturesByBufferParameters|SuperMap.GetFeaturesByBoundsParameters|SuperMap.GetFeaturesBySQLParameters|SuperMap.GetFeaturesByGeometryParameters)} queryParam - 查询参数。
- * @param {L.Map} map - Leaflet Map 对象。
- */
- }, {
- key: "getFeatures",
- value: function getFeatures(queryParam, map) {
- var dataserviceUrl = this.dataserviceUrl;
- var me = this;
- var featureService = external_L_default().supermap.featureService(dataserviceUrl);
- if (queryParam instanceof GetFeaturesByIDsParameters) {
- featureService.getFeaturesByIDs(queryParam, function (serviceResult) {
- me._getQureyResult(serviceResult, map);
- });
- } else if (queryParam instanceof GetFeaturesBySQLParameters) {
- featureService.getFeaturesBySQL(queryParam, function (serviceResult) {
- me._getQureyResult(serviceResult, map);
- });
- } else if (queryParam instanceof GetFeaturesByBoundsParameters) {
- featureService.getFeaturesByBounds(queryParam, function (serviceResult) {
- me._getQureyResult(serviceResult, map);
- });
- } else if (queryParam instanceof GetFeaturesByBufferParameters) {
- featureService.getFeaturesByBuffer(queryParam, function (serviceResult) {
- me._getQureyResult(serviceResult, map);
- });
- } else if (queryParam instanceof GetFeaturesByGeometryParameters) {
- featureService.getFeaturesByGeometry(queryParam, function (serviceResult) {
- me._getQureyResult(serviceResult, map);
- });
- }
- }
- /**
- * @function L.supermap.components.dataServiceQueryViewModel.prototype._getQureyResult
- * @description 获取查询结果。
- * @private
- * @param {Object} serviceResult - 服务器返回结果。
- * @param {L.Map} map - Leaflet Map 对象。
- */
- }, {
- key: "_getQureyResult",
- value: function _getQureyResult(serviceResult, map) {
- if (serviceResult.error) {
- /**
- * @event L.supermap.components.dataServiceQueryViewModel#getfeaturesfailed
- * @description features 获取失败时触发。
- * @property {string} error - 服务器返回的错误。
- */
- this.fire('getfeaturesfailed', {
- 'error': serviceResult.error
- });
- return;
- }
- var resultLayer = external_L_default().geoJSON(serviceResult.result.features, {
- onEachFeature: function onEachFeature(feature, layer) {
- layer.bindPopup("ID: " + feature.properties.SMID);
- },
- pointToLayer: function pointToLayer(geoJsonPoint, latLng) {
- return external_L_default().circleMarker(latLng, {
- radius: 6
- });
- }
- }).addTo(map);
- this.resultLayers.push(resultLayer);
- /**
- * @event L.supermap.components.dataServiceQueryViewModel#getfeaturessucceeded
- * @description features 获取成功时触发。
- * @property {Object} result - 服务器返回的结果。
- */
- this.fire('getfeaturessucceeded', {
- 'result': serviceResult.result.features
- });
- }
- /**
- * @function L.supermap.components.dataServiceQueryViewModel.prototype.clearLayers
- * @description 清除所有结果图层。
- */
- }, {
- key: "clearLayers",
- value: function clearLayers() {
- for (var i in this.resultLayers) {
- this.resultLayers[i].remove();
- }
- this.resultLayers = [];
- }
- }]);
- return DataServiceQueryViewModel;
- }((external_L_default()).Evented);
- var dataServiceQueryViewModel = function dataServiceQueryViewModel(dataserviceUrl) {
- return new dataServiceQueryViewModel(dataserviceUrl);
- };
- (external_L_default()).supermap.components.dataServiceQueryViewModel = dataServiceQueryViewModel;
- ;// CONCATENATED MODULE: ./src/leaflet/components/dataservicequery/DataServiceQueryView.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- /**
- * @class L.supermap.components.dataServiceQuery
- * @classdesc 数据服务查询组件。
- * @version 9.1.1
- * @param {string} dataServiceUrl - 数据服务地址。
- * @param {(Array.<string>|string)} dataSetNames - 配置查询方式和查询的数据集数组。格式:" 数据源名:数据集名 ",例:"World: Countries"。
- * @param {Object} options - 可选参数。
- * @param {(Array.<SuperMap.GetFeatureMode>|SuperMap.GetFeatureMode)} [options.getFeatureMode] - 查询方式。
- * @param {string} [options.position='topright'] - 组件在地图中显示的位置,包括:'topleft','topright','bottomleft' 和 'bottomright',继承自 leaflet control。
- * @param {function} [options.style] - 设置图层点线面默认样式,点样式返回 maker 或者 circleMaker;线和面返回 L.path 样式。
- * @param {function} [options.onEachFeature] - 在创建和设置样式后,将为每个创建的要素调用一次的函数。用于将事件和弹出窗口附加到要素。默认情况下,对新创建的图层不执行任何操作。
- * @fires L.supermap.components.dataServiceQuery#getfeaturessucceeded
- * @fires L.supermap.components.dataServiceQuery#getfeaturesfailed
- * @category Components DataServiceQuery
- * @extends {L.supermap.components.componentsViewBase}
- */
- var DataServiceQueryView = ComponentsViewBase.extend({
- initialize: function initialize(dataServiceUrl, dataSetNames, options) {
- ComponentsViewBase.prototype.initialize.apply(this, [options]);
- this.dataServiceUrl = dataServiceUrl;
- if (!dataSetNames || dataSetNames.length === 0) {
- throw new Error('Please configure the dataset of the query!');
- }
- if (dataSetNames instanceof Array) {
- this.dataSetNames = dataSetNames;
- } else {
- this.dataSetNames = dataSetNames.split(" ");
- }
- },
- /**
- * @function L.supermap.components.dataServiceQuery.prototype.onAdd
- * @description 添加控件。
- * @private
- * @override
- */
- onAdd: function onAdd(map) {
- return ComponentsViewBase.prototype.onAdd.apply(this, [map]);
- },
- /**
- * @function L.supermap.components.dataServiceQuery.prototype.onRemove
- * @description 移除控件。
- * @private
- */
- onRemove: function onRemove() {
- this.map.off('pm:create');
- },
- /**
- * @function L.supermap.components.dataServiceQuery.prototype.setDataSetNames
- * @description 设置查询的数据集名。
- * @param {(Array.<string>|string)} dataSetNames - 配置查询方式和查询的数据集数组。格式:" 数据源名:数据集名 ",例:"World: Countries";
- */
- setDataSetNames: function setDataSetNames(dataSetNames) {
- if (dataSetNames instanceof Array) {
- this.dataSetNames = dataSetNames;
- } else {
- this.dataSetNames = dataSetNames.split(" ");
- }
- },
- /**
- * @function L.supermap.components.dataServiceQuery.prototype.setGetFeatureMode
- * @description 设置查询方式。
- * @param {(Array.<SuperMap.GetFeatureMode>|SuperMap.GetFeatureMode)} getFeatureMode - 查询方式。
- */
- setGetFeatureMode: function setGetFeatureMode(getFeatureMode) {
- this.getFeatureMode = getFeatureMode;
- this._getFeatureModeOnchange(this.getFeatureMode);
- },
- /**
- * @function L.supermap.components.dataServiceQuery.prototype.setDataServiceUrl
- * @description 设置查询的数据服务地址。
- * @param {string} dataServiceUrl - 数据服务地址。
- */
- setDataServiceUrl: function setDataServiceUrl(dataServiceUrl) {
- this.dataServiceUrl = dataServiceUrl;
- this.viewModel = new DataServiceQueryViewModel(this.dataServiceUrl);
- },
- /**
- * @function L.supermap.components.dataServiceQuery.prototype._getFeatureModeOnchange
- * @private
- * @description 查询方式改变时改变 UI。
- * @param {string} getFeatureMode - 查询方式。
- */
- _getFeatureModeOnchange: function _getFeatureModeOnchange(getFeatureMode) {
- var queryModelOptionsArr;
- if (!getFeatureMode || JSON.stringify(getFeatureMode) == '{}') {
- queryModelOptionsArr = ['ID', 'SQL', 'BOUNDS', 'BUFFER', 'SPATIAL'];
- } else {
- queryModelOptionsArr = getFeatureMode;
- }
- var queryModelControl = document.getElementById('queryModelControl');
- queryModelControl.innerHTML = '';
- this.creatQueryModeSelect(queryModelOptionsArr, queryModelControl);
- },
- /**
- * @function L.supermap.components.dataServiceQuery.prototype._initView
- * @description 创建数据服务查询组件。
- * @returns {HTMLElement}
- * @private
- */
- _initView: function _initView() {
- var _this = this;
- // 初始化 ViewModel:
- this.viewModel = new DataServiceQueryViewModel(this.dataServiceUrl);
- this.messageBox = new MessageBox(); // 组件 container
- var container = new CommonContainer({
- title: Lang.i18n('title_dataServiceQuery')
- }).getElement();
- container.classList.add('component-servicequery__container');
- container.children[0].classList.add('component-servicequery__title');
- var componentContentContainer = container.children[1];
- componentContentContainer.classList.add('component-content--scroll');
- componentContentContainer.classList.add('data-services'); // 组件内容 container
- var analyusisTypeContainer = external_L_default().DomUtil.create('div', 'component-analysis__container', componentContentContainer);
- var analysisType = external_L_default().DomUtil.create('div', 'component-servicequery__analysistype', analyusisTypeContainer);
- var analysisLayer = external_L_default().DomUtil.create('div', 'component-analysis__container__analysisLayer', analysisType);
- var queryModelOptionsArr,
- getFeatureModeArr = this.options.getFeatureMode; // 获取查询模式
- if (!getFeatureModeArr || JSON.stringify(getFeatureModeArr) == '{}') {
- queryModelOptionsArr = ['ID', 'SQL', 'BOUNDS', 'BUFFER', 'SPATIAL'];
- } else {
- queryModelOptionsArr = getFeatureModeArr;
- } // 查询模式
- var queryModelContainer = external_L_default().DomUtil.create('div', '', analysisLayer);
- queryModelContainer.id = 'queryModelContainer';
- var queryModelControl = external_L_default().DomUtil.create('div', 'component-analysis__selecttool', queryModelContainer);
- queryModelControl.id = 'queryModelControl';
- this.creatQueryModeSelect = creatQueryModeSelect.bind(this);
- this.queryModeltOnchange = queryModeltOnchange.bind(this);
- this.creatQueryModeSelect(queryModelOptionsArr, queryModelControl); // 要素 ID 数组
- var featuresIdArrContainer = external_L_default().DomUtil.create('div', 'component-analysis__container component-textarea--dataservice__container', analysisLayer);
- var textareaSpan = external_L_default().DomUtil.create('span', 'textarea-name', featuresIdArrContainer);
- textareaSpan.innerHTML = Lang.i18n('text_label_IDArrayOfFeatures');
- var textareaControl = external_L_default().DomUtil.create('div', 'component-textarea component-textarea--dataservice', featuresIdArrContainer);
- textareaControl.id = 'getfeaturesIdArr';
- var scrollarea = external_L_default().DomUtil.create('div', 'scrollarea', textareaControl);
- var scrollareaContent = external_L_default().DomUtil.create('div', 'component-scrollarea-content', scrollarea);
- scrollareaContent.setAttribute('tabindex', '1');
- var getValueTextArea = external_L_default().DomUtil.create('textarea', 'component-textarea__content', scrollareaContent);
- getValueTextArea.value = '[1,2,3]';
- getValueTextArea.id = 'getValueTextArea'; // SQL 最多可返回的要素数量
- var maxFeaturesContainer = external_L_default().DomUtil.create('div', 'component-servicequery__maxfeatures-container hidden', analysisLayer);
- var maxFeaturesOtions = {
- 'spanName': Lang.i18n('text_label_maxFeatures'),
- 'value': '1000'
- };
- var maxFeaturesInputBox = this._creatInputBox(maxFeaturesOtions, maxFeaturesContainer);
- var maxFeaturesInput = maxFeaturesInputBox.children[1];
- maxFeaturesInput.classList.add('max-features-input'); // Buffer 缓冲区距离
- var bufferDistanceContainer = external_L_default().DomUtil.create('div', 'component-servicequery__distance-container hidden', analysisLayer);
- var bufferDistanceOtions = {
- 'spanName': Lang.i18n('text_label_bufferDistance'),
- 'value': '10'
- };
- var bufferDistanceInputBox = this._creatInputBox(bufferDistanceOtions, bufferDistanceContainer);
- var bufferDistanceInput = bufferDistanceInputBox.children[1]; // Bounds 查询范围;
- var queryRangeContainer = external_L_default().DomUtil.create('div', 'component-analysis__container component-textarea--dataservice__container hidden', analysisLayer);
- var queryRangetextareaSpan = external_L_default().DomUtil.create('span', 'textarea-name', queryRangeContainer);
- var queryRangeMainContent = external_L_default().DomUtil.create('div', '', queryRangeContainer);
- var queryRangeIconContainer = external_L_default().DomUtil.create('div', 'component-servicequery__rangeicon-container', queryRangeMainContent);
- queryRangetextareaSpan.innerHTML = Lang.i18n('text_label_queryRange1');
- var queryRangeRecIcon = external_L_default().DomUtil.create('div', 'component-servicequery__rangeicon supermapol-icons-polygon-layer bounds', queryRangeIconContainer);
- var queryRangeLineIcon = external_L_default().DomUtil.create('div', 'component-servicequery__rangeicon supermapol-icons-line-layer hidden', queryRangeIconContainer);
- var queryRangePointIcon = external_L_default().DomUtil.create('div', 'component-servicequery__rangeicon supermapol-icons-point-layer hidden', queryRangeIconContainer);
- var queryRangetextareaControl = external_L_default().DomUtil.create('div', 'component-textarea component-textarea--rangequery', queryRangeMainContent);
- queryRangetextareaControl.id = 'getfeaturesIdArr';
- var queryRangescrollarea = external_L_default().DomUtil.create('div', '', queryRangetextareaControl);
- var queryRangescrollareaContent = external_L_default().DomUtil.create('div', 'component-scrollarea-content', queryRangescrollarea);
- queryRangescrollareaContent.setAttribute('tabindex', '1');
- var queryRangeTextArea = external_L_default().DomUtil.create('textarea', 'component-textarea__content component-textarea--rangequery__content', queryRangescrollareaContent);
- queryRangeTextArea.value = '{"leftBottom":{"x":-5,"y":-5},"rightTop":{"x":5,"y":5}}'; // geometry 空间查询模式
- var spatialQueryModeContainer = external_L_default().DomUtil.create('div', 'component-servicequery__spatialquerymode-container hidden', analysisLayer);
- var spatialQueryModeOptions = {
- 'optionsArr': ['CONTAIN', 'CROSS', 'DISJOINT', 'IDENTITY', 'INTERSECT', 'NONE', 'OVERLAP', 'TOUCH', 'WITHIN'],
- 'labelName': Lang.i18n('text_label_spatialQueryMode')
- };
- var spatialQueryModeControl = external_L_default().DomUtil.create('div', 'component-analysis__selecttool', spatialQueryModeContainer);
- var spatialQueryModeSelectTool = new Select(spatialQueryModeOptions).getElement();
- spatialQueryModeSelectTool.children[1].classList.add('dataservice-select');
- spatialQueryModeControl.appendChild(spatialQueryModeSelectTool);
- var spatialQueryModeSelectName = spatialQueryModeSelectTool.children[1].children[0];
- spatialQueryModeSelectName.id = 'spatialQueryModeSelectName';
- var spatialQueryModeSelectContent = spatialQueryModeSelectTool.children[1].children[2];
- spatialQueryModeSelectContent.classList.add('component-servicequery__spatialquerymode__selectcontent'); // 分析按钮
- var runBtnContainer = external_L_default().DomUtil.create('div', 'component-analysis__container__analysisbtn', analysisLayer);
- var runBtn = external_L_default().DomUtil.create('div', 'component-analysis__analysisbtn', runBtnContainer);
- var analysisBtn = external_L_default().DomUtil.create('button', 'component-analysis__analysisbtn--analysis', runBtn);
- analysisBtn.innerHTML = Lang.i18n('btn_query');
- var analysingContainer = external_L_default().DomUtil.create('div', 'component-analysis__analysisbtn--analysing-container hidden', runBtn);
- var analysisingBtn = external_L_default().DomUtil.create('div', 'component-analysis__analysisbtn--analysising component-servicequery__querybtn--querying', analysingContainer);
- var svgContainer = external_L_default().DomUtil.create('div', 'component-analysis__svg-container', analysisingBtn);
- svgContainer.innerHTML = "<svg class=\"component-analysis__svg-rotate\" width=\"16px\" height=\"16px\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <path id=\"ring\" fill=\"#FFF\" transform=\"translate(8,8)\" d=\"M 0 0 v -8 A 8 8 0 1 1 -8.00 0 z\"></path>\n <circle cx=\"8\" cy=\"8\" r=\"6\" fill=\"#38ADF5\"></circle>\n <rect class=\"svg-top\" x=\"8\" y=\"0\" rx=\"2\" ry=\"2\" width=\"2\" height=\"2\" style=\"fill: rgb(255, 255, 255); stroke-width: 0;\"></rect>\n <rect class=\"svg-left\" x=\"0\" y=\"8\" rx=\"2\" ry=\"2\" width=\"2\" height=\"2\" style=\"fill: rgb(255, 255, 255); stroke-width: 0;\"></rect>\n </svg>";
- external_L_default().DomUtil.create('span', '', analysisingBtn).innerHTML = Lang.i18n('btn_querying'); // 删除按钮
- var deleteLayersBtn = external_L_default().DomUtil.create('button', 'component-analysis__analysisbtn--analysis component-analysis__analysisbtn--deletelayers', runBtn);
- deleteLayersBtn.innerHTML = Lang.i18n('btn_emptyTheRresultLayer'); // 设置当前显示参数
- queryModeltOnchange(queryModelOptionsArr[0]); // 分析按钮点击事件
- var me = this;
- analysisBtn.onclick = function () {
- _this.messageBox.closeView();
- analysingContainer.style.display = 'block';
- analysisBtn.style.display = 'none';
- var queryParams = getQueryParams();
- _this.viewModel.on('getfeaturessucceeded', function (e) {
- analysingContainer.style.display = 'none';
- analysisBtn.style.display = 'block';
- if (e.result.features.length === 0) {
- _this.messageBox.showView(Lang.i18n('msg_dataReturnedIsEmpty'), "success");
- }
- /**
- * @event L.supermap.components.dataServiceQuery#getfeaturessucceeded
- * @description features 获取成功时触发。
- * @property {Object} result - 服务器返回的结果。
- */
- _this._event.fire('getfeaturessucceeded', {
- 'result': e.result
- });
- });
- _this.viewModel.on('getfeaturesfailed', function (e) {
- analysingContainer.style.display = 'none';
- analysisBtn.style.display = 'block';
- _this.messageBox.showView(e.error.errorMsg, "failure");
- /**
- * @event L.supermap.components.dataServiceQuery#getfeaturesfailed
- * @description features 获取失败时触发。
- * @property {string} error - 服务器返回的错误。
- */
- _this._event.fire('getfeaturesfailed', {
- 'error': e.error
- });
- });
- _this.viewModel.getFeatures(queryParams, _this.map);
- };
- var bounds, resultLayer; // 矩形 & 多边形绘制
- queryRangeRecIcon.onclick = function (e) {
- var queryModelSelectName = document.getElementById('queryModelSelectName');
- var getFeatureMode = queryModelSelectName.title;
- if (resultLayer) {
- resultLayer.remove();
- } // 矩形
- if (getFeatureMode === 'BOUNDS') {
- _this.map.pm.enableDraw('Rectangle'); // 多边形
- } else {
- _this.map.pm.enableDraw('Poly');
- }
- e.stopPropagation();
- e.preventDefault();
- }; // 线绘制
- queryRangeLineIcon.onclick = function (e) {
- if (resultLayer) {
- resultLayer.remove();
- }
- _this.map.pm.enableDraw('Line');
- e.stopPropagation();
- e.preventDefault();
- }; // 点绘制
- queryRangePointIcon.onclick = function (e) {
- if (resultLayer) {
- resultLayer.remove();
- }
- _this.map.pm.enableDraw('Marker');
- e.stopPropagation();
- e.preventDefault();
- };
- this.map.on('pm:create', function (e) {
- if (e.shape === 'Rectangle') {
- resultLayer = e.layer;
- var boundsT = resultLayer.getBounds();
- bounds = external_L_default().bounds([boundsT._southWest.lng, boundsT._southWest.lat], [boundsT._northEast.lng, boundsT._northEast.lat]);
- var geo = {
- 'leftBottom': {
- 'x': boundsT._southWest.lng,
- 'y': boundsT._southWest.lat
- },
- 'rightTop': {
- 'x': boundsT._northEast.lng,
- 'y': boundsT._northEast.lat
- }
- };
- queryRangeTextArea.value = JSON.stringify(geo);
- }
- if (e.shape === 'Marker') {
- resultLayer = e.layer;
- queryRangeTextArea.value = JSON.stringify(e.layer.toGeoJSON());
- _this.map.pm.disableDraw("Marker");
- }
- if (e.shape === 'Line') {
- resultLayer = e.layer;
- queryRangeTextArea.value = JSON.stringify(e.layer.toGeoJSON());
- }
- if (e.shape === 'Polygon') {
- resultLayer = e.layer;
- queryRangeTextArea.value = JSON.stringify(e.layer.toGeoJSON());
- }
- }); // 删除按钮点击事件
- deleteLayersBtn.onclick = function () {
- _this.viewModel.clearLayers();
- };
- function creatQueryModeSelect(queryModelOptionsArr, queryModelControl) {
- // 查询模式
- var queryModelSelectName;
- if (queryModelOptionsArr instanceof Array && queryModelOptionsArr.length > 1) {
- var queryModelOptions = {
- 'optionsArr': queryModelOptionsArr,
- 'labelName': Lang.i18n('text_label_queryMode'),
- 'optionsClickCb': this.queryModeltOnchange
- };
- var queryModelSelectTool = new Select(queryModelOptions).getElement();
- queryModelControl.appendChild(queryModelSelectTool);
- queryModelSelectName = queryModelSelectTool.children[1].children[0];
- queryModelSelectTool.children[1].classList.add('dataservice-select');
- var queryModelSelect = queryModelSelectTool.children[1];
- queryModelSelect.classList.add('dataservice-select');
- queryModelSelect.classList.add('querymodel-select');
- } else {
- var span = external_L_default().DomUtil.create('span', '', queryModelContainer);
- span.innerHTML = Lang.i18n('text_label_queryMode');
- queryModelSelectName = external_L_default().DomUtil.create('div', 'component-servicequery__querymode-selectname', queryModelContainer);
- var text = external_L_default().DomUtil.create('span', '', queryModelSelectName);
- if (queryModelOptionsArr instanceof Array) {
- text.innerHTML = queryModelOptionsArr[0];
- } else {
- text.innerHTML = queryModelOptionsArr;
- }
- queryModelSelectName.title = text.innerHTML;
- this.queryModeltOnchange(queryModelSelectName);
- }
- queryModelSelectName.id = 'queryModelSelectName';
- return queryModelSelectName;
- } // 查询模式下拉框 onchange 事件
- function queryModeltOnchange(option) {
- // 获取当前选中查询模式
- var queryModelSelectName;
- if (option.title) {
- queryModelSelectName = option.title;
- } else {
- queryModelSelectName = option;
- } // 控制部分查询参数元素隐藏和显示
- maxFeaturesContainer.classList.add('hidden');
- queryRangeContainer.classList.add('hidden');
- bufferDistanceContainer.classList.add('hidden');
- queryRangeLineIcon.classList.add('hidden');
- queryRangePointIcon.classList.add('hidden');
- queryRangeRecIcon.classList.remove('bounds');
- spatialQueryModeContainer.classList.add('hidden');
- textareaSpan.innerHTML = Lang.i18n('text_label_featureFilter');
- getValueTextArea.value = 'SMID<10';
- if (queryModelSelectName === 'BUFFER' || queryModelSelectName === 'SPATIAL') {
- queryRangeContainer.classList.remove('hidden');
- queryRangetextareaSpan.innerHTML = Lang.i18n('text_label_geometricObject');
- queryRangeTextArea.value = '{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[84.90234375,40.25390625]}}';
- queryRangeLineIcon.classList.remove('hidden');
- queryRangePointIcon.classList.remove('hidden');
- }
- switch (queryModelSelectName) {
- case 'ID':
- textareaSpan.innerHTML = Lang.i18n('text_label_IDArrayOfFeatures');
- getValueTextArea.value = '[1,2,3]';
- break;
- case 'SQL':
- maxFeaturesContainer.classList.remove('hidden');
- break;
- case 'BOUNDS':
- queryRangeContainer.classList.remove('hidden');
- queryRangetextareaSpan.innerHTML = Lang.i18n('text_label_queryRange');
- queryRangeTextArea.value = '{"leftBottom":{"x":-5,"y":-5},"rightTop":{"x":5,"y":5}}';
- queryRangeRecIcon.classList.add('bounds');
- break;
- case 'BUFFER':
- bufferDistanceContainer.classList.remove('hidden');
- break;
- case 'SPATIAL':
- spatialQueryModeContainer.classList.remove('hidden');
- break;
- }
- } // 获取查询参数
- function getQueryParams() {
- // 数据集数组
- var datasetArr = me.dataSetNames;
- var queryModelSelectName = document.getElementById('queryModelSelectName');
- var getFeatureMode = queryModelSelectName.title; // 过滤条件
- var attributeFilter = getValueTextArea.value;
- var queryParam;
- if (getFeatureMode === 'ID') {
- var value = getValueTextArea.value;
- var ids = value.substring(1, value.length - 1).split(',');
- queryParam = new GetFeaturesByIDsParameters({
- IDs: ids,
- datasetNames: datasetArr
- });
- } else if (getFeatureMode === 'SQL') {
- var maxFeatures = maxFeaturesInput.value;
- queryParam = new GetFeaturesBySQLParameters({
- queryParameter: {
- attributeFilter: attributeFilter
- },
- datasetNames: datasetArr,
- maxFeatures: maxFeatures
- });
- } else if (getFeatureMode === 'BOUNDS') {
- if (!bounds) {
- var _value = JSON.parse(queryRangeTextArea.value);
- bounds = external_L_default().bounds([_value.leftBottom.x, _value.leftBottom.y], [_value.rightTop.x, _value.rightTop.y]);
- }
- queryParam = new GetFeaturesByBoundsParameters({
- attributeFilter: attributeFilter,
- datasetNames: datasetArr,
- bounds: bounds
- });
- } else if (getFeatureMode === 'BUFFER') {
- var bufferDistance = bufferDistanceInput.value;
- var defaultGeometryValue = JSON.parse(queryRangeTextArea.value);
- var geometryLayer = resultLayer || defaultGeometryValue;
- queryParam = new GetFeaturesByBufferParameters({
- attributeFilter: attributeFilter,
- datasetNames: datasetArr,
- bufferDistance: bufferDistance,
- geometry: geometryLayer
- });
- } else if (getFeatureMode === 'SPATIAL') {
- var spatialQueryMode = spatialQueryModeSelectName.title;
- var _defaultGeometryValue = JSON.parse(queryRangeTextArea.value);
- var _geometryLayer = resultLayer || _defaultGeometryValue;
- queryParam = new GetFeaturesByGeometryParameters({
- attributeFilter: attributeFilter,
- datasetNames: datasetArr,
- spatialQueryMode: spatialQueryMode,
- geometry: _geometryLayer
- });
- }
- return queryParam;
- } //阻止 map 默认事件
- this._preventMapEvent(container, this.map);
- return container;
- },
- /**
- * @function L.supermap.components.dataServiceQuery.prototype._creatInputBox
- * @description 创建含有 span 的 input 框。
- * @private
- */
- _creatInputBox: function _creatInputBox(inputOptions, parentEle) {
- var div = external_L_default().DomUtil.create('div', '', parentEle);
- var span = external_L_default().DomUtil.create('span', '', div);
- span.innerHTML = inputOptions.spanName;
- var input = external_L_default().DomUtil.create('input', '', div);
- input.value = inputOptions.value; // input.className = 'distributeInput'
- return div;
- }
- });
- var dataServiceQueryView = function dataServiceQueryView(dataServiceUrl, dataSetNames, options) {
- return new DataServiceQueryView(dataServiceUrl, dataSetNames, options);
- };
- (external_L_default()).supermap.components.dataServiceQuery = dataServiceQueryView;
- ;// CONCATENATED MODULE: ./src/leaflet/components/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- ;// CONCATENATED MODULE: ./src/leaflet/index.js
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- }();
- !function() {
- "use strict";
- /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- * This program are made available under the terms of the Apache License, Version 2.0
- * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
- }();
- /******/ })()
- ;
|