api-map-baidu.lite.js 101 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184
  1. window.TILE_VERSION = {
  2. "ditu": {
  3. "normal": {
  4. "version": "088",
  5. "updateDate": "20190929"
  6. },
  7. "satellite": {
  8. "version": "009",
  9. "updateDate": "20190929"
  10. },
  11. "normalTraffic": {
  12. "version": "081",
  13. "updateDate": "20190929"
  14. },
  15. "satelliteTraffic": {
  16. "version": "083",
  17. "updateDate": "20190929"
  18. },
  19. "mapJS": {
  20. "version": "104",
  21. "updateDate": "20190929"
  22. },
  23. "satelliteStreet": {
  24. "version": "083",
  25. "updateDate": "20190929"
  26. },
  27. "earthVector": {
  28. "version": "001",
  29. "updateDate": "20190929"
  30. }
  31. },
  32. "webapp": {
  33. "high_normal": {
  34. "version": "001",
  35. "updateDate": "20190929"
  36. },
  37. "lower_normal": {
  38. "version": "002",
  39. "updateDate": "20190929"
  40. }
  41. },
  42. "api_for_mobile": {
  43. "vector": {
  44. "version": "002",
  45. "updateDate": "20190929"
  46. },
  47. "vectorIcon": {
  48. "version": "002",
  49. "updateDate": "20190929"
  50. }
  51. }
  52. };
  53. window.BMAP_AUTHENTIC_KEY = "hlDtW6AATwvq3WZ7QGMbQKSNMvM59BLZ";
  54. (function() {
  55. (function() {
  56. var g, J = g = J || {
  57. version: "1.3.4"
  58. };
  59. J.guid = "$BAIDU$";
  60. window[J.guid] = window[J.guid] || {};
  61. J.object = J.object || {};
  62. J.extend = J.object.extend = function(N, L) {
  63. for (var M in L) {
  64. if (L.hasOwnProperty(M)) {
  65. N[M] = L[M]
  66. }
  67. }
  68. return N
  69. };
  70. J.dom = J.dom || {};
  71. J.dom.g = function(L) {
  72. if ("string" == typeof L || L instanceof String) {
  73. return document.getElementById(L)
  74. } else {
  75. if (L && L.nodeName && (L.nodeType == 1 || L.nodeType == 9)) {
  76. return L
  77. }
  78. }
  79. return null
  80. };
  81. J.g = J.G = J.dom.g;
  82. J.dom.hide = function(L) {
  83. L = J.dom.g(L);
  84. L.style.display = "none";
  85. return L
  86. };
  87. J.hide = J.dom.hide;
  88. J.lang = J.lang || {};
  89. J.lang.isString = function(L) {
  90. return "[object String]" == Object.prototype.toString.call(L)
  91. };
  92. J.isString = J.lang.isString;
  93. J.dom._g = function(L) {
  94. if (J.lang.isString(L)) {
  95. return document.getElementById(L)
  96. }
  97. return L
  98. };
  99. J._g = J.dom._g;
  100. J.dom.contains = function(L, M) {
  101. var N = J.dom._g;
  102. L = N(L);
  103. M = N(M);
  104. return L.contains ? L != M && L.contains(M) : !!(L.compareDocumentPosition(M) & 16)
  105. };
  106. J.browser = J.browser || {};
  107. J.dom._NAME_ATTRS = (function() {
  108. var L = {
  109. cellpadding: "cellPadding",
  110. cellspacing: "cellSpacing",
  111. colspan: "colSpan",
  112. rowspan: "rowSpan",
  113. valign: "vAlign",
  114. usemap: "useMap",
  115. frameborder: "frameBorder"
  116. };
  117. L.htmlFor = "for";
  118. L.className = "class";
  119. return L
  120. })();
  121. J.dom.setAttr = function(M, L, N) {
  122. M = J.dom.g(M);
  123. if ("style" == L) {
  124. M.style.cssText = N
  125. } else {
  126. L = J.dom._NAME_ATTRS[L] || L;
  127. M.setAttribute(L, N)
  128. }
  129. return M
  130. };
  131. J.setAttr = J.dom.setAttr;
  132. J.dom.setAttrs = function(N, L) {
  133. N = J.dom.g(N);
  134. for (var M in L) {
  135. J.dom.setAttr(N, M, L[M])
  136. }
  137. return N
  138. };
  139. J.setAttrs = J.dom.setAttrs;
  140. J.string = J.string || {};
  141. J.dom.removeClass = function(Q, R) {
  142. Q = J.dom.g(Q);
  143. var O = Q.className.split(/\s+/),
  144. S = R.split(/\s+/),
  145. M, L = S.length,
  146. N, P = 0;
  147. for (; P < L; ++P) {
  148. for (N = 0, M = O.length; N < M; ++N) {
  149. if (O[N] == S[P]) {
  150. O.splice(N, 1);
  151. break
  152. }
  153. }
  154. }
  155. Q.className = O.join(" ");
  156. return Q
  157. };
  158. J.removeClass = J.dom.removeClass;
  159. J.dom.insertHTML = function(O, L, N) {
  160. O = J.dom.g(O);
  161. var M, P;
  162. if (O.insertAdjacentHTML) {
  163. O.insertAdjacentHTML(L, N)
  164. } else {
  165. M = O.ownerDocument.createRange();
  166. L = L.toUpperCase();
  167. if (L == "AFTERBEGIN" || L == "BEFOREEND") {
  168. M.selectNodeContents(O);
  169. M.collapse(L == "AFTERBEGIN")
  170. } else {
  171. P = L == "BEFOREBEGIN";
  172. M[P ? "setStartBefore" : "setEndAfter"](O);
  173. M.collapse(P)
  174. }
  175. M.insertNode(M.createContextualFragment(N))
  176. }
  177. return O
  178. };
  179. J.insertHTML = J.dom.insertHTML;
  180. J.dom.show = function(L) {
  181. L = J.dom.g(L);
  182. L.style.display = "";
  183. return L
  184. };
  185. J.show = J.dom.show;
  186. J.dom.getDocument = function(L) {
  187. L = J.dom.g(L);
  188. return L.nodeType == 9 ? L : L.ownerDocument || L.document
  189. };
  190. J.dom.addClass = function(Q, R) {
  191. Q = J.dom.g(Q);
  192. var M = R.split(/\s+/),
  193. L = Q.className,
  194. P = " " + L + " ",
  195. O = 0,
  196. N = M.length;
  197. for (; O < N; O++) {
  198. if (P.indexOf(" " + M[O] + " ") < 0) {
  199. L += " " + M[O]
  200. }
  201. }
  202. Q.className = L;
  203. return Q
  204. };
  205. J.addClass = J.dom.addClass;
  206. J.dom._styleFixer = J.dom._styleFixer || {};
  207. J.dom._styleFilter = J.dom._styleFilter || [];
  208. J.dom._styleFilter.filter = function(M, P, Q) {
  209. for (var L = 0, O = J.dom._styleFilter, N; N = O[L]; L++) {
  210. if (N = N[Q]) {
  211. P = N(M, P)
  212. }
  213. }
  214. return P
  215. };
  216. J.string.toCamelCase = function(L) {
  217. if (L.indexOf("-") < 0 && L.indexOf("_") < 0) {
  218. return L
  219. }
  220. return L.replace(/[-_][^-_]/g, function(M) {
  221. return M.charAt(1).toUpperCase()
  222. })
  223. };
  224. J.dom.getStyle = function(N, M) {
  225. var Q = J.dom;
  226. N = Q.g(N);
  227. M = J.string.toCamelCase(M);
  228. var P = N.style[M];
  229. if (!P) {
  230. var L = Q._styleFixer[M],
  231. O = N.currentStyle || getComputedStyle(N, null);
  232. P = L && L.get ? L.get(N, O) : O[L || M]
  233. }
  234. if (L = Q._styleFilter) {
  235. P = L.filter(M, P, "get")
  236. }
  237. return P
  238. };
  239. J.getStyle = J.dom.getStyle;
  240. if (/opera\/(\d+\.\d)/i.test(navigator.userAgent)) {
  241. J.browser.opera = +RegExp["\x241"]
  242. }
  243. J.browser.isWebkit = /webkit/i.test(navigator.userAgent);
  244. J.browser.isGecko = /gecko/i.test(navigator.userAgent) && !/like gecko/i.test(navigator.userAgent);
  245. J.browser.isStrict = document.compatMode == "CSS1Compat";
  246. J.dom.getPosition = function(L) {
  247. L = J.dom.g(L);
  248. var U = J.dom.getDocument(L),
  249. O = J.browser,
  250. R = J.dom.getStyle,
  251. N = O.isGecko > 0 && U.getBoxObjectFor && R(L, "position") == "absolute" && (L.style.top === "" || L.style.left ===
  252. ""),
  253. S = {
  254. left: 0,
  255. top: 0
  256. },
  257. Q = (O.ie && !O.isStrict) ? U.body : U.documentElement,
  258. V, M;
  259. if (L == Q) {
  260. return S
  261. }
  262. if (L.getBoundingClientRect) {
  263. M = L.getBoundingClientRect();
  264. S.left = Math.floor(M.left) + Math.max(U.documentElement.scrollLeft, U.body.scrollLeft);
  265. S.top = Math.floor(M.top) + Math.max(U.documentElement.scrollTop, U.body.scrollTop);
  266. S.left -= U.documentElement.clientLeft;
  267. S.top -= U.documentElement.clientTop;
  268. var T = U.body,
  269. W = parseInt(R(T, "borderLeftWidth")),
  270. P = parseInt(R(T, "borderTopWidth"));
  271. if (O.ie && !O.isStrict) {
  272. S.left -= isNaN(W) ? 2 : W;
  273. S.top -= isNaN(P) ? 2 : P
  274. }
  275. } else {
  276. V = L;
  277. do {
  278. S.left += V.offsetLeft;
  279. S.top += V.offsetTop;
  280. if (O.isWebkit > 0 && R(V, "position") == "fixed") {
  281. S.left += U.body.scrollLeft;
  282. S.top += U.body.scrollTop;
  283. break
  284. }
  285. V = V.offsetParent
  286. } while (V && V != L);
  287. if (O.opera > 0 || (O.isWebkit > 0 && R(L, "position") == "absolute")) {
  288. S.top -= U.body.offsetTop
  289. }
  290. V = L.offsetParent;
  291. while (V && V != U.body) {
  292. S.left -= V.scrollLeft;
  293. if (!O.opera || V.tagName != "TR") {
  294. S.top -= V.scrollTop
  295. }
  296. V = V.offsetParent
  297. }
  298. }
  299. return S
  300. };
  301. if (/firefox\/(\d+\.\d)/i.test(navigator.userAgent)) {
  302. J.browser.firefox = +RegExp["\x241"]
  303. }(function() {
  304. var L = navigator.userAgent;
  305. if (/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(L) && !/chrome/i.test(L)) {
  306. J.browser.safari = +(RegExp["\x241"] || RegExp["\x242"])
  307. }
  308. })();
  309. if (/chrome\/(\d+\.\d)/i.test(navigator.userAgent)) {
  310. J.browser.chrome = +RegExp["\x241"]
  311. }
  312. J.array = J.array || {};
  313. J.array.each = function(Q, O) {
  314. var N, P, M, L = Q.length;
  315. if ("function" == typeof O) {
  316. for (M = 0; M < L; M++) {
  317. P = Q[M];
  318. N = O.call(Q, P, M);
  319. if (N === false) {
  320. break
  321. }
  322. }
  323. }
  324. return Q
  325. };
  326. J.each = J.array.each;
  327. J.lang.guid = function() {
  328. return "GUID__" + (window[J.guid]._counter++).toString(36)
  329. };
  330. window[J.guid]._counter = window[J.guid]._counter || 1;
  331. window[J.guid]._instances = window[J.guid]._instances || {};
  332. J.lang.isFunction = function(L) {
  333. return "[object Function]" == Object.prototype.toString.call(L)
  334. };
  335. J.lang.isNumber = function(L) {
  336. return "[object Number]" == Object.prototype.toString.call(L)
  337. };
  338. J.lang.Class = function(L) {
  339. this.guid = L || J.lang.guid();
  340. window[J.guid]._instances[this.guid] = this
  341. };
  342. window[J.guid]._instances = window[J.guid]._instances || {};
  343. J.lang.Class.prototype.dispose = function() {
  344. delete window[J.guid]._instances[this.guid];
  345. for (var L in this) {
  346. if (!J.lang.isFunction(this[L])) {
  347. delete this[L]
  348. }
  349. }
  350. this.disposed = true
  351. };
  352. J.lang.Class.prototype.toString = function() {
  353. return "[object " + (this._className || "Object") + "]"
  354. };
  355. J.lang.Event = function(L, M) {
  356. this.type = L;
  357. this.returnValue = true;
  358. this.target = M || null;
  359. this.currentTarget = null
  360. };
  361. J.lang.Class.prototype.addEventListener = function(O, N, M) {
  362. if (!J.lang.isFunction(N)) {
  363. return
  364. }!this.__listeners && (this.__listeners = {});
  365. var L = this.__listeners,
  366. P;
  367. if (typeof M == "string" && M) {
  368. if (/[^\w\-]/.test(M)) {
  369. throw ("nonstandard key:" + M)
  370. } else {
  371. N.hashCode = M;
  372. P = M
  373. }
  374. }
  375. O.indexOf("on") != 0 && (O = "on" + O);
  376. typeof L[O] != "object" && (L[O] = {});
  377. P = P || J.lang.guid();
  378. N.hashCode = P;
  379. L[O][P] = N
  380. };
  381. J.lang.Class.prototype.removeEventListener = function(N, M) {
  382. if (J.lang.isFunction(M)) {
  383. M = M.hashCode
  384. } else {
  385. if (!J.lang.isString(M)) {
  386. return
  387. }
  388. }!this.__listeners && (this.__listeners = {});
  389. N.indexOf("on") != 0 && (N = "on" + N);
  390. var L = this.__listeners;
  391. if (!L[N]) {
  392. return
  393. }
  394. L[N][M] && delete L[N][M]
  395. };
  396. J.lang.Class.prototype.dispatchEvent = function(O, L) {
  397. if (J.lang.isString(O)) {
  398. O = new J.lang.Event(O)
  399. }!this.__listeners && (this.__listeners = {});
  400. L = L || {};
  401. for (var N in L) {
  402. O[N] = L[N]
  403. }
  404. var N, M = this.__listeners,
  405. P = O.type;
  406. O.target = O.target || this;
  407. O.currentTarget = this;
  408. P.indexOf("on") != 0 && (P = "on" + P);
  409. J.lang.isFunction(this[P]) && this[P].apply(this, arguments);
  410. if (typeof M[P] == "object") {
  411. for (N in M[P]) {
  412. M[P][N].apply(this, arguments)
  413. }
  414. }
  415. return O.returnValue
  416. };
  417. J.lang.inherits = function(R, P, O) {
  418. var N, Q, L = R.prototype,
  419. M = new Function();
  420. M.prototype = P.prototype;
  421. Q = R.prototype = new M();
  422. for (N in L) {
  423. Q[N] = L[N]
  424. }
  425. R.prototype.constructor = R;
  426. R.superClass = P.prototype;
  427. if ("string" == typeof O) {
  428. Q._className = O
  429. }
  430. };
  431. J.inherits = J.lang.inherits;
  432. J.lang.instance = function(L) {
  433. return window[J.guid]._instances[L] || null
  434. };
  435. J.platform = J.platform || {};
  436. J.platform.isAndroid = /android/i.test(navigator.userAgent);
  437. if (/android (\d+(\.\d)?)/i.test(navigator.userAgent)) {
  438. J.platform.android = J.android = RegExp["\x241"]
  439. }
  440. J.platform.isIpad = /ipad/i.test(navigator.userAgent);
  441. J.platform.isIphone = /iphone/i.test(navigator.userAgent);
  442. J.platform.iosVersion = /iphone os (\d)\_/i.test(navigator.userAgent) ? +RegExp["\x241"] : 0;
  443. J.lang.Event.prototype.inherit = function(N) {
  444. var M = this;
  445. this.domEvent = N = window.event || N;
  446. M.clientX = N.clientX || N.pageX;
  447. M.clientY = N.clientY || N.pageY;
  448. M.offsetX = N.offsetX || N.layerX;
  449. M.offsetY = N.offsetY || N.layerY;
  450. M.screenX = N.screenX;
  451. M.screenY = N.screenY;
  452. M.ctrlKey = N.ctrlKey || N.metaKey;
  453. M.shiftKey = N.shiftKey;
  454. M.altKey = N.altKey;
  455. if (N.touches) {
  456. M.touches = [];
  457. for (var L = 0; L < N.touches.length; L++) {
  458. M.touches.push({
  459. clientX: N.touches[L].clientX,
  460. clientY: N.touches[L].clientY,
  461. screenX: N.touches[L].screenX,
  462. screenY: N.touches[L].screenY,
  463. pageX: N.touches[L].pageX,
  464. pageY: N.touches[L].pageY,
  465. target: N.touches[L].target,
  466. identifier: N.touches[L].identifier
  467. })
  468. }
  469. }
  470. if (N.changedTouches) {
  471. M.changedTouches = [];
  472. for (var L = 0; L < N.changedTouches.length; L++) {
  473. M.changedTouches.push({
  474. clientX: N.changedTouches[L].clientX,
  475. clientY: N.changedTouches[L].clientY,
  476. screenX: N.changedTouches[L].screenX,
  477. screenY: N.changedTouches[L].screenY,
  478. pageX: N.changedTouches[L].pageX,
  479. pageY: N.changedTouches[L].pageY,
  480. target: N.changedTouches[L].target,
  481. identifier: N.changedTouches[L].identifier
  482. })
  483. }
  484. }
  485. if (N.targetTouches) {
  486. M.targetTouches = [];
  487. for (var L = 0; L < N.targetTouches.length; L++) {
  488. M.targetTouches.push({
  489. clientX: N.targetTouches[L].clientX,
  490. clientY: N.targetTouches[L].clientY,
  491. screenX: N.targetTouches[L].screenX,
  492. screenY: N.targetTouches[L].screenY,
  493. pageX: N.targetTouches[L].pageX,
  494. pageY: N.targetTouches[L].pageY,
  495. target: N.targetTouches[L].target,
  496. identifier: N.targetTouches[L].identifier
  497. })
  498. }
  499. }
  500. M.rotation = N.rotation;
  501. M.scale = N.scale;
  502. return M
  503. };
  504. var F = J.lang.Event;
  505. J.lang.decontrol = function(M) {
  506. var L = window[J.guid];
  507. L._instances && (delete L._instances[M])
  508. };
  509. J.event = {};
  510. J.on = J.event.on = function(N, M, L) {
  511. if (!(N = J.g(N))) {
  512. return N
  513. }
  514. M = M.replace(/^on/, "");
  515. if (N.addEventListener) {
  516. N.addEventListener(M, L, false)
  517. } else {
  518. if (N.attachEvent) {
  519. N.attachEvent("on" + M, L)
  520. }
  521. }
  522. return N
  523. };
  524. J.un = J.event.un = function(N, M, L) {
  525. if (!(N = J.g(N))) {
  526. return N
  527. }
  528. M = M.replace(/^on/, "");
  529. if (N.removeEventListener) {
  530. N.removeEventListener(M, L, false)
  531. } else {
  532. if (N.detachEvent) {
  533. N.detachEvent("on" + M, L)
  534. }
  535. }
  536. return N
  537. };
  538. J.dom.hasClass = function(N, M) {
  539. if (!N || !N.className || typeof N.className != "string") {
  540. return false
  541. }
  542. var L = -1;
  543. try {
  544. L = N.className == M || N.className.indexOf(M)
  545. } catch (O) {
  546. return false
  547. }
  548. return L > -1
  549. };
  550. var u = u || {};
  551. u._register = [];
  552. u.register = function(L) {
  553. this._register.push(L)
  554. };
  555. var G = window.BMAP_AUTHENTIC_KEY || "";
  556. u._rd = {};
  557. u.verify = function() {
  558. var L = u.apiUrl + "?qt=verify&ak=" + G;
  559. o.request(L, function(M) {
  560. if (M && M.error !== 0) {
  561. if (typeof map !== "undefined") {
  562. map.getContainer().innerHTML = "";
  563. map.__listeners = {}
  564. }
  565. u = null;
  566. var N =
  567. "百度未授权使用地图API,可能是因为您提供的密钥不是有效的百度LBS开放平台密钥,或此密钥未对本应用的百度地图JavaScriptAPI授权。您可以访问如下网址了解如何获取有效的密钥:http://lbsyun.baidu.com/apiconsole/key#。";
  568. switch (M.error) {
  569. case 101:
  570. N = "开发者禁用了该ak的jsapi服务权限。您可以访问如下网址了解如何获取有效的密钥:http://lbsyun.baidu.com/apiconsole/key#。";
  571. break;
  572. case 102:
  573. N = "开发者Referer不正确。您可以访问如下网址了解如何获取有效的密钥:http://lbsyun.baidu.com/apiconsole/key#。";
  574. break
  575. }
  576. alert(N)
  577. }
  578. })
  579. };
  580. u.copyright = function() {};
  581. window.BMap = u;
  582. u.Map = m;
  583. u.Point = w;
  584. u.Pixel = j;
  585. u.Size = d;
  586. u.Bounds = f;
  587. u.Projection = n;
  588. u.MercatorProjection = r;
  589. u.TileLayer = l;
  590. u.Control = x;
  591. u.ScaleControl = y;
  592. u.ZoomControl = C;
  593. u.CopyrightControl = k;
  594. u.Overlay = E;
  595. u.Marker = z;
  596. u.Icon = h;
  597. u.MassFeature = q;
  598. function m(O, Q) {
  599. O = J.g(O);
  600. if (!O) {
  601. return
  602. }
  603. var P = this;
  604. J.lang.Class.call(P);
  605. P.config = {
  606. useVectorMap: false,
  607. enableDragging: true,
  608. enableDblclickZoom: true,
  609. enablePinchToZoom: true,
  610. enableInertialDragging: true,
  611. minZoom: 4,
  612. maxZoom: 18,
  613. dpr: 2,
  614. tileSize: 256,
  615. fixCenterWhenPinch: false,
  616. fixCenterWhenResize: false,
  617. backgroundColor: "#F5F3F0",
  618. personalUrls: "dd",
  619. mapStyle: null
  620. };
  621. J.extend(P.config, Q || {});
  622. P.projection = new r();
  623. P.container = O;
  624. P._setStyle(O);
  625. O.unselectable = "on";
  626. O.innerHTML = "";
  627. O.appendChild(P._render());
  628. var M = P.getSize();
  629. P.width = M.width;
  630. P.height = M.height;
  631. P.offsetX = 0;
  632. P.offsetY = 0;
  633. P.platform = O.firstChild;
  634. P.preWebkitTransform = "";
  635. P.maskLayer = P.platform.firstChild;
  636. P.maskLayer.style.width = P.width + "px";
  637. P.maskLayer.style.height = P.height + "px";
  638. P._panes = {};
  639. P.centerPoint = new w(0, 0);
  640. P.zoomLevel = 3;
  641. P.lastLevel = -1;
  642. P.defaultZoomLevel = null;
  643. P.defaultCenter = null;
  644. P._checkZoom();
  645. P.temp = {
  646. lastDomMoveTime: 0,
  647. registerIndex: -1
  648. };
  649. for (var N = 0; N < u._register.length; N++) {
  650. u._register[N](P)
  651. }
  652. P.temp.registerIndex = N;
  653. var L = P.config.useVectorMap;
  654. if (L) {
  655. P.vectorLayerMgr = new VectorLayerMgr(P)
  656. } else {
  657. P.rasterLayerMgr = new c(P)
  658. }
  659. P._bind();
  660. p.load("opmb", function() {
  661. P._asyncRegister()
  662. });
  663. O = null;
  664. P.addCopyrightControl()
  665. }
  666. J.lang.inherits(m, J.lang.Class, "Map");
  667. J.extend(m.prototype, {
  668. _render: function() {
  669. var L = document.createElement("div");
  670. L.style.cssText = "position:absolute;overflow:visible;left:0;top:0;z-index:0;";
  671. var M = document.createElement("div");
  672. M.style.cssText = "position:absolute;left:0;top:0;z-index:10;overflow:hidden;";
  673. L.appendChild(M);
  674. return L
  675. },
  676. _setStyle: function(O) {
  677. var N = O.style;
  678. var M = N.cssText;
  679. if (o.getCurrentStyle(O).position != "absolute") {
  680. M += "position: relative; z-index: 0;"
  681. }
  682. var L = this.config.backgroundColor;
  683. M += ("overflow:hidden;background-color:" + L + ";color:#000;text-align:left");
  684. N.cssText = M
  685. },
  686. _bind: function() {
  687. var L = this;
  688. L._watchSize = function() {
  689. var M = L.getSize();
  690. if (L.width !== M.width || L.height !== M.height) {
  691. L.width = M.width;
  692. L.height = M.height;
  693. var O = new d(L.width, L.height);
  694. var P = new F("onbeforeresize");
  695. P.size = O;
  696. L.dispatchEvent(P);
  697. if (!L.config.fixCenterWhenResize) {
  698. L._updateCenterPoint((M.width - L.width) / 2, (M.height - L.height) / 2)
  699. }
  700. L.maskLayer.style.width = L.width + "px";
  701. L.maskLayer.style.height = L.height + "px";
  702. var N = new F("onresize");
  703. N.size = M;
  704. L.dispatchEvent(N)
  705. }
  706. };
  707. L.temp.autoResizeTimer = setInterval(L._watchSize, 1000)
  708. },
  709. _zoomTo: function(N) {
  710. if (!J.lang.isNumber(N)) {
  711. return
  712. }
  713. N = this._getProperZoom(N).zoom;
  714. if (N == this.zoomLevel) {
  715. return
  716. }
  717. var M = this.temp;
  718. if (M.dragAni) {
  719. M.dragAni.stop()
  720. }
  721. this.lastLevel = this.zoomLevel;
  722. this.zoomLevel = N;
  723. var L = new F("onzoomstart");
  724. L.evtSrc = "zoomTo";
  725. this.dispatchEvent(L)
  726. },
  727. setZoom: function(L) {
  728. this._zoomTo(L)
  729. },
  730. zoomIn: function() {
  731. this._zoomTo(this.zoomLevel + 1)
  732. },
  733. zoomOut: function() {
  734. this._zoomTo(this.zoomLevel - 1)
  735. },
  736. setCenter: function(L) {
  737. if (L.equals(this.centerPoint)) {
  738. return
  739. }
  740. this.panTo(L, {
  741. noAnimation: true
  742. })
  743. },
  744. isLoaded: function() {
  745. return !!this.loaded
  746. },
  747. centerAndZoom: function(L, P) {
  748. var O = this;
  749. P = parseInt(P, 10);
  750. if (!(L instanceof w) || !P) {
  751. return
  752. }
  753. L = O.projection.lngLatToMercator(L);
  754. P = O._getProperZoom(P).zoom;
  755. if (L.equals(O.getCenter()) && P === O.getZoom()) {
  756. return
  757. }
  758. O.lastLevel = O.zoomLevel || P;
  759. O.zoomLevel = P;
  760. O.centerPoint = new w(L.lng, L.lat);
  761. O.defaultZoomLevel = O.defaultZoomLevel || O.zoomLevel;
  762. O.defaultCenter = O.defaultCenter || O.centerPoint;
  763. var M = new F("oncenterzoomend");
  764. M.point = new w(L.lng, L.lat);
  765. M.pixel = O.pointToPixel(O.centerPoint);
  766. M.zoom = O.zoomLevel;
  767. O.dispatchEvent(M);
  768. if (!O.loaded) {
  769. var N = new F("onload");
  770. N.point = new w(L.lng, L.lat);
  771. N.pixel = O.pointToPixel(O.centerPoint);
  772. N.zoom = P;
  773. O.dispatchEvent(N)
  774. }
  775. },
  776. reset: function() {
  777. this.centerAndZoom(this.defaultCenter, this.defaultZoomLevel)
  778. },
  779. getContainer: function() {
  780. return this.container
  781. },
  782. getSize: function() {
  783. return new d(this.container.clientWidth, this.container.clientHeight)
  784. },
  785. getCenter: function() {
  786. var L = this.projection.mercatorToLngLat(this.centerPoint);
  787. return L
  788. },
  789. getZoom: function() {
  790. return this.zoomLevel
  791. },
  792. _getProperZoom: function(N) {
  793. var M = this.config.minZoom;
  794. var L = this.config.maxZoom;
  795. var O = false;
  796. if (N < M) {
  797. O = true;
  798. N = M
  799. }
  800. if (N > L) {
  801. O = true;
  802. N = L
  803. }
  804. return {
  805. zoom: N,
  806. exceeded: O
  807. }
  808. },
  809. panTo: function(M, O) {
  810. if (!(M instanceof w) || M.equals(this.centerPoint)) {
  811. return
  812. }
  813. var N = this.pointToPixel(M);
  814. var L = this.width / 2;
  815. var P = this.height / 2;
  816. O = O || {};
  817. if (Math.abs(L - N.x) > this.width || Math.abs(P - N.y) > this.height || O.noAnimation) {
  818. this._panTo(L - N.x, P - N.y)
  819. } else {
  820. this._panBy(L - N.x, P - N.y, {
  821. duration: O.duration
  822. })
  823. }
  824. },
  825. _panTo: function(M, L) {
  826. var N = this.temp;
  827. if (N.dragAni) {
  828. N.dragAni.stop()
  829. }
  830. this.dispatchEvent(new F("onmovestart"));
  831. this._setPlatformPosition(this.offsetX + M, this.offsetY + L);
  832. this.dispatchEvent(new F("onmoveend"))
  833. },
  834. panBy: function(M, L, N) {
  835. M = M || 0;
  836. L = L || 0;
  837. N = N || {};
  838. if (Math.abs(M) <= this.width && Math.abs(L) <= this.height && (!N.noAnimation)) {
  839. this._panBy(M, L)
  840. } else {
  841. this._panTo(M, L)
  842. }
  843. },
  844. _panBy: function(N, M, Q) {
  845. var P = this;
  846. Q = Q || {};
  847. this.dispatchEvent(new F("onmovestart"));
  848. var L = P.offsetX;
  849. var R = P.offsetY;
  850. var O = P.temp;
  851. if (O.dragAni) {
  852. O.dragAni.stop()
  853. }
  854. if (O.panAni) {
  855. O.panAni.stop()
  856. }
  857. O.panAni = new v({
  858. fps: Q.fps || 30,
  859. duration: Q.duration || 500,
  860. transition: Q.transition || i.easeInOutQuad,
  861. render: function(S) {
  862. P._setPlatformPosition(L + N * S, R + M * S)
  863. },
  864. finish: function(S) {
  865. P.dispatchEvent(new F("onmoveend"));
  866. P.temp.panAni = null
  867. }
  868. })
  869. },
  870. _setPlatformPosition: function(L, M) {
  871. if (isNaN(L) || isNaN(M)) {
  872. return
  873. }
  874. if (this.offsetX == L && this.offsetY == M) {
  875. return
  876. }
  877. this._updateCenterPoint(this.offsetX - L, this.offsetY - M);
  878. this.offsetX = L;
  879. this.offsetY = M;
  880. o.css3TransformDom(this.platform, L, M);
  881. o.css3TransformDom(this.maskLayer, -L, -M);
  882. this.dispatchEvent(new F("onmoving"))
  883. },
  884. _updateCenterPoint: function(M, L) {
  885. var N = this.getZoomUnits(this.zoomLevel);
  886. var O = this.centerPoint;
  887. this.centerPoint = new w(O.lng + M * N, O.lat - L * N)
  888. },
  889. getZoomUnits: function(L) {
  890. return Math.pow(2, (this.config.maxZoom - L))
  891. },
  892. getTileUnits: function(L) {
  893. return this.getZoomUnits(L) * this.config.tileSize
  894. },
  895. pointToPixel: function(M, P) {
  896. if (!M) {
  897. return
  898. }
  899. M = this.projection.lngLatToMercator(M);
  900. P = P || {};
  901. var O = P.zoom || this.zoomLevel;
  902. var S = P.centerPoint || this.centerPoint;
  903. var Q = P.basePoint || new j(this.width / 2, this.height / 2);
  904. var N = this.getZoomUnits(O);
  905. var L = (M.lng - S.lng) / N + Q.x;
  906. var R = (S.lat - M.lat) / N + Q.y;
  907. return new j(L, R)
  908. },
  909. pixelToPoint: function(N, M) {
  910. if (!N) {
  911. return
  912. }
  913. M = M || {};
  914. var T = M.zoom || this.zoomLevel;
  915. var O = M.centerPoint || this.centerPoint;
  916. var L = M.basePoint || new j(this.width / 2, this.height / 2);
  917. var S = this.getZoomUnits(T);
  918. var Q = O.lng + S * (N.x - L.x);
  919. var P = O.lat - S * (N.y - L.y);
  920. var R = new w(Q, P);
  921. R = this.projection.mercatorToLngLat(R);
  922. return R
  923. },
  924. pointToOverlayPixel: function(L, N) {
  925. if (!L) {
  926. return
  927. }
  928. var M = this.pointToPixel(L, N);
  929. M.x -= this.offsetX;
  930. M.y -= this.offsetY;
  931. return M
  932. },
  933. overlayPixelToPoint: function(L, N) {
  934. if (!L) {
  935. return
  936. }
  937. var M = new j(L.x, L.y);
  938. M.x += this.offsetX;
  939. M.y += this.offsetY;
  940. return this.pixelToPoint(M, N)
  941. },
  942. getBounds: function() {
  943. if (!this.isLoaded()) {
  944. return new f()
  945. }
  946. var M = new j(0, this.height);
  947. var L = new j(this.width, 0);
  948. var O = this.pixelToPoint(M);
  949. var N = this.pixelToPoint(L);
  950. return new f(O, N)
  951. },
  952. _getBestLevel: function(M, N) {
  953. var Q = N.margins || [10, 10, 10, 10];
  954. var R = Q[1] + Q[3];
  955. var P = Q[0] + Q[2];
  956. var L = this.config.minZoom;
  957. var T = this.config.maxZoom;
  958. for (var O = T; O >= L; O--) {
  959. var S = this.getZoomUnits(O);
  960. if (M.toSpan().lng / S < this.width - R && M.toSpan().lat / S < this.height - P) {
  961. break
  962. }
  963. }
  964. if (O < L) {
  965. O = L
  966. }
  967. if (O > T) {
  968. O = T
  969. }
  970. return O
  971. },
  972. getViewport: function(U, M) {
  973. var Y = {
  974. center: this.getCenter(),
  975. zoom: this.getZoom()
  976. };
  977. if (!U || !U instanceof f && U.length == 0 || U instanceof f && U.isEmpty()) {
  978. return Y
  979. }
  980. var W = [];
  981. if (U instanceof f) {
  982. W.push(U.getNorthEast());
  983. W.push(U.getSouthWest())
  984. } else {
  985. W = U.slice(0)
  986. }
  987. M = M || {};
  988. var Q = [];
  989. for (var R = 0, P = W.length; R < P; R++) {
  990. Q.push(this.projection.lngLatToMercator(W[R]))
  991. }
  992. var N = new f();
  993. for (var R = Q.length - 1; R >= 0; R--) {
  994. N.extend(Q[R])
  995. }
  996. if (N.isEmpty()) {
  997. return Y
  998. }
  999. var L = N.getCenter();
  1000. var X = this._getBestLevel(N, M);
  1001. if (M.margins) {
  1002. var T = M.margins;
  1003. var S = (T[1] - T[3]) / 2;
  1004. var V = (T[0] - T[2]) / 2;
  1005. var O = this.getZoomUnits(X);
  1006. L.lng = L.lng + O * S;
  1007. L.lat = L.lat + O * V
  1008. }
  1009. L = this.projection.mercatorToLngLat(L);
  1010. return {
  1011. center: L,
  1012. zoom: X
  1013. }
  1014. },
  1015. setViewport: function(M, N) {
  1016. var L;
  1017. if (M && M.center) {
  1018. L = M
  1019. } else {
  1020. L = this.getViewport(M, N)
  1021. }
  1022. N = N || {};
  1023. if (L.zoom == this.zoomLevel && N.enableAnimation !== false) {
  1024. this.panTo(L.center, {
  1025. duration: 210
  1026. })
  1027. } else {
  1028. this.centerAndZoom(L.center, L.zoom)
  1029. }
  1030. },
  1031. getPanes: function() {
  1032. return this._panes
  1033. },
  1034. getOverlays: function() {
  1035. var O = [];
  1036. var P = this._overlays;
  1037. var N = this._customOverlays;
  1038. if (P) {
  1039. for (var M in P) {
  1040. if (P[M] instanceof I) {
  1041. O.push(P[M])
  1042. }
  1043. }
  1044. }
  1045. if (N) {
  1046. for (var M = 0, L = N.length; M < L; M++) {
  1047. O.push(N[M])
  1048. }
  1049. }
  1050. return O
  1051. },
  1052. _asyncRegister: function() {
  1053. for (var M = this.temp.registerIndex, L = u._register.length; M < L; M++) {
  1054. u._register[M](this)
  1055. }
  1056. this.temp.registerIndex = M
  1057. },
  1058. _checkZoom: function() {
  1059. var L = this.config;
  1060. if (L.minZoom < 3) {
  1061. L.minZoom = 3
  1062. }
  1063. if (L.maxZoom > 18) {
  1064. L.maxZoom = 18
  1065. }
  1066. },
  1067. addControl: function(L) {
  1068. if (L && J.lang.isFunction(L._i)) {
  1069. L._i(this);
  1070. this.dispatchEvent(new F("onaddcontrol", L))
  1071. }
  1072. },
  1073. removeControl: function(L) {
  1074. if (L && J.lang.isFunction(L.remove)) {
  1075. L.remove();
  1076. this.dispatchEvent(new F("onremovecontrol", L))
  1077. }
  1078. },
  1079. addOverlay: function(L) {
  1080. if (L && J.lang.isFunction(L._i)) {
  1081. L._i(this);
  1082. this.dispatchEvent(new F("onaddoverlay", L))
  1083. }
  1084. },
  1085. removeOverlay: function(L) {
  1086. if (L && J.lang.isFunction(L.remove)) {
  1087. L.remove();
  1088. this.dispatchEvent(new F("onremoveoverlay", L))
  1089. }
  1090. },
  1091. clearOverlays: function() {
  1092. this.dispatchEvent(new F("onclearoverlays"))
  1093. },
  1094. addMassFeatures: function(M) {
  1095. var L = new F("onaddmassfeatures");
  1096. L.massFeatures = M;
  1097. this.dispatchEvent(L)
  1098. },
  1099. removeMassFeatures: function(M) {
  1100. var L = new F("onremovemassfeatures");
  1101. L.massFeatures = M;
  1102. this.dispatchEvent(L)
  1103. },
  1104. clearMassFeatures: function() {
  1105. var L = new F("onclearmassfeatures");
  1106. this.dispatchEvent(L)
  1107. },
  1108. addTileLayer: function(L) {
  1109. if (L) {
  1110. this.dispatchEvent(new F("onaddtilelayer", L))
  1111. }
  1112. },
  1113. removeTileLayer: function(L) {
  1114. if (L) {
  1115. this.dispatchEvent(new F("onremovetilelayer", L))
  1116. }
  1117. },
  1118. enableDragging: function() {
  1119. this.config.enableDragging = true
  1120. },
  1121. disableDragging: function() {
  1122. this.config.enableDragging = false
  1123. },
  1124. enableInertialDragging: function() {
  1125. this.config.enableInertialDragging = true
  1126. },
  1127. disableInertialDragging: function() {
  1128. this.config.enableInertialDragging = false
  1129. },
  1130. enableDoubleClickZoom: function() {
  1131. this.config.enableDblclickZoom = true
  1132. },
  1133. disableDoubleClickZoom: function() {
  1134. this.config.enableDblclickZoom = false
  1135. },
  1136. enablePinchToZoom: function() {
  1137. this.config.enablePinchToZoom = true
  1138. },
  1139. disablePinchToZoom: function() {
  1140. this.config.enablePinchToZoom = false
  1141. },
  1142. addCopyrightControl: function() {
  1143. var L = new k();
  1144. this.addControl(L)
  1145. }
  1146. });
  1147. function f(L, M) {
  1148. if (L && !M) {
  1149. M = L
  1150. }
  1151. this._sw = this._ne = null;
  1152. this._swLng = this._swLat = null;
  1153. this._neLng = this._neLat = null;
  1154. if (L) {
  1155. this._sw = new w(L.lng, L.lat);
  1156. this._ne = new w(M.lng, M.lat);
  1157. this._swLng = L.lng;
  1158. this._swLat = L.lat;
  1159. this._neLng = M.lng;
  1160. this._neLat = M.lat
  1161. }
  1162. }
  1163. J.object.extend(f.prototype, {
  1164. isEmpty: function() {
  1165. return !this._sw || !this._ne
  1166. },
  1167. equals: function(L) {
  1168. if (!(L instanceof f) || this.isEmpty()) {
  1169. return false
  1170. }
  1171. return this.getSouthWest().equals(L.getSouthWest()) && this.getNorthEast().equals(L.getNorthEast())
  1172. },
  1173. getSouthWest: function() {
  1174. return this._sw
  1175. },
  1176. getNorthEast: function() {
  1177. return this._ne
  1178. },
  1179. getCenter: function() {
  1180. if (this.isEmpty()) {
  1181. return null
  1182. }
  1183. return new w((this._swLng + this._neLng) / 2, (this._swLat + this._neLat) / 2)
  1184. },
  1185. extend: function(L) {
  1186. if (!(L instanceof w)) {
  1187. return
  1188. }
  1189. var M = L.lng,
  1190. N = L.lat;
  1191. if (!this._sw) {
  1192. this._sw = new w(0, 0)
  1193. }
  1194. if (!this._ne) {
  1195. this._ne = new w(0, 0)
  1196. }
  1197. if (!this._swLng || this._swLng > M) {
  1198. this._sw.lng = this._swLng = M
  1199. }
  1200. if (!this._neLng || this._neLng < M) {
  1201. this._ne.lng = this._neLng = M
  1202. }
  1203. if (!this._swLat || this._swLat > N) {
  1204. this._sw.lat = this._swLat = N
  1205. }
  1206. if (!this._neLat || this._neLat < N) {
  1207. this._ne.lat = this._neLat = N
  1208. }
  1209. },
  1210. toSpan: function() {
  1211. if (this.isEmpty()) {
  1212. return new w(0, 0)
  1213. }
  1214. return new w(Math.abs(this._neLng - this._swLng), Math.abs(this._neLat - this._swLat))
  1215. }
  1216. });
  1217. function w(L, M) {
  1218. this.lng = parseFloat(L);
  1219. this.lat = parseFloat(M)
  1220. }
  1221. w.prototype.equals = function(L) {
  1222. return L && this.lat == L.lat && this.lng == L.lng
  1223. };
  1224. function n() {}
  1225. n.prototype.lngLatToPoint = function() {};
  1226. n.prototype.pointToLngLat = function() {};
  1227. function r() {}
  1228. J.extend(r, {
  1229. EARTHRADIUS: 6370996.81,
  1230. MCBAND: [12890594.86, 8362377.87, 5591021, 3481989.83, 1678043.12, 0],
  1231. LLBAND: [75, 60, 45, 30, 15, 0],
  1232. MC2LL: [
  1233. [1.410526172116255e-8, 0.00000898305509648872, -1.9939833816331, 200.9824383106796, -187.2403703815547,
  1234. 91.6087516669843, -23.38765649603339, 2.57121317296198, -0.03801003308653, 17337981.2
  1235. ],
  1236. [-7.435856389565537e-9, 0.000008983055097726239, -0.78625201886289, 96.32687599759846, -1.85204757529826, -
  1237. 59.36935905485877, 47.40033549296737, -16.50741931063887, 2.28786674699375, 10260144.86
  1238. ],
  1239. [-3.030883460898826e-8, 0.00000898305509983578, 0.30071316287616, 59.74293618442277, 7.357984074871, -
  1240. 25.38371002664745, 13.45380521110908, -3.29883767235584, 0.32710905363475, 6856817.37
  1241. ],
  1242. [-1.981981304930552e-8, 0.000008983055099779535, 0.03278182852591, 40.31678527705744, 0.65659298677277, -
  1243. 4.44255534477492, 0.85341911805263, 0.12923347998204, -0.04625736007561, 4482777.06
  1244. ],
  1245. [3.09191371068437e-9, 0.000008983055096812155, 0.00006995724062, 23.10934304144901, -0.00023663490511, -
  1246. 0.6321817810242, -0.00663494467273, 0.03430082397953, -0.00466043876332, 2555164.4
  1247. ],
  1248. [2.890871144776878e-9, 0.000008983055095805407, -3.068298e-8, 7.47137025468032, -0.00000353937994, -
  1249. 0.02145144861037, -0.00001234426596, 0.00010322952773, -0.00000323890364, 826088.5
  1250. ]
  1251. ],
  1252. LL2MC: [
  1253. [-0.0015702102444, 111320.7020616939, 1704480524535203, -10338987376042340, 26112667856603880, -
  1254. 35149669176653700, 26595700718403920, -10725012454188240, 1800819912950474, 82.5
  1255. ],
  1256. [0.0008277824516172526, 111320.7020463578, 647795574.6671607, -4082003173.641316, 10774905663.51142, -
  1257. 15171875531.51559, 12053065338.62167, -5124939663.577472, 913311935.9512032, 67.5
  1258. ],
  1259. [0.00337398766765, 111320.7020202162, 4481351.045890365, -23393751.19931662, 79682215.47186455, -
  1260. 115964993.2797253, 97236711.15602145, -43661946.33752821, 8477230.501135234, 52.5
  1261. ],
  1262. [0.00220636496208, 111320.7020209128, 51751.86112841131, 3796837.749470245, 992013.7397791013, -
  1263. 1221952.21711287, 1340652.697009075, -620943.6990984312, 144416.9293806241, 37.5
  1264. ],
  1265. [-0.0003441963504368392, 111320.7020576856, 278.2353980772752, 2485758.690035394, 6070.750963243378,
  1266. 54821.18345352118, 9540.606633304236, -2710.55326746645, 1405.483844121726, 22.5
  1267. ],
  1268. [-0.0003218135878613132, 111320.7020701615, 0.00369383431289, 823725.6402795718, 0.46104986909093,
  1269. 2351.343141331292, 1.58060784298199, 8.77738589078284, 0.37238884252424, 7.45
  1270. ]
  1271. ],
  1272. getDistanceByMC: function(Q, O) {
  1273. if (!Q || !O) {
  1274. return 0
  1275. }
  1276. var M;
  1277. var P;
  1278. var L;
  1279. var N;
  1280. Q = this.convertMC2LL(Q);
  1281. if (!Q) {
  1282. return 0
  1283. }
  1284. M = this.toRadians(Q.lng);
  1285. P = this.toRadians(Q.lat);
  1286. O = this.convertMC2LL(O);
  1287. if (!O) {
  1288. return 0
  1289. }
  1290. L = this.toRadians(O.lng);
  1291. N = this.toRadians(O.lat);
  1292. return this.getDistance(M, L, P, N)
  1293. },
  1294. getDistanceByLL: function(Q, O) {
  1295. if (!Q || !O) {
  1296. return 0
  1297. }
  1298. Q.lng = this.getLoop(Q.lng, -180, 180);
  1299. Q.lat = this.getRange(Q.lat, -74, 74);
  1300. O.lng = this.getLoop(O.lng, -180, 180);
  1301. O.lat = this.getRange(O.lat, -74, 74);
  1302. var M;
  1303. var L;
  1304. var P;
  1305. var N;
  1306. M = this.toRadians(Q.lng);
  1307. P = this.toRadians(Q.lat);
  1308. L = this.toRadians(O.lng);
  1309. N = this.toRadians(O.lat);
  1310. return this.getDistance(M, L, P, N)
  1311. },
  1312. convertMC2LL: function(M) {
  1313. if (M === null || M === undefined) {
  1314. return new w(0, 0)
  1315. }
  1316. var N;
  1317. var P;
  1318. N = new w(Math.abs(M.lng), Math.abs(M.lat));
  1319. for (var O = 0; O < this.MCBAND.length; O++) {
  1320. if (N.lat >= this.MCBAND[O]) {
  1321. P = this.MC2LL[O];
  1322. break
  1323. }
  1324. }
  1325. var L = this.convertor(M, P);
  1326. var M = new w(L.lng.toFixed(6), L.lat.toFixed(6));
  1327. return M
  1328. },
  1329. convertLL2MC: function(L) {
  1330. if (L === null || L === undefined) {
  1331. return new w(0, 0)
  1332. }
  1333. if (L.lng > 180 || L.lng < -180 || L.lat > 90 || L.lat < -90) {
  1334. return new w(0, 0)
  1335. }
  1336. var M;
  1337. var O;
  1338. L.lng = this.getLoop(L.lng, -180, 180);
  1339. L.lat = this.getRange(L.lat, -74, 74);
  1340. M = new w(L.lng, L.lat);
  1341. for (var N = 0; N < this.LLBAND.length; N++) {
  1342. if (M.lat >= this.LLBAND[N]) {
  1343. O = this.LL2MC[N];
  1344. break
  1345. }
  1346. }
  1347. if (!O) {
  1348. for (var N = 0; N < this.LLBAND.length; N++) {
  1349. if (M.lat <= -this.LLBAND[N]) {
  1350. O = this.LL2MC[N];
  1351. break
  1352. }
  1353. }
  1354. }
  1355. var P = this.convertor(L, O);
  1356. var L = new w(P.lng.toFixed(2), P.lat.toFixed(2));
  1357. return L
  1358. },
  1359. convertor: function(N, O) {
  1360. if (!N || !O) {
  1361. return
  1362. }
  1363. var L = O[0] + O[1] * Math.abs(N.lng);
  1364. var M = Math.abs(N.lat) / O[9];
  1365. 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 +
  1366. O[8] * M * M * M * M * M * M;
  1367. L *= (N.lng < 0 ? -1 : 1);
  1368. P *= (N.lat < 0 ? -1 : 1);
  1369. return new w(L, P)
  1370. },
  1371. getDistance: function(M, L, O, N) {
  1372. return this.EARTHRADIUS * Math.acos((Math.sin(O) * Math.sin(N) + Math.cos(O) * Math.cos(N) * Math.cos(L - M)))
  1373. },
  1374. toRadians: function(L) {
  1375. return Math.PI * L / 180
  1376. },
  1377. toDegrees: function(L) {
  1378. return (180 * L) / Math.PI
  1379. },
  1380. getRange: function(N, M, L) {
  1381. if (M != null) {
  1382. N = Math.max(N, M)
  1383. }
  1384. if (L != null) {
  1385. N = Math.min(N, L)
  1386. }
  1387. return N
  1388. },
  1389. getLoop: function(N, M, L) {
  1390. while (N > L) {
  1391. N -= L - M
  1392. }
  1393. while (N < M) {
  1394. N += L - M
  1395. }
  1396. return N
  1397. }
  1398. });
  1399. J.extend(r.prototype, {
  1400. lngLatToMercator: function(L) {
  1401. return r.convertLL2MC(L)
  1402. },
  1403. lngLatToPoint: function(L) {
  1404. var M = r.convertLL2MC(L);
  1405. return new j(M.lng, M.lat)
  1406. },
  1407. mercatorToLngLat: function(L) {
  1408. return r.convertMC2LL(L)
  1409. },
  1410. pointToLngLat: function(L) {
  1411. var M = new w(L.x, L.y);
  1412. return r.convertMC2LL(M)
  1413. },
  1414. pointToPixel: function(M, Q, P, O, R) {
  1415. if (!M) {
  1416. return
  1417. }
  1418. M = this.lngLatToMercator(M, R);
  1419. var N = this.getZoomUnits(Q);
  1420. var L = Math.round((M.lng - P.lng) / N + O.width / 2);
  1421. var S = Math.round((P.lat - M.lat) / N + O.height / 2);
  1422. return new j(L, S)
  1423. },
  1424. pixelToPoint: function(L, T, P, N, M) {
  1425. if (!L) {
  1426. return
  1427. }
  1428. var S = this.getZoomUnits(T);
  1429. var Q = P.lng + S * (L.x - N.width / 2);
  1430. var O = P.lat - S * (L.y - N.height / 2);
  1431. var R = new w(Q, O);
  1432. return this.mercatorToLngLat(R, M)
  1433. },
  1434. getZoomUnits: function(L) {
  1435. return Math.pow(2, (18 - L))
  1436. }
  1437. });
  1438. u.httpUrl = {
  1439. TILE_ONLINE_URLS: ["online0.map.bdimg.com", "online1.map.bdimg.com", "online2.map.bdimg.com",
  1440. "online3.map.bdimg.com", "online4.map.bdimg.com"
  1441. ],
  1442. baidumap: "map.baidu.com",
  1443. main_domain_nocdn: {
  1444. baidu: "api.map.baidu.com"
  1445. },
  1446. main_domain_cdn: {
  1447. other: ["api.map.baidu.com"],
  1448. baidu: ["api0.map.bdimg.com", "api1.map.bdimg.com", "api2.map.bdimg.com"]
  1449. }
  1450. };
  1451. u.httpsUrl = {
  1452. TILE_ONLINE_URLS: ["gss0.bdstatic.com/8bo_dTSlR1gBo1vgoIiO_jowehsv",
  1453. "gss0.bdstatic.com/8bo_dTSlRMgBo1vgoIiO_jowehsv", "gss0.bdstatic.com/8bo_dTSlRcgBo1vgoIiO_jowehsv",
  1454. "gss0.bdstatic.com/8bo_dTSlRsgBo1vgoIiO_jowehsv", "gss0.bdstatic.com/8bo_dTSlQ1gBo1vgoIiO_jowehsv"
  1455. ],
  1456. baidumap: "gsp0.baidu.com/80MWsjip0QIZ8tyhnq",
  1457. main_domain_nocdn: {
  1458. baidu: "gsp0.baidu.com/9_Q4sjOpB1gCo2Kml5_Y_D3",
  1459. other: "api.map.baidu.com"
  1460. },
  1461. main_domain_cdn: {
  1462. other: "api.map.baidu.com",
  1463. baidu: ["gss0.bdstatic.com/9_Q4vHSd2RZ3otebn9fN2DJv", "gss0.baidu.com/9_Q4vXSd2RZ3otebn9fN2DJv",
  1464. "gss0.bdstatic.com/9_Q4vnSd2RZ3otebn9fN2DJv"
  1465. ]
  1466. }
  1467. };
  1468. u.urlType = {
  1469. "0": {
  1470. proto: "http://",
  1471. domain: u.httpUrl
  1472. },
  1473. "1": {
  1474. proto: "https://",
  1475. domain: u.httpsUrl
  1476. },
  1477. "2": {
  1478. proto: "https://",
  1479. domain: u.httpsUrl
  1480. }
  1481. };
  1482. if (window.BMAP_PROTOCOL && window.BMAP_PROTOCOL === "https") {
  1483. window.HOST_TYPE = 2
  1484. }
  1485. u.urlStr = window.HOST_TYPE || "0";
  1486. u.url = u.urlType[u.urlStr];
  1487. u.mapUrl = u.url.proto + u.url.domain["baidumap"] + "/";
  1488. u.apiUrl = u.url.proto + (u.urlStr == "2" ? u.url.domain["main_domain_nocdn"]["other"] : u.url.domain[
  1489. "main_domain_nocdn"]["baidu"]) + "/";
  1490. u.apiUrlCdn = u.url.proto + (u.urlStr == "2" ? u.url.domain["main_domain_cdn"]["other"] : u.url.domain[
  1491. "main_domain_cdn"]["baidu"][0]) + "/";
  1492. var o = {
  1493. setPosition: function(N, L) {
  1494. var M = N.style;
  1495. M.left = L[0] + "px";
  1496. M.top = L[1] + "px"
  1497. },
  1498. setUnSelectable: function(L) {
  1499. L.style.MozUserSelect = "none"
  1500. },
  1501. isInDocument: function(L) {
  1502. return L && L.parentNode && L.parentNode.nodeType != 11
  1503. },
  1504. beforeEndHTML: function(M, L) {
  1505. J.dom.insertHTML(M, "beforeEnd", L);
  1506. return M.lastChild
  1507. },
  1508. getPosition: function(L) {
  1509. var M = {
  1510. left: 0,
  1511. top: 0
  1512. };
  1513. while (L && L.offsetParent) {
  1514. M.left += L.offsetLeft;
  1515. M.top += L.offsetTop;
  1516. L = L.offsetParent
  1517. }
  1518. return M
  1519. },
  1520. stopBubble: function(L) {
  1521. var L = window.event || L;
  1522. L.stopPropagation ? L.stopPropagation() : L.cancelBubble = true
  1523. },
  1524. preventDefault: function(L) {
  1525. var L = window.event || L;
  1526. L.preventDefault ? L.preventDefault() : L.returnValue = false;
  1527. return false
  1528. },
  1529. stopAndPrevent: function(L) {
  1530. this.stopBubble(L);
  1531. return this.preventDefault(L)
  1532. },
  1533. getScroll: function() {
  1534. var L = document.documentElement,
  1535. M = document.body;
  1536. if (L && (L.scrollTop || L.scrollLeft)) {
  1537. return [L.scrollTop, L.scrollLeft]
  1538. } else {
  1539. if (M) {
  1540. return [M.scrollTop, M.scrollLeft]
  1541. } else {
  1542. return [0, 0]
  1543. }
  1544. }
  1545. },
  1546. getDistanceByPixel: function(M, L) {
  1547. if (!M || !L) {
  1548. return
  1549. }
  1550. return Math.round(Math.sqrt(Math.pow(M.x - L.x, 2) + Math.pow(M.y - L.y, 2)))
  1551. },
  1552. create: function(M, L, N) {
  1553. var O = document.createElement(M);
  1554. if (N) {
  1555. O = document.createElementNS(N, M)
  1556. }
  1557. return J.dom.setAttrs(O, L || {})
  1558. },
  1559. getCurrentStyle: function(L) {
  1560. if (L.currentStyle) {
  1561. return L.currentStyle
  1562. } else {
  1563. if (L.ownerDocument && L.ownerDocument.defaultView) {
  1564. return L.ownerDocument.defaultView.getComputedStyle(L, null)
  1565. }
  1566. }
  1567. },
  1568. isDefined: function(L) {
  1569. return typeof L != "undefined"
  1570. },
  1571. isSupportCanvas: function() {
  1572. if (typeof this.isSupportCanvas.result != "boolean") {
  1573. this.isSupportCanvas.result = !!this.create("canvas").getContext
  1574. }
  1575. return this.isSupportCanvas.result
  1576. },
  1577. getCurrentTime: function() {
  1578. return (new Date).getTime()
  1579. },
  1580. isAndroid23More: function() {
  1581. if (J.platform.isAndroid && parseFloat(J.platform.android) > 2.3) {
  1582. return true
  1583. }
  1584. return false
  1585. },
  1586. canUseTranslate3d: function() {
  1587. if (typeof this.canUseTranslate3d.result !== "boolean") {
  1588. this.canUseTranslate3d.result = o.isAndroid23More() || J.platform.isIphone
  1589. }
  1590. return this.canUseTranslate3d.result
  1591. },
  1592. css3TransformDom: function(P, M, Q, O) {
  1593. var L = "";
  1594. if (O !== undefined) {
  1595. L = " scale(" + O + ")"
  1596. }
  1597. var N = "";
  1598. if (this.canUseTranslate3d()) {
  1599. N = "translate3d(" + M + "px," + Q + "px,0px)"
  1600. } else {
  1601. N = "translate(" + M + "px," + Q + "px)"
  1602. }
  1603. P.style.WebkitTransform = N + L
  1604. },
  1605. request: function(O, L) {
  1606. if (L) {
  1607. var N = (Math.random() * 100000).toFixed(0);
  1608. u._rd["_cbk" + N] = function(P) {
  1609. L && L(P);
  1610. delete u._rd["_cbk" + N]
  1611. };
  1612. O += "&callback=BMap._rd._cbk" + N
  1613. }
  1614. var M = this.create("script", {
  1615. src: O,
  1616. type: "text/javascript",
  1617. charset: "utf-8"
  1618. });
  1619. M.addEventListener("load", function(Q) {
  1620. var P = Q.target;
  1621. P.parentNode.removeChild(P)
  1622. }, false);
  1623. document.getElementsByTagName("head")[0].appendChild(M);
  1624. M = null
  1625. }
  1626. };
  1627. function v(O) {
  1628. var L = {
  1629. duration: 1000,
  1630. fps: 30,
  1631. delay: 0,
  1632. transition: i.linear,
  1633. onStop: function() {}
  1634. };
  1635. this._anis = [];
  1636. if (O) {
  1637. for (var M in O) {
  1638. L[M] = O[M]
  1639. }
  1640. }
  1641. this._opts = L;
  1642. if (J.lang.isNumber(L.delay)) {
  1643. var N = this;
  1644. setTimeout(function() {
  1645. N.start()
  1646. }, L.delay)
  1647. } else {
  1648. if (L.delay != v.INFINITE) {
  1649. this.start()
  1650. }
  1651. }
  1652. }
  1653. v.INFINITE = "INFINITE";
  1654. v.prototype.start = function() {
  1655. if (window.requestAnimationFrame) {
  1656. var L = this;
  1657. L._timer = window.requestAnimationFrame(function(M) {
  1658. L._loop(M)
  1659. })
  1660. } else {
  1661. this._beginTime = o.getCurrentTime();
  1662. this._endTime = this._beginTime + this._opts.duration;
  1663. this._loop()
  1664. }
  1665. };
  1666. v.prototype._loop = function() {
  1667. var M = this;
  1668. var L = o.getCurrentTime();
  1669. if (!this._beginTime) {
  1670. this._beginTime = L;
  1671. this._endTime = this._beginTime + this._opts.duration
  1672. }
  1673. if (L >= M._endTime) {
  1674. if (J.lang.isFunction(M._opts.render)) {
  1675. M._opts.render(M._opts.transition(1))
  1676. }
  1677. if (J.lang.isFunction(M._opts.finish)) {
  1678. M._opts.finish()
  1679. }
  1680. return
  1681. }
  1682. M.schedule = M._opts.transition((L - M._beginTime) / M._opts.duration);
  1683. if (J.lang.isFunction(M._opts.render)) {
  1684. M._opts.render(M.schedule)
  1685. }
  1686. if (!M.terminative) {
  1687. if (window.requestAnimationFrame) {
  1688. M._timer = requestAnimationFrame(function(N) {
  1689. M._loop(N)
  1690. })
  1691. } else {
  1692. M._timer = setTimeout(function() {
  1693. M._loop()
  1694. }, 1000 / M._opts.fps)
  1695. }
  1696. }
  1697. };
  1698. v.prototype.stop = function(M) {
  1699. this.terminative = true;
  1700. for (var L = 0; L < this._anis.length; L++) {
  1701. this._anis[L].stop();
  1702. this._anis[L] = null
  1703. }
  1704. this._anis.length = 0;
  1705. if (this._timer) {
  1706. if (window.cancelAnimationFrame) {
  1707. cancelAnimationFrame(this._timer)
  1708. } else {
  1709. clearTimeout(this._timer)
  1710. }
  1711. this._timer = null
  1712. }
  1713. this._opts.onStop(this.schedule);
  1714. if (M) {
  1715. this._endTime = this._beginTime;
  1716. this._loop()
  1717. }
  1718. };
  1719. var i = {
  1720. linear: function(L) {
  1721. return L
  1722. },
  1723. reverse: function(L) {
  1724. return 1 - L
  1725. },
  1726. easeInQuad: function(L) {
  1727. return L * L
  1728. },
  1729. easeInCubic: function(L) {
  1730. return Math.pow(L, 3)
  1731. },
  1732. easeOutQuad: function(L) {
  1733. return -(L * (L - 2))
  1734. },
  1735. easeOutCubic: function(L) {
  1736. return Math.pow((L - 1), 3) + 1
  1737. },
  1738. easeInOutQuad: function(L) {
  1739. if (L < 0.5) {
  1740. return L * L * 2
  1741. } else {
  1742. return -2 * (L - 2) * L - 1
  1743. }
  1744. return
  1745. },
  1746. easeInOutCubic: function(L) {
  1747. if (L < 0.5) {
  1748. return Math.pow(L, 3) * 4
  1749. } else {
  1750. return Math.pow(L - 1, 3) * 4 + 1
  1751. }
  1752. },
  1753. easeInOutSine: function(L) {
  1754. return (1 - Math.cos(Math.PI * L)) / 2
  1755. }
  1756. };
  1757. i["ease-in"] = i.easeInQuad;
  1758. i["ease-out"] = i.easeOutQuad;
  1759. function j(L, M) {
  1760. this.x = L || 0;
  1761. this.y = M || 0
  1762. }
  1763. j.prototype.equals = function(L) {
  1764. return L && L.x == this.x && L.y == this.y
  1765. };
  1766. function d(M, L) {
  1767. this.width = M || 0;
  1768. this.height = L || 0
  1769. }
  1770. d.prototype.equals = function(L) {
  1771. return L && this.width == L.width && this.height == L.height
  1772. };
  1773. var B = 0;
  1774. function p() {}
  1775. J.object.extend(p, {
  1776. Request: {
  1777. INITIAL: -1,
  1778. WAITING: 0,
  1779. COMPLETED: 1
  1780. },
  1781. getDependency: function() {
  1782. return {
  1783. opmb: [],
  1784. control: [],
  1785. marker: [],
  1786. massfeatures: []
  1787. }
  1788. },
  1789. Config: {
  1790. _baseUrl: "http://api.map.baidu.com/getmodules?type=lite"
  1791. },
  1792. delayFlag: false,
  1793. ModuleTree: {
  1794. _modules: {},
  1795. _arrMdls: []
  1796. },
  1797. load: function(N, P, M) {
  1798. var L = this.getModule(N);
  1799. if (L._status == this.Request.COMPLETED) {
  1800. if (M) {
  1801. P && P()
  1802. }
  1803. return
  1804. } else {
  1805. if (L._status == this.Request.INITIAL) {
  1806. this.combine(N);
  1807. this.pushUniqueMdl(N);
  1808. var O = this;
  1809. if (O.delayFlag == false) {
  1810. O.delayFlag = true;
  1811. window.setTimeout(function() {
  1812. var W = O.ModuleTree._arrMdls.slice(0);
  1813. var Y = [];
  1814. for (var S = 0, R = W.length; S < R; S++) {
  1815. var X = W[S],
  1816. Q = A.asyncMdlVer[X],
  1817. U = "async_" + X + "_" + Q;
  1818. if (!A.chkVersion(U)) {
  1819. W[W[S]] = "";
  1820. Y.push(X + "_" + Q)
  1821. } else {
  1822. W[W[S]] = A.getVersion(U)
  1823. }
  1824. }
  1825. if (Y.length == 0) {
  1826. for (var S = 0, R = W.length; S < R; S++) {
  1827. var Z = W[S],
  1828. U = "async_" + Z + "_" + A.asyncMdlVer[Z],
  1829. V = A.getVersion(U);
  1830. p.run(Z, V)
  1831. }
  1832. } else {
  1833. var T = O.Config._baseUrl + "&mod=" + Y.join(",") + "&sendSequenceNum=" + B + "&v=1.0";
  1834. o.request(T);
  1835. window["sendSequenceNum" + B] = W;
  1836. B++
  1837. }
  1838. O.delayFlag = false;
  1839. O.ModuleTree._arrMdls.length = 0
  1840. }, 1)
  1841. }
  1842. L._status = this.Request.WAITING
  1843. }
  1844. L._callbacks.push(P)
  1845. }
  1846. },
  1847. combine: function(L) {
  1848. var N = this.getDependency();
  1849. if (L && N[L]) {
  1850. var N = N[L];
  1851. for (var M = 0; M < N.length; M++) {
  1852. this.combine(N[M]);
  1853. if (!this.ModuleTree._modules[N[M]]) {
  1854. this.pushUniqueMdl(N[M])
  1855. }
  1856. }
  1857. }
  1858. },
  1859. pushUniqueMdl: function(O) {
  1860. var L = this.ModuleTree._arrMdls;
  1861. for (var N = 0, M = L.length; N < M; N++) {
  1862. if (L[N] == O) {
  1863. return
  1864. }
  1865. }
  1866. L.push(O)
  1867. },
  1868. getModule: function(M) {
  1869. var L;
  1870. if (!this.ModuleTree._modules[M]) {
  1871. this.ModuleTree._modules[M] = {};
  1872. this.ModuleTree._modules[M]._status = this.Request.INITIAL;
  1873. this.ModuleTree._modules[M]._callbacks = []
  1874. }
  1875. L = this.ModuleTree._modules[M];
  1876. return L
  1877. },
  1878. run: function(O, R) {
  1879. var M = "async_" + O + "_" + A.asyncMdlVer[O],
  1880. Q = "async_" + O;
  1881. if (!A.chkVersion(M)) {
  1882. A.saveVersion(M, R, Q)
  1883. }
  1884. var N = this.getModule(O);
  1885. try {
  1886. eval(R)
  1887. } catch (S) {
  1888. return
  1889. }
  1890. N._status = this.Request.COMPLETED;
  1891. for (var P = 0, L = N._callbacks.length; P < L; P++) {
  1892. N._callbacks[P]()
  1893. }
  1894. N._callbacks.length = 0
  1895. }
  1896. });
  1897. window._jsload = function(Q, S, R) {
  1898. var L = window["sendSequenceNum" + R],
  1899. N = Q.split("_")[0];
  1900. L[N] = S;
  1901. var P = true;
  1902. for (var O = 0, M = L.length; O < M; O++) {
  1903. if (L[L[O]].length <= 0) {
  1904. P = false;
  1905. break
  1906. }
  1907. }
  1908. if (P) {
  1909. for (var O = 0, M = L.length; O < M; O++) {
  1910. var Q = L[O],
  1911. S = L[Q];
  1912. p.run(Q, S)
  1913. }
  1914. L.length = 0;
  1915. delete window["sendSequenceNum" + R]
  1916. }
  1917. };
  1918. var A = {
  1919. asyncMdlVer: {
  1920. control: "ldhxzj",
  1921. marker: "01zsya",
  1922. opmb: "dt2tyx",
  1923. massfeatures: "j0omg2"
  1924. },
  1925. chkVersion: function(L) {
  1926. try {
  1927. var M = window.localStorage;
  1928. if (!M) {
  1929. return false
  1930. }
  1931. return M[L] && M[L].length > 0
  1932. } catch (N) {
  1933. return false
  1934. }
  1935. },
  1936. saveVersion: function(L, R, P) {
  1937. try {
  1938. var N = window.localStorage;
  1939. if (N) {
  1940. for (var M = N.length, O = M - 1; O >= 0; O--) {
  1941. var S = N.key(O);
  1942. if (S.indexOf(P) > -1) {
  1943. N.removeItem(S)
  1944. }
  1945. }
  1946. N.setItem(L, R)
  1947. }
  1948. } catch (Q) {}
  1949. },
  1950. getVersion: function(L) {
  1951. try {
  1952. var M = window.localStorage;
  1953. if (!M) {
  1954. return ""
  1955. }
  1956. return M.getItem(L)
  1957. } catch (N) {
  1958. return ""
  1959. }
  1960. }
  1961. };
  1962. void
  1963. function(N, L, M) {
  1964. void
  1965. function(Y, ay, aa) {
  1966. var av = "alog";
  1967. var W = aa[av];
  1968. if (W && W.defined) {
  1969. return
  1970. }
  1971. var am = ay.all && Y.attachEvent,
  1972. ar, R = (W && W.l) || +new Date,
  1973. ac = Y.logId || (+new Date).toString(36) + Math.random().toString(36).substr(2, 3),
  1974. ae = 0,
  1975. ag = {},
  1976. ak = function(aF) {
  1977. var aA = arguments;
  1978. var az, aC, aE, aD;
  1979. if (aF == "define" || aF == "require") {
  1980. for (var aB = 1; aB < aA.length; aB++) {
  1981. switch (typeof aA[aB]) {
  1982. case "string":
  1983. az = aA[aB];
  1984. break;
  1985. case "object":
  1986. aE = aA[aB];
  1987. break;
  1988. case "function":
  1989. aD = aA[aB];
  1990. break
  1991. }
  1992. }
  1993. if (aF == "require") {
  1994. if (az && !aE) {
  1995. aE = [az]
  1996. }
  1997. az = null
  1998. }
  1999. az = !az ? "#" + (ae++) : az;
  2000. aC = ah[az] = (ah[az] || {});
  2001. if (!aC.defined) {
  2002. aC.name = az;
  2003. aC.requires = aE;
  2004. aC.creator = aD;
  2005. if (aF == "define") {
  2006. aC.defining = true
  2007. }
  2008. ab(aC)
  2009. }
  2010. return
  2011. }
  2012. if (typeof aF == "function") {
  2013. aF(ak);
  2014. return
  2015. }
  2016. String(aF).replace(/^(?:([\w$_]+)\.)?(\w+)$/, function(aG, aH, aI) {
  2017. aA[0] = aI;
  2018. Z.apply(ak.tracker(aH), aA)
  2019. })
  2020. },
  2021. aq = {},
  2022. S = {},
  2023. ah = {
  2024. alog: {
  2025. name: "alog",
  2026. defined: true,
  2027. instance: ak
  2028. }
  2029. },
  2030. an;
  2031. function au(az) {
  2032. var aB = P.get("alias") || {};
  2033. var aC = aB[az] || (az + ".js");
  2034. if (ag[aC]) {
  2035. return
  2036. }
  2037. ag[aC] = true;
  2038. var aA = "script";
  2039. var aE = ay.createElement(aA);
  2040. var aD = ay.getElementsByTagName(aA)[0];
  2041. aE.async = !0;
  2042. aE.src = aC;
  2043. aD.parentNode.insertBefore(aE, aD)
  2044. }
  2045. function ab(aB) {
  2046. if (aB.defined) {
  2047. return
  2048. }
  2049. var aF = true;
  2050. var aE = [];
  2051. var aC = aB.requires;
  2052. for (var aA = 0; aC && aA < aC.length; aA++) {
  2053. var az = aC[aA];
  2054. var aD = ah[az] = (ah[az] || {});
  2055. if (aD.defined || aD == aB) {
  2056. aE.push(aD.instance)
  2057. } else {
  2058. aF = false;
  2059. if (!aD.defining) {
  2060. au(az)
  2061. }
  2062. aD.waiting = aD.waiting || {};
  2063. aD.waiting[aB.name] = aB
  2064. }
  2065. }
  2066. if (aF) {
  2067. aB.defined = true;
  2068. if (aB.creator) {
  2069. aB.instance = aB.creator.apply(aB, aE)
  2070. }
  2071. ao(aB)
  2072. }
  2073. }
  2074. function ao(az) {
  2075. for (var aA in az.waiting) {
  2076. ab(az.waiting[aA])
  2077. }
  2078. }
  2079. function V(az) {
  2080. return (az || new Date) - R
  2081. }
  2082. function aj(aB, az, aC) {
  2083. if (!aB) {
  2084. return
  2085. }
  2086. if (typeof aB == "string") {
  2087. aC = az;
  2088. az = aB;
  2089. aB = ak
  2090. }
  2091. try {
  2092. if (aB == ak) {
  2093. aq[az] = aq[az] || [];
  2094. aq[az].unshift(aC);
  2095. return
  2096. }
  2097. if (aB.addEventListener) {
  2098. aB.addEventListener(az, aC, false)
  2099. } else {
  2100. if (aB.attachEvent) {
  2101. aB.attachEvent("on" + az, aC)
  2102. }
  2103. }
  2104. } catch (aA) {}
  2105. }
  2106. function al(aC, az, aE) {
  2107. if (!aC) {
  2108. return
  2109. }
  2110. if (typeof aC == "string") {
  2111. aE = az;
  2112. az = aC;
  2113. aC = ak
  2114. }
  2115. try {
  2116. if (aC == ak) {
  2117. var aD = aq[az];
  2118. if (!aD) {
  2119. return
  2120. }
  2121. var aB = aD.length;
  2122. while (aB--) {
  2123. if (aD[aB] === aE) {
  2124. aD.splice(aB, 1)
  2125. }
  2126. }
  2127. return
  2128. }
  2129. if (aC.removeEventListener) {
  2130. aC.removeEventListener(az, aE, false)
  2131. } else {
  2132. aC.detachEvent && aC.detachEvent("on" + az, aE)
  2133. }
  2134. } catch (aA) {}
  2135. }
  2136. function af(aB) {
  2137. var aE = aq[aB],
  2138. az = 0;
  2139. if (!aE) {
  2140. return
  2141. }
  2142. var aA = [];
  2143. var aC = arguments;
  2144. for (var aD = 1; aD < aC.length; aD++) {
  2145. aA.push(aC[aD])
  2146. }
  2147. var aD = aE.length;
  2148. while (aD--) {
  2149. if (aE[aD].apply(this, aA)) {
  2150. az++
  2151. }
  2152. }
  2153. return az
  2154. }
  2155. function ax(aB, aD) {
  2156. if (!aB || !aD) {
  2157. return
  2158. }
  2159. var aE = new Image(1, 1),
  2160. az = [],
  2161. aA = "img_" + (+new Date);
  2162. for (var aC in aD) {
  2163. if (aD[aC]) {
  2164. az.push(aC + "=" + encodeURIComponent(aD[aC]))
  2165. }
  2166. }
  2167. ak[aA] = aE;
  2168. aE.onload = aE.onerror = function() {
  2169. ak[aA] = aE = aE.onload = aE.onerror = null;
  2170. delete ak[aA]
  2171. };
  2172. aE.src = aB + "?" + az.join("&")
  2173. }
  2174. function X(aA, aB) {
  2175. if (!aA) {
  2176. return aB
  2177. }
  2178. var az = {};
  2179. for (var aC in aB) {
  2180. if (aA[aC] !== null) {
  2181. az[aA[aC] || aC] = aB[aC]
  2182. }
  2183. }
  2184. return az
  2185. }
  2186. function Z() {
  2187. var aA = arguments;
  2188. var aE = aA[0];
  2189. if (this.created || /^(on|un|set|get|create)$/.test(aE)) {
  2190. var aC = ai.prototype[aE];
  2191. var aD = [];
  2192. for (var aB = 1, az = aA.length; aB < az; aB++) {
  2193. aD.push(aA[aB])
  2194. }
  2195. if (typeof aC == "function") {
  2196. aC.apply(this, aD)
  2197. }
  2198. } else {
  2199. this.argsList.push(aA)
  2200. }
  2201. }
  2202. function ap(aB, aA) {
  2203. var az = {};
  2204. for (var aC in aB) {
  2205. if (aB.hasOwnProperty(aC)) {
  2206. az[aC] = aB[aC]
  2207. }
  2208. }
  2209. for (var aC in aA) {
  2210. if (aA.hasOwnProperty(aC)) {
  2211. az[aC] = aA[aC]
  2212. }
  2213. }
  2214. return az
  2215. }
  2216. function ai(az) {
  2217. this.name = az;
  2218. this.fields = {
  2219. protocolParameter: {
  2220. postUrl: null,
  2221. protocolParameter: null
  2222. }
  2223. };
  2224. this.argsList = [];
  2225. this["alog"] = ak
  2226. }
  2227. function Q(aC) {
  2228. var az;
  2229. aC = aC || "default";
  2230. if (aC == "*") {
  2231. az = [];
  2232. for (var aB in S) {
  2233. az.push(S[aB])
  2234. }
  2235. return az
  2236. }
  2237. var aA = S[aC];
  2238. if (!aA) {
  2239. aA = S[aC] = new ai(aC)
  2240. }
  2241. return aA
  2242. }
  2243. ai.prototype.start = ai.prototype.create = function(az) {
  2244. if (this.created) {
  2245. return
  2246. }
  2247. if (typeof az == "object") {
  2248. this.set(az)
  2249. }
  2250. this.created = new Date;
  2251. this.fire("create", this);
  2252. var aA;
  2253. while (aA = this.argsList.shift()) {
  2254. Z.apply(this, aA)
  2255. }
  2256. };
  2257. ai.prototype.send = function(aC, aA) {
  2258. var aB = ap({
  2259. ts: V().toString(36),
  2260. t: aC,
  2261. sid: ac
  2262. }, this.fields);
  2263. if (typeof aA == "object") {
  2264. aB = ap(aB, aA)
  2265. } else {
  2266. var az = arguments;
  2267. switch (aC) {
  2268. case "pageview":
  2269. if (az[1]) {
  2270. aB.page = az[1]
  2271. }
  2272. if (az[2]) {
  2273. aB.title = az[2]
  2274. }
  2275. break;
  2276. case "event":
  2277. if (az[1]) {
  2278. aB.eventCategory = az[1]
  2279. }
  2280. if (az[2]) {
  2281. aB.eventAction = az[2]
  2282. }
  2283. if (az[3]) {
  2284. aB.eventLabel = az[3]
  2285. }
  2286. if (az[4]) {
  2287. aB.eventValue = az[4]
  2288. }
  2289. break;
  2290. case "timing":
  2291. if (az[1]) {
  2292. aB.timingCategory = az[1]
  2293. }
  2294. if (az[2]) {
  2295. aB.timingVar = az[2]
  2296. }
  2297. if (az[3]) {
  2298. aB.timingValue = az[3]
  2299. }
  2300. if (az[4]) {
  2301. aB.timingLabel = az[4]
  2302. }
  2303. break;
  2304. case "exception":
  2305. if (az[1]) {
  2306. aB.exDescription = az[1]
  2307. }
  2308. if (az[2]) {
  2309. aB.exFatal = az[2]
  2310. }
  2311. break;
  2312. default:
  2313. return
  2314. }
  2315. }
  2316. this.fire("send", aB);
  2317. ax(this.fields.postUrl, X(this.fields.protocolParameter, aB))
  2318. };
  2319. ai.prototype.set = function(az, aA) {
  2320. if (typeof az == "string") {
  2321. if (az == "protocolParameter") {
  2322. aA = ap({
  2323. postUrl: null,
  2324. protocolParameter: null
  2325. }, aA)
  2326. }
  2327. this.fields[az] = aA
  2328. } else {
  2329. if (typeof az == "object") {
  2330. for (var aB in az) {
  2331. this.set(aB, az[aB])
  2332. }
  2333. }
  2334. }
  2335. };
  2336. ai.prototype.get = function(aA, aB) {
  2337. var az = this.fields[aA];
  2338. if (typeof aB == "function") {
  2339. aB(az)
  2340. }
  2341. return az
  2342. };
  2343. ai.prototype.fire = function(az, aA) {
  2344. return ak.fire(this.name + "." + az, aA)
  2345. };
  2346. ai.prototype.on = function(az, aA) {
  2347. ak.on(this.name + "." + az, aA)
  2348. };
  2349. ai.prototype.un = function(az, aA) {
  2350. ak.un(this.name + "." + az, aA)
  2351. };
  2352. ak.name = "alog";
  2353. ak.sid = ac;
  2354. ak.defined = true;
  2355. ak.timestamp = V;
  2356. ak.un = al;
  2357. ak.on = aj;
  2358. ak.fire = af;
  2359. ak.tracker = Q;
  2360. ak("init");
  2361. var O = ai.prototype;
  2362. s(O, {
  2363. start: O.start,
  2364. create: O.create,
  2365. send: O.send,
  2366. set: O.set,
  2367. get: O.get,
  2368. on: O.on,
  2369. un: O.un,
  2370. fire: O.fire
  2371. });
  2372. var P = Q();
  2373. P.set("protocolParameter", {
  2374. alias: null
  2375. });
  2376. if (W) {
  2377. var ad = [].concat(W.p || [], W.q || []);
  2378. W.p = W.q = null;
  2379. for (var at in ak) {
  2380. if (ak.hasOwnProperty(at)) {
  2381. W[at] = ak[at]
  2382. }
  2383. }
  2384. ak.p = ak.q = {
  2385. push: function(az) {
  2386. ak.apply(ak, az)
  2387. }
  2388. };
  2389. for (var aw = 0; aw < ad.length; aw++) {
  2390. ak.apply(ak, ad[aw])
  2391. }
  2392. }
  2393. aa[av] = ak;
  2394. if (am) {
  2395. aj(ay, "mouseup", function(aA) {
  2396. var az = aA.target || aA.srcElement;
  2397. if (az.nodeType == 1 && /^ajavascript:/i.test(az.tagName + az.href)) {
  2398. ar = new Date
  2399. }
  2400. })
  2401. }
  2402. function T() {
  2403. if (am && (new Date - ar < 50)) {
  2404. return
  2405. }
  2406. if (an) {
  2407. return
  2408. }
  2409. an = true;
  2410. var az = 0;
  2411. for (var aB in S) {
  2412. var aA = S[aB];
  2413. if (aA.created) {
  2414. az += aA.fire("unload")
  2415. }
  2416. }
  2417. if (az) {
  2418. var aC = new Date;
  2419. while (new Date - aC < 100) {}
  2420. }
  2421. }
  2422. var U = false;
  2423. Y.onerror = function(aD, aB, az, aC) {
  2424. var aA = true;
  2425. if (!aB && /^script error/i.test(aD)) {
  2426. if (U) {
  2427. aA = false
  2428. } else {
  2429. U = true
  2430. }
  2431. }
  2432. if (aA) {
  2433. aa.alog("exception.send", "exception", {
  2434. msg: aD,
  2435. js: aB,
  2436. ln: az,
  2437. col: aC
  2438. })
  2439. }
  2440. return false
  2441. };
  2442. aa.alog("exception.on", "catch", function(az) {
  2443. aa.alog("exception.send", "exception", {
  2444. msg: az.msg,
  2445. js: az.path,
  2446. ln: az.ln,
  2447. method: az.method,
  2448. flag: "catch"
  2449. })
  2450. })
  2451. }(N, L, M);
  2452. void
  2453. function(aa, ba, bj) {
  2454. var at = "18_5";
  2455. var aF = {
  2456. product: "18",
  2457. page: at,
  2458. monkey_page: "",
  2459. speed_page: "",
  2460. monkey: {
  2461. sample: "0.1"
  2462. },
  2463. exception: {
  2464. sample: "0.1"
  2465. },
  2466. cus: {
  2467. sample: "0.1"
  2468. },
  2469. feature: {
  2470. sample: "0"
  2471. }
  2472. };
  2473. var aE = "http://fex.bdstatic.com";
  2474. var Y = "http://static.tieba.baidu.com";
  2475. var Q = Y;
  2476. if (aa.location.protocol === "https:") {
  2477. aE = "https://fex.bdstatic.com";
  2478. Y = "https://gsp0.baidu.com/5aAHeD3nKhI2p27j8IqW0jdnxx1xbK";
  2479. Q = Y
  2480. }
  2481. var ab = aF.product;
  2482. var aJ = aF.page;
  2483. var aZ = aF.monkey_page;
  2484. var aT = aF.speed_page;
  2485. var V = Math.random;
  2486. var az = Y + "/tb/pms/img/st.gif";
  2487. var ae = az;
  2488. var aA = aF.monkey;
  2489. var av = aF.exception;
  2490. var ai = aF.cus;
  2491. var aG = aF.feature;
  2492. if (aA && aA.sample && V() < aA.sample) {
  2493. var R = bj.alog.tracker("monkey");
  2494. var aM;
  2495. var X = aa.screen;
  2496. var bh = ba.referrer;
  2497. R.set("ver", 5);
  2498. R.set("pid", 241);
  2499. if (X) {
  2500. R.set("px", X.width + "*" + X.height)
  2501. }
  2502. R.set("ref", bh);
  2503. bj.alog("monkey.on", "create", function() {
  2504. aM = bj.alog.timestamp;
  2505. R.set("protocolParameter", {
  2506. reports: null
  2507. })
  2508. });
  2509. bj.alog("monkey.on", "send", function(bl) {
  2510. if (bl.t == "pageview") {
  2511. bl.cmd = "open"
  2512. }
  2513. if (bl.now) {
  2514. bl.ts = aM(bl.now).toString(36);
  2515. bl.now = ""
  2516. }
  2517. });
  2518. bj.alog("monkey.create", {
  2519. page: aJ,
  2520. pid: "241",
  2521. p: ab,
  2522. dv: 6,
  2523. postUrl: ae,
  2524. reports: {
  2525. refer: 1
  2526. }
  2527. });
  2528. bj.alog("monkey.send", "pageview", {
  2529. now: +new Date
  2530. })
  2531. }
  2532. if (av && av.sample && V() < av.sample) {
  2533. var ap = false;
  2534. aa.onerror = function(bp, bn, bl, bo) {
  2535. var bm = true;
  2536. if (!bn && /^script error/i.test(bp)) {
  2537. if (ap) {
  2538. bm = false
  2539. } else {
  2540. ap = true
  2541. }
  2542. }
  2543. if (bm) {
  2544. bj.alog("exception.send", "exception", {
  2545. msg: bp,
  2546. js: bn,
  2547. ln: bl,
  2548. col: bo
  2549. })
  2550. }
  2551. return false
  2552. };
  2553. bj.alog("exception.on", "catch", function(bl) {
  2554. bj.alog("exception.send", "exception", {
  2555. msg: bl.msg,
  2556. js: bl.path,
  2557. ln: bl.ln,
  2558. method: bl.method,
  2559. flag: "catch"
  2560. })
  2561. });
  2562. bj.alog("exception.create", {
  2563. postUrl: ae,
  2564. dv: 7,
  2565. page: aZ ? aZ : aJ,
  2566. pid: "170",
  2567. p: ab
  2568. })
  2569. }
  2570. if (ai && ai.sample && V() < ai.sample) {
  2571. bj.alog("cus.on", "time", function(bo) {
  2572. var bn = {};
  2573. var bl = false;
  2574. var bp;
  2575. if (bo.toString() !== "[object Object]") {
  2576. return
  2577. }
  2578. for (var bm in bo) {
  2579. if (bm == "page") {
  2580. bn.page = bo[bm];
  2581. continue
  2582. }
  2583. bp = parseInt(bo[bm]);
  2584. if (bp > 0 && /^z_/.test(bm)) {
  2585. bl = true;
  2586. bn[bm] = bp
  2587. }
  2588. }
  2589. if (bl) {
  2590. bj.alog("cus.send", "time", bn)
  2591. }
  2592. });
  2593. bj.alog("cus.on", "count", function(bo) {
  2594. var bn = {};
  2595. var bl = false;
  2596. if (typeof bo === "string") {
  2597. bo = [bo]
  2598. }
  2599. if (bo instanceof Array) {
  2600. for (var bm = 0; bm < bo.length; bm++) {
  2601. if (/^z_/.test(bo[bm])) {
  2602. bl = true;
  2603. bn[bo[bm]] = 1
  2604. } else {
  2605. if (/^page:/.test(bo[bm])) {
  2606. bn.page = bo[bm].substring(5)
  2607. }
  2608. }
  2609. }
  2610. }
  2611. if (bl) {
  2612. bj.alog("cus.send", "count", bn)
  2613. }
  2614. });
  2615. bj.alog("cus.create", {
  2616. dv: 3,
  2617. postUrl: az,
  2618. page: aJ,
  2619. p: ab
  2620. })
  2621. }
  2622. if (aG && aG.sample && V() < aG.sample) {
  2623. var a8 = ["Moz", "O", "ms", "Webkit"];
  2624. var ar = ["-webkit-", "-moz-", "-o-", "-ms-"];
  2625. var aC = function() {
  2626. if (typeof ba.createElement !== "function") {
  2627. return ba.createElement(arguments[0])
  2628. } else {
  2629. return ba.createElement.apply(ba, arguments)
  2630. }
  2631. };
  2632. var bf = {
  2633. elem: aC("dpFeatureTest")
  2634. };
  2635. var ac = {
  2636. style: bf.elem.style
  2637. };
  2638. function an(bm, bl) {
  2639. return typeof bm === bl
  2640. }
  2641. function U(bm, bp, bo) {
  2642. var bn;
  2643. for (var bl in bm) {
  2644. if (bm[bl] in bp) {
  2645. if (bo === false) {
  2646. return bm[bl]
  2647. }
  2648. bn = bp[bm[bl]];
  2649. if (an(bn, "function")) {
  2650. return fnBind(bn, bo || bp)
  2651. }
  2652. return bn
  2653. }
  2654. }
  2655. return false
  2656. }
  2657. function aj(bn, bl, bm) {
  2658. return bd(bn, undefined, undefined, bl, bm)
  2659. }
  2660. function bd(br, bl, bo, bp, bq) {
  2661. var bm = br.charAt(0).toUpperCase() + br.slice(1),
  2662. bn = (br + " " + a8.join(bm + " ") + bm).split(" ");
  2663. if (an(bl, "string") || an(bl, "undefined")) {
  2664. return aO(bn, bl, bp, bq)
  2665. } else {
  2666. bn = (br + " " + (a8).join(bm + " ") + bm).split(" ");
  2667. return U(bn, bl, bo)
  2668. }
  2669. }
  2670. function aO(bp, bn, bs, bq) {
  2671. bq = an(bq, "undefined") ? false : bq;
  2672. var bt, bo, bl, bm, br;
  2673. bl = bp.length;
  2674. for (bo = 0; bo < bl; bo++) {
  2675. bm = bp[bo];
  2676. br = ac.style[bm];
  2677. if (!!~("" + bm).indexOf("-")) {
  2678. bm = al(bm)
  2679. }
  2680. if (ac.style[bm] !== undefined) {
  2681. return bn == "pfx" ? bm : true
  2682. }
  2683. }
  2684. return false
  2685. }
  2686. function al(bl) {
  2687. return bl.replace(/([a-z])-([a-z])/g, function(bo, bn, bm) {
  2688. return bn + bm.toUpperCase()
  2689. }).replace(/^-/, "")
  2690. }
  2691. var ax = function(bn, bm, bl) {
  2692. if (bn.indexOf("@") === 0) {
  2693. return atRule(bn)
  2694. }
  2695. if (bn.indexOf("-") != -1) {
  2696. bn = al(bn)
  2697. }
  2698. if (!bm) {
  2699. return bd(bn, "pfx")
  2700. } else {
  2701. return bd(bn, bm, bl)
  2702. }
  2703. };
  2704. function a4() {
  2705. var bl = aC("canvas");
  2706. return !!(bl.getContext && bl.getContext("2d"))
  2707. }
  2708. function aV() {
  2709. var bl = aC("div");
  2710. return ("draggable" in bl) || ("ondragstart" in bl && "ondrop" in bl)
  2711. }
  2712. function ah() {
  2713. var bl = "localStorage";
  2714. try {
  2715. localStorage.setItem(bl, bl);
  2716. localStorage.removeItem(bl);
  2717. return true
  2718. } catch (bm) {
  2719. return false
  2720. }
  2721. }
  2722. function aL() {
  2723. return "content" in ba.createElement("template")
  2724. }
  2725. function aX() {
  2726. return "createShadowRoot" in ba.createElement("a")
  2727. }
  2728. function aS() {
  2729. return "registerElement" in ba
  2730. }
  2731. function O() {
  2732. return "import" in ba.createElement("link")
  2733. }
  2734. function T() {
  2735. return "getItems" in ba
  2736. }
  2737. function aq() {
  2738. return "EventSource" in window
  2739. }
  2740. function a7(bn, bo) {
  2741. var bl = {
  2742. lossy: "UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",
  2743. lossless: "UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",
  2744. alpha: "UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",
  2745. animation: "UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"
  2746. };
  2747. var bm = new Image();
  2748. bm.onload = function() {
  2749. var bp = (bm.width > 0) && (bm.height > 0);
  2750. bo(bn, bp)
  2751. };
  2752. bm.onerror = function() {
  2753. bo(bn, false)
  2754. };
  2755. bm.src = "data:image/webp;base64," + bl[bn]
  2756. }
  2757. function bi(bm, bl) {
  2758. ag.f["WebP-" + bm] = bl;
  2759. return bl
  2760. }
  2761. function aY() {
  2762. return "openDatabase" in aa
  2763. }
  2764. function a3() {
  2765. return "performance" in aa && "timing" in aa.performance
  2766. }
  2767. function be() {
  2768. return "performance" in aa && "mark" in aa.performance
  2769. }
  2770. function aB() {
  2771. return !!(Array.prototype && Array.prototype.every && Array.prototype.filter && Array.prototype.forEach &&
  2772. Array.prototype.indexOf && Array.prototype.lastIndexOf && Array.prototype.map && Array.prototype.some &&
  2773. Array.prototype.reduce && Array.prototype.reduceRight && Array.isArray)
  2774. }
  2775. function ad() {
  2776. return "Promise" in aa && "cast" in aa.Promise && "resolve" in aa.Promise && "reject" in aa.Promise && "all" in
  2777. aa.Promise && "race" in aa.Promise && (function() {
  2778. var bl;
  2779. new aa.Promise(function(bm) {
  2780. bl = bm
  2781. });
  2782. return typeof bl === "function"
  2783. }())
  2784. }
  2785. function ao() {
  2786. var bl = !!(aa.ProgressEvent);
  2787. var bm = !!(aa.FormData);
  2788. var bn = aa.XMLHttpRequest && "withCredentials" in new XMLHttpRequest;
  2789. return bl && bm && bn
  2790. }
  2791. function aN() {
  2792. return "geolocation" in navigator
  2793. }
  2794. function ay() {
  2795. var bm = aC("canvas");
  2796. var bl = "probablySupportsContext" in bm ? "probablySupportsContext" : "supportsContext";
  2797. if (bl in bm) {
  2798. return bm[bl]("webgl") || bm[bl]("experimental-webgl")
  2799. }
  2800. return "WebGLRenderingContext" in aa
  2801. }
  2802. function aI() {
  2803. return !!ba.createElementNS && !!ba.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect
  2804. }
  2805. function a5() {
  2806. return !!aa.Worker
  2807. }
  2808. function a1() {
  2809. return "WebSocket" in aa && aa.WebSocket.CLOSING === 2
  2810. }
  2811. function aQ() {
  2812. var bl = ba.createElement("video");
  2813. return !!bl.canPlayType
  2814. }
  2815. function am() {
  2816. var bl = ba.createElement("audio");
  2817. return !!bl.canPlayType
  2818. }
  2819. function aW() {
  2820. return !!(aa.history && "pushState" in aa.history)
  2821. }
  2822. function aH() {
  2823. return !!(aa.File && aa.FileReader)
  2824. }
  2825. function aK() {
  2826. return "postMessage" in window
  2827. }
  2828. function aP() {
  2829. return !!aa.webkitNotifications || ("Notification" in aa && "permission" in aa.Notification &&
  2830. "requestPermission" in aa.Notification)
  2831. }
  2832. function aD() {
  2833. var bn = ["webkit", "moz", "o", "ms"];
  2834. var bm = aa.requestAnimationFrame;
  2835. for (var bl = 0; bl < bn.length && !bm; ++bl) {
  2836. bm = aa[bn[bl] + "RequestAnimationFrame"]
  2837. }
  2838. return !!bm
  2839. }
  2840. function aR() {
  2841. return "JSON" in aa && "parse" in JSON && "stringify" in JSON
  2842. }
  2843. function a6() {
  2844. return !!(ax("exitFullscreen", ba, false) || ax("cancelFullScreen", ba, false))
  2845. }
  2846. function ak() {
  2847. return !!ax("Intl", aa)
  2848. }
  2849. function a0() {
  2850. return aj("flexBasis", "1px", true)
  2851. }
  2852. function a2() {
  2853. return !!aj("perspective", "1px", true)
  2854. }
  2855. function au() {
  2856. return aj("shapeOutside", "content-box", true)
  2857. }
  2858. function bk() {
  2859. var bl = aC("div");
  2860. bl.style.cssText = ar.join("filter:blur(2px); ");
  2861. return !!bl.style.length && ((ba.documentMode === undefined || ba.documentMode > 9))
  2862. }
  2863. function Z() {
  2864. return "XMLHttpRequest" in aa && "withCredentials" in new XMLHttpRequest()
  2865. }
  2866. function W() {
  2867. return aC("progress").max !== undefined
  2868. }
  2869. function aU() {
  2870. return aC("meter").max !== undefined
  2871. }
  2872. function bc() {
  2873. return "sendBeacon" in navigator
  2874. }
  2875. function a9() {
  2876. return aj("borderRadius", "0px", true)
  2877. }
  2878. function P() {
  2879. return aj("boxShadow", "1px 1px", true)
  2880. }
  2881. function S() {
  2882. var bm = aC("div");
  2883. var bl = bm.style;
  2884. bl.cssText = ar.join("opacity:.55;");
  2885. return (/^0.55$/).test(bl.opacity)
  2886. }
  2887. function bb() {
  2888. return aO(["textShadow"], undefined, "1px 1px")
  2889. }
  2890. function af() {
  2891. return aj("animationName", "a", true)
  2892. }
  2893. function aw() {
  2894. return aj("transition", "all", true)
  2895. }
  2896. function bg() {
  2897. return navigator.userAgent.indexOf("Android 2.") === -1 && aj("transform", "scale(1)", true)
  2898. }
  2899. var ag = {
  2900. f: {},
  2901. t: function(bl, bn, bm) {
  2902. this.f[bl] = bn.apply(this, [].slice.call(arguments, 2))
  2903. },
  2904. c: function(bm, bl) {
  2905. bm.apply(this, [].slice.call(arguments, 1))
  2906. },
  2907. runAllTest: function() {
  2908. var bl = this;
  2909. bl.t("bdrs", a9);
  2910. bl.t("bxsd", P);
  2911. bl.t("opat", S);
  2912. bl.t("txsd", bb);
  2913. bl.t("anim", af);
  2914. bl.t("trsi", aw);
  2915. bl.t("trfm", bg);
  2916. bl.t("flex", a0);
  2917. bl.t("3dtr", a2);
  2918. bl.t("shpe", au);
  2919. bl.t("fltr", bk);
  2920. bl.t("cavs", a4);
  2921. bl.t("dgdp", aV);
  2922. bl.t("locs", ah);
  2923. bl.t("wctem", aL);
  2924. bl.t("wcsdd", aX);
  2925. bl.t("wccse", aS);
  2926. bl.t("wchti", O);
  2927. bl.c(a7, "lossy", bi);
  2928. bl.c(a7, "lossless", bi);
  2929. bl.c(a7, "alpha", bi);
  2930. bl.c(a7, "animation", bi);
  2931. bl.t("wsql", aY);
  2932. bl.t("natm", a3);
  2933. bl.t("ustm", be);
  2934. bl.t("arra", aB);
  2935. bl.t("prms", ad);
  2936. bl.t("xhr2", ao);
  2937. bl.t("wbgl", ay);
  2938. bl.t("geol", aN);
  2939. bl.t("svg", aI);
  2940. bl.t("work", a5);
  2941. bl.t("wbsk", a1);
  2942. bl.t("vido", aQ);
  2943. bl.t("audo", am);
  2944. bl.t("hsty", aW);
  2945. bl.t("file", aH);
  2946. bl.t("psmg", aK);
  2947. bl.t("wknf", aP);
  2948. bl.t("rqaf", aD);
  2949. bl.t("json", aR);
  2950. bl.t("flsc", a6);
  2951. bl.t("i18n", ak);
  2952. bl.t("cors", Z);
  2953. bl.t("prog", W);
  2954. bl.t("metr", aU);
  2955. bl.t("becn", bc);
  2956. bl.t("mcrd", T);
  2957. bl.t("esrc", aq)
  2958. }
  2959. };
  2960. var R = bj.alog.tracker("feature");
  2961. R.on("commit", function() {
  2962. ag.runAllTest();
  2963. var bl = setInterval(function() {
  2964. if ("WebP-lossy" in ag.f && "WebP-lossless" in ag.f && "WebP-alpha" in ag.f && "WebP-animation" in ag.f) {
  2965. for (var bm in ag.f) {
  2966. ag.f[bm] = ag.f[bm] ? "y" : "n"
  2967. }
  2968. R.send("feature", ag.f);
  2969. clearInterval(bl)
  2970. }
  2971. }, 500)
  2972. });
  2973. bj.alog("feature.create", {
  2974. dv: 4,
  2975. postUrl: az,
  2976. page: aZ ? aZ : aJ,
  2977. p: ab
  2978. });
  2979. bj.alog("feature.fire", "commit")
  2980. }
  2981. }(N, L, M)
  2982. }(window, document, u);
  2983. u._alog = u.alog || function() {};
  2984. u.alog("cus.fire", "count", "z_loadscriptcount");
  2985. if (location.protocol === "https:") {
  2986. u.alog("cus.fire", "count", "z_httpscount")
  2987. }
  2988. function s(L, M) {
  2989. for (var N in M) {
  2990. L[N] = M[N]
  2991. }
  2992. }
  2993. function c(L) {
  2994. this.map = L;
  2995. this.tileLayers = [];
  2996. this.bufferNumber = 30;
  2997. this.realBufferNumber = 0;
  2998. this.curViewTiles = {};
  2999. this.bufferTiles = {};
  3000. this.layersContainer = this.createLayersContainer();
  3001. this.initialize()
  3002. }
  3003. J.extend(c.prototype, {
  3004. createLayersContainer: function() {
  3005. var L = document.createElement("div");
  3006. L.style.cssText = "position:absolute;left:0;top:0;z-index:0;";
  3007. this.map.platform.appendChild(L);
  3008. return L
  3009. },
  3010. initialize: function() {
  3011. var L = this;
  3012. var M = this.map;
  3013. M.addEventListener("onload", function() {
  3014. L.loadBaseTileLayer()
  3015. });
  3016. M.addEventListener("oncenterzoomend", function() {
  3017. L.reDrawCurViewTiles()
  3018. });
  3019. M.addEventListener("addtilelayer", function(N) {
  3020. L.addTileLayer(N)
  3021. });
  3022. M.addEventListener("removetilelayer", function(N) {
  3023. L.removeTileLayer(N)
  3024. });
  3025. M.addEventListener("moving", function(N) {
  3026. L.reDrawCurViewTiles()
  3027. });
  3028. M.addEventListener("zoomstart", function(P) {
  3029. if (P.evtSrc === "zoomTo") {
  3030. if (this._zoomMapByAnimation) {
  3031. var O = new j(this.width / 2, this.height / 2);
  3032. var N = this.zoomLevel;
  3033. this._zoomMapByAnimation(this, O, N)
  3034. } else {
  3035. L.reDrawCurViewTiles()
  3036. }
  3037. }
  3038. });
  3039. M.addEventListener("zoomend", function(N) {
  3040. L.reDrawCurViewTiles()
  3041. });
  3042. M.addEventListener("resize", function(N) {
  3043. L.reDrawCurViewTiles()
  3044. })
  3045. },
  3046. loadBaseTileLayer: function() {
  3047. var M = this.map;
  3048. if (!M.loaded) {
  3049. var N = new l();
  3050. var L = M.config.mapStyle ? e : H;
  3051. J.extend(N, L);
  3052. M.addTileLayer(N);
  3053. M.loaded = true
  3054. }
  3055. },
  3056. addTileLayer: function(P) {
  3057. var O = this.map;
  3058. var M = P.target;
  3059. for (var N = 0, L = this.tileLayers.length; N < L; N++) {
  3060. if (this.tileLayers[N] === M) {
  3061. return
  3062. }
  3063. }
  3064. this.tileLayers.push(M);
  3065. M.initialize(O, this.layersContainer);
  3066. this.reDrawCurViewTiles()
  3067. },
  3068. removeTileLayer: function(S) {
  3069. var R = this;
  3070. var N = S.target;
  3071. var L = R.curViewTiles;
  3072. var P = R.bufferTiles;
  3073. for (var Q in P) {
  3074. var M = Q.split("-")[1];
  3075. if (M == N.guid) {
  3076. delete P[Q]
  3077. }
  3078. }
  3079. for (var Q in L) {
  3080. var M = Q.split("-")[1];
  3081. if (M == N.guid) {
  3082. delete L[Q]
  3083. }
  3084. }
  3085. N.remove();
  3086. for (var O = this.tileLayers.length - 1; O >= 0; O--) {
  3087. if (this.tileLayers[O] === N) {
  3088. this.tileLayers.splice(O, 1)
  3089. }
  3090. }
  3091. R.reDrawCurViewTiles()
  3092. },
  3093. getTileName: function(L, M) {
  3094. return "TILE-" + M.guid + "-" + L[0] + "-" + L[1] + "-" + L[2]
  3095. },
  3096. reDrawCurViewTiles: function() {
  3097. var V = this.tileLayers.length;
  3098. if (V <= 0) {
  3099. return
  3100. }
  3101. var an = this.map;
  3102. var M = an.getZoom();
  3103. var ad = an.centerPoint;
  3104. var U = an.getZoomUnits(M);
  3105. var O = an.getTileUnits(M);
  3106. var W = Math.ceil(ad.lat / O);
  3107. var R = Math.ceil(ad.lng / O);
  3108. var Z = an.config.tileSize;
  3109. var P = [W, R, (ad.lat - W * O) / O * Z, (ad.lng - R * O) / O * Z];
  3110. var ak = an.width;
  3111. var ab = an.height;
  3112. var ai = P[0] - Math.ceil((ab / 2 - P[2]) / Z);
  3113. var N = P[1] - Math.ceil((ak / 2 - P[3]) / Z);
  3114. var af = P[0] + Math.ceil((ab / 2 + P[2]) / Z);
  3115. var Y = P[1] + Math.ceil((ak / 2 + P[3]) / Z);
  3116. var X = this.tileLayers;
  3117. var aa = this.curViewTiles;
  3118. var L = [];
  3119. for (var ae = 0, aj = X.length; ae < aj; ae++) {
  3120. var ap = X[ae];
  3121. o.css3TransformDom(ap.tilesDiv, Math.round(-an.offsetX + ak / 2), Math.round(-an.offsetY + ab / 2));
  3122. for (var am in aa) {
  3123. var ao = aa[am];
  3124. var al = ao.info;
  3125. if (al[2] !== M || (al[2] === M && (ai > al[0] || af <= al[0] || N > al[1] || Y <= al[1]))) {
  3126. this.hideTile(ao)
  3127. }
  3128. }
  3129. L.length = 0;
  3130. for (var ah = ai; ah < af; ah++) {
  3131. for (var ag = N; ag < Y; ag++) {
  3132. L.push([ah, ag])
  3133. }
  3134. }
  3135. L.sort((function(aq) {
  3136. return function(ar, at) {
  3137. 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]) +
  3138. 0.6 * Math.abs(at[0] - aq[0])))
  3139. }
  3140. })([P[0] - 1, P[1] - 1]));
  3141. var T = -ad.lng / U;
  3142. var S = ad.lat / U;
  3143. var Q = [Math.round(S), Math.round(T)];
  3144. for (var ah = 0, ac = L.length; ah < ac; ah++) {
  3145. this.showTile([L[ah][0], L[ah][1], M], Q, ap, Z)
  3146. }
  3147. }
  3148. },
  3149. showTile: function(Q, P, T, V) {
  3150. var N = this.getTileName(Q, T);
  3151. var O = (Q[1] * V) + P[1];
  3152. var M = (-1 - Q[0]) * V + P[0];
  3153. var U = this.curViewTiles[N];
  3154. if (U && U.img) {
  3155. o.css3TransformDom(U.img, O, M);
  3156. return
  3157. }
  3158. U = this.bufferTiles[N];
  3159. if (U && U.img) {
  3160. T.tilesDiv.insertBefore(U.img, T.tilesDiv.lastChild);
  3161. this.curViewTiles[N] = U;
  3162. o.css3TransformDom(U.img, O, M);
  3163. return
  3164. }
  3165. var R = new j(Q[1], Q[0]);
  3166. var L = T.getTilesUrl(R, Q[2]);
  3167. var S = [O, M];
  3168. U = new b(this, L, S, Q, T, V);
  3169. this.curViewTiles[N] = U
  3170. },
  3171. hideTile: function(M) {
  3172. var L = M.img;
  3173. if (L) {
  3174. if (o.isInDocument(L)) {
  3175. L.parentNode.removeChild(L)
  3176. }
  3177. }
  3178. delete this.curViewTiles[M.name];
  3179. if (!M.loaded) {
  3180. L = null;
  3181. M.img = null;
  3182. M.mgr = null
  3183. }
  3184. }
  3185. });
  3186. function l(L) {
  3187. this.opts = L || {};
  3188. this.baseLayer = this.opts.baseLayer || false;
  3189. this.zIndex = this.opts.zIndex || 0;
  3190. this.guid = l._guid++
  3191. }
  3192. l._guid = 0;
  3193. J.lang.inherits(l, J.lang.Class, "TileLayer");
  3194. J.extend(l.prototype, {
  3195. initialize: function(N, L) {
  3196. if (this.baseLayer) {
  3197. this.zIndex = -1
  3198. }
  3199. this.map = N;
  3200. if (!this.tilesDiv) {
  3201. var O = o.create("div");
  3202. var M = O.style;
  3203. M.cssText = "position:absolute;left:0;top:0;z-index:" + this.zIndex;
  3204. L.appendChild(O);
  3205. this.tilesDiv = O
  3206. }
  3207. },
  3208. remove: function() {
  3209. if (this.tilesDiv && this.tilesDiv.parentNode) {
  3210. this.tilesDiv.innerHTML = "";
  3211. this.tilesDiv.parentNode.removeChild(this.tilesDiv)
  3212. }
  3213. delete this.tilesDiv
  3214. },
  3215. getTilesUrl: function(M, N) {
  3216. var L = "";
  3217. if (this.opts.tileUrlTemplate) {
  3218. L = this.opts.tileUrlTemplate.replace(/\{X\}/, M.x);
  3219. L = L.replace(/\{Y\}/, M.y);
  3220. L = L.replace(/\{Z\}/, N)
  3221. }
  3222. return L
  3223. },
  3224. getTileVersion: function(M) {
  3225. var N = window.TILE_VERSION;
  3226. var L = "20170730";
  3227. if (N && N.ditu) {
  3228. var O = N.ditu;
  3229. if (O[M] && O[M]["updateDate"]) {
  3230. L = O[M]["updateDate"]
  3231. }
  3232. }
  3233. return L
  3234. }
  3235. });
  3236. function b(R, L, N, M, O, T) {
  3237. this.mgr = R;
  3238. this.position = N;
  3239. this.name = R.getTileName(M, O);
  3240. this.info = M;
  3241. var S = o.create("img");
  3242. o.setUnSelectable(S);
  3243. S.galleryImg = false;
  3244. var Q = S.style;
  3245. Q.cssText = "position:absolute;width:" + T + "px;height:" + T + "px;left:0;top:0;";
  3246. o.css3TransformDom(S, N[0], N[1]);
  3247. this.img = S;
  3248. this.src = L;
  3249. this.errorImgSrc = u.apiUrlCdn + "/images/blank.gif";
  3250. var P = this;
  3251. P.img.onload = function() {
  3252. P.loaded = true;
  3253. if (!P.mgr) {
  3254. return
  3255. }
  3256. var V = P.mgr;
  3257. var U = V.bufferTiles;
  3258. if (!U[P.name]) {
  3259. V.realBufferNumber++;
  3260. U[P.name] = P
  3261. }
  3262. if (P.img && !o.isInDocument(P.img) && O.tilesDiv) {
  3263. O.tilesDiv.appendChild(P.img)
  3264. }
  3265. var X = V.realBufferNumber - V.bufferNumber;
  3266. for (var Y in U) {
  3267. if (X <= 0) {
  3268. break
  3269. }
  3270. if (!V.curViewTiles[Y]) {
  3271. var W = U[Y].img;
  3272. if (W && W.parentNode) {
  3273. W.parentNode.removeChild(W)
  3274. }
  3275. W = null;
  3276. U[Y].img = null;
  3277. U[Y].mgr = null;
  3278. delete U[Y];
  3279. V.realBufferNumber--;
  3280. X--
  3281. }
  3282. }
  3283. };
  3284. P.img.onerror = function() {
  3285. var V = P.img;
  3286. var W = V ? V.getAttribute("errorCount") : true;
  3287. if (V && (!W || W && W < 5)) {
  3288. W = W || 0;
  3289. W++;
  3290. V.src = L;
  3291. V.setAttribute("errorCount", W)
  3292. } else {
  3293. if (!P.mgr) {
  3294. return
  3295. }
  3296. var U = P.mgr;
  3297. P.img.src = P.errorImgSrc;
  3298. if (P.img && !o.isInDocument(P.img)) {
  3299. O.tilesDiv.appendChild(P.img)
  3300. }
  3301. }
  3302. };
  3303. P.img.src = L
  3304. }
  3305. var H = new l({
  3306. baseLayer: true
  3307. });
  3308. H.getTilesUrl = function(N, P) {
  3309. var S = N.x;
  3310. var O = N.y;
  3311. var Q = u.url.domain["TILE_ONLINE_URLS"];
  3312. var R = "x=" + S + "&y=" + O + "&z=" + P + "&styles=pl&scaler=2";
  3313. var M = u.url.proto + Q[Math.abs(S + O) % Q.length] + "/tile/?qt=vtile&" + R;
  3314. var L = this.getTileVersion("normal");
  3315. M += "&udt=" + L;
  3316. return M.replace(/-(\d+)/gi, "M$1")
  3317. };
  3318. var e = new l({
  3319. baseLayer: true
  3320. });
  3321. e.getTilesUrl = function(O, T) {
  3322. var M = this.map;
  3323. var U = O.x;
  3324. var P = O.y;
  3325. var S = u.url.domain["main_domain_cdn"]["baidu"];
  3326. var Q = "x=" + U + "&y=" + P + "&z=" + T + "&scale=2";
  3327. var N = u.url.proto + S[Math.abs(U + P) % S.length] + "/customimage/tile/?" + Q;
  3328. var R = this.getTileVersion("normal");
  3329. N += "&udt=" + R;
  3330. var L = this.getStyleParam();
  3331. N += L;
  3332. return N.replace("{x}", U).replace("{y}", P).replace("{z}", T)
  3333. };
  3334. e.getStyleParam = function() {
  3335. var M = this.map.config.mapStyle;
  3336. var N = "&";
  3337. if (M.style) {
  3338. N = N + "customid=" + M.style
  3339. } else {
  3340. if (M.styleJson) {
  3341. var L = this.styleJson2styleString(M.styleJson);
  3342. N = N + "styles=" + encodeURIComponent(L)
  3343. }
  3344. }
  3345. return N
  3346. };
  3347. e.styleJson2styleString = function(L) {
  3348. var Q = {
  3349. featureType: "t",
  3350. elementType: "e",
  3351. visibility: "v",
  3352. color: "c",
  3353. lightness: "l",
  3354. saturation: "s",
  3355. weight: "w",
  3356. zoom: "z",
  3357. hue: "h"
  3358. };
  3359. var S = {
  3360. all: "all",
  3361. geometry: "g",
  3362. "geometry.fill": "g.f",
  3363. "geometry.stroke": "g.s",
  3364. labels: "l",
  3365. "labels.text.fill": "l.t.f",
  3366. "labels.text.stroke": "l.t.s",
  3367. "lables.text": "l.t",
  3368. "labels.icon": "l.i"
  3369. };
  3370. var T = [];
  3371. for (var M = 0, R; R = L[M]; M++) {
  3372. var O = R.stylers;
  3373. delete R.stylers;
  3374. J.extend(R, O);
  3375. var N = [];
  3376. for (var P in Q) {
  3377. if (R[P]) {
  3378. if (P === "elementType") {
  3379. N.push(Q[P] + ":" + S[R[P]])
  3380. } else {
  3381. N.push(Q[P] + ":" + R[P])
  3382. }
  3383. }
  3384. }
  3385. if (N.length > 2) {
  3386. T.push(N.join("|"))
  3387. }
  3388. }
  3389. return T.join(",")
  3390. };
  3391. function a() {
  3392. this.map = null;
  3393. this._overlays = {};
  3394. this._customOverlays = []
  3395. }
  3396. J.extend(a.prototype, {
  3397. draw: function(L) {
  3398. for (var M in this._overlays) {
  3399. this._overlays[M].draw(L)
  3400. }
  3401. J.array.each(this._customOverlays, function(N) {
  3402. N.draw(L)
  3403. })
  3404. }
  3405. });
  3406. u.register(function(M) {
  3407. M.overlayDiv = document.createElement("div");
  3408. M.overlayDiv.style.cssText = "position:absolute;z-index:100;left:0;top:0;width:0;height:0;";
  3409. M._panes.markerPane = document.createElement("div");
  3410. M._panes.markerPane.style.cssText = "position:absolute;z-index:100;left:0;top:0;width: 0;height: 0;";
  3411. M.overlayDiv.appendChild(M._panes.markerPane);
  3412. M.platform.appendChild(M.overlayDiv);
  3413. var L = new a();
  3414. L.map = M;
  3415. M._overlays = L._overlays;
  3416. M._customOverlays = L._customOverlays;
  3417. M.addEventListener("load", function(N) {
  3418. L.draw(N)
  3419. });
  3420. M.addEventListener("moveend", function(N) {
  3421. L.draw(N)
  3422. });
  3423. M.addEventListener("zooming", function(N) {
  3424. L.draw(N)
  3425. });
  3426. M.addEventListener("zoomend", function(N) {
  3427. L.draw(N)
  3428. });
  3429. M.addEventListener("oncenterzoomend", function(N) {
  3430. L.draw(N)
  3431. });
  3432. M.addEventListener("resize", function(N) {
  3433. L.draw(N)
  3434. });
  3435. M.addEventListener("addoverlay", function(R) {
  3436. var O = R.target;
  3437. if (O instanceof I) {
  3438. if (!L._overlays[O.guid]) {
  3439. L._overlays[O.guid] = O
  3440. }
  3441. } else {
  3442. var Q = false;
  3443. for (var P = 0, N = L._customOverlays.length; P < N; P++) {
  3444. if (L._customOverlays[P] === O) {
  3445. Q = true;
  3446. break
  3447. }
  3448. }
  3449. if (!Q) {
  3450. L._customOverlays.push(O)
  3451. }
  3452. }
  3453. });
  3454. M.addEventListener("removeoverlay", function(Q) {
  3455. var O = Q.target;
  3456. if (O instanceof I) {
  3457. delete L._overlays[O.guid]
  3458. } else {
  3459. for (var P = 0, N = L._customOverlays.length; P < N; P++) {
  3460. if (L._customOverlays[P] === O) {
  3461. L._customOverlays.splice(P, 1);
  3462. break
  3463. }
  3464. }
  3465. }
  3466. });
  3467. M.addEventListener("clearoverlays", function(Q) {
  3468. for (var P in L._overlays) {
  3469. if (L._overlays[P]._config.enableMassClear) {
  3470. L._overlays[P].remove();
  3471. delete L._overlays[P]
  3472. }
  3473. }
  3474. for (var N = L._customOverlays.length, O = N - 1; O >= 0; O--) {
  3475. if (L._customOverlays[O].enableMassClear !== false) {
  3476. L._customOverlays[O].remove();
  3477. L._customOverlays[O] = null;
  3478. L._customOverlays.splice(O, 1)
  3479. }
  3480. }
  3481. })
  3482. });
  3483. function E() {
  3484. this._type = "overlay"
  3485. }
  3486. J.lang.inherits(E, J.lang.Class, "Overlay");
  3487. E.getZIndex = function(L) {
  3488. L = L * 1;
  3489. if (!L) {
  3490. return 0
  3491. }
  3492. return (L * -100000) << 1
  3493. };
  3494. J.extend(E.prototype, {
  3495. _i: function(L) {
  3496. if (!this.domElement && J.lang.isFunction(this.initialize)) {
  3497. this.domElement = this.initialize(L);
  3498. if (this.domElement) {
  3499. this.domElement.style.WebkitUserSelect = "none"
  3500. }
  3501. }
  3502. this.draw()
  3503. },
  3504. initialize: function(L) {
  3505. throw "initialize方法未实现"
  3506. },
  3507. draw: function() {
  3508. throw "draw方法未实现"
  3509. },
  3510. remove: function() {
  3511. if (this.domElement && this.domElement.parentNode) {
  3512. this.domElement.parentNode.removeChild(this.domElement)
  3513. }
  3514. this.domElement = null;
  3515. this.dispatchEvent(new F("onremove"))
  3516. },
  3517. hide: function() {
  3518. if (this.domElement) {
  3519. J.dom.hide(this.domElement)
  3520. }
  3521. },
  3522. show: function() {
  3523. if (this.domElement) {
  3524. J.dom.show(this.domElement)
  3525. }
  3526. },
  3527. isVisible: function() {
  3528. if (!this.domElement) {
  3529. return false
  3530. }
  3531. if (this.domElement.style.display == "none" || this.domElement.style.visibility == "hidden") {
  3532. return false
  3533. }
  3534. return true
  3535. }
  3536. });
  3537. function I() {
  3538. J.lang.Class.call(this);
  3539. E.call(this);
  3540. this.map = null;
  3541. this._visible = true
  3542. }
  3543. J.lang.inherits(I, E, "OverlayInternal");
  3544. J.extend(I.prototype, {
  3545. initialize: function(L) {
  3546. this.map = L;
  3547. J.lang.Class.call(this, this.guid);
  3548. return null
  3549. },
  3550. getMap: function() {
  3551. return this.map
  3552. },
  3553. draw: function() {},
  3554. remove: function() {
  3555. this.map = null;
  3556. J.lang.decontrol(this.guid);
  3557. E.prototype.remove.call(this)
  3558. },
  3559. hide: function() {
  3560. if (this._visible == false) {
  3561. return
  3562. }
  3563. this._visible = false
  3564. },
  3565. show: function() {
  3566. if (this._visible == true) {
  3567. return
  3568. }
  3569. this._visible = true
  3570. },
  3571. isVisible: function() {
  3572. if (!this.domElement) {
  3573. return false
  3574. }
  3575. return !!this._visible
  3576. },
  3577. getContainer: function() {
  3578. return this.domElement
  3579. },
  3580. setConfig: function(M) {
  3581. M = M || {};
  3582. for (var L in M) {
  3583. this._config[L] = M[L]
  3584. }
  3585. },
  3586. setZIndex: function(L) {
  3587. this.zIndex = L
  3588. },
  3589. enableMassClear: function() {
  3590. this._config.enableMassClear = true
  3591. },
  3592. disableMassClear: function() {
  3593. this._config.enableMassClear = false
  3594. }
  3595. });
  3596. function h(M, N, Q) {
  3597. var P = this.dpr = 2;
  3598. if (!M || !N) {
  3599. return
  3600. }
  3601. Q = Q || {};
  3602. N.width = N.width / P;
  3603. N.height = N.height / P;
  3604. if (Q.anchor && Q.anchor instanceof d) {
  3605. Q.anchor.width = Q.anchor.width / P;
  3606. Q.anchor.height = Q.anchor.height / P
  3607. }
  3608. if (Q.imageOffset && Q.imageOffset instanceof d) {
  3609. Q.imageOffset.width = Math.floor(Q.imageOffset.width / P);
  3610. Q.imageOffset.height = Math.floor(Q.imageOffset.height / P)
  3611. }
  3612. if (Q.backGroundImageSize && Q.backGroundImageSize instanceof d) {
  3613. Q.backGroundImageSize.width = Math.floor(Q.backGroundImageSize.width / P);
  3614. Q.backGroundImageSize.height = Math.floor(Q.backGroundImageSize.height / P)
  3615. }
  3616. this.size = N;
  3617. this.imageUrl = M;
  3618. var L = new d(Math.floor(N.width / 2), N.height);
  3619. var O = new d(N.width, N.height);
  3620. var R = {
  3621. anchor: L,
  3622. imageOffset: new d(0, 0),
  3623. backGroundImageSize: O
  3624. };
  3625. J.extend(R, Q);
  3626. this.anchor = R.anchor;
  3627. this.imageOffset = R.imageOffset;
  3628. this.backGroundImageSize = R.backGroundImageSize
  3629. }
  3630. J.extend(h.prototype, {
  3631. setImageUrl: function(L) {
  3632. if (!L) {
  3633. return
  3634. }
  3635. this.imageUrl = L
  3636. },
  3637. setSize: function(L) {
  3638. if (!L) {
  3639. return
  3640. }
  3641. this.size = new d(L.width / this.dpr, L.height / this.dpr)
  3642. },
  3643. setAnchor: function(L) {
  3644. if (!L) {
  3645. return
  3646. }
  3647. this.anchor = new d(L.width / this.dpr, L.height / this.dpr)
  3648. },
  3649. setImageOffset: function(L) {
  3650. if (!L) {
  3651. return
  3652. }
  3653. this.imageOffset = new d(L.width / this.dpr, L.height / this.dpr)
  3654. },
  3655. getHTML: function() {
  3656. var L = '<img style="position:absolute;padding:0;margin:0;border:0;left:' + this.imageOffset.width + "px;top:" +
  3657. this.imageOffset.height + "px;width:" + this.backGroundImageSize.width + "px;height:" + this.backGroundImageSize
  3658. .height + 'px;"src="' + this.imageUrl + '"/>';
  3659. return L
  3660. },
  3661. setBackGroundImageSize: function(L) {
  3662. if (!L) {
  3663. return
  3664. }
  3665. this.backGroundImageSize = new d(L.width / this.dpr, L.height / this.dpr)
  3666. },
  3667. toString: function() {
  3668. return "Icon"
  3669. }
  3670. });
  3671. var D = new h(u.apiUrlCdn + "/images/hd_red_marker.png", new d(47, 50));
  3672. function z(L, M) {
  3673. I.call(this);
  3674. M = M || {};
  3675. this.point = L;
  3676. this.map = null;
  3677. this._config = {
  3678. offset: new d(0, 0),
  3679. icon: D,
  3680. baseZIndex: 0,
  3681. clickable: true,
  3682. isTop: false,
  3683. enableMassClear: true
  3684. };
  3685. this.setConfig(M);
  3686. if (o.isDefined(M.enableClicking)) {
  3687. this._config.clickable = M.enableClicking
  3688. }
  3689. this._loadAsyncCode()
  3690. }
  3691. J.lang.inherits(z, I, "Marker");
  3692. J.extend(z.prototype, {
  3693. _loadAsyncCode: function() {
  3694. var L = this;
  3695. p.load("marker", function() {
  3696. L._loadAsyncCodeCbk()
  3697. })
  3698. },
  3699. setIcon: function(L) {
  3700. if (L instanceof h) {
  3701. this._config.icon = L
  3702. }
  3703. },
  3704. getIcon: function() {
  3705. return this._config.icon
  3706. },
  3707. getPosition: function() {
  3708. return this.point
  3709. },
  3710. setPosition: function(L) {
  3711. if (L instanceof w) {
  3712. this.point = new w(L.lng, L.lat)
  3713. }
  3714. },
  3715. setTop: function(M, L) {
  3716. this._config.isTop = !!M;
  3717. if (M) {
  3718. this._addi = L || 0
  3719. }
  3720. },
  3721. setOffset: function(L) {
  3722. if (L instanceof d) {
  3723. this._config.offset = L
  3724. }
  3725. },
  3726. getOffset: function() {
  3727. return this._config.offset
  3728. }
  3729. });
  3730. function x() {
  3731. this._map = null;
  3732. this._container;
  3733. this._type = "control";
  3734. this._visible = true
  3735. }
  3736. J.lang.inherits(x, J.lang.Class, "Control");
  3737. J.extend(x.prototype, {
  3738. initialize: function(L) {
  3739. this._map = L;
  3740. if (this._container) {
  3741. L.container.appendChild(this._container);
  3742. return this._container
  3743. }
  3744. return
  3745. },
  3746. _i: function(L) {
  3747. if (!this._container && this.initialize && J.lang.isFunction(this.initialize)) {
  3748. this._container = this.initialize(L)
  3749. }
  3750. this._opts = this._opts || {};
  3751. this._setStyle();
  3752. this._setPosition();
  3753. if (this._container) {
  3754. this._container._jsobj = this
  3755. }
  3756. },
  3757. _setStyle: function() {
  3758. var N = this._container;
  3759. if (N) {
  3760. var L = N.style;
  3761. var M = this._container.style.zIndex || 10;
  3762. L.position = "absolute";
  3763. L.zIndex = M
  3764. }
  3765. },
  3766. remove: function() {
  3767. this._map = null;
  3768. if (!this._container) {
  3769. return
  3770. }
  3771. this._container.parentNode && this._container.parentNode.removeChild(this._container);
  3772. this._container._jsobj = null;
  3773. this._container = null
  3774. },
  3775. _render: function() {
  3776. this._container = o.beforeEndHTML(this._map.container, "<div></div>");
  3777. if (this._visible == false) {
  3778. J.dom.hide(this._container)
  3779. }
  3780. return this._container
  3781. },
  3782. _setPosition: function() {
  3783. this.setAnchor(this._opts.anchor)
  3784. },
  3785. setAnchor: function(N) {
  3786. if (this.anchorFixed || !J.lang.isNumber(N) || isNaN(N) || N < BMAP_ANCHOR_TOP_LEFT || N >
  3787. BMAP_ANCHOR_BOTTOM_RIGHT) {
  3788. N = this.defaultAnchor
  3789. }
  3790. this._opts = this._opts || {};
  3791. this._opts.offset = this._opts.offset || this.defaultOffset;
  3792. var M = this._opts.anchor;
  3793. this._opts.anchor = N;
  3794. if (!this._container) {
  3795. return
  3796. }
  3797. var P = this._container;
  3798. var L = this._opts.offset.width;
  3799. var O = this._opts.offset.height;
  3800. switch (N) {
  3801. case BMAP_ANCHOR_TOP_LEFT:
  3802. P.style.top = O + "px";
  3803. P.style.left = L + "px";
  3804. break;
  3805. case BMAP_ANCHOR_TOP_RIGHT:
  3806. P.style.top = O + "px";
  3807. P.style.right = L + "px";
  3808. break;
  3809. case BMAP_ANCHOR_BOTTOM_LEFT:
  3810. P.style.bottom = O + "px";
  3811. P.style.left = L + "px";
  3812. break;
  3813. case BMAP_ANCHOR_BOTTOM_RIGHT:
  3814. P.style.bottom = O + "px";
  3815. P.style.right = L + "px";
  3816. break;
  3817. default:
  3818. break
  3819. }
  3820. },
  3821. getAnchor: function() {
  3822. return this._opts.anchor
  3823. },
  3824. setOffset: function(L) {
  3825. if (!(L instanceof d)) {
  3826. return
  3827. }
  3828. this._opts = this._opts || {};
  3829. this._opts.offset = new d(L.width, L.height);
  3830. if (!this._container) {
  3831. return
  3832. }
  3833. this.setAnchor(this._opts.anchor)
  3834. },
  3835. getOffset: function() {
  3836. return this._opts.offset
  3837. },
  3838. getDom: function() {
  3839. return this._container
  3840. },
  3841. show: function() {
  3842. this._visible = true;
  3843. if (this._container) {
  3844. J.dom.show(this._container)
  3845. }
  3846. },
  3847. hide: function() {
  3848. this._visible = false;
  3849. if (this._container) {
  3850. J.dom.hide(this._container)
  3851. }
  3852. },
  3853. isVisible: function() {
  3854. if (!this._container && !this._map) {
  3855. return false
  3856. }
  3857. return !!this._visible
  3858. }
  3859. });
  3860. window.BMAP_ANCHOR_TOP_LEFT = 0;
  3861. window.BMAP_ANCHOR_TOP_RIGHT = 1;
  3862. window.BMAP_ANCHOR_BOTTOM_LEFT = 2;
  3863. window.BMAP_ANCHOR_BOTTOM_RIGHT = 3;
  3864. function y(L) {
  3865. x.call(this);
  3866. L = L || {};
  3867. this._opts = {};
  3868. this._opts = J.object.extend(J.object.extend(this._opts, {
  3869. color: "black",
  3870. unit: "metric"
  3871. }), L);
  3872. this.defaultAnchor = BMAP_ANCHOR_BOTTOM_LEFT;
  3873. this.defaultOffset = new d(20, 10);
  3874. this.setAnchor(L.anchor);
  3875. this._units = {
  3876. metric: {
  3877. name: "metric",
  3878. conv: 1,
  3879. incon: 1000,
  3880. u1: "米",
  3881. u2: "公里"
  3882. }
  3883. };
  3884. if (!this._units[this._opts.unit]) {
  3885. this._opts.unit = "metric"
  3886. }
  3887. this._scaleText = null;
  3888. this._numberArray = {};
  3889. this._loadAsyncCode()
  3890. }
  3891. J.lang.inherits(y, x, "ScaleControl");
  3892. J.object.extend(y.prototype, {
  3893. _loadAsyncCode: function() {
  3894. var L = this;
  3895. p.load("control", function() {
  3896. L._loadAsyncCodeCbk()
  3897. })
  3898. },
  3899. initialize: function(L) {
  3900. this._map = L;
  3901. return this._container
  3902. },
  3903. setColor: function(L) {
  3904. this._opts.color = L + ""
  3905. },
  3906. getColor: function() {
  3907. return this._opts.color
  3908. }
  3909. });
  3910. function C(L) {
  3911. x.call(this);
  3912. L = L || {};
  3913. this._opts = {};
  3914. this._opts = J.object.extend(this._opts, L);
  3915. this.defaultAnchor = BMAP_ANCHOR_BOTTOM_RIGHT;
  3916. this.defaultOffset = new u.Size(8, 14);
  3917. this.setAnchor(L.anchor)
  3918. }
  3919. J.lang.inherits(C, x, "ZoomControl");
  3920. J.object.extend(C.prototype, {
  3921. initialize: function(M) {
  3922. this._map = M;
  3923. var O = this._container = document.createElement("div");
  3924. O.style.cssText = "box-shadow:1px 1px 2px rgba(0,0,0,.4);background:rgba(255,255,255,.8);border-radius: 3px;";
  3925. var L = this._zoomIn = document.createElement("div");
  3926. L.style.cssText = "width:36px;height:42px;text-align:center;line-height:42px;font-family:arial;color:#000;";
  3927. L.innerHTML =
  3928. '<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>';
  3929. var N = this._zoomOut = document.createElement("div");
  3930. N.style.cssText = "width:36px;height:42px;text-align:center;line-height:42px;font-family:arial;color:#000;";
  3931. N.innerHTML =
  3932. '<div style="font-size:40px;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;">-</div>';
  3933. O.appendChild(L);
  3934. O.appendChild(N);
  3935. M.getContainer().appendChild(O);
  3936. this.bindEvt();
  3937. return O
  3938. },
  3939. bindEvt: function() {
  3940. var L = this;
  3941. var M = L._map;
  3942. L._zoomIn.onclick = function() {
  3943. M.zoomIn();
  3944. L.zoomChangeHandler()
  3945. };
  3946. L._zoomOut.onclick = function() {
  3947. M.zoomOut();
  3948. L.zoomChangeHandler()
  3949. };
  3950. L._zoomIn.ontouchstart = function() {
  3951. this.style.background = "rgba(94,169,221,.8)"
  3952. };
  3953. L._zoomIn.ontouchend = function() {
  3954. this.style.background = ""
  3955. };
  3956. L._zoomOut.ontouchstart = function() {
  3957. this.style.background = "rgba(94,169,221,.8)"
  3958. };
  3959. L._zoomOut.ontouchend = function() {
  3960. this.style.background = ""
  3961. };
  3962. L.zoomChangeHandler = function() {
  3963. if (M.getZoom() >= M.config.maxZoom) {
  3964. L._zoomIn.style.background = "rgba(205,205,205,.8)"
  3965. } else {
  3966. L._zoomIn.style.background = ""
  3967. }
  3968. if (M.getZoom() <= M.config.minZoom) {
  3969. L._zoomOut.style.background = "rgba(205,205,205,.8)"
  3970. } else {
  3971. L._zoomOut.style.background = ""
  3972. }
  3973. };
  3974. M.addEventListener("zoomend", L.zoomChangeHandler);
  3975. M.addEventListener("centerzoomend", L.zoomChangeHandler);
  3976. M.addEventListener("load", L.zoomChangeHandler)
  3977. }
  3978. });
  3979. function k(L) {
  3980. this["defaultAnchor"] = BMAP_ANCHOR_BOTTOM_LEFT;
  3981. this["defaultOffset"] = new d(1, 1);
  3982. this._cZIndex = 30;
  3983. this.IMG_URL = u.apiUrlCdn + "images/copyright_logo_hd.png"
  3984. }
  3985. k.prototype = new x();
  3986. k.prototype.initialize = function(M) {
  3987. this._map = M;
  3988. var N = o.create("div");
  3989. var L = o.create("a", {
  3990. title: "到百度地图查看此区域",
  3991. target: "_blank",
  3992. href: "http://map.baidu.com/?sr=1"
  3993. });
  3994. L.style.outline = "none";
  3995. N.style.height = "25px";
  3996. L.href = "http://map.baidu.com/?sr=1";
  3997. L.innerHTML = "<img style='border:none;width:68px;height:25px' src='" + this.IMG_URL + "' />";
  3998. N.appendChild(L);
  3999. M.getContainer().appendChild(N);
  4000. return N
  4001. };
  4002. var K = new h(u.apiUrlCdn + "/images/hd_red_marker.png", new d(47, 50));
  4003. function q(L, M) {
  4004. J.lang.Class.call(this);
  4005. M = M || {};
  4006. this.point = L;
  4007. this._opts = {
  4008. icon: K,
  4009. data: "",
  4010. margin: 0
  4011. };
  4012. this._opts = J.object.extend(this._opts, M)
  4013. }
  4014. J.lang.inherits(q, J.lang.Class, "MassFeature");
  4015. J.extend(q.prototype, {
  4016. getData: function() {
  4017. return this._opts.data
  4018. },
  4019. getIcon: function() {
  4020. return this._opts.icon
  4021. },
  4022. getPosition: function() {
  4023. return this.point
  4024. }
  4025. });
  4026. function t(L) {
  4027. this._map = L;
  4028. this._asyncCodeLoaded = false;
  4029. this._massFeatures = [];
  4030. this._IconCache = {};
  4031. this._needLoadImgNumber = 0
  4032. }
  4033. u.register(function(M) {
  4034. var L = new t(M);
  4035. L.initialize()
  4036. });
  4037. J.extend(t.prototype, {
  4038. initialize: function() {
  4039. var M = this._map;
  4040. var L = this;
  4041. M.addEventListener("addmassfeatures", function(Q) {
  4042. var N = Q.massFeatures;
  4043. for (var S = 0, P = N.length; S < P; S++) {
  4044. var R = N[S];
  4045. var O = R.guid;
  4046. if (!L._massFeatures[O]) {
  4047. L._massFeatures[O] = 1;
  4048. L._massFeatures.push(R)
  4049. }
  4050. }
  4051. L._loadAsyncCode(function() {
  4052. L.drawMassFeatures(true)
  4053. })
  4054. });
  4055. M.addEventListener("removemassfeatures", function(Q) {
  4056. var N = Q.massFeatures;
  4057. for (var S = 0, P = N.length; S < P; S++) {
  4058. for (var R = L._massFeatures.length - 1; R >= 0; R--) {
  4059. if (N[S].guid === L._massFeatures[R].guid) {
  4060. var O = L._massFeatures[R].guid;
  4061. L._massFeatures.splice(R, 1);
  4062. delete L._massFeatures[O];
  4063. break
  4064. }
  4065. }
  4066. }
  4067. L._loadAsyncCode(function() {
  4068. L.drawMassFeatures()
  4069. })
  4070. });
  4071. M.addEventListener("clearmassfeatures", function(N) {
  4072. L._massFeatures.length = 0;
  4073. for (var O in L._massFeatures) {
  4074. delete L._massFeatures[O]
  4075. }
  4076. L._loadAsyncCode(function() {
  4077. L.drawMassFeatures()
  4078. })
  4079. })
  4080. },
  4081. _loadAsyncCode: function(L) {
  4082. var M = this;
  4083. p.load("massfeatures", function() {
  4084. if (!M._asyncCodeLoaded) {
  4085. M._loadAsyncCodeCbk()
  4086. }
  4087. L && L()
  4088. }, true)
  4089. }
  4090. });
  4091. u.verify();
  4092. })();
  4093. })();