12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184 |
- window.TILE_VERSION = {
- "ditu": {
- "normal": {
- "version": "088",
- "updateDate": "20190929"
- },
- "satellite": {
- "version": "009",
- "updateDate": "20190929"
- },
- "normalTraffic": {
- "version": "081",
- "updateDate": "20190929"
- },
- "satelliteTraffic": {
- "version": "083",
- "updateDate": "20190929"
- },
- "mapJS": {
- "version": "104",
- "updateDate": "20190929"
- },
- "satelliteStreet": {
- "version": "083",
- "updateDate": "20190929"
- },
- "earthVector": {
- "version": "001",
- "updateDate": "20190929"
- }
- },
- "webapp": {
- "high_normal": {
- "version": "001",
- "updateDate": "20190929"
- },
- "lower_normal": {
- "version": "002",
- "updateDate": "20190929"
- }
- },
- "api_for_mobile": {
- "vector": {
- "version": "002",
- "updateDate": "20190929"
- },
- "vectorIcon": {
- "version": "002",
- "updateDate": "20190929"
- }
- }
- };
- window.BMAP_AUTHENTIC_KEY = "hlDtW6AATwvq3WZ7QGMbQKSNMvM59BLZ";
- (function() {
- (function() {
- var g, J = g = J || {
- version: "1.3.4"
- };
- J.guid = "$BAIDU$";
- window[J.guid] = window[J.guid] || {};
- J.object = J.object || {};
- J.extend = J.object.extend = function(N, L) {
- for (var M in L) {
- if (L.hasOwnProperty(M)) {
- N[M] = L[M]
- }
- }
- return N
- };
- J.dom = J.dom || {};
- J.dom.g = function(L) {
- if ("string" == typeof L || L instanceof String) {
- return document.getElementById(L)
- } else {
- if (L && L.nodeName && (L.nodeType == 1 || L.nodeType == 9)) {
- return L
- }
- }
- return null
- };
- J.g = J.G = J.dom.g;
- J.dom.hide = function(L) {
- L = J.dom.g(L);
- L.style.display = "none";
- return L
- };
- J.hide = J.dom.hide;
- J.lang = J.lang || {};
- J.lang.isString = function(L) {
- return "[object String]" == Object.prototype.toString.call(L)
- };
- J.isString = J.lang.isString;
- J.dom._g = function(L) {
- if (J.lang.isString(L)) {
- return document.getElementById(L)
- }
- return L
- };
- J._g = J.dom._g;
- J.dom.contains = function(L, M) {
- var N = J.dom._g;
- L = N(L);
- M = N(M);
- return L.contains ? L != M && L.contains(M) : !!(L.compareDocumentPosition(M) & 16)
- };
- J.browser = J.browser || {};
- J.dom._NAME_ATTRS = (function() {
- var L = {
- cellpadding: "cellPadding",
- cellspacing: "cellSpacing",
- colspan: "colSpan",
- rowspan: "rowSpan",
- valign: "vAlign",
- usemap: "useMap",
- frameborder: "frameBorder"
- };
- L.htmlFor = "for";
- L.className = "class";
- return L
- })();
- J.dom.setAttr = function(M, L, N) {
- M = J.dom.g(M);
- if ("style" == L) {
- M.style.cssText = N
- } else {
- L = J.dom._NAME_ATTRS[L] || L;
- M.setAttribute(L, N)
- }
- return M
- };
- J.setAttr = J.dom.setAttr;
- J.dom.setAttrs = function(N, L) {
- N = J.dom.g(N);
- for (var M in L) {
- J.dom.setAttr(N, M, L[M])
- }
- return N
- };
- J.setAttrs = J.dom.setAttrs;
- J.string = J.string || {};
- J.dom.removeClass = function(Q, R) {
- Q = J.dom.g(Q);
- var O = Q.className.split(/\s+/),
- S = R.split(/\s+/),
- M, L = S.length,
- N, P = 0;
- for (; P < L; ++P) {
- for (N = 0, M = O.length; N < M; ++N) {
- if (O[N] == S[P]) {
- O.splice(N, 1);
- break
- }
- }
- }
- Q.className = O.join(" ");
- return Q
- };
- J.removeClass = J.dom.removeClass;
- J.dom.insertHTML = function(O, L, N) {
- O = J.dom.g(O);
- var M, P;
- if (O.insertAdjacentHTML) {
- O.insertAdjacentHTML(L, N)
- } else {
- M = O.ownerDocument.createRange();
- L = L.toUpperCase();
- if (L == "AFTERBEGIN" || L == "BEFOREEND") {
- M.selectNodeContents(O);
- M.collapse(L == "AFTERBEGIN")
- } else {
- P = L == "BEFOREBEGIN";
- M[P ? "setStartBefore" : "setEndAfter"](O);
- M.collapse(P)
- }
- M.insertNode(M.createContextualFragment(N))
- }
- return O
- };
- J.insertHTML = J.dom.insertHTML;
- J.dom.show = function(L) {
- L = J.dom.g(L);
- L.style.display = "";
- return L
- };
- J.show = J.dom.show;
- J.dom.getDocument = function(L) {
- L = J.dom.g(L);
- return L.nodeType == 9 ? L : L.ownerDocument || L.document
- };
- J.dom.addClass = function(Q, R) {
- Q = J.dom.g(Q);
- var M = R.split(/\s+/),
- L = Q.className,
- P = " " + L + " ",
- O = 0,
- N = M.length;
- for (; O < N; O++) {
- if (P.indexOf(" " + M[O] + " ") < 0) {
- L += " " + M[O]
- }
- }
- Q.className = L;
- return Q
- };
- J.addClass = J.dom.addClass;
- J.dom._styleFixer = J.dom._styleFixer || {};
- J.dom._styleFilter = J.dom._styleFilter || [];
- J.dom._styleFilter.filter = function(M, P, Q) {
- for (var L = 0, O = J.dom._styleFilter, N; N = O[L]; L++) {
- if (N = N[Q]) {
- P = N(M, P)
- }
- }
- return P
- };
- J.string.toCamelCase = function(L) {
- if (L.indexOf("-") < 0 && L.indexOf("_") < 0) {
- return L
- }
- return L.replace(/[-_][^-_]/g, function(M) {
- return M.charAt(1).toUpperCase()
- })
- };
- J.dom.getStyle = function(N, M) {
- var Q = J.dom;
- N = Q.g(N);
- M = J.string.toCamelCase(M);
- var P = N.style[M];
- if (!P) {
- var L = Q._styleFixer[M],
- O = N.currentStyle || getComputedStyle(N, null);
- P = L && L.get ? L.get(N, O) : O[L || M]
- }
- if (L = Q._styleFilter) {
- P = L.filter(M, P, "get")
- }
- return P
- };
- J.getStyle = J.dom.getStyle;
- if (/opera\/(\d+\.\d)/i.test(navigator.userAgent)) {
- J.browser.opera = +RegExp["\x241"]
- }
- J.browser.isWebkit = /webkit/i.test(navigator.userAgent);
- J.browser.isGecko = /gecko/i.test(navigator.userAgent) && !/like gecko/i.test(navigator.userAgent);
- J.browser.isStrict = document.compatMode == "CSS1Compat";
- J.dom.getPosition = function(L) {
- L = J.dom.g(L);
- var U = J.dom.getDocument(L),
- O = J.browser,
- R = J.dom.getStyle,
- N = O.isGecko > 0 && U.getBoxObjectFor && R(L, "position") == "absolute" && (L.style.top === "" || L.style.left ===
- ""),
- S = {
- left: 0,
- top: 0
- },
- Q = (O.ie && !O.isStrict) ? U.body : U.documentElement,
- V, M;
- if (L == Q) {
- return S
- }
- if (L.getBoundingClientRect) {
- M = L.getBoundingClientRect();
- S.left = Math.floor(M.left) + Math.max(U.documentElement.scrollLeft, U.body.scrollLeft);
- S.top = Math.floor(M.top) + Math.max(U.documentElement.scrollTop, U.body.scrollTop);
- S.left -= U.documentElement.clientLeft;
- S.top -= U.documentElement.clientTop;
- var T = U.body,
- W = parseInt(R(T, "borderLeftWidth")),
- P = parseInt(R(T, "borderTopWidth"));
- if (O.ie && !O.isStrict) {
- S.left -= isNaN(W) ? 2 : W;
- S.top -= isNaN(P) ? 2 : P
- }
- } else {
- V = L;
- do {
- S.left += V.offsetLeft;
- S.top += V.offsetTop;
- if (O.isWebkit > 0 && R(V, "position") == "fixed") {
- S.left += U.body.scrollLeft;
- S.top += U.body.scrollTop;
- break
- }
- V = V.offsetParent
- } while (V && V != L);
- if (O.opera > 0 || (O.isWebkit > 0 && R(L, "position") == "absolute")) {
- S.top -= U.body.offsetTop
- }
- V = L.offsetParent;
- while (V && V != U.body) {
- S.left -= V.scrollLeft;
- if (!O.opera || V.tagName != "TR") {
- S.top -= V.scrollTop
- }
- V = V.offsetParent
- }
- }
- return S
- };
- if (/firefox\/(\d+\.\d)/i.test(navigator.userAgent)) {
- J.browser.firefox = +RegExp["\x241"]
- }(function() {
- var L = navigator.userAgent;
- if (/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(L) && !/chrome/i.test(L)) {
- J.browser.safari = +(RegExp["\x241"] || RegExp["\x242"])
- }
- })();
- if (/chrome\/(\d+\.\d)/i.test(navigator.userAgent)) {
- J.browser.chrome = +RegExp["\x241"]
- }
- J.array = J.array || {};
- J.array.each = function(Q, O) {
- var N, P, M, L = Q.length;
- if ("function" == typeof O) {
- for (M = 0; M < L; M++) {
- P = Q[M];
- N = O.call(Q, P, M);
- if (N === false) {
- break
- }
- }
- }
- return Q
- };
- J.each = J.array.each;
- J.lang.guid = function() {
- return "GUID__" + (window[J.guid]._counter++).toString(36)
- };
- window[J.guid]._counter = window[J.guid]._counter || 1;
- window[J.guid]._instances = window[J.guid]._instances || {};
- J.lang.isFunction = function(L) {
- return "[object Function]" == Object.prototype.toString.call(L)
- };
- J.lang.isNumber = function(L) {
- return "[object Number]" == Object.prototype.toString.call(L)
- };
- J.lang.Class = function(L) {
- this.guid = L || J.lang.guid();
- window[J.guid]._instances[this.guid] = this
- };
- window[J.guid]._instances = window[J.guid]._instances || {};
- J.lang.Class.prototype.dispose = function() {
- delete window[J.guid]._instances[this.guid];
- for (var L in this) {
- if (!J.lang.isFunction(this[L])) {
- delete this[L]
- }
- }
- this.disposed = true
- };
- J.lang.Class.prototype.toString = function() {
- return "[object " + (this._className || "Object") + "]"
- };
- J.lang.Event = function(L, M) {
- this.type = L;
- this.returnValue = true;
- this.target = M || null;
- this.currentTarget = null
- };
- J.lang.Class.prototype.addEventListener = function(O, N, M) {
- if (!J.lang.isFunction(N)) {
- return
- }!this.__listeners && (this.__listeners = {});
- var L = this.__listeners,
- P;
- if (typeof M == "string" && M) {
- if (/[^\w\-]/.test(M)) {
- throw ("nonstandard key:" + M)
- } else {
- N.hashCode = M;
- P = M
- }
- }
- O.indexOf("on") != 0 && (O = "on" + O);
- typeof L[O] != "object" && (L[O] = {});
- P = P || J.lang.guid();
- N.hashCode = P;
- L[O][P] = N
- };
- J.lang.Class.prototype.removeEventListener = function(N, M) {
- if (J.lang.isFunction(M)) {
- M = M.hashCode
- } else {
- if (!J.lang.isString(M)) {
- return
- }
- }!this.__listeners && (this.__listeners = {});
- N.indexOf("on") != 0 && (N = "on" + N);
- var L = this.__listeners;
- if (!L[N]) {
- return
- }
- L[N][M] && delete L[N][M]
- };
- J.lang.Class.prototype.dispatchEvent = function(O, L) {
- if (J.lang.isString(O)) {
- O = new J.lang.Event(O)
- }!this.__listeners && (this.__listeners = {});
- L = L || {};
- for (var N in L) {
- O[N] = L[N]
- }
- var N, M = this.__listeners,
- P = O.type;
- O.target = O.target || this;
- O.currentTarget = this;
- P.indexOf("on") != 0 && (P = "on" + P);
- J.lang.isFunction(this[P]) && this[P].apply(this, arguments);
- if (typeof M[P] == "object") {
- for (N in M[P]) {
- M[P][N].apply(this, arguments)
- }
- }
- return O.returnValue
- };
- J.lang.inherits = function(R, P, O) {
- var N, Q, L = R.prototype,
- M = new Function();
- M.prototype = P.prototype;
- Q = R.prototype = new M();
- for (N in L) {
- Q[N] = L[N]
- }
- R.prototype.constructor = R;
- R.superClass = P.prototype;
- if ("string" == typeof O) {
- Q._className = O
- }
- };
- J.inherits = J.lang.inherits;
- J.lang.instance = function(L) {
- return window[J.guid]._instances[L] || null
- };
- J.platform = J.platform || {};
- J.platform.isAndroid = /android/i.test(navigator.userAgent);
- if (/android (\d+(\.\d)?)/i.test(navigator.userAgent)) {
- J.platform.android = J.android = RegExp["\x241"]
- }
- J.platform.isIpad = /ipad/i.test(navigator.userAgent);
- J.platform.isIphone = /iphone/i.test(navigator.userAgent);
- J.platform.iosVersion = /iphone os (\d)\_/i.test(navigator.userAgent) ? +RegExp["\x241"] : 0;
- J.lang.Event.prototype.inherit = function(N) {
- var M = this;
- this.domEvent = N = window.event || N;
- M.clientX = N.clientX || N.pageX;
- M.clientY = N.clientY || N.pageY;
- M.offsetX = N.offsetX || N.layerX;
- M.offsetY = N.offsetY || N.layerY;
- M.screenX = N.screenX;
- M.screenY = N.screenY;
- M.ctrlKey = N.ctrlKey || N.metaKey;
- M.shiftKey = N.shiftKey;
- M.altKey = N.altKey;
- if (N.touches) {
- M.touches = [];
- for (var L = 0; L < N.touches.length; L++) {
- M.touches.push({
- clientX: N.touches[L].clientX,
- clientY: N.touches[L].clientY,
- screenX: N.touches[L].screenX,
- screenY: N.touches[L].screenY,
- pageX: N.touches[L].pageX,
- pageY: N.touches[L].pageY,
- target: N.touches[L].target,
- identifier: N.touches[L].identifier
- })
- }
- }
- if (N.changedTouches) {
- M.changedTouches = [];
- for (var L = 0; L < N.changedTouches.length; L++) {
- M.changedTouches.push({
- clientX: N.changedTouches[L].clientX,
- clientY: N.changedTouches[L].clientY,
- screenX: N.changedTouches[L].screenX,
- screenY: N.changedTouches[L].screenY,
- pageX: N.changedTouches[L].pageX,
- pageY: N.changedTouches[L].pageY,
- target: N.changedTouches[L].target,
- identifier: N.changedTouches[L].identifier
- })
- }
- }
- if (N.targetTouches) {
- M.targetTouches = [];
- for (var L = 0; L < N.targetTouches.length; L++) {
- M.targetTouches.push({
- clientX: N.targetTouches[L].clientX,
- clientY: N.targetTouches[L].clientY,
- screenX: N.targetTouches[L].screenX,
- screenY: N.targetTouches[L].screenY,
- pageX: N.targetTouches[L].pageX,
- pageY: N.targetTouches[L].pageY,
- target: N.targetTouches[L].target,
- identifier: N.targetTouches[L].identifier
- })
- }
- }
- M.rotation = N.rotation;
- M.scale = N.scale;
- return M
- };
- var F = J.lang.Event;
- J.lang.decontrol = function(M) {
- var L = window[J.guid];
- L._instances && (delete L._instances[M])
- };
- J.event = {};
- J.on = J.event.on = function(N, M, L) {
- if (!(N = J.g(N))) {
- return N
- }
- M = M.replace(/^on/, "");
- if (N.addEventListener) {
- N.addEventListener(M, L, false)
- } else {
- if (N.attachEvent) {
- N.attachEvent("on" + M, L)
- }
- }
- return N
- };
- J.un = J.event.un = function(N, M, L) {
- if (!(N = J.g(N))) {
- return N
- }
- M = M.replace(/^on/, "");
- if (N.removeEventListener) {
- N.removeEventListener(M, L, false)
- } else {
- if (N.detachEvent) {
- N.detachEvent("on" + M, L)
- }
- }
- return N
- };
- J.dom.hasClass = function(N, M) {
- if (!N || !N.className || typeof N.className != "string") {
- return false
- }
- var L = -1;
- try {
- L = N.className == M || N.className.indexOf(M)
- } catch (O) {
- return false
- }
- return L > -1
- };
- var u = u || {};
- u._register = [];
- u.register = function(L) {
- this._register.push(L)
- };
- var G = window.BMAP_AUTHENTIC_KEY || "";
- u._rd = {};
- u.verify = function() {
- var L = u.apiUrl + "?qt=verify&ak=" + G;
- o.request(L, function(M) {
- if (M && M.error !== 0) {
- if (typeof map !== "undefined") {
- map.getContainer().innerHTML = "";
- map.__listeners = {}
- }
- u = null;
- var N =
- "百度未授权使用地图API,可能是因为您提供的密钥不是有效的百度LBS开放平台密钥,或此密钥未对本应用的百度地图JavaScriptAPI授权。您可以访问如下网址了解如何获取有效的密钥:http://lbsyun.baidu.com/apiconsole/key#。";
- switch (M.error) {
- case 101:
- N = "开发者禁用了该ak的jsapi服务权限。您可以访问如下网址了解如何获取有效的密钥:http://lbsyun.baidu.com/apiconsole/key#。";
- break;
- case 102:
- N = "开发者Referer不正确。您可以访问如下网址了解如何获取有效的密钥:http://lbsyun.baidu.com/apiconsole/key#。";
- break
- }
- alert(N)
- }
- })
- };
- u.copyright = function() {};
- window.BMap = u;
- u.Map = m;
- u.Point = w;
- u.Pixel = j;
- u.Size = d;
- u.Bounds = f;
- u.Projection = n;
- u.MercatorProjection = r;
- u.TileLayer = l;
- u.Control = x;
- u.ScaleControl = y;
- u.ZoomControl = C;
- u.CopyrightControl = k;
- u.Overlay = E;
- u.Marker = z;
- u.Icon = h;
- u.MassFeature = q;
- function m(O, Q) {
- O = J.g(O);
- if (!O) {
- return
- }
- var P = this;
- J.lang.Class.call(P);
- P.config = {
- useVectorMap: false,
- enableDragging: true,
- enableDblclickZoom: true,
- enablePinchToZoom: true,
- enableInertialDragging: true,
- minZoom: 4,
- maxZoom: 18,
- dpr: 2,
- tileSize: 256,
- fixCenterWhenPinch: false,
- fixCenterWhenResize: false,
- backgroundColor: "#F5F3F0",
- personalUrls: "dd",
- mapStyle: null
- };
- J.extend(P.config, Q || {});
- P.projection = new r();
- P.container = O;
- P._setStyle(O);
- O.unselectable = "on";
- O.innerHTML = "";
- O.appendChild(P._render());
- var M = P.getSize();
- P.width = M.width;
- P.height = M.height;
- P.offsetX = 0;
- P.offsetY = 0;
- P.platform = O.firstChild;
- P.preWebkitTransform = "";
- P.maskLayer = P.platform.firstChild;
- P.maskLayer.style.width = P.width + "px";
- P.maskLayer.style.height = P.height + "px";
- P._panes = {};
- P.centerPoint = new w(0, 0);
- P.zoomLevel = 3;
- P.lastLevel = -1;
- P.defaultZoomLevel = null;
- P.defaultCenter = null;
- P._checkZoom();
- P.temp = {
- lastDomMoveTime: 0,
- registerIndex: -1
- };
- for (var N = 0; N < u._register.length; N++) {
- u._register[N](P)
- }
- P.temp.registerIndex = N;
- var L = P.config.useVectorMap;
- if (L) {
- P.vectorLayerMgr = new VectorLayerMgr(P)
- } else {
- P.rasterLayerMgr = new c(P)
- }
- P._bind();
- p.load("opmb", function() {
- P._asyncRegister()
- });
- O = null;
- P.addCopyrightControl()
- }
- J.lang.inherits(m, J.lang.Class, "Map");
- J.extend(m.prototype, {
- _render: function() {
- var L = document.createElement("div");
- L.style.cssText = "position:absolute;overflow:visible;left:0;top:0;z-index:0;";
- var M = document.createElement("div");
- M.style.cssText = "position:absolute;left:0;top:0;z-index:10;overflow:hidden;";
- L.appendChild(M);
- return L
- },
- _setStyle: function(O) {
- var N = O.style;
- var M = N.cssText;
- if (o.getCurrentStyle(O).position != "absolute") {
- M += "position: relative; z-index: 0;"
- }
- var L = this.config.backgroundColor;
- M += ("overflow:hidden;background-color:" + L + ";color:#000;text-align:left");
- N.cssText = M
- },
- _bind: function() {
- var L = this;
- L._watchSize = function() {
- var M = L.getSize();
- if (L.width !== M.width || L.height !== M.height) {
- L.width = M.width;
- L.height = M.height;
- var O = new d(L.width, L.height);
- var P = new F("onbeforeresize");
- P.size = O;
- L.dispatchEvent(P);
- if (!L.config.fixCenterWhenResize) {
- L._updateCenterPoint((M.width - L.width) / 2, (M.height - L.height) / 2)
- }
- L.maskLayer.style.width = L.width + "px";
- L.maskLayer.style.height = L.height + "px";
- var N = new F("onresize");
- N.size = M;
- L.dispatchEvent(N)
- }
- };
- L.temp.autoResizeTimer = setInterval(L._watchSize, 1000)
- },
- _zoomTo: function(N) {
- if (!J.lang.isNumber(N)) {
- return
- }
- N = this._getProperZoom(N).zoom;
- if (N == this.zoomLevel) {
- return
- }
- var M = this.temp;
- if (M.dragAni) {
- M.dragAni.stop()
- }
- this.lastLevel = this.zoomLevel;
- this.zoomLevel = N;
- var L = new F("onzoomstart");
- L.evtSrc = "zoomTo";
- this.dispatchEvent(L)
- },
- setZoom: function(L) {
- this._zoomTo(L)
- },
- zoomIn: function() {
- this._zoomTo(this.zoomLevel + 1)
- },
- zoomOut: function() {
- this._zoomTo(this.zoomLevel - 1)
- },
- setCenter: function(L) {
- if (L.equals(this.centerPoint)) {
- return
- }
- this.panTo(L, {
- noAnimation: true
- })
- },
- isLoaded: function() {
- return !!this.loaded
- },
- centerAndZoom: function(L, P) {
- var O = this;
- P = parseInt(P, 10);
- if (!(L instanceof w) || !P) {
- return
- }
- L = O.projection.lngLatToMercator(L);
- P = O._getProperZoom(P).zoom;
- if (L.equals(O.getCenter()) && P === O.getZoom()) {
- return
- }
- O.lastLevel = O.zoomLevel || P;
- O.zoomLevel = P;
- O.centerPoint = new w(L.lng, L.lat);
- O.defaultZoomLevel = O.defaultZoomLevel || O.zoomLevel;
- O.defaultCenter = O.defaultCenter || O.centerPoint;
- var M = new F("oncenterzoomend");
- M.point = new w(L.lng, L.lat);
- M.pixel = O.pointToPixel(O.centerPoint);
- M.zoom = O.zoomLevel;
- O.dispatchEvent(M);
- if (!O.loaded) {
- var N = new F("onload");
- N.point = new w(L.lng, L.lat);
- N.pixel = O.pointToPixel(O.centerPoint);
- N.zoom = P;
- O.dispatchEvent(N)
- }
- },
- reset: function() {
- this.centerAndZoom(this.defaultCenter, this.defaultZoomLevel)
- },
- getContainer: function() {
- return this.container
- },
- getSize: function() {
- return new d(this.container.clientWidth, this.container.clientHeight)
- },
- getCenter: function() {
- var L = this.projection.mercatorToLngLat(this.centerPoint);
- return L
- },
- getZoom: function() {
- return this.zoomLevel
- },
- _getProperZoom: function(N) {
- var M = this.config.minZoom;
- var L = this.config.maxZoom;
- var O = false;
- if (N < M) {
- O = true;
- N = M
- }
- if (N > L) {
- O = true;
- N = L
- }
- return {
- zoom: N,
- exceeded: O
- }
- },
- panTo: function(M, O) {
- if (!(M instanceof w) || M.equals(this.centerPoint)) {
- return
- }
- var N = this.pointToPixel(M);
- var L = this.width / 2;
- var P = this.height / 2;
- O = O || {};
- if (Math.abs(L - N.x) > this.width || Math.abs(P - N.y) > this.height || O.noAnimation) {
- this._panTo(L - N.x, P - N.y)
- } else {
- this._panBy(L - N.x, P - N.y, {
- duration: O.duration
- })
- }
- },
- _panTo: function(M, L) {
- var N = this.temp;
- if (N.dragAni) {
- N.dragAni.stop()
- }
- this.dispatchEvent(new F("onmovestart"));
- this._setPlatformPosition(this.offsetX + M, this.offsetY + L);
- this.dispatchEvent(new F("onmoveend"))
- },
- panBy: function(M, L, N) {
- M = M || 0;
- L = L || 0;
- N = N || {};
- if (Math.abs(M) <= this.width && Math.abs(L) <= this.height && (!N.noAnimation)) {
- this._panBy(M, L)
- } else {
- this._panTo(M, L)
- }
- },
- _panBy: function(N, M, Q) {
- var P = this;
- Q = Q || {};
- this.dispatchEvent(new F("onmovestart"));
- var L = P.offsetX;
- var R = P.offsetY;
- var O = P.temp;
- if (O.dragAni) {
- O.dragAni.stop()
- }
- if (O.panAni) {
- O.panAni.stop()
- }
- O.panAni = new v({
- fps: Q.fps || 30,
- duration: Q.duration || 500,
- transition: Q.transition || i.easeInOutQuad,
- render: function(S) {
- P._setPlatformPosition(L + N * S, R + M * S)
- },
- finish: function(S) {
- P.dispatchEvent(new F("onmoveend"));
- P.temp.panAni = null
- }
- })
- },
- _setPlatformPosition: function(L, M) {
- if (isNaN(L) || isNaN(M)) {
- return
- }
- if (this.offsetX == L && this.offsetY == M) {
- return
- }
- this._updateCenterPoint(this.offsetX - L, this.offsetY - M);
- this.offsetX = L;
- this.offsetY = M;
- o.css3TransformDom(this.platform, L, M);
- o.css3TransformDom(this.maskLayer, -L, -M);
- this.dispatchEvent(new F("onmoving"))
- },
- _updateCenterPoint: function(M, L) {
- var N = this.getZoomUnits(this.zoomLevel);
- var O = this.centerPoint;
- this.centerPoint = new w(O.lng + M * N, O.lat - L * N)
- },
- getZoomUnits: function(L) {
- return Math.pow(2, (this.config.maxZoom - L))
- },
- getTileUnits: function(L) {
- return this.getZoomUnits(L) * this.config.tileSize
- },
- pointToPixel: function(M, P) {
- if (!M) {
- return
- }
- M = this.projection.lngLatToMercator(M);
- P = P || {};
- var O = P.zoom || this.zoomLevel;
- var S = P.centerPoint || this.centerPoint;
- var Q = P.basePoint || new j(this.width / 2, this.height / 2);
- var N = this.getZoomUnits(O);
- var L = (M.lng - S.lng) / N + Q.x;
- var R = (S.lat - M.lat) / N + Q.y;
- return new j(L, R)
- },
- pixelToPoint: function(N, M) {
- if (!N) {
- return
- }
- M = M || {};
- var T = M.zoom || this.zoomLevel;
- var O = M.centerPoint || this.centerPoint;
- var L = M.basePoint || new j(this.width / 2, this.height / 2);
- var S = this.getZoomUnits(T);
- var Q = O.lng + S * (N.x - L.x);
- var P = O.lat - S * (N.y - L.y);
- var R = new w(Q, P);
- R = this.projection.mercatorToLngLat(R);
- return R
- },
- pointToOverlayPixel: function(L, N) {
- if (!L) {
- return
- }
- var M = this.pointToPixel(L, N);
- M.x -= this.offsetX;
- M.y -= this.offsetY;
- return M
- },
- overlayPixelToPoint: function(L, N) {
- if (!L) {
- return
- }
- var M = new j(L.x, L.y);
- M.x += this.offsetX;
- M.y += this.offsetY;
- return this.pixelToPoint(M, N)
- },
- getBounds: function() {
- if (!this.isLoaded()) {
- return new f()
- }
- var M = new j(0, this.height);
- var L = new j(this.width, 0);
- var O = this.pixelToPoint(M);
- var N = this.pixelToPoint(L);
- return new f(O, N)
- },
- _getBestLevel: function(M, N) {
- var Q = N.margins || [10, 10, 10, 10];
- var R = Q[1] + Q[3];
- var P = Q[0] + Q[2];
- var L = this.config.minZoom;
- var T = this.config.maxZoom;
- for (var O = T; O >= L; O--) {
- var S = this.getZoomUnits(O);
- if (M.toSpan().lng / S < this.width - R && M.toSpan().lat / S < this.height - P) {
- break
- }
- }
- if (O < L) {
- O = L
- }
- if (O > T) {
- O = T
- }
- return O
- },
- getViewport: function(U, M) {
- var Y = {
- center: this.getCenter(),
- zoom: this.getZoom()
- };
- if (!U || !U instanceof f && U.length == 0 || U instanceof f && U.isEmpty()) {
- return Y
- }
- var W = [];
- if (U instanceof f) {
- W.push(U.getNorthEast());
- W.push(U.getSouthWest())
- } else {
- W = U.slice(0)
- }
- M = M || {};
- var Q = [];
- for (var R = 0, P = W.length; R < P; R++) {
- Q.push(this.projection.lngLatToMercator(W[R]))
- }
- var N = new f();
- for (var R = Q.length - 1; R >= 0; R--) {
- N.extend(Q[R])
- }
- if (N.isEmpty()) {
- return Y
- }
- var L = N.getCenter();
- var X = this._getBestLevel(N, M);
- if (M.margins) {
- var T = M.margins;
- var S = (T[1] - T[3]) / 2;
- var V = (T[0] - T[2]) / 2;
- var O = this.getZoomUnits(X);
- L.lng = L.lng + O * S;
- L.lat = L.lat + O * V
- }
- L = this.projection.mercatorToLngLat(L);
- return {
- center: L,
- zoom: X
- }
- },
- setViewport: function(M, N) {
- var L;
- if (M && M.center) {
- L = M
- } else {
- L = this.getViewport(M, N)
- }
- N = N || {};
- if (L.zoom == this.zoomLevel && N.enableAnimation !== false) {
- this.panTo(L.center, {
- duration: 210
- })
- } else {
- this.centerAndZoom(L.center, L.zoom)
- }
- },
- getPanes: function() {
- return this._panes
- },
- getOverlays: function() {
- var O = [];
- var P = this._overlays;
- var N = this._customOverlays;
- if (P) {
- for (var M in P) {
- if (P[M] instanceof I) {
- O.push(P[M])
- }
- }
- }
- if (N) {
- for (var M = 0, L = N.length; M < L; M++) {
- O.push(N[M])
- }
- }
- return O
- },
- _asyncRegister: function() {
- for (var M = this.temp.registerIndex, L = u._register.length; M < L; M++) {
- u._register[M](this)
- }
- this.temp.registerIndex = M
- },
- _checkZoom: function() {
- var L = this.config;
- if (L.minZoom < 3) {
- L.minZoom = 3
- }
- if (L.maxZoom > 18) {
- L.maxZoom = 18
- }
- },
- addControl: function(L) {
- if (L && J.lang.isFunction(L._i)) {
- L._i(this);
- this.dispatchEvent(new F("onaddcontrol", L))
- }
- },
- removeControl: function(L) {
- if (L && J.lang.isFunction(L.remove)) {
- L.remove();
- this.dispatchEvent(new F("onremovecontrol", L))
- }
- },
- addOverlay: function(L) {
- if (L && J.lang.isFunction(L._i)) {
- L._i(this);
- this.dispatchEvent(new F("onaddoverlay", L))
- }
- },
- removeOverlay: function(L) {
- if (L && J.lang.isFunction(L.remove)) {
- L.remove();
- this.dispatchEvent(new F("onremoveoverlay", L))
- }
- },
- clearOverlays: function() {
- this.dispatchEvent(new F("onclearoverlays"))
- },
- addMassFeatures: function(M) {
- var L = new F("onaddmassfeatures");
- L.massFeatures = M;
- this.dispatchEvent(L)
- },
- removeMassFeatures: function(M) {
- var L = new F("onremovemassfeatures");
- L.massFeatures = M;
- this.dispatchEvent(L)
- },
- clearMassFeatures: function() {
- var L = new F("onclearmassfeatures");
- this.dispatchEvent(L)
- },
- addTileLayer: function(L) {
- if (L) {
- this.dispatchEvent(new F("onaddtilelayer", L))
- }
- },
- removeTileLayer: function(L) {
- if (L) {
- this.dispatchEvent(new F("onremovetilelayer", L))
- }
- },
- enableDragging: function() {
- this.config.enableDragging = true
- },
- disableDragging: function() {
- this.config.enableDragging = false
- },
- enableInertialDragging: function() {
- this.config.enableInertialDragging = true
- },
- disableInertialDragging: function() {
- this.config.enableInertialDragging = false
- },
- enableDoubleClickZoom: function() {
- this.config.enableDblclickZoom = true
- },
- disableDoubleClickZoom: function() {
- this.config.enableDblclickZoom = false
- },
- enablePinchToZoom: function() {
- this.config.enablePinchToZoom = true
- },
- disablePinchToZoom: function() {
- this.config.enablePinchToZoom = false
- },
- addCopyrightControl: function() {
- var L = new k();
- this.addControl(L)
- }
- });
- function f(L, M) {
- if (L && !M) {
- M = L
- }
- this._sw = this._ne = null;
- this._swLng = this._swLat = null;
- this._neLng = this._neLat = null;
- if (L) {
- this._sw = new w(L.lng, L.lat);
- this._ne = new w(M.lng, M.lat);
- this._swLng = L.lng;
- this._swLat = L.lat;
- this._neLng = M.lng;
- this._neLat = M.lat
- }
- }
- J.object.extend(f.prototype, {
- isEmpty: function() {
- return !this._sw || !this._ne
- },
- equals: function(L) {
- if (!(L instanceof f) || this.isEmpty()) {
- return false
- }
- return this.getSouthWest().equals(L.getSouthWest()) && this.getNorthEast().equals(L.getNorthEast())
- },
- getSouthWest: function() {
- return this._sw
- },
- getNorthEast: function() {
- return this._ne
- },
- getCenter: function() {
- if (this.isEmpty()) {
- return null
- }
- return new w((this._swLng + this._neLng) / 2, (this._swLat + this._neLat) / 2)
- },
- extend: function(L) {
- if (!(L instanceof w)) {
- return
- }
- var M = L.lng,
- N = L.lat;
- if (!this._sw) {
- this._sw = new w(0, 0)
- }
- if (!this._ne) {
- this._ne = new w(0, 0)
- }
- if (!this._swLng || this._swLng > M) {
- this._sw.lng = this._swLng = M
- }
- if (!this._neLng || this._neLng < M) {
- this._ne.lng = this._neLng = M
- }
- if (!this._swLat || this._swLat > N) {
- this._sw.lat = this._swLat = N
- }
- if (!this._neLat || this._neLat < N) {
- this._ne.lat = this._neLat = N
- }
- },
- toSpan: function() {
- if (this.isEmpty()) {
- return new w(0, 0)
- }
- return new w(Math.abs(this._neLng - this._swLng), Math.abs(this._neLat - this._swLat))
- }
- });
- function w(L, M) {
- this.lng = parseFloat(L);
- this.lat = parseFloat(M)
- }
- w.prototype.equals = function(L) {
- return L && this.lat == L.lat && this.lng == L.lng
- };
- function n() {}
- n.prototype.lngLatToPoint = function() {};
- n.prototype.pointToLngLat = function() {};
- function r() {}
- J.extend(r, {
- EARTHRADIUS: 6370996.81,
- MCBAND: [12890594.86, 8362377.87, 5591021, 3481989.83, 1678043.12, 0],
- LLBAND: [75, 60, 45, 30, 15, 0],
- MC2LL: [
- [1.410526172116255e-8, 0.00000898305509648872, -1.9939833816331, 200.9824383106796, -187.2403703815547,
- 91.6087516669843, -23.38765649603339, 2.57121317296198, -0.03801003308653, 17337981.2
- ],
- [-7.435856389565537e-9, 0.000008983055097726239, -0.78625201886289, 96.32687599759846, -1.85204757529826, -
- 59.36935905485877, 47.40033549296737, -16.50741931063887, 2.28786674699375, 10260144.86
- ],
- [-3.030883460898826e-8, 0.00000898305509983578, 0.30071316287616, 59.74293618442277, 7.357984074871, -
- 25.38371002664745, 13.45380521110908, -3.29883767235584, 0.32710905363475, 6856817.37
- ],
- [-1.981981304930552e-8, 0.000008983055099779535, 0.03278182852591, 40.31678527705744, 0.65659298677277, -
- 4.44255534477492, 0.85341911805263, 0.12923347998204, -0.04625736007561, 4482777.06
- ],
- [3.09191371068437e-9, 0.000008983055096812155, 0.00006995724062, 23.10934304144901, -0.00023663490511, -
- 0.6321817810242, -0.00663494467273, 0.03430082397953, -0.00466043876332, 2555164.4
- ],
- [2.890871144776878e-9, 0.000008983055095805407, -3.068298e-8, 7.47137025468032, -0.00000353937994, -
- 0.02145144861037, -0.00001234426596, 0.00010322952773, -0.00000323890364, 826088.5
- ]
- ],
- LL2MC: [
- [-0.0015702102444, 111320.7020616939, 1704480524535203, -10338987376042340, 26112667856603880, -
- 35149669176653700, 26595700718403920, -10725012454188240, 1800819912950474, 82.5
- ],
- [0.0008277824516172526, 111320.7020463578, 647795574.6671607, -4082003173.641316, 10774905663.51142, -
- 15171875531.51559, 12053065338.62167, -5124939663.577472, 913311935.9512032, 67.5
- ],
- [0.00337398766765, 111320.7020202162, 4481351.045890365, -23393751.19931662, 79682215.47186455, -
- 115964993.2797253, 97236711.15602145, -43661946.33752821, 8477230.501135234, 52.5
- ],
- [0.00220636496208, 111320.7020209128, 51751.86112841131, 3796837.749470245, 992013.7397791013, -
- 1221952.21711287, 1340652.697009075, -620943.6990984312, 144416.9293806241, 37.5
- ],
- [-0.0003441963504368392, 111320.7020576856, 278.2353980772752, 2485758.690035394, 6070.750963243378,
- 54821.18345352118, 9540.606633304236, -2710.55326746645, 1405.483844121726, 22.5
- ],
- [-0.0003218135878613132, 111320.7020701615, 0.00369383431289, 823725.6402795718, 0.46104986909093,
- 2351.343141331292, 1.58060784298199, 8.77738589078284, 0.37238884252424, 7.45
- ]
- ],
- getDistanceByMC: function(Q, O) {
- if (!Q || !O) {
- return 0
- }
- var M;
- var P;
- var L;
- var N;
- Q = this.convertMC2LL(Q);
- if (!Q) {
- return 0
- }
- M = this.toRadians(Q.lng);
- P = this.toRadians(Q.lat);
- O = this.convertMC2LL(O);
- if (!O) {
- return 0
- }
- L = this.toRadians(O.lng);
- N = this.toRadians(O.lat);
- return this.getDistance(M, L, P, N)
- },
- getDistanceByLL: function(Q, O) {
- if (!Q || !O) {
- return 0
- }
- Q.lng = this.getLoop(Q.lng, -180, 180);
- Q.lat = this.getRange(Q.lat, -74, 74);
- O.lng = this.getLoop(O.lng, -180, 180);
- O.lat = this.getRange(O.lat, -74, 74);
- var M;
- var L;
- var P;
- var N;
- M = this.toRadians(Q.lng);
- P = this.toRadians(Q.lat);
- L = this.toRadians(O.lng);
- N = this.toRadians(O.lat);
- return this.getDistance(M, L, P, N)
- },
- convertMC2LL: function(M) {
- if (M === null || M === undefined) {
- return new w(0, 0)
- }
- var N;
- var P;
- N = new w(Math.abs(M.lng), Math.abs(M.lat));
- for (var O = 0; O < this.MCBAND.length; O++) {
- if (N.lat >= this.MCBAND[O]) {
- P = this.MC2LL[O];
- break
- }
- }
- var L = this.convertor(M, P);
- var M = new w(L.lng.toFixed(6), L.lat.toFixed(6));
- return M
- },
- convertLL2MC: function(L) {
- if (L === null || L === undefined) {
- return new w(0, 0)
- }
- if (L.lng > 180 || L.lng < -180 || L.lat > 90 || L.lat < -90) {
- return new w(0, 0)
- }
- var M;
- var O;
- L.lng = this.getLoop(L.lng, -180, 180);
- L.lat = this.getRange(L.lat, -74, 74);
- M = new w(L.lng, L.lat);
- for (var N = 0; N < this.LLBAND.length; N++) {
- if (M.lat >= this.LLBAND[N]) {
- O = this.LL2MC[N];
- break
- }
- }
- if (!O) {
- for (var N = 0; N < this.LLBAND.length; N++) {
- if (M.lat <= -this.LLBAND[N]) {
- O = this.LL2MC[N];
- break
- }
- }
- }
- var P = this.convertor(L, O);
- var L = new w(P.lng.toFixed(2), P.lat.toFixed(2));
- return L
- },
- convertor: function(N, O) {
- if (!N || !O) {
- return
- }
- var L = O[0] + O[1] * Math.abs(N.lng);
- var M = Math.abs(N.lat) / O[9];
- var P = O[2] + O[3] * M + O[4] * M * M + O[5] * M * M * M + O[6] * M * M * M * M + O[7] * M * M * M * M * M +
- O[8] * M * M * M * M * M * M;
- L *= (N.lng < 0 ? -1 : 1);
- P *= (N.lat < 0 ? -1 : 1);
- return new w(L, P)
- },
- getDistance: function(M, L, O, N) {
- return this.EARTHRADIUS * Math.acos((Math.sin(O) * Math.sin(N) + Math.cos(O) * Math.cos(N) * Math.cos(L - M)))
- },
- toRadians: function(L) {
- return Math.PI * L / 180
- },
- toDegrees: function(L) {
- return (180 * L) / Math.PI
- },
- getRange: function(N, M, L) {
- if (M != null) {
- N = Math.max(N, M)
- }
- if (L != null) {
- N = Math.min(N, L)
- }
- return N
- },
- getLoop: function(N, M, L) {
- while (N > L) {
- N -= L - M
- }
- while (N < M) {
- N += L - M
- }
- return N
- }
- });
- J.extend(r.prototype, {
- lngLatToMercator: function(L) {
- return r.convertLL2MC(L)
- },
- lngLatToPoint: function(L) {
- var M = r.convertLL2MC(L);
- return new j(M.lng, M.lat)
- },
- mercatorToLngLat: function(L) {
- return r.convertMC2LL(L)
- },
- pointToLngLat: function(L) {
- var M = new w(L.x, L.y);
- return r.convertMC2LL(M)
- },
- pointToPixel: function(M, Q, P, O, R) {
- if (!M) {
- return
- }
- M = this.lngLatToMercator(M, R);
- var N = this.getZoomUnits(Q);
- var L = Math.round((M.lng - P.lng) / N + O.width / 2);
- var S = Math.round((P.lat - M.lat) / N + O.height / 2);
- return new j(L, S)
- },
- pixelToPoint: function(L, T, P, N, M) {
- if (!L) {
- return
- }
- var S = this.getZoomUnits(T);
- var Q = P.lng + S * (L.x - N.width / 2);
- var O = P.lat - S * (L.y - N.height / 2);
- var R = new w(Q, O);
- return this.mercatorToLngLat(R, M)
- },
- getZoomUnits: function(L) {
- return Math.pow(2, (18 - L))
- }
- });
- u.httpUrl = {
- TILE_ONLINE_URLS: ["online0.map.bdimg.com", "online1.map.bdimg.com", "online2.map.bdimg.com",
- "online3.map.bdimg.com", "online4.map.bdimg.com"
- ],
- baidumap: "map.baidu.com",
- main_domain_nocdn: {
- baidu: "api.map.baidu.com"
- },
- main_domain_cdn: {
- other: ["api.map.baidu.com"],
- baidu: ["api0.map.bdimg.com", "api1.map.bdimg.com", "api2.map.bdimg.com"]
- }
- };
- u.httpsUrl = {
- TILE_ONLINE_URLS: ["gss0.bdstatic.com/8bo_dTSlR1gBo1vgoIiO_jowehsv",
- "gss0.bdstatic.com/8bo_dTSlRMgBo1vgoIiO_jowehsv", "gss0.bdstatic.com/8bo_dTSlRcgBo1vgoIiO_jowehsv",
- "gss0.bdstatic.com/8bo_dTSlRsgBo1vgoIiO_jowehsv", "gss0.bdstatic.com/8bo_dTSlQ1gBo1vgoIiO_jowehsv"
- ],
- baidumap: "gsp0.baidu.com/80MWsjip0QIZ8tyhnq",
- main_domain_nocdn: {
- baidu: "gsp0.baidu.com/9_Q4sjOpB1gCo2Kml5_Y_D3",
- other: "api.map.baidu.com"
- },
- main_domain_cdn: {
- other: "api.map.baidu.com",
- baidu: ["gss0.bdstatic.com/9_Q4vHSd2RZ3otebn9fN2DJv", "gss0.baidu.com/9_Q4vXSd2RZ3otebn9fN2DJv",
- "gss0.bdstatic.com/9_Q4vnSd2RZ3otebn9fN2DJv"
- ]
- }
- };
- u.urlType = {
- "0": {
- proto: "http://",
- domain: u.httpUrl
- },
- "1": {
- proto: "https://",
- domain: u.httpsUrl
- },
- "2": {
- proto: "https://",
- domain: u.httpsUrl
- }
- };
- if (window.BMAP_PROTOCOL && window.BMAP_PROTOCOL === "https") {
- window.HOST_TYPE = 2
- }
- u.urlStr = window.HOST_TYPE || "0";
- u.url = u.urlType[u.urlStr];
- u.mapUrl = u.url.proto + u.url.domain["baidumap"] + "/";
- u.apiUrl = u.url.proto + (u.urlStr == "2" ? u.url.domain["main_domain_nocdn"]["other"] : u.url.domain[
- "main_domain_nocdn"]["baidu"]) + "/";
- u.apiUrlCdn = u.url.proto + (u.urlStr == "2" ? u.url.domain["main_domain_cdn"]["other"] : u.url.domain[
- "main_domain_cdn"]["baidu"][0]) + "/";
- var o = {
- setPosition: function(N, L) {
- var M = N.style;
- M.left = L[0] + "px";
- M.top = L[1] + "px"
- },
- setUnSelectable: function(L) {
- L.style.MozUserSelect = "none"
- },
- isInDocument: function(L) {
- return L && L.parentNode && L.parentNode.nodeType != 11
- },
- beforeEndHTML: function(M, L) {
- J.dom.insertHTML(M, "beforeEnd", L);
- return M.lastChild
- },
- getPosition: function(L) {
- var M = {
- left: 0,
- top: 0
- };
- while (L && L.offsetParent) {
- M.left += L.offsetLeft;
- M.top += L.offsetTop;
- L = L.offsetParent
- }
- return M
- },
- stopBubble: function(L) {
- var L = window.event || L;
- L.stopPropagation ? L.stopPropagation() : L.cancelBubble = true
- },
- preventDefault: function(L) {
- var L = window.event || L;
- L.preventDefault ? L.preventDefault() : L.returnValue = false;
- return false
- },
- stopAndPrevent: function(L) {
- this.stopBubble(L);
- return this.preventDefault(L)
- },
- getScroll: function() {
- var L = document.documentElement,
- M = document.body;
- if (L && (L.scrollTop || L.scrollLeft)) {
- return [L.scrollTop, L.scrollLeft]
- } else {
- if (M) {
- return [M.scrollTop, M.scrollLeft]
- } else {
- return [0, 0]
- }
- }
- },
- getDistanceByPixel: function(M, L) {
- if (!M || !L) {
- return
- }
- return Math.round(Math.sqrt(Math.pow(M.x - L.x, 2) + Math.pow(M.y - L.y, 2)))
- },
- create: function(M, L, N) {
- var O = document.createElement(M);
- if (N) {
- O = document.createElementNS(N, M)
- }
- return J.dom.setAttrs(O, L || {})
- },
- getCurrentStyle: function(L) {
- if (L.currentStyle) {
- return L.currentStyle
- } else {
- if (L.ownerDocument && L.ownerDocument.defaultView) {
- return L.ownerDocument.defaultView.getComputedStyle(L, null)
- }
- }
- },
- isDefined: function(L) {
- return typeof L != "undefined"
- },
- isSupportCanvas: function() {
- if (typeof this.isSupportCanvas.result != "boolean") {
- this.isSupportCanvas.result = !!this.create("canvas").getContext
- }
- return this.isSupportCanvas.result
- },
- getCurrentTime: function() {
- return (new Date).getTime()
- },
- isAndroid23More: function() {
- if (J.platform.isAndroid && parseFloat(J.platform.android) > 2.3) {
- return true
- }
- return false
- },
- canUseTranslate3d: function() {
- if (typeof this.canUseTranslate3d.result !== "boolean") {
- this.canUseTranslate3d.result = o.isAndroid23More() || J.platform.isIphone
- }
- return this.canUseTranslate3d.result
- },
- css3TransformDom: function(P, M, Q, O) {
- var L = "";
- if (O !== undefined) {
- L = " scale(" + O + ")"
- }
- var N = "";
- if (this.canUseTranslate3d()) {
- N = "translate3d(" + M + "px," + Q + "px,0px)"
- } else {
- N = "translate(" + M + "px," + Q + "px)"
- }
- P.style.WebkitTransform = N + L
- },
- request: function(O, L) {
- if (L) {
- var N = (Math.random() * 100000).toFixed(0);
- u._rd["_cbk" + N] = function(P) {
- L && L(P);
- delete u._rd["_cbk" + N]
- };
- O += "&callback=BMap._rd._cbk" + N
- }
- var M = this.create("script", {
- src: O,
- type: "text/javascript",
- charset: "utf-8"
- });
- M.addEventListener("load", function(Q) {
- var P = Q.target;
- P.parentNode.removeChild(P)
- }, false);
- document.getElementsByTagName("head")[0].appendChild(M);
- M = null
- }
- };
- function v(O) {
- var L = {
- duration: 1000,
- fps: 30,
- delay: 0,
- transition: i.linear,
- onStop: function() {}
- };
- this._anis = [];
- if (O) {
- for (var M in O) {
- L[M] = O[M]
- }
- }
- this._opts = L;
- if (J.lang.isNumber(L.delay)) {
- var N = this;
- setTimeout(function() {
- N.start()
- }, L.delay)
- } else {
- if (L.delay != v.INFINITE) {
- this.start()
- }
- }
- }
- v.INFINITE = "INFINITE";
- v.prototype.start = function() {
- if (window.requestAnimationFrame) {
- var L = this;
- L._timer = window.requestAnimationFrame(function(M) {
- L._loop(M)
- })
- } else {
- this._beginTime = o.getCurrentTime();
- this._endTime = this._beginTime + this._opts.duration;
- this._loop()
- }
- };
- v.prototype._loop = function() {
- var M = this;
- var L = o.getCurrentTime();
- if (!this._beginTime) {
- this._beginTime = L;
- this._endTime = this._beginTime + this._opts.duration
- }
- if (L >= M._endTime) {
- if (J.lang.isFunction(M._opts.render)) {
- M._opts.render(M._opts.transition(1))
- }
- if (J.lang.isFunction(M._opts.finish)) {
- M._opts.finish()
- }
- return
- }
- M.schedule = M._opts.transition((L - M._beginTime) / M._opts.duration);
- if (J.lang.isFunction(M._opts.render)) {
- M._opts.render(M.schedule)
- }
- if (!M.terminative) {
- if (window.requestAnimationFrame) {
- M._timer = requestAnimationFrame(function(N) {
- M._loop(N)
- })
- } else {
- M._timer = setTimeout(function() {
- M._loop()
- }, 1000 / M._opts.fps)
- }
- }
- };
- v.prototype.stop = function(M) {
- this.terminative = true;
- for (var L = 0; L < this._anis.length; L++) {
- this._anis[L].stop();
- this._anis[L] = null
- }
- this._anis.length = 0;
- if (this._timer) {
- if (window.cancelAnimationFrame) {
- cancelAnimationFrame(this._timer)
- } else {
- clearTimeout(this._timer)
- }
- this._timer = null
- }
- this._opts.onStop(this.schedule);
- if (M) {
- this._endTime = this._beginTime;
- this._loop()
- }
- };
- var i = {
- linear: function(L) {
- return L
- },
- reverse: function(L) {
- return 1 - L
- },
- easeInQuad: function(L) {
- return L * L
- },
- easeInCubic: function(L) {
- return Math.pow(L, 3)
- },
- easeOutQuad: function(L) {
- return -(L * (L - 2))
- },
- easeOutCubic: function(L) {
- return Math.pow((L - 1), 3) + 1
- },
- easeInOutQuad: function(L) {
- if (L < 0.5) {
- return L * L * 2
- } else {
- return -2 * (L - 2) * L - 1
- }
- return
- },
- easeInOutCubic: function(L) {
- if (L < 0.5) {
- return Math.pow(L, 3) * 4
- } else {
- return Math.pow(L - 1, 3) * 4 + 1
- }
- },
- easeInOutSine: function(L) {
- return (1 - Math.cos(Math.PI * L)) / 2
- }
- };
- i["ease-in"] = i.easeInQuad;
- i["ease-out"] = i.easeOutQuad;
- function j(L, M) {
- this.x = L || 0;
- this.y = M || 0
- }
- j.prototype.equals = function(L) {
- return L && L.x == this.x && L.y == this.y
- };
- function d(M, L) {
- this.width = M || 0;
- this.height = L || 0
- }
- d.prototype.equals = function(L) {
- return L && this.width == L.width && this.height == L.height
- };
- var B = 0;
- function p() {}
- J.object.extend(p, {
- Request: {
- INITIAL: -1,
- WAITING: 0,
- COMPLETED: 1
- },
- getDependency: function() {
- return {
- opmb: [],
- control: [],
- marker: [],
- massfeatures: []
- }
- },
- Config: {
- _baseUrl: "http://api.map.baidu.com/getmodules?type=lite"
- },
- delayFlag: false,
- ModuleTree: {
- _modules: {},
- _arrMdls: []
- },
- load: function(N, P, M) {
- var L = this.getModule(N);
- if (L._status == this.Request.COMPLETED) {
- if (M) {
- P && P()
- }
- return
- } else {
- if (L._status == this.Request.INITIAL) {
- this.combine(N);
- this.pushUniqueMdl(N);
- var O = this;
- if (O.delayFlag == false) {
- O.delayFlag = true;
- window.setTimeout(function() {
- var W = O.ModuleTree._arrMdls.slice(0);
- var Y = [];
- for (var S = 0, R = W.length; S < R; S++) {
- var X = W[S],
- Q = A.asyncMdlVer[X],
- U = "async_" + X + "_" + Q;
- if (!A.chkVersion(U)) {
- W[W[S]] = "";
- Y.push(X + "_" + Q)
- } else {
- W[W[S]] = A.getVersion(U)
- }
- }
- if (Y.length == 0) {
- for (var S = 0, R = W.length; S < R; S++) {
- var Z = W[S],
- U = "async_" + Z + "_" + A.asyncMdlVer[Z],
- V = A.getVersion(U);
- p.run(Z, V)
- }
- } else {
- var T = O.Config._baseUrl + "&mod=" + Y.join(",") + "&sendSequenceNum=" + B + "&v=1.0";
- o.request(T);
- window["sendSequenceNum" + B] = W;
- B++
- }
- O.delayFlag = false;
- O.ModuleTree._arrMdls.length = 0
- }, 1)
- }
- L._status = this.Request.WAITING
- }
- L._callbacks.push(P)
- }
- },
- combine: function(L) {
- var N = this.getDependency();
- if (L && N[L]) {
- var N = N[L];
- for (var M = 0; M < N.length; M++) {
- this.combine(N[M]);
- if (!this.ModuleTree._modules[N[M]]) {
- this.pushUniqueMdl(N[M])
- }
- }
- }
- },
- pushUniqueMdl: function(O) {
- var L = this.ModuleTree._arrMdls;
- for (var N = 0, M = L.length; N < M; N++) {
- if (L[N] == O) {
- return
- }
- }
- L.push(O)
- },
- getModule: function(M) {
- var L;
- if (!this.ModuleTree._modules[M]) {
- this.ModuleTree._modules[M] = {};
- this.ModuleTree._modules[M]._status = this.Request.INITIAL;
- this.ModuleTree._modules[M]._callbacks = []
- }
- L = this.ModuleTree._modules[M];
- return L
- },
- run: function(O, R) {
- var M = "async_" + O + "_" + A.asyncMdlVer[O],
- Q = "async_" + O;
- if (!A.chkVersion(M)) {
- A.saveVersion(M, R, Q)
- }
- var N = this.getModule(O);
- try {
- eval(R)
- } catch (S) {
- return
- }
- N._status = this.Request.COMPLETED;
- for (var P = 0, L = N._callbacks.length; P < L; P++) {
- N._callbacks[P]()
- }
- N._callbacks.length = 0
- }
- });
- window._jsload = function(Q, S, R) {
- var L = window["sendSequenceNum" + R],
- N = Q.split("_")[0];
- L[N] = S;
- var P = true;
- for (var O = 0, M = L.length; O < M; O++) {
- if (L[L[O]].length <= 0) {
- P = false;
- break
- }
- }
- if (P) {
- for (var O = 0, M = L.length; O < M; O++) {
- var Q = L[O],
- S = L[Q];
- p.run(Q, S)
- }
- L.length = 0;
- delete window["sendSequenceNum" + R]
- }
- };
- var A = {
- asyncMdlVer: {
- control: "ldhxzj",
- marker: "01zsya",
- opmb: "dt2tyx",
- massfeatures: "j0omg2"
- },
- chkVersion: function(L) {
- try {
- var M = window.localStorage;
- if (!M) {
- return false
- }
- return M[L] && M[L].length > 0
- } catch (N) {
- return false
- }
- },
- saveVersion: function(L, R, P) {
- try {
- var N = window.localStorage;
- if (N) {
- for (var M = N.length, O = M - 1; O >= 0; O--) {
- var S = N.key(O);
- if (S.indexOf(P) > -1) {
- N.removeItem(S)
- }
- }
- N.setItem(L, R)
- }
- } catch (Q) {}
- },
- getVersion: function(L) {
- try {
- var M = window.localStorage;
- if (!M) {
- return ""
- }
- return M.getItem(L)
- } catch (N) {
- return ""
- }
- }
- };
- void
- function(N, L, M) {
- void
- function(Y, ay, aa) {
- var av = "alog";
- var W = aa[av];
- if (W && W.defined) {
- return
- }
- var am = ay.all && Y.attachEvent,
- ar, R = (W && W.l) || +new Date,
- ac = Y.logId || (+new Date).toString(36) + Math.random().toString(36).substr(2, 3),
- ae = 0,
- ag = {},
- ak = function(aF) {
- var aA = arguments;
- var az, aC, aE, aD;
- if (aF == "define" || aF == "require") {
- for (var aB = 1; aB < aA.length; aB++) {
- switch (typeof aA[aB]) {
- case "string":
- az = aA[aB];
- break;
- case "object":
- aE = aA[aB];
- break;
- case "function":
- aD = aA[aB];
- break
- }
- }
- if (aF == "require") {
- if (az && !aE) {
- aE = [az]
- }
- az = null
- }
- az = !az ? "#" + (ae++) : az;
- aC = ah[az] = (ah[az] || {});
- if (!aC.defined) {
- aC.name = az;
- aC.requires = aE;
- aC.creator = aD;
- if (aF == "define") {
- aC.defining = true
- }
- ab(aC)
- }
- return
- }
- if (typeof aF == "function") {
- aF(ak);
- return
- }
- String(aF).replace(/^(?:([\w$_]+)\.)?(\w+)$/, function(aG, aH, aI) {
- aA[0] = aI;
- Z.apply(ak.tracker(aH), aA)
- })
- },
- aq = {},
- S = {},
- ah = {
- alog: {
- name: "alog",
- defined: true,
- instance: ak
- }
- },
- an;
- function au(az) {
- var aB = P.get("alias") || {};
- var aC = aB[az] || (az + ".js");
- if (ag[aC]) {
- return
- }
- ag[aC] = true;
- var aA = "script";
- var aE = ay.createElement(aA);
- var aD = ay.getElementsByTagName(aA)[0];
- aE.async = !0;
- aE.src = aC;
- aD.parentNode.insertBefore(aE, aD)
- }
- function ab(aB) {
- if (aB.defined) {
- return
- }
- var aF = true;
- var aE = [];
- var aC = aB.requires;
- for (var aA = 0; aC && aA < aC.length; aA++) {
- var az = aC[aA];
- var aD = ah[az] = (ah[az] || {});
- if (aD.defined || aD == aB) {
- aE.push(aD.instance)
- } else {
- aF = false;
- if (!aD.defining) {
- au(az)
- }
- aD.waiting = aD.waiting || {};
- aD.waiting[aB.name] = aB
- }
- }
- if (aF) {
- aB.defined = true;
- if (aB.creator) {
- aB.instance = aB.creator.apply(aB, aE)
- }
- ao(aB)
- }
- }
- function ao(az) {
- for (var aA in az.waiting) {
- ab(az.waiting[aA])
- }
- }
- function V(az) {
- return (az || new Date) - R
- }
- function aj(aB, az, aC) {
- if (!aB) {
- return
- }
- if (typeof aB == "string") {
- aC = az;
- az = aB;
- aB = ak
- }
- try {
- if (aB == ak) {
- aq[az] = aq[az] || [];
- aq[az].unshift(aC);
- return
- }
- if (aB.addEventListener) {
- aB.addEventListener(az, aC, false)
- } else {
- if (aB.attachEvent) {
- aB.attachEvent("on" + az, aC)
- }
- }
- } catch (aA) {}
- }
- function al(aC, az, aE) {
- if (!aC) {
- return
- }
- if (typeof aC == "string") {
- aE = az;
- az = aC;
- aC = ak
- }
- try {
- if (aC == ak) {
- var aD = aq[az];
- if (!aD) {
- return
- }
- var aB = aD.length;
- while (aB--) {
- if (aD[aB] === aE) {
- aD.splice(aB, 1)
- }
- }
- return
- }
- if (aC.removeEventListener) {
- aC.removeEventListener(az, aE, false)
- } else {
- aC.detachEvent && aC.detachEvent("on" + az, aE)
- }
- } catch (aA) {}
- }
- function af(aB) {
- var aE = aq[aB],
- az = 0;
- if (!aE) {
- return
- }
- var aA = [];
- var aC = arguments;
- for (var aD = 1; aD < aC.length; aD++) {
- aA.push(aC[aD])
- }
- var aD = aE.length;
- while (aD--) {
- if (aE[aD].apply(this, aA)) {
- az++
- }
- }
- return az
- }
- function ax(aB, aD) {
- if (!aB || !aD) {
- return
- }
- var aE = new Image(1, 1),
- az = [],
- aA = "img_" + (+new Date);
- for (var aC in aD) {
- if (aD[aC]) {
- az.push(aC + "=" + encodeURIComponent(aD[aC]))
- }
- }
- ak[aA] = aE;
- aE.onload = aE.onerror = function() {
- ak[aA] = aE = aE.onload = aE.onerror = null;
- delete ak[aA]
- };
- aE.src = aB + "?" + az.join("&")
- }
- function X(aA, aB) {
- if (!aA) {
- return aB
- }
- var az = {};
- for (var aC in aB) {
- if (aA[aC] !== null) {
- az[aA[aC] || aC] = aB[aC]
- }
- }
- return az
- }
- function Z() {
- var aA = arguments;
- var aE = aA[0];
- if (this.created || /^(on|un|set|get|create)$/.test(aE)) {
- var aC = ai.prototype[aE];
- var aD = [];
- for (var aB = 1, az = aA.length; aB < az; aB++) {
- aD.push(aA[aB])
- }
- if (typeof aC == "function") {
- aC.apply(this, aD)
- }
- } else {
- this.argsList.push(aA)
- }
- }
- function ap(aB, aA) {
- var az = {};
- for (var aC in aB) {
- if (aB.hasOwnProperty(aC)) {
- az[aC] = aB[aC]
- }
- }
- for (var aC in aA) {
- if (aA.hasOwnProperty(aC)) {
- az[aC] = aA[aC]
- }
- }
- return az
- }
- function ai(az) {
- this.name = az;
- this.fields = {
- protocolParameter: {
- postUrl: null,
- protocolParameter: null
- }
- };
- this.argsList = [];
- this["alog"] = ak
- }
- function Q(aC) {
- var az;
- aC = aC || "default";
- if (aC == "*") {
- az = [];
- for (var aB in S) {
- az.push(S[aB])
- }
- return az
- }
- var aA = S[aC];
- if (!aA) {
- aA = S[aC] = new ai(aC)
- }
- return aA
- }
- ai.prototype.start = ai.prototype.create = function(az) {
- if (this.created) {
- return
- }
- if (typeof az == "object") {
- this.set(az)
- }
- this.created = new Date;
- this.fire("create", this);
- var aA;
- while (aA = this.argsList.shift()) {
- Z.apply(this, aA)
- }
- };
- ai.prototype.send = function(aC, aA) {
- var aB = ap({
- ts: V().toString(36),
- t: aC,
- sid: ac
- }, this.fields);
- if (typeof aA == "object") {
- aB = ap(aB, aA)
- } else {
- var az = arguments;
- switch (aC) {
- case "pageview":
- if (az[1]) {
- aB.page = az[1]
- }
- if (az[2]) {
- aB.title = az[2]
- }
- break;
- case "event":
- if (az[1]) {
- aB.eventCategory = az[1]
- }
- if (az[2]) {
- aB.eventAction = az[2]
- }
- if (az[3]) {
- aB.eventLabel = az[3]
- }
- if (az[4]) {
- aB.eventValue = az[4]
- }
- break;
- case "timing":
- if (az[1]) {
- aB.timingCategory = az[1]
- }
- if (az[2]) {
- aB.timingVar = az[2]
- }
- if (az[3]) {
- aB.timingValue = az[3]
- }
- if (az[4]) {
- aB.timingLabel = az[4]
- }
- break;
- case "exception":
- if (az[1]) {
- aB.exDescription = az[1]
- }
- if (az[2]) {
- aB.exFatal = az[2]
- }
- break;
- default:
- return
- }
- }
- this.fire("send", aB);
- ax(this.fields.postUrl, X(this.fields.protocolParameter, aB))
- };
- ai.prototype.set = function(az, aA) {
- if (typeof az == "string") {
- if (az == "protocolParameter") {
- aA = ap({
- postUrl: null,
- protocolParameter: null
- }, aA)
- }
- this.fields[az] = aA
- } else {
- if (typeof az == "object") {
- for (var aB in az) {
- this.set(aB, az[aB])
- }
- }
- }
- };
- ai.prototype.get = function(aA, aB) {
- var az = this.fields[aA];
- if (typeof aB == "function") {
- aB(az)
- }
- return az
- };
- ai.prototype.fire = function(az, aA) {
- return ak.fire(this.name + "." + az, aA)
- };
- ai.prototype.on = function(az, aA) {
- ak.on(this.name + "." + az, aA)
- };
- ai.prototype.un = function(az, aA) {
- ak.un(this.name + "." + az, aA)
- };
- ak.name = "alog";
- ak.sid = ac;
- ak.defined = true;
- ak.timestamp = V;
- ak.un = al;
- ak.on = aj;
- ak.fire = af;
- ak.tracker = Q;
- ak("init");
- var O = ai.prototype;
- s(O, {
- start: O.start,
- create: O.create,
- send: O.send,
- set: O.set,
- get: O.get,
- on: O.on,
- un: O.un,
- fire: O.fire
- });
- var P = Q();
- P.set("protocolParameter", {
- alias: null
- });
- if (W) {
- var ad = [].concat(W.p || [], W.q || []);
- W.p = W.q = null;
- for (var at in ak) {
- if (ak.hasOwnProperty(at)) {
- W[at] = ak[at]
- }
- }
- ak.p = ak.q = {
- push: function(az) {
- ak.apply(ak, az)
- }
- };
- for (var aw = 0; aw < ad.length; aw++) {
- ak.apply(ak, ad[aw])
- }
- }
- aa[av] = ak;
- if (am) {
- aj(ay, "mouseup", function(aA) {
- var az = aA.target || aA.srcElement;
- if (az.nodeType == 1 && /^ajavascript:/i.test(az.tagName + az.href)) {
- ar = new Date
- }
- })
- }
- function T() {
- if (am && (new Date - ar < 50)) {
- return
- }
- if (an) {
- return
- }
- an = true;
- var az = 0;
- for (var aB in S) {
- var aA = S[aB];
- if (aA.created) {
- az += aA.fire("unload")
- }
- }
- if (az) {
- var aC = new Date;
- while (new Date - aC < 100) {}
- }
- }
- var U = false;
- Y.onerror = function(aD, aB, az, aC) {
- var aA = true;
- if (!aB && /^script error/i.test(aD)) {
- if (U) {
- aA = false
- } else {
- U = true
- }
- }
- if (aA) {
- aa.alog("exception.send", "exception", {
- msg: aD,
- js: aB,
- ln: az,
- col: aC
- })
- }
- return false
- };
- aa.alog("exception.on", "catch", function(az) {
- aa.alog("exception.send", "exception", {
- msg: az.msg,
- js: az.path,
- ln: az.ln,
- method: az.method,
- flag: "catch"
- })
- })
- }(N, L, M);
- void
- function(aa, ba, bj) {
- var at = "18_5";
- var aF = {
- product: "18",
- page: at,
- monkey_page: "",
- speed_page: "",
- monkey: {
- sample: "0.1"
- },
- exception: {
- sample: "0.1"
- },
- cus: {
- sample: "0.1"
- },
- feature: {
- sample: "0"
- }
- };
- var aE = "http://fex.bdstatic.com";
- var Y = "http://static.tieba.baidu.com";
- var Q = Y;
- if (aa.location.protocol === "https:") {
- aE = "https://fex.bdstatic.com";
- Y = "https://gsp0.baidu.com/5aAHeD3nKhI2p27j8IqW0jdnxx1xbK";
- Q = Y
- }
- var ab = aF.product;
- var aJ = aF.page;
- var aZ = aF.monkey_page;
- var aT = aF.speed_page;
- var V = Math.random;
- var az = Y + "/tb/pms/img/st.gif";
- var ae = az;
- var aA = aF.monkey;
- var av = aF.exception;
- var ai = aF.cus;
- var aG = aF.feature;
- if (aA && aA.sample && V() < aA.sample) {
- var R = bj.alog.tracker("monkey");
- var aM;
- var X = aa.screen;
- var bh = ba.referrer;
- R.set("ver", 5);
- R.set("pid", 241);
- if (X) {
- R.set("px", X.width + "*" + X.height)
- }
- R.set("ref", bh);
- bj.alog("monkey.on", "create", function() {
- aM = bj.alog.timestamp;
- R.set("protocolParameter", {
- reports: null
- })
- });
- bj.alog("monkey.on", "send", function(bl) {
- if (bl.t == "pageview") {
- bl.cmd = "open"
- }
- if (bl.now) {
- bl.ts = aM(bl.now).toString(36);
- bl.now = ""
- }
- });
- bj.alog("monkey.create", {
- page: aJ,
- pid: "241",
- p: ab,
- dv: 6,
- postUrl: ae,
- reports: {
- refer: 1
- }
- });
- bj.alog("monkey.send", "pageview", {
- now: +new Date
- })
- }
- if (av && av.sample && V() < av.sample) {
- var ap = false;
- aa.onerror = function(bp, bn, bl, bo) {
- var bm = true;
- if (!bn && /^script error/i.test(bp)) {
- if (ap) {
- bm = false
- } else {
- ap = true
- }
- }
- if (bm) {
- bj.alog("exception.send", "exception", {
- msg: bp,
- js: bn,
- ln: bl,
- col: bo
- })
- }
- return false
- };
- bj.alog("exception.on", "catch", function(bl) {
- bj.alog("exception.send", "exception", {
- msg: bl.msg,
- js: bl.path,
- ln: bl.ln,
- method: bl.method,
- flag: "catch"
- })
- });
- bj.alog("exception.create", {
- postUrl: ae,
- dv: 7,
- page: aZ ? aZ : aJ,
- pid: "170",
- p: ab
- })
- }
- if (ai && ai.sample && V() < ai.sample) {
- bj.alog("cus.on", "time", function(bo) {
- var bn = {};
- var bl = false;
- var bp;
- if (bo.toString() !== "[object Object]") {
- return
- }
- for (var bm in bo) {
- if (bm == "page") {
- bn.page = bo[bm];
- continue
- }
- bp = parseInt(bo[bm]);
- if (bp > 0 && /^z_/.test(bm)) {
- bl = true;
- bn[bm] = bp
- }
- }
- if (bl) {
- bj.alog("cus.send", "time", bn)
- }
- });
- bj.alog("cus.on", "count", function(bo) {
- var bn = {};
- var bl = false;
- if (typeof bo === "string") {
- bo = [bo]
- }
- if (bo instanceof Array) {
- for (var bm = 0; bm < bo.length; bm++) {
- if (/^z_/.test(bo[bm])) {
- bl = true;
- bn[bo[bm]] = 1
- } else {
- if (/^page:/.test(bo[bm])) {
- bn.page = bo[bm].substring(5)
- }
- }
- }
- }
- if (bl) {
- bj.alog("cus.send", "count", bn)
- }
- });
- bj.alog("cus.create", {
- dv: 3,
- postUrl: az,
- page: aJ,
- p: ab
- })
- }
- if (aG && aG.sample && V() < aG.sample) {
- var a8 = ["Moz", "O", "ms", "Webkit"];
- var ar = ["-webkit-", "-moz-", "-o-", "-ms-"];
- var aC = function() {
- if (typeof ba.createElement !== "function") {
- return ba.createElement(arguments[0])
- } else {
- return ba.createElement.apply(ba, arguments)
- }
- };
- var bf = {
- elem: aC("dpFeatureTest")
- };
- var ac = {
- style: bf.elem.style
- };
- function an(bm, bl) {
- return typeof bm === bl
- }
- function U(bm, bp, bo) {
- var bn;
- for (var bl in bm) {
- if (bm[bl] in bp) {
- if (bo === false) {
- return bm[bl]
- }
- bn = bp[bm[bl]];
- if (an(bn, "function")) {
- return fnBind(bn, bo || bp)
- }
- return bn
- }
- }
- return false
- }
- function aj(bn, bl, bm) {
- return bd(bn, undefined, undefined, bl, bm)
- }
- function bd(br, bl, bo, bp, bq) {
- var bm = br.charAt(0).toUpperCase() + br.slice(1),
- bn = (br + " " + a8.join(bm + " ") + bm).split(" ");
- if (an(bl, "string") || an(bl, "undefined")) {
- return aO(bn, bl, bp, bq)
- } else {
- bn = (br + " " + (a8).join(bm + " ") + bm).split(" ");
- return U(bn, bl, bo)
- }
- }
- function aO(bp, bn, bs, bq) {
- bq = an(bq, "undefined") ? false : bq;
- var bt, bo, bl, bm, br;
- bl = bp.length;
- for (bo = 0; bo < bl; bo++) {
- bm = bp[bo];
- br = ac.style[bm];
- if (!!~("" + bm).indexOf("-")) {
- bm = al(bm)
- }
- if (ac.style[bm] !== undefined) {
- return bn == "pfx" ? bm : true
- }
- }
- return false
- }
- function al(bl) {
- return bl.replace(/([a-z])-([a-z])/g, function(bo, bn, bm) {
- return bn + bm.toUpperCase()
- }).replace(/^-/, "")
- }
- var ax = function(bn, bm, bl) {
- if (bn.indexOf("@") === 0) {
- return atRule(bn)
- }
- if (bn.indexOf("-") != -1) {
- bn = al(bn)
- }
- if (!bm) {
- return bd(bn, "pfx")
- } else {
- return bd(bn, bm, bl)
- }
- };
- function a4() {
- var bl = aC("canvas");
- return !!(bl.getContext && bl.getContext("2d"))
- }
- function aV() {
- var bl = aC("div");
- return ("draggable" in bl) || ("ondragstart" in bl && "ondrop" in bl)
- }
- function ah() {
- var bl = "localStorage";
- try {
- localStorage.setItem(bl, bl);
- localStorage.removeItem(bl);
- return true
- } catch (bm) {
- return false
- }
- }
- function aL() {
- return "content" in ba.createElement("template")
- }
- function aX() {
- return "createShadowRoot" in ba.createElement("a")
- }
- function aS() {
- return "registerElement" in ba
- }
- function O() {
- return "import" in ba.createElement("link")
- }
- function T() {
- return "getItems" in ba
- }
- function aq() {
- return "EventSource" in window
- }
- function a7(bn, bo) {
- var bl = {
- lossy: "UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",
- lossless: "UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",
- alpha: "UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",
- animation: "UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"
- };
- var bm = new Image();
- bm.onload = function() {
- var bp = (bm.width > 0) && (bm.height > 0);
- bo(bn, bp)
- };
- bm.onerror = function() {
- bo(bn, false)
- };
- bm.src = "data:image/webp;base64," + bl[bn]
- }
- function bi(bm, bl) {
- ag.f["WebP-" + bm] = bl;
- return bl
- }
- function aY() {
- return "openDatabase" in aa
- }
- function a3() {
- return "performance" in aa && "timing" in aa.performance
- }
- function be() {
- return "performance" in aa && "mark" in aa.performance
- }
- function aB() {
- return !!(Array.prototype && Array.prototype.every && Array.prototype.filter && Array.prototype.forEach &&
- Array.prototype.indexOf && Array.prototype.lastIndexOf && Array.prototype.map && Array.prototype.some &&
- Array.prototype.reduce && Array.prototype.reduceRight && Array.isArray)
- }
- function ad() {
- return "Promise" in aa && "cast" in aa.Promise && "resolve" in aa.Promise && "reject" in aa.Promise && "all" in
- aa.Promise && "race" in aa.Promise && (function() {
- var bl;
- new aa.Promise(function(bm) {
- bl = bm
- });
- return typeof bl === "function"
- }())
- }
- function ao() {
- var bl = !!(aa.ProgressEvent);
- var bm = !!(aa.FormData);
- var bn = aa.XMLHttpRequest && "withCredentials" in new XMLHttpRequest;
- return bl && bm && bn
- }
- function aN() {
- return "geolocation" in navigator
- }
- function ay() {
- var bm = aC("canvas");
- var bl = "probablySupportsContext" in bm ? "probablySupportsContext" : "supportsContext";
- if (bl in bm) {
- return bm[bl]("webgl") || bm[bl]("experimental-webgl")
- }
- return "WebGLRenderingContext" in aa
- }
- function aI() {
- return !!ba.createElementNS && !!ba.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect
- }
- function a5() {
- return !!aa.Worker
- }
- function a1() {
- return "WebSocket" in aa && aa.WebSocket.CLOSING === 2
- }
- function aQ() {
- var bl = ba.createElement("video");
- return !!bl.canPlayType
- }
- function am() {
- var bl = ba.createElement("audio");
- return !!bl.canPlayType
- }
- function aW() {
- return !!(aa.history && "pushState" in aa.history)
- }
- function aH() {
- return !!(aa.File && aa.FileReader)
- }
- function aK() {
- return "postMessage" in window
- }
- function aP() {
- return !!aa.webkitNotifications || ("Notification" in aa && "permission" in aa.Notification &&
- "requestPermission" in aa.Notification)
- }
- function aD() {
- var bn = ["webkit", "moz", "o", "ms"];
- var bm = aa.requestAnimationFrame;
- for (var bl = 0; bl < bn.length && !bm; ++bl) {
- bm = aa[bn[bl] + "RequestAnimationFrame"]
- }
- return !!bm
- }
- function aR() {
- return "JSON" in aa && "parse" in JSON && "stringify" in JSON
- }
- function a6() {
- return !!(ax("exitFullscreen", ba, false) || ax("cancelFullScreen", ba, false))
- }
- function ak() {
- return !!ax("Intl", aa)
- }
- function a0() {
- return aj("flexBasis", "1px", true)
- }
- function a2() {
- return !!aj("perspective", "1px", true)
- }
- function au() {
- return aj("shapeOutside", "content-box", true)
- }
- function bk() {
- var bl = aC("div");
- bl.style.cssText = ar.join("filter:blur(2px); ");
- return !!bl.style.length && ((ba.documentMode === undefined || ba.documentMode > 9))
- }
- function Z() {
- return "XMLHttpRequest" in aa && "withCredentials" in new XMLHttpRequest()
- }
- function W() {
- return aC("progress").max !== undefined
- }
- function aU() {
- return aC("meter").max !== undefined
- }
- function bc() {
- return "sendBeacon" in navigator
- }
- function a9() {
- return aj("borderRadius", "0px", true)
- }
- function P() {
- return aj("boxShadow", "1px 1px", true)
- }
- function S() {
- var bm = aC("div");
- var bl = bm.style;
- bl.cssText = ar.join("opacity:.55;");
- return (/^0.55$/).test(bl.opacity)
- }
- function bb() {
- return aO(["textShadow"], undefined, "1px 1px")
- }
- function af() {
- return aj("animationName", "a", true)
- }
- function aw() {
- return aj("transition", "all", true)
- }
- function bg() {
- return navigator.userAgent.indexOf("Android 2.") === -1 && aj("transform", "scale(1)", true)
- }
- var ag = {
- f: {},
- t: function(bl, bn, bm) {
- this.f[bl] = bn.apply(this, [].slice.call(arguments, 2))
- },
- c: function(bm, bl) {
- bm.apply(this, [].slice.call(arguments, 1))
- },
- runAllTest: function() {
- var bl = this;
- bl.t("bdrs", a9);
- bl.t("bxsd", P);
- bl.t("opat", S);
- bl.t("txsd", bb);
- bl.t("anim", af);
- bl.t("trsi", aw);
- bl.t("trfm", bg);
- bl.t("flex", a0);
- bl.t("3dtr", a2);
- bl.t("shpe", au);
- bl.t("fltr", bk);
- bl.t("cavs", a4);
- bl.t("dgdp", aV);
- bl.t("locs", ah);
- bl.t("wctem", aL);
- bl.t("wcsdd", aX);
- bl.t("wccse", aS);
- bl.t("wchti", O);
- bl.c(a7, "lossy", bi);
- bl.c(a7, "lossless", bi);
- bl.c(a7, "alpha", bi);
- bl.c(a7, "animation", bi);
- bl.t("wsql", aY);
- bl.t("natm", a3);
- bl.t("ustm", be);
- bl.t("arra", aB);
- bl.t("prms", ad);
- bl.t("xhr2", ao);
- bl.t("wbgl", ay);
- bl.t("geol", aN);
- bl.t("svg", aI);
- bl.t("work", a5);
- bl.t("wbsk", a1);
- bl.t("vido", aQ);
- bl.t("audo", am);
- bl.t("hsty", aW);
- bl.t("file", aH);
- bl.t("psmg", aK);
- bl.t("wknf", aP);
- bl.t("rqaf", aD);
- bl.t("json", aR);
- bl.t("flsc", a6);
- bl.t("i18n", ak);
- bl.t("cors", Z);
- bl.t("prog", W);
- bl.t("metr", aU);
- bl.t("becn", bc);
- bl.t("mcrd", T);
- bl.t("esrc", aq)
- }
- };
- var R = bj.alog.tracker("feature");
- R.on("commit", function() {
- ag.runAllTest();
- var bl = setInterval(function() {
- if ("WebP-lossy" in ag.f && "WebP-lossless" in ag.f && "WebP-alpha" in ag.f && "WebP-animation" in ag.f) {
- for (var bm in ag.f) {
- ag.f[bm] = ag.f[bm] ? "y" : "n"
- }
- R.send("feature", ag.f);
- clearInterval(bl)
- }
- }, 500)
- });
- bj.alog("feature.create", {
- dv: 4,
- postUrl: az,
- page: aZ ? aZ : aJ,
- p: ab
- });
- bj.alog("feature.fire", "commit")
- }
- }(N, L, M)
- }(window, document, u);
- u._alog = u.alog || function() {};
- u.alog("cus.fire", "count", "z_loadscriptcount");
- if (location.protocol === "https:") {
- u.alog("cus.fire", "count", "z_httpscount")
- }
- function s(L, M) {
- for (var N in M) {
- L[N] = M[N]
- }
- }
- function c(L) {
- this.map = L;
- this.tileLayers = [];
- this.bufferNumber = 30;
- this.realBufferNumber = 0;
- this.curViewTiles = {};
- this.bufferTiles = {};
- this.layersContainer = this.createLayersContainer();
- this.initialize()
- }
- J.extend(c.prototype, {
- createLayersContainer: function() {
- var L = document.createElement("div");
- L.style.cssText = "position:absolute;left:0;top:0;z-index:0;";
- this.map.platform.appendChild(L);
- return L
- },
- initialize: function() {
- var L = this;
- var M = this.map;
- M.addEventListener("onload", function() {
- L.loadBaseTileLayer()
- });
- M.addEventListener("oncenterzoomend", function() {
- L.reDrawCurViewTiles()
- });
- M.addEventListener("addtilelayer", function(N) {
- L.addTileLayer(N)
- });
- M.addEventListener("removetilelayer", function(N) {
- L.removeTileLayer(N)
- });
- M.addEventListener("moving", function(N) {
- L.reDrawCurViewTiles()
- });
- M.addEventListener("zoomstart", function(P) {
- if (P.evtSrc === "zoomTo") {
- if (this._zoomMapByAnimation) {
- var O = new j(this.width / 2, this.height / 2);
- var N = this.zoomLevel;
- this._zoomMapByAnimation(this, O, N)
- } else {
- L.reDrawCurViewTiles()
- }
- }
- });
- M.addEventListener("zoomend", function(N) {
- L.reDrawCurViewTiles()
- });
- M.addEventListener("resize", function(N) {
- L.reDrawCurViewTiles()
- })
- },
- loadBaseTileLayer: function() {
- var M = this.map;
- if (!M.loaded) {
- var N = new l();
- var L = M.config.mapStyle ? e : H;
- J.extend(N, L);
- M.addTileLayer(N);
- M.loaded = true
- }
- },
- addTileLayer: function(P) {
- var O = this.map;
- var M = P.target;
- for (var N = 0, L = this.tileLayers.length; N < L; N++) {
- if (this.tileLayers[N] === M) {
- return
- }
- }
- this.tileLayers.push(M);
- M.initialize(O, this.layersContainer);
- this.reDrawCurViewTiles()
- },
- removeTileLayer: function(S) {
- var R = this;
- var N = S.target;
- var L = R.curViewTiles;
- var P = R.bufferTiles;
- for (var Q in P) {
- var M = Q.split("-")[1];
- if (M == N.guid) {
- delete P[Q]
- }
- }
- for (var Q in L) {
- var M = Q.split("-")[1];
- if (M == N.guid) {
- delete L[Q]
- }
- }
- N.remove();
- for (var O = this.tileLayers.length - 1; O >= 0; O--) {
- if (this.tileLayers[O] === N) {
- this.tileLayers.splice(O, 1)
- }
- }
- R.reDrawCurViewTiles()
- },
- getTileName: function(L, M) {
- return "TILE-" + M.guid + "-" + L[0] + "-" + L[1] + "-" + L[2]
- },
- reDrawCurViewTiles: function() {
- var V = this.tileLayers.length;
- if (V <= 0) {
- return
- }
- var an = this.map;
- var M = an.getZoom();
- var ad = an.centerPoint;
- var U = an.getZoomUnits(M);
- var O = an.getTileUnits(M);
- var W = Math.ceil(ad.lat / O);
- var R = Math.ceil(ad.lng / O);
- var Z = an.config.tileSize;
- var P = [W, R, (ad.lat - W * O) / O * Z, (ad.lng - R * O) / O * Z];
- var ak = an.width;
- var ab = an.height;
- var ai = P[0] - Math.ceil((ab / 2 - P[2]) / Z);
- var N = P[1] - Math.ceil((ak / 2 - P[3]) / Z);
- var af = P[0] + Math.ceil((ab / 2 + P[2]) / Z);
- var Y = P[1] + Math.ceil((ak / 2 + P[3]) / Z);
- var X = this.tileLayers;
- var aa = this.curViewTiles;
- var L = [];
- for (var ae = 0, aj = X.length; ae < aj; ae++) {
- var ap = X[ae];
- o.css3TransformDom(ap.tilesDiv, Math.round(-an.offsetX + ak / 2), Math.round(-an.offsetY + ab / 2));
- for (var am in aa) {
- var ao = aa[am];
- var al = ao.info;
- if (al[2] !== M || (al[2] === M && (ai > al[0] || af <= al[0] || N > al[1] || Y <= al[1]))) {
- this.hideTile(ao)
- }
- }
- L.length = 0;
- for (var ah = ai; ah < af; ah++) {
- for (var ag = N; ag < Y; ag++) {
- L.push([ah, ag])
- }
- }
- L.sort((function(aq) {
- return function(ar, at) {
- return ((0.4 * Math.abs(ar[1] - aq[1]) + 0.6 * Math.abs(ar[0] - aq[0])) - (0.4 * Math.abs(at[1] - aq[1]) +
- 0.6 * Math.abs(at[0] - aq[0])))
- }
- })([P[0] - 1, P[1] - 1]));
- var T = -ad.lng / U;
- var S = ad.lat / U;
- var Q = [Math.round(S), Math.round(T)];
- for (var ah = 0, ac = L.length; ah < ac; ah++) {
- this.showTile([L[ah][0], L[ah][1], M], Q, ap, Z)
- }
- }
- },
- showTile: function(Q, P, T, V) {
- var N = this.getTileName(Q, T);
- var O = (Q[1] * V) + P[1];
- var M = (-1 - Q[0]) * V + P[0];
- var U = this.curViewTiles[N];
- if (U && U.img) {
- o.css3TransformDom(U.img, O, M);
- return
- }
- U = this.bufferTiles[N];
- if (U && U.img) {
- T.tilesDiv.insertBefore(U.img, T.tilesDiv.lastChild);
- this.curViewTiles[N] = U;
- o.css3TransformDom(U.img, O, M);
- return
- }
- var R = new j(Q[1], Q[0]);
- var L = T.getTilesUrl(R, Q[2]);
- var S = [O, M];
- U = new b(this, L, S, Q, T, V);
- this.curViewTiles[N] = U
- },
- hideTile: function(M) {
- var L = M.img;
- if (L) {
- if (o.isInDocument(L)) {
- L.parentNode.removeChild(L)
- }
- }
- delete this.curViewTiles[M.name];
- if (!M.loaded) {
- L = null;
- M.img = null;
- M.mgr = null
- }
- }
- });
- function l(L) {
- this.opts = L || {};
- this.baseLayer = this.opts.baseLayer || false;
- this.zIndex = this.opts.zIndex || 0;
- this.guid = l._guid++
- }
- l._guid = 0;
- J.lang.inherits(l, J.lang.Class, "TileLayer");
- J.extend(l.prototype, {
- initialize: function(N, L) {
- if (this.baseLayer) {
- this.zIndex = -1
- }
- this.map = N;
- if (!this.tilesDiv) {
- var O = o.create("div");
- var M = O.style;
- M.cssText = "position:absolute;left:0;top:0;z-index:" + this.zIndex;
- L.appendChild(O);
- this.tilesDiv = O
- }
- },
- remove: function() {
- if (this.tilesDiv && this.tilesDiv.parentNode) {
- this.tilesDiv.innerHTML = "";
- this.tilesDiv.parentNode.removeChild(this.tilesDiv)
- }
- delete this.tilesDiv
- },
- getTilesUrl: function(M, N) {
- var L = "";
- if (this.opts.tileUrlTemplate) {
- L = this.opts.tileUrlTemplate.replace(/\{X\}/, M.x);
- L = L.replace(/\{Y\}/, M.y);
- L = L.replace(/\{Z\}/, N)
- }
- return L
- },
- getTileVersion: function(M) {
- var N = window.TILE_VERSION;
- var L = "20170730";
- if (N && N.ditu) {
- var O = N.ditu;
- if (O[M] && O[M]["updateDate"]) {
- L = O[M]["updateDate"]
- }
- }
- return L
- }
- });
- function b(R, L, N, M, O, T) {
- this.mgr = R;
- this.position = N;
- this.name = R.getTileName(M, O);
- this.info = M;
- var S = o.create("img");
- o.setUnSelectable(S);
- S.galleryImg = false;
- var Q = S.style;
- Q.cssText = "position:absolute;width:" + T + "px;height:" + T + "px;left:0;top:0;";
- o.css3TransformDom(S, N[0], N[1]);
- this.img = S;
- this.src = L;
- this.errorImgSrc = u.apiUrlCdn + "/images/blank.gif";
- var P = this;
- P.img.onload = function() {
- P.loaded = true;
- if (!P.mgr) {
- return
- }
- var V = P.mgr;
- var U = V.bufferTiles;
- if (!U[P.name]) {
- V.realBufferNumber++;
- U[P.name] = P
- }
- if (P.img && !o.isInDocument(P.img) && O.tilesDiv) {
- O.tilesDiv.appendChild(P.img)
- }
- var X = V.realBufferNumber - V.bufferNumber;
- for (var Y in U) {
- if (X <= 0) {
- break
- }
- if (!V.curViewTiles[Y]) {
- var W = U[Y].img;
- if (W && W.parentNode) {
- W.parentNode.removeChild(W)
- }
- W = null;
- U[Y].img = null;
- U[Y].mgr = null;
- delete U[Y];
- V.realBufferNumber--;
- X--
- }
- }
- };
- P.img.onerror = function() {
- var V = P.img;
- var W = V ? V.getAttribute("errorCount") : true;
- if (V && (!W || W && W < 5)) {
- W = W || 0;
- W++;
- V.src = L;
- V.setAttribute("errorCount", W)
- } else {
- if (!P.mgr) {
- return
- }
- var U = P.mgr;
- P.img.src = P.errorImgSrc;
- if (P.img && !o.isInDocument(P.img)) {
- O.tilesDiv.appendChild(P.img)
- }
- }
- };
- P.img.src = L
- }
- var H = new l({
- baseLayer: true
- });
- H.getTilesUrl = function(N, P) {
- var S = N.x;
- var O = N.y;
- var Q = u.url.domain["TILE_ONLINE_URLS"];
- var R = "x=" + S + "&y=" + O + "&z=" + P + "&styles=pl&scaler=2";
- var M = u.url.proto + Q[Math.abs(S + O) % Q.length] + "/tile/?qt=vtile&" + R;
- var L = this.getTileVersion("normal");
- M += "&udt=" + L;
- return M.replace(/-(\d+)/gi, "M$1")
- };
- var e = new l({
- baseLayer: true
- });
- e.getTilesUrl = function(O, T) {
- var M = this.map;
- var U = O.x;
- var P = O.y;
- var S = u.url.domain["main_domain_cdn"]["baidu"];
- var Q = "x=" + U + "&y=" + P + "&z=" + T + "&scale=2";
- var N = u.url.proto + S[Math.abs(U + P) % S.length] + "/customimage/tile/?" + Q;
- var R = this.getTileVersion("normal");
- N += "&udt=" + R;
- var L = this.getStyleParam();
- N += L;
- return N.replace("{x}", U).replace("{y}", P).replace("{z}", T)
- };
- e.getStyleParam = function() {
- var M = this.map.config.mapStyle;
- var N = "&";
- if (M.style) {
- N = N + "customid=" + M.style
- } else {
- if (M.styleJson) {
- var L = this.styleJson2styleString(M.styleJson);
- N = N + "styles=" + encodeURIComponent(L)
- }
- }
- return N
- };
- e.styleJson2styleString = function(L) {
- var Q = {
- featureType: "t",
- elementType: "e",
- visibility: "v",
- color: "c",
- lightness: "l",
- saturation: "s",
- weight: "w",
- zoom: "z",
- hue: "h"
- };
- var S = {
- all: "all",
- geometry: "g",
- "geometry.fill": "g.f",
- "geometry.stroke": "g.s",
- labels: "l",
- "labels.text.fill": "l.t.f",
- "labels.text.stroke": "l.t.s",
- "lables.text": "l.t",
- "labels.icon": "l.i"
- };
- var T = [];
- for (var M = 0, R; R = L[M]; M++) {
- var O = R.stylers;
- delete R.stylers;
- J.extend(R, O);
- var N = [];
- for (var P in Q) {
- if (R[P]) {
- if (P === "elementType") {
- N.push(Q[P] + ":" + S[R[P]])
- } else {
- N.push(Q[P] + ":" + R[P])
- }
- }
- }
- if (N.length > 2) {
- T.push(N.join("|"))
- }
- }
- return T.join(",")
- };
- function a() {
- this.map = null;
- this._overlays = {};
- this._customOverlays = []
- }
- J.extend(a.prototype, {
- draw: function(L) {
- for (var M in this._overlays) {
- this._overlays[M].draw(L)
- }
- J.array.each(this._customOverlays, function(N) {
- N.draw(L)
- })
- }
- });
- u.register(function(M) {
- M.overlayDiv = document.createElement("div");
- M.overlayDiv.style.cssText = "position:absolute;z-index:100;left:0;top:0;width:0;height:0;";
- M._panes.markerPane = document.createElement("div");
- M._panes.markerPane.style.cssText = "position:absolute;z-index:100;left:0;top:0;width: 0;height: 0;";
- M.overlayDiv.appendChild(M._panes.markerPane);
- M.platform.appendChild(M.overlayDiv);
- var L = new a();
- L.map = M;
- M._overlays = L._overlays;
- M._customOverlays = L._customOverlays;
- M.addEventListener("load", function(N) {
- L.draw(N)
- });
- M.addEventListener("moveend", function(N) {
- L.draw(N)
- });
- M.addEventListener("zooming", function(N) {
- L.draw(N)
- });
- M.addEventListener("zoomend", function(N) {
- L.draw(N)
- });
- M.addEventListener("oncenterzoomend", function(N) {
- L.draw(N)
- });
- M.addEventListener("resize", function(N) {
- L.draw(N)
- });
- M.addEventListener("addoverlay", function(R) {
- var O = R.target;
- if (O instanceof I) {
- if (!L._overlays[O.guid]) {
- L._overlays[O.guid] = O
- }
- } else {
- var Q = false;
- for (var P = 0, N = L._customOverlays.length; P < N; P++) {
- if (L._customOverlays[P] === O) {
- Q = true;
- break
- }
- }
- if (!Q) {
- L._customOverlays.push(O)
- }
- }
- });
- M.addEventListener("removeoverlay", function(Q) {
- var O = Q.target;
- if (O instanceof I) {
- delete L._overlays[O.guid]
- } else {
- for (var P = 0, N = L._customOverlays.length; P < N; P++) {
- if (L._customOverlays[P] === O) {
- L._customOverlays.splice(P, 1);
- break
- }
- }
- }
- });
- M.addEventListener("clearoverlays", function(Q) {
- for (var P in L._overlays) {
- if (L._overlays[P]._config.enableMassClear) {
- L._overlays[P].remove();
- delete L._overlays[P]
- }
- }
- for (var N = L._customOverlays.length, O = N - 1; O >= 0; O--) {
- if (L._customOverlays[O].enableMassClear !== false) {
- L._customOverlays[O].remove();
- L._customOverlays[O] = null;
- L._customOverlays.splice(O, 1)
- }
- }
- })
- });
- function E() {
- this._type = "overlay"
- }
- J.lang.inherits(E, J.lang.Class, "Overlay");
- E.getZIndex = function(L) {
- L = L * 1;
- if (!L) {
- return 0
- }
- return (L * -100000) << 1
- };
- J.extend(E.prototype, {
- _i: function(L) {
- if (!this.domElement && J.lang.isFunction(this.initialize)) {
- this.domElement = this.initialize(L);
- if (this.domElement) {
- this.domElement.style.WebkitUserSelect = "none"
- }
- }
- this.draw()
- },
- initialize: function(L) {
- throw "initialize方法未实现"
- },
- draw: function() {
- throw "draw方法未实现"
- },
- remove: function() {
- if (this.domElement && this.domElement.parentNode) {
- this.domElement.parentNode.removeChild(this.domElement)
- }
- this.domElement = null;
- this.dispatchEvent(new F("onremove"))
- },
- hide: function() {
- if (this.domElement) {
- J.dom.hide(this.domElement)
- }
- },
- show: function() {
- if (this.domElement) {
- J.dom.show(this.domElement)
- }
- },
- isVisible: function() {
- if (!this.domElement) {
- return false
- }
- if (this.domElement.style.display == "none" || this.domElement.style.visibility == "hidden") {
- return false
- }
- return true
- }
- });
- function I() {
- J.lang.Class.call(this);
- E.call(this);
- this.map = null;
- this._visible = true
- }
- J.lang.inherits(I, E, "OverlayInternal");
- J.extend(I.prototype, {
- initialize: function(L) {
- this.map = L;
- J.lang.Class.call(this, this.guid);
- return null
- },
- getMap: function() {
- return this.map
- },
- draw: function() {},
- remove: function() {
- this.map = null;
- J.lang.decontrol(this.guid);
- E.prototype.remove.call(this)
- },
- hide: function() {
- if (this._visible == false) {
- return
- }
- this._visible = false
- },
- show: function() {
- if (this._visible == true) {
- return
- }
- this._visible = true
- },
- isVisible: function() {
- if (!this.domElement) {
- return false
- }
- return !!this._visible
- },
- getContainer: function() {
- return this.domElement
- },
- setConfig: function(M) {
- M = M || {};
- for (var L in M) {
- this._config[L] = M[L]
- }
- },
- setZIndex: function(L) {
- this.zIndex = L
- },
- enableMassClear: function() {
- this._config.enableMassClear = true
- },
- disableMassClear: function() {
- this._config.enableMassClear = false
- }
- });
- function h(M, N, Q) {
- var P = this.dpr = 2;
- if (!M || !N) {
- return
- }
- Q = Q || {};
- N.width = N.width / P;
- N.height = N.height / P;
- if (Q.anchor && Q.anchor instanceof d) {
- Q.anchor.width = Q.anchor.width / P;
- Q.anchor.height = Q.anchor.height / P
- }
- if (Q.imageOffset && Q.imageOffset instanceof d) {
- Q.imageOffset.width = Math.floor(Q.imageOffset.width / P);
- Q.imageOffset.height = Math.floor(Q.imageOffset.height / P)
- }
- if (Q.backGroundImageSize && Q.backGroundImageSize instanceof d) {
- Q.backGroundImageSize.width = Math.floor(Q.backGroundImageSize.width / P);
- Q.backGroundImageSize.height = Math.floor(Q.backGroundImageSize.height / P)
- }
- this.size = N;
- this.imageUrl = M;
- var L = new d(Math.floor(N.width / 2), N.height);
- var O = new d(N.width, N.height);
- var R = {
- anchor: L,
- imageOffset: new d(0, 0),
- backGroundImageSize: O
- };
- J.extend(R, Q);
- this.anchor = R.anchor;
- this.imageOffset = R.imageOffset;
- this.backGroundImageSize = R.backGroundImageSize
- }
- J.extend(h.prototype, {
- setImageUrl: function(L) {
- if (!L) {
- return
- }
- this.imageUrl = L
- },
- setSize: function(L) {
- if (!L) {
- return
- }
- this.size = new d(L.width / this.dpr, L.height / this.dpr)
- },
- setAnchor: function(L) {
- if (!L) {
- return
- }
- this.anchor = new d(L.width / this.dpr, L.height / this.dpr)
- },
- setImageOffset: function(L) {
- if (!L) {
- return
- }
- this.imageOffset = new d(L.width / this.dpr, L.height / this.dpr)
- },
- getHTML: function() {
- var L = '<img style="position:absolute;padding:0;margin:0;border:0;left:' + this.imageOffset.width + "px;top:" +
- this.imageOffset.height + "px;width:" + this.backGroundImageSize.width + "px;height:" + this.backGroundImageSize
- .height + 'px;"src="' + this.imageUrl + '"/>';
- return L
- },
- setBackGroundImageSize: function(L) {
- if (!L) {
- return
- }
- this.backGroundImageSize = new d(L.width / this.dpr, L.height / this.dpr)
- },
- toString: function() {
- return "Icon"
- }
- });
- var D = new h(u.apiUrlCdn + "/images/hd_red_marker.png", new d(47, 50));
- function z(L, M) {
- I.call(this);
- M = M || {};
- this.point = L;
- this.map = null;
- this._config = {
- offset: new d(0, 0),
- icon: D,
- baseZIndex: 0,
- clickable: true,
- isTop: false,
- enableMassClear: true
- };
- this.setConfig(M);
- if (o.isDefined(M.enableClicking)) {
- this._config.clickable = M.enableClicking
- }
- this._loadAsyncCode()
- }
- J.lang.inherits(z, I, "Marker");
- J.extend(z.prototype, {
- _loadAsyncCode: function() {
- var L = this;
- p.load("marker", function() {
- L._loadAsyncCodeCbk()
- })
- },
- setIcon: function(L) {
- if (L instanceof h) {
- this._config.icon = L
- }
- },
- getIcon: function() {
- return this._config.icon
- },
- getPosition: function() {
- return this.point
- },
- setPosition: function(L) {
- if (L instanceof w) {
- this.point = new w(L.lng, L.lat)
- }
- },
- setTop: function(M, L) {
- this._config.isTop = !!M;
- if (M) {
- this._addi = L || 0
- }
- },
- setOffset: function(L) {
- if (L instanceof d) {
- this._config.offset = L
- }
- },
- getOffset: function() {
- return this._config.offset
- }
- });
- function x() {
- this._map = null;
- this._container;
- this._type = "control";
- this._visible = true
- }
- J.lang.inherits(x, J.lang.Class, "Control");
- J.extend(x.prototype, {
- initialize: function(L) {
- this._map = L;
- if (this._container) {
- L.container.appendChild(this._container);
- return this._container
- }
- return
- },
- _i: function(L) {
- if (!this._container && this.initialize && J.lang.isFunction(this.initialize)) {
- this._container = this.initialize(L)
- }
- this._opts = this._opts || {};
- this._setStyle();
- this._setPosition();
- if (this._container) {
- this._container._jsobj = this
- }
- },
- _setStyle: function() {
- var N = this._container;
- if (N) {
- var L = N.style;
- var M = this._container.style.zIndex || 10;
- L.position = "absolute";
- L.zIndex = M
- }
- },
- remove: function() {
- this._map = null;
- if (!this._container) {
- return
- }
- this._container.parentNode && this._container.parentNode.removeChild(this._container);
- this._container._jsobj = null;
- this._container = null
- },
- _render: function() {
- this._container = o.beforeEndHTML(this._map.container, "<div></div>");
- if (this._visible == false) {
- J.dom.hide(this._container)
- }
- return this._container
- },
- _setPosition: function() {
- this.setAnchor(this._opts.anchor)
- },
- setAnchor: function(N) {
- if (this.anchorFixed || !J.lang.isNumber(N) || isNaN(N) || N < BMAP_ANCHOR_TOP_LEFT || N >
- BMAP_ANCHOR_BOTTOM_RIGHT) {
- N = this.defaultAnchor
- }
- this._opts = this._opts || {};
- this._opts.offset = this._opts.offset || this.defaultOffset;
- var M = this._opts.anchor;
- this._opts.anchor = N;
- if (!this._container) {
- return
- }
- var P = this._container;
- var L = this._opts.offset.width;
- var O = this._opts.offset.height;
- switch (N) {
- case BMAP_ANCHOR_TOP_LEFT:
- P.style.top = O + "px";
- P.style.left = L + "px";
- break;
- case BMAP_ANCHOR_TOP_RIGHT:
- P.style.top = O + "px";
- P.style.right = L + "px";
- break;
- case BMAP_ANCHOR_BOTTOM_LEFT:
- P.style.bottom = O + "px";
- P.style.left = L + "px";
- break;
- case BMAP_ANCHOR_BOTTOM_RIGHT:
- P.style.bottom = O + "px";
- P.style.right = L + "px";
- break;
- default:
- break
- }
- },
- getAnchor: function() {
- return this._opts.anchor
- },
- setOffset: function(L) {
- if (!(L instanceof d)) {
- return
- }
- this._opts = this._opts || {};
- this._opts.offset = new d(L.width, L.height);
- if (!this._container) {
- return
- }
- this.setAnchor(this._opts.anchor)
- },
- getOffset: function() {
- return this._opts.offset
- },
- getDom: function() {
- return this._container
- },
- show: function() {
- this._visible = true;
- if (this._container) {
- J.dom.show(this._container)
- }
- },
- hide: function() {
- this._visible = false;
- if (this._container) {
- J.dom.hide(this._container)
- }
- },
- isVisible: function() {
- if (!this._container && !this._map) {
- return false
- }
- return !!this._visible
- }
- });
- window.BMAP_ANCHOR_TOP_LEFT = 0;
- window.BMAP_ANCHOR_TOP_RIGHT = 1;
- window.BMAP_ANCHOR_BOTTOM_LEFT = 2;
- window.BMAP_ANCHOR_BOTTOM_RIGHT = 3;
- function y(L) {
- x.call(this);
- L = L || {};
- this._opts = {};
- this._opts = J.object.extend(J.object.extend(this._opts, {
- color: "black",
- unit: "metric"
- }), L);
- this.defaultAnchor = BMAP_ANCHOR_BOTTOM_LEFT;
- this.defaultOffset = new d(20, 10);
- this.setAnchor(L.anchor);
- this._units = {
- metric: {
- name: "metric",
- conv: 1,
- incon: 1000,
- u1: "米",
- u2: "公里"
- }
- };
- if (!this._units[this._opts.unit]) {
- this._opts.unit = "metric"
- }
- this._scaleText = null;
- this._numberArray = {};
- this._loadAsyncCode()
- }
- J.lang.inherits(y, x, "ScaleControl");
- J.object.extend(y.prototype, {
- _loadAsyncCode: function() {
- var L = this;
- p.load("control", function() {
- L._loadAsyncCodeCbk()
- })
- },
- initialize: function(L) {
- this._map = L;
- return this._container
- },
- setColor: function(L) {
- this._opts.color = L + ""
- },
- getColor: function() {
- return this._opts.color
- }
- });
- function C(L) {
- x.call(this);
- L = L || {};
- this._opts = {};
- this._opts = J.object.extend(this._opts, L);
- this.defaultAnchor = BMAP_ANCHOR_BOTTOM_RIGHT;
- this.defaultOffset = new u.Size(8, 14);
- this.setAnchor(L.anchor)
- }
- J.lang.inherits(C, x, "ZoomControl");
- J.object.extend(C.prototype, {
- initialize: function(M) {
- this._map = M;
- var O = this._container = document.createElement("div");
- O.style.cssText = "box-shadow:1px 1px 2px rgba(0,0,0,.4);background:rgba(255,255,255,.8);border-radius: 3px;";
- var L = this._zoomIn = document.createElement("div");
- L.style.cssText = "width:36px;height:42px;text-align:center;line-height:42px;font-family:arial;color:#000;";
- L.innerHTML =
- '<div style="font-size:24px;border-bottom:solid 1px #ccc;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events: none;">+</div>';
- var N = this._zoomOut = document.createElement("div");
- N.style.cssText = "width:36px;height:42px;text-align:center;line-height:42px;font-family:arial;color:#000;";
- N.innerHTML =
- '<div style="font-size:40px;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;">-</div>';
- O.appendChild(L);
- O.appendChild(N);
- M.getContainer().appendChild(O);
- this.bindEvt();
- return O
- },
- bindEvt: function() {
- var L = this;
- var M = L._map;
- L._zoomIn.onclick = function() {
- M.zoomIn();
- L.zoomChangeHandler()
- };
- L._zoomOut.onclick = function() {
- M.zoomOut();
- L.zoomChangeHandler()
- };
- L._zoomIn.ontouchstart = function() {
- this.style.background = "rgba(94,169,221,.8)"
- };
- L._zoomIn.ontouchend = function() {
- this.style.background = ""
- };
- L._zoomOut.ontouchstart = function() {
- this.style.background = "rgba(94,169,221,.8)"
- };
- L._zoomOut.ontouchend = function() {
- this.style.background = ""
- };
- L.zoomChangeHandler = function() {
- if (M.getZoom() >= M.config.maxZoom) {
- L._zoomIn.style.background = "rgba(205,205,205,.8)"
- } else {
- L._zoomIn.style.background = ""
- }
- if (M.getZoom() <= M.config.minZoom) {
- L._zoomOut.style.background = "rgba(205,205,205,.8)"
- } else {
- L._zoomOut.style.background = ""
- }
- };
- M.addEventListener("zoomend", L.zoomChangeHandler);
- M.addEventListener("centerzoomend", L.zoomChangeHandler);
- M.addEventListener("load", L.zoomChangeHandler)
- }
- });
- function k(L) {
- this["defaultAnchor"] = BMAP_ANCHOR_BOTTOM_LEFT;
- this["defaultOffset"] = new d(1, 1);
- this._cZIndex = 30;
- this.IMG_URL = u.apiUrlCdn + "images/copyright_logo_hd.png"
- }
- k.prototype = new x();
- k.prototype.initialize = function(M) {
- this._map = M;
- var N = o.create("div");
- var L = o.create("a", {
- title: "到百度地图查看此区域",
- target: "_blank",
- href: "http://map.baidu.com/?sr=1"
- });
- L.style.outline = "none";
- N.style.height = "25px";
- L.href = "http://map.baidu.com/?sr=1";
- L.innerHTML = "<img style='border:none;width:68px;height:25px' src='" + this.IMG_URL + "' />";
- N.appendChild(L);
- M.getContainer().appendChild(N);
- return N
- };
- var K = new h(u.apiUrlCdn + "/images/hd_red_marker.png", new d(47, 50));
- function q(L, M) {
- J.lang.Class.call(this);
- M = M || {};
- this.point = L;
- this._opts = {
- icon: K,
- data: "",
- margin: 0
- };
- this._opts = J.object.extend(this._opts, M)
- }
- J.lang.inherits(q, J.lang.Class, "MassFeature");
- J.extend(q.prototype, {
- getData: function() {
- return this._opts.data
- },
- getIcon: function() {
- return this._opts.icon
- },
- getPosition: function() {
- return this.point
- }
- });
- function t(L) {
- this._map = L;
- this._asyncCodeLoaded = false;
- this._massFeatures = [];
- this._IconCache = {};
- this._needLoadImgNumber = 0
- }
- u.register(function(M) {
- var L = new t(M);
- L.initialize()
- });
- J.extend(t.prototype, {
- initialize: function() {
- var M = this._map;
- var L = this;
- M.addEventListener("addmassfeatures", function(Q) {
- var N = Q.massFeatures;
- for (var S = 0, P = N.length; S < P; S++) {
- var R = N[S];
- var O = R.guid;
- if (!L._massFeatures[O]) {
- L._massFeatures[O] = 1;
- L._massFeatures.push(R)
- }
- }
- L._loadAsyncCode(function() {
- L.drawMassFeatures(true)
- })
- });
- M.addEventListener("removemassfeatures", function(Q) {
- var N = Q.massFeatures;
- for (var S = 0, P = N.length; S < P; S++) {
- for (var R = L._massFeatures.length - 1; R >= 0; R--) {
- if (N[S].guid === L._massFeatures[R].guid) {
- var O = L._massFeatures[R].guid;
- L._massFeatures.splice(R, 1);
- delete L._massFeatures[O];
- break
- }
- }
- }
- L._loadAsyncCode(function() {
- L.drawMassFeatures()
- })
- });
- M.addEventListener("clearmassfeatures", function(N) {
- L._massFeatures.length = 0;
- for (var O in L._massFeatures) {
- delete L._massFeatures[O]
- }
- L._loadAsyncCode(function() {
- L.drawMassFeatures()
- })
- })
- },
- _loadAsyncCode: function(L) {
- var M = this;
- p.load("massfeatures", function() {
- if (!M._asyncCodeLoaded) {
- M._loadAsyncCodeCbk()
- }
- L && L()
- }, true)
- }
- });
- u.verify();
- })();
- })();
|