采用百度Mapv 整合,缩放显示均价!
配置项如下
var points = [[120.60215193640713,31.285888495281945,24564],[120.58793758210217,31.29860994251617,22149],[120.614219665527,31.3077697753906,10479],[120.61782316438475,31.29433393273269,24472],[120.6105295542542,31.301118353860254,23018],[120.60430584747,31.304029020007,20961],[120.59873760472306,31.284918789133982,33299],[120.613302,31.306031,16762],[120.60618682741881,31.29780664680905,25566],[120.61828738172314,31.285509693829795,22043],[120.5983379845339,31.28564565215188,22238],[120.6147957418669,31.295182251334047,23274],[120.62392360111997,31.29823516353973,33081],[120.61282634986685,31.30938748744022,16056],[120.6048981848088,31.302965845743646,25000],[120.65346810716,31.313450822592,29200],[120.621535,31.296557,37233],[120.61504739227416,31.30301050359539,22444],[120.62033781435477,31.286716447132115,24770],[120.60944349480788,31.29609671968627,16334],[120.62389,31.305023,16868],[120.65310552273047,31.324765971819456,20011],[120.60426432736,31.287707040787,21582],[120.60566694388457,31.2944064197488,23095],[120.57669519065,31.268807034395,17389],[120.60631271056315,31.28104817795216,20871],[120.61611,31.315651,24382],[120.60674732065024,31.300906731559543,19766],[120.61605545095475,31.30499693179272,16121],[120.61388426719815,31.2926392994469,18389],[120.59071684143473,31.29822113195096,17902],[120.60975922763531,31.296700077105275,18046],[120.62435259397,31.309433003594,30566],[120.60847825835096,31.302344740012018,16896],[120.65604108632347,31.170226646621188,11953],[120.60405810836029,31.291484119082607,19713],[120.5946337534,31.30152936598,17050],[120.60012922099199,31.299979928390965,19145],[120.614608764648,31.3054370880127,15712],[120.61211095103667,31.296670564521573,17836],[120.61957043058473,31.28703471420129,16476],[120.59851398302,31.304178926912,18405],[120.61345314792626,31.295212241899648,18377],[120.61629924657862,31.294019185992095,16591],[120.61441524211051,31.29983532620598,19396],[120.59600060078337,31.299444364252295,19526],[120.60919498558,31.305614468165,16988],[120.61373773401,31.29840740654,16824],[120.61440791219,31.296485420028,17916],[120.6222375733049,31.300159605750196,19695],[120.59373271157,31.295472967969,17303],[120.60165270991,31.297987709669,18784],[120.60855894055864,31.304144738678477,17501],[120.61282277191602,31.301656553034352,15712],[120.59267699837,31.302427419089,18630],[120.58548426394084,31.312201422775075,19401],[120.60987337186,31.29767979274,20008],[120.60098194439,31.301737938395,17060],[120.61355533287295,31.306882052208483,16237],[120.613724,31.298693,19396],[120.64230787806,31.314146039618,25892],[120.61580499376,31.30527735497,19795],[120.60080151912379,31.30175144967208,17060],[120.61614927596,31.3030957998,14378],[120.61309,31.296081,18046],[120.62559249056,31.303285836082,23197],[120.58859482547,31.297370211316,20760],[120.60496616659,31.287358317364,18316],[120.61100655859,31.304008549562,13386],[120.602218,31.302222,17060],[120.625795,31.304675,21817],[120.59824489227,31.297332172895,17173],[120.610011,31.302886,16896],[120.60337703647856,31.298710199203366,17741],[120.60096942284,31.301974097186,14378],[120.62538940664436,31.294772584144486,49367],[120.62492264018,31.30451721852,21363],[120.58586616954535,31.296976296814186,17703],[120.616122,31.305061,19795],[120.62547683768,31.309568231232,22404],[120.64121857290014,31.823536244217973,17777],[120.61696141002767,31.301322942609403,21440],[120.62514247832,31.30650475154,16269],[120.59759066915,31.313256759278,19749],[120.61908534485,31.313942056152,21365],[120.61443103378,31.305312802332,23759],[120.59511278927837,31.3167877483716,21742],[120.61160037933736,31.294113323515326,19925],[120.61244607242,31.300987636012,15010],[120.61785342290754,31.293073657266312,17092],[120.6067455222426,31.277518843906055,27097],[120.61306513334,31.267048895201,23316],[120.59564746161621,31.2806523017302,18633],[120.59882058187,31.283068811667,17881],[120.60768850048558,31.264321397476863,20246],[120.603826099403,31.272358798102893,26641],[120.604187,31.2680365,13813],[120.59899496925168,31.27468263473219,26338],[120.61344587524486,31.286023015671493,22043],[120.60254350598,31.275135211456,26898],[120.5916639896119,31.291574128645138,21640],[120.59903694257662,31.28509094243199,18310],[120.614471435547,31.2892398834229,10519],[120.60632970380847,31.27036168433115,26752],[120.61299485581102,31.273268584152824,29378],[120.60818883509532,31.27424807468454,21904],[120.6078669111463,31.2762181279799,25756],[120.61329265396894,31.276215920179073,27824],[120.6154248997749,31.26786177145976,23649],[120.55266406984,31.264673755315,22896],[120.61746097119634,31.277230096317894,28874],[120.59583050124523,31.286773193884507,19879],[120.627906799316,31.285665512085,6363],[120.620002746582,31.2775325775147,31505],[120.59756883469524,31.287159210818942,22238],[120.61778076896,31.287964970226,25826],[120.61312732443305,31.27094832508899,25861],[120.61139308456126,31.285415139503897,18686],[120.47586989001,31.170473887161,17777],[120.61889091816137,31.282573387773255,18224],[120.61537902083,31.283248839243,18224],[120.60478123495,31.28736603805,19976],[120.62003027497191,31.291428677872652,23939],[120.62299161993305,31.28824927809486,17057],[120.61250870993683,31.27940016169193,18350],[120.6102059932,31.276334872207,20051],[120.61417528404777,31.290757280538333,18001],[120.60939513285,31.261616637622,27976],[120.60302019562,31.27081296777,16037],[120.61681811323102,31.278656247950767,27397],[120.61321148621,31.285987719941,22043],[120.58965585625,31.293733622254,19090],[120.59571211286,31.297222554563,17836],[120.6028224334,31.284361285004,20263],[120.61760380147,31.289176702451,18101],[120.61015120676,31.276414838824,18604],[120.55019474492,31.37249294033,19948],[120.57142369055614,31.334966555241856,17857],[120.54744191491572,31.36301327003165,14224],[120.55106482864765,31.371201527303857,16336],[120.5544520961833,31.36735248688974,15764],[120.55121846494072,31.3784906288546,19496],[120.55865773993,31.366741752193,16180],[120.54899015254692,31.365565435127007,15760],[120.55707567653,31.366380701318,20108],[120.559313,31.3626922,20129],[120.56887444301,31.352921238506,11561],[120.57685562605,31.354432416533,14616],[120.54792795029836,31.37008279080309,13977],[120.56579095988,31.34778916593,14567],[120.56676747516,31.355107806814,7884],[120.56690481708,31.353849769875,15970],[120.56902398596257,31.333923180137592,16563],[120.56840262566,31.353226034982,16675],[120.5522991058082,31.376246620766917,16675],[120.61085766813,31.310951353135,20378],[120.6178872306354,31.30885431290984,35594],[120.58936975866149,31.310616688876234,27019],[120.59409619310222,31.327519158812446,23547],[120.595191,31.3068747,19864],[120.59603106591643,31.301844800467283,19133],[120.60048988256949,31.303393990591623,26599],[120.60104553483254,31.322176420156595,31941],[120.60973003270624,31.30695488775847,18714],[120.98442048868418,31.36772796348379,20320],[120.58654963541126,31.309140852381166,27692],[120.59795652626,31.303485314594,19094],[120.58795735290815,31.2959802149154,21046],[120.59546696509008,31.310700235423976,26493],[120.56049,31.347655,18388],[120.59102276296939,31.313187088428332,22107],[120.58552769970717,31.294580611562978,18723],[120.58903986314938,31.312768491526626,23532],[120.58707731068,31.307560153345,25550],[120.61400102625342,31.304912855391834,17226],[120.58336599037878,31.31486512366857,20817],[120.5811465801926,31.3137605939165,17758],[120.59163783544699,31.30932471325314,19897],[120.58682416565986,31.305212633000824,17877],[120.59611294287046,31.306896123915077,18092],[120.60036681471463,31.311538383415403,24413],[120.58793602803364,31.31493197602371,17112],[120.59027908907498,31.317437584035776,23394],[120.59234096162727,31.301017925892342,17416],[120.58094797472569,31.31125040799228,18410],[120.61068191286,31.311573224672,15988],[120.60076364869,31.312951913206,18823],[120.59801503785,31.315330256294,18541],[120.58206705498424,31.30794051899634,19919],[120.60729199034,31.302926667921,16787],[120.60070399817931,31.30734150847188,18109],[120.59984591975,31.311842382178,16888],[120.59620198973,31.314549429467,19442],[120.59511761129,31.308705385144,19180],[120.58619078937,31.297440839863,21783],[120.60565233671,31.308075419411,14640],[120.59591899535,31.335666725476,20176],[120.6130971194,31.309134445147,17818],[120.59765043511,31.30978989742,15178],[120.6203821389,31.313566256291,22481],[120.58398533848,31.303182812481,8779],[120.60549003159744,31.307477076327423,16149],[120.597584,31.304008,15968],[120.59520052614,31.303459587779,13250],[120.5691532431424,31.347947828891474,15902],[120.58727640589088,31.323093378145398,19050],[120.58932983277,31.328731631205,19845],[120.58333612711041,31.33554941687306,17121],[120.58952215978447,31.3278091277832,19524],[120.58712186230925,31.32784206199572,27215],[120.58969147543,31.329761211531,16233],[120.59274902916,31.325925184148,15910],[120.589816,31.341914,11604],[120.58981293678652,31.329683844332664,20526],[120.57690545620191,31.323506988072587,24415],[121.1458851136254,31.28765815790396,22149],[120.41104526641,31.34079283069,10782],[120.58589592,31.321699524111,27721],[120.56885264886,31.334880506951,16828],[120.59923548156891,31.32919714325396,18663],[120.58493371892,31.323246575146,20920],[120.59254944665818,31.32594014781371,19344],[120.59270067639078,31.327642475139196,16272],[120.59541227619,31.328333823065,16584],[120.58098874791449,31.31927069475326,19245],[120.5817931517529,31.325099079417193,16424],[120.57541300334287,31.32364863577032,17933],[120.58363683209,31.32187705099,17179],[120.6043606028594,31.330370640509326,17184],[121.10665464237684,31.418762934552912,13387],[120.59088827375,31.328007802845,16621],[120.57107662025,31.33640062822,19333],[120.58815846464742,31.328718699925,27397],[120.59250893038475,31.325299475206666,15910],[120.565282,31.350456,18790],[120.57992433352,31.301371435006,28101],[120.58708352992,31.321950074984,14122],[120.5976385746435,31.329084818011697,21209],[120.59250417457572,31.32515665659582,15362],[120.5943550046,31.328089352794,15079],[120.58604178378103,31.323203204078666,24291],[120.57899812176879,31.316224995602358,24575],[120.5760745918764,31.31841998448061,48161],[120.58423577379051,31.32907378919305,16837],[120.59439198451,31.323228546981,14175],[120.578355,31.320753,13458],[120.59534807166094,31.321957448795583,14237],[120.59765211271,31.322702433602,17157],[120.59999909335411,31.324170904848774,12487],[120.59109036495053,31.310247483949624,25814],[120.61871239790739,31.31288599033586,36940],[120.60858326487525,31.3117058209386,28689],[120.60443077188,31.323610144017,15951],[120.59432223483,31.314137927152,34151],[120.6103177940014,31.323133293858884,24346],[120.606398,31.319031,9859],[120.6004196074,31.320297598142,39779],[120.60138276974,31.326838453234,20845],[120.5798683278,31.319960308214,18534],[120.61152432519965,31.309204791058526,26821],[120.60854100135,31.319952390271,14705],[120.60865186489,31.317282990807,12054],[120.610931396484,31.3101539611816,16545],[120.609130859375,31.3286056518555,17391],[120.59934103066973,31.32497679449172,15216],[120.61200408619,31.309980512626,13958],[120.609092712402,31.3111457824707,24081],[120.60151813425962,31.314817064598238,24114],[120.57694032213368,31.32846885912448,19353],[120.6153137605189,31.313099831649446,28702],[120.59396958772027,31.308163489690862,23859],[120.611877441406,31.3102893829346,13571],[120.60307319811439,31.31047250201514,17011],[120.60520053018921,31.32063947882475,21607],[120.61962340635556,31.31045485727184,20000],[120.6081496134,31.32654134705,18365],[120.61515045166,31.3076610565186,10686],[120.60070911223261,31.3252753881734,16997],[120.5766800514,31.324762547033,16542],[120.62251195334,31.322781274598,19134],[120.60977251447211,31.331387415353745,18082],[120.58504863966682,31.31139384380281,19401],[120.61053000969508,31.317951124742457,22821],[120.61099973004,31.310803694254,6874],[120.59407415137993,31.314915900714222,19146],[120.60076472913,31.321325674167,31941],[0,0,16184],[120.5959229295,31.31599700366,15660],[120.59763314399,31.30937258421,20001],[120.60924960609,31.319820103559,15341],[120.59711759337992,31.316667256181272,18541],[120.615898132324,31.3081817626953,18799],[120.614852905273,31.3263416290283,17539],[120.60751058119797,31.308336990796242,20244],[120.61237626107753,31.305711886675784,16823],[120.60751386136,31.314362229338,12000],[120.58690986122,31.314415619352,9088],[120.6308401942246,30.908944247342674,8035],[120.618625,31.308406,15584],[120.60363753023,31.32685712428,11860],[120.86408730518,31.758626281087,15692],[120.61305,31.309462,16056],[120.60864999999158,31.330641324503304,15553],[120.6041103831,31.325037836548,15000],[120.57519306042522,31.3246046409735,23831],[120.60617767266,31.32024801452,13606],[120.60709028709,31.314980550778,19870],[120.6084099197593,31.306475326173352,16823],[120.60813102216,31.330258373083,15000],[120.60294315027,31.327909256437,14915],[120.61264765402,31.311719135242,17985],[120.61444098616,31.315635588251,18437],[120.6233481645764,31.312883501191802,20091],[120.61457943349333,31.309175089680075,21557],[120.60753764263,31.31728830941,8200],[120.61496877077931,31.308997723866636,20317],[120.61260136797,31.323250117723,13235],[120.60763725035963,31.320345390236643,22232],[120.61008447585,31.32000296854,28938],[120.60941240111,31.319003541982,8366],[120.59927054653,31.315588461905,7155],[120.58357002374,31.316000103611,18240],[120.61034990003,31.319722337977,28938],[120.632426974552,31.280572398131447,16841],[0,0,12540],[120.62785430845524,31.34359169744536,21510],[120.60172523320513,31.34569503638482,12324],[120.60759482053,31.346169452649,10020],[120.90414139380097,31.39842703539202,20000],[120.637733,31.314514,16766],[120.63133315543,31.312698764699,26455],[120.6407339694165,31.3155875611393,29637],[120.64796106451557,31.33535077722945,24407],[120.64945742230864,31.31785632687543,23531],[120.60792848100597,31.272121141149036,18582],[120.63982447546,31.314672630338,21545],[120.65414745920675,31.3183199142502,22722],[120.62880492139675,31.324759725267043,20398],[120.63148225247,31.33271536809,16580],[120.640071,31.32113,50435],[120.6415534059,31.322870951559,14814],[120.64103636936,31.331303748661,28465],[120.6393752541,31.325182770141,13953],[120.60607669017,31.346231077949,9183],[120.650335,31.31674,20331],[120.653421,31.317068,21142],[120.64335774494,31.342699548685,19849],[120.65370802263,31.317122836322,19478],[120.63453292425,31.321569776982,22410],[120.60882120857,31.301356759439,13572],[120.63163861584,31.32275836176,21457],[120.64074,31.318457,18356],[120.64396704820119,31.317040193499565,32382],[120.65714736842,31.31246501225,20329],[120.695744,31.2976703,36870],[120.70964366510418,31.305172679688397,57267],[120.6626822679418,31.283850410606014,25593],[120.662117004395,31.2957344055176,14548],[120.662805,31.2977607,24851],[120.72272204382054,31.301122473696083,50666],[121.15228044429682,31.297567584634184,7143],[120.66206763532,31.305845743126,22036],[120.65766972319612,31.33827898374805,21053],[120.657104492188,31.31884765625,22234],[120.66111246379191,31.30380803399873,19073],[120.65957281396139,31.308948104883413,13079],[120.66294473933722,31.304159895855587,22572],[120.656181335449,31.3197841644287,17924],[120.66180552176407,31.306229837945178,22307],[120.66333401512,31.306082942554,22530],[120.65968753386316,31.314888533833322,20585],[120.6580365067257,31.32745406261561,21052],[120.66030858007241,31.325317221943827,24803],[120.66154651333636,31.30997672007137,20171],[120.65337101692394,31.324360642653676,18708],[120.65482807774,31.310741712589,20520],[120.65528210620148,31.312551080045207,19298],[120.65630404469,31.31076252703,20000],[120.65723684441,31.314551557272,15789],[120.65739061967417,31.325077836200514,29085],[120.6587397847196,31.31608856717396,21410],[120.65445682574303,31.333800844715007,19658],[120.6585867952065,31.29930412853821,19603],[120.66225587555353,31.307683073833726,19671],[120.65829595766,31.312545321065,23494],[120.65863764738312,31.311288254157688,34755],[121.12969053285764,31.298814050324175,11111],[121.0015394922963,31.34308986226045,6227],[120.65729648084,31.333182989637,19360],[120.65631524005,31.329032069043,21052],[120.65769511739458,31.316614055058217,20155],[120.65481909832,31.310882850743,19542],[120.68824425292,31.25576100696,21903],[120.85282603110298,31.44141086313944,12121],[120.73222883237,31.301594563828,28089],[120.67008,31.2900033,22613],[120.70167986606317,31.26796088911016,28319],[120.66648335967334,31.276525189481053,9555],[120.73193525377502,31.29023276832441,21912],[120.7301318668366,31.27249357363289,31490],[120.755066,31.2803561,28006],[120.763841,31.2573825,20242],[120.68699911063914,31.284042529854958,44921],[120.75038476642376,31.284528950355657,22846],[120.68611939107016,31.29753716854738,41419],[120.7318320348787,31.30392283109728,6903],[120.72866972637,31.303418907085,37765],[120.72633419028,31.268361633119,23035],[120.73120812936303,31.267370399798423,35208],[120.72477258966,31.332612435341,24117],[120.75040574292,31.284740666452,19555],[120.75597309176402,31.249161169752295,16877],[120.729817,31.271641,17505],[121.03047504373932,31.264471582273142,6352],[120.74763959816,31.253492464491,16636],[120.74355,31.253848,16935],[120.737658,31.270921,5607],[120.73818265861,31.24795070848,16935],[120.86846577816,31.33897773888,13523],[120.75620255817,31.316891066595,35154],[120.72937668385201,31.336210187437608,38665],[120.74431719778883,31.311503857287814,34999],[120.71876430287925,31.29406851228749,33722],[120.738478932,31.331093713573,26094],[120.7713067176666,31.33634296741647,24927],[120.75312527666,31.338556643115,35444],[120.75656174058506,31.301173524964195,19847],[120.76933149476548,31.34018888365925,23434],[120.72646695372887,31.299047064292875,56358],[120.75638153780484,31.30327711573226,28554],[120.75419866823,31.317759070445,30955],[120.76912411375206,31.311214663194868,24780],[120.74752309115387,31.34234619879692,28967],[120.754753,31.3265841,32878],[120.76027907520914,31.337161994751032,33112],[120.75547299063,31.326035379511,31297],[120.71959621013747,31.369071098990208,11192],[120.711065,31.305028,11000],[120.7609043802848,31.318825519710266,28526],[120.7563489427894,31.328675460337966,35984],[120.76815517986967,31.338036280382724,29908],[120.738612,31.3382368,35218],[120.722131,31.3250571,44849],[120.756517,31.326674,30380],[120.76027907520914,31.337161994751032,37101],[120.73060584246777,31.296259445890694,25000],[120.72851097515407,31.320698371207865,39313],[120.72914968923608,31.36491093074895,24400],[120.767046,31.322263,25782],[120.70043349142232,31.333337659037458,46912],[120.717503219384,31.333535082233315,39910],[120.72896868067583,31.29821773949327,50000],[120.675561,31.29372,7309],[120.77193956401702,31.30672884127967,30547],[120.721709,31.3672118,11882],[120.79996841259015,31.347294408184045,19031],[120.7397044969104,31.311644386650404,33738],[120.71781908475,31.336344502407,41222],[120.73413977634401,31.338049976426326,26462],[120.75808406952,31.320257548617,30516],[120.717503219384,31.333535082233315,34454],[120.73870855008302,31.307065279954866,25446],[120.74489441657056,31.32406526041858,28225],[120.71510948403053,31.333832168826547,45617],[120.7626878734,31.324992954075,28550],[120.730857,31.2943972,22857],[120.7713067176666,31.33634296741647,28110],[120.770962,31.3135827,24780],[120.69402079381047,31.303973919169337,43300],[120.74732667787,31.323080780579,29835],[120.74832353885482,31.318367469520243,26804],[120.74868907912955,31.310979460141066,36139],[120.72592982417,31.331117281103,27990],[120.77284978141,31.307205909196,30547],[120.71787076205,31.336103875651,37714],[120.73076011206622,31.290567819293308,34599],[120.726593017578,31.3418979644775,13102],[120.73103,31.2900323,35493],[120.735204,31.320135,40418],[120.74669176779425,31.31297366735216,29578],[120.738331,31.372347,26308],[120.7293907522146,31.306863308801542,37908],[120.734466552734,31.305591583252,25415],[120.72204166722729,31.336961220113466,37134],[120.73156483390477,31.321737716281437,32679],[120.70549182549476,31.33179423484631,45298],[120.746879,31.3182402,26849],[120.75746774636985,31.318889667537785,30544],[120.71581911736,31.334414748745,39117],[120.73189205321,31.307576407237,24035],[120.73638069555736,31.33345856381574,33122],[120.7313719380677,31.318977970081917,27811],[120.72131002164365,31.375071948714293,44972],[120.70697177846,31.335356711167,40380],[120.76395483086438,31.343861688591037,24263],[120.7107601133276,31.33400443158862,43286],[120.74016025927,31.323247725434,36768],[120.74229778454476,31.31713176470101,28362],[120.73250656709632,31.314471779560755,28400],[120.73617452545975,31.311462179521744,31516],[120.71807933145332,31.37406398032502,21939],[120.68166394623,31.311579109217,39073],[120.73993097230574,31.317480896318806,28248],[120.7623375665395,31.256064003824783,17109],[120.7400621249102,31.3135794223439,33749],[120.742736816406,31.3023052215576,52813],[120.70333589496572,31.33528948066195,37500],[120.72265744307809,31.315492401926925,52921],[120.80950975076,31.329790651408,15366],[120.70268749535371,31.335958967043585,9541],[120.73845122957137,31.32347182914196,31778],[120.73471581744721,31.299633290880607,28708],[120.70325108451,31.349290830234,17495],[120.7245105467,31.311687561306,57327],[120.73650278207,31.323272041735,29692],[120.7313719380677,31.318977970081917,27811],[120.72950299279316,31.314400360447028,37903],[120.66679455066809,31.296912909799463,15477],[120.59202934932723,31.22796786287257,13130],[120.716418,31.33578,40047],[120.75685331168917,31.327563654763665,30380],[120.75253960934,31.324943903183,29598],[120.74733827336,31.301291295195,24463],[120.72578377746,31.258783898534,34572],[120.76330826706,31.320482662494,36503],[120.77344625487,31.306455512216,30490],[120.67416672659856,31.325736034890895,34846],[120.68511376230599,31.31638353853961,36794],[120.72422026559755,31.306985433443465,54796],[120.68117128177872,31.329169483906174,31480],[120.67324914794386,31.29908485392925,27002],[120.66457266834513,31.352934952179528,17948],[120.83274616932,31.304658789739,14840],[120.82579306996,31.306186168737,15745],[120.78644651468,31.368021680528,16101],[120.70074746446925,31.349494525577725,19599],[120.79289177462,31.370086043957,16208],[120.69455306946921,31.349955220722176,17386],[120.61589144192796,31.25101181470259,15149],[120.41431762508493,31.08862129183759,19200],[120.3987537383276,31.30473272777288,19599],[120.68660055416,31.289684386954,23944],[120.74325236709832,31.25207013118225,16812],[120.87250007699238,31.27709197135516,8719],[120.64384647134752,31.27466230108583,23599],[120.47810368443,31.137807819128,8730],[120.62741953164,31.144075503232,22348],[120.65604108632347,31.170226646621188,11953],[120.64652851719,31.169238331499,12223],[120.67819206333,30.921139466855,7738],[120.6391103747327,30.90813016544456,14325],[120.55850900018,30.890550065386,7613],[120.86361627906,31.271604115492,13059],[120.49819978021,31.238079115699,8326],[120.53899303000101,31.018328372372668,15760],[120.53899303000101,31.018328372372668,15760],[120.6578625026,31.295443534453,17610],[120.62054894268,31.301106295308,33420],[120.62798773715,31.309182151856,32190],[0,0,29408],[120.75230935979,31.33618118377,35151],[120.77260187385,31.34611296934,28050],[120.72667328821638,31.312558679855492,71513],[120.76279805869477,31.344467725915518,23864],[120.77947836903,31.345043349808,28692],[120.7713067176666,31.33634296741647,29811],[120.61071236618,31.370776389167,26104],[120.76132408956,31.316317308861,35154],[120.75820373335,31.321366600064,25011],[120.75782861725256,31.338968213664025,28391],[120.76279805869477,31.344467725915518,25360],[121.05294526495236,31.25802421018656,6200],[120.6692056727247,31.17194722334395,30302],[120.79899258331467,31.34772582926761,19031],[120.7313719380677,31.318977970081917,30904],[120.73755371349,31.292486274248,19584],[120.747517,31.316933,25822],[120.770207064163,31.309558524571752,25384],[120.73246661347,31.294132025599,18830],[120.72440086418,31.311298625022,57665],[120.85118414242744,31.39096992558922,16993],[120.68303660648,31.284996523263,23856],[120.74168465647,31.336966058176,32278],[120.71862223137134,31.350666968018718,17334],[120.66532022168,31.319447130487,28708],[120.71393509833,31.297140611763,48140],[120.67897453673883,31.32541144371556,39170],[120.673586,31.3196354,30463],[120.686135,31.3230311,44441],[120.68862425310336,31.309752601615134,55305],[120.677546,31.3191743,36592],[120.69051022755544,31.300553125301477,31057],[120.671353,31.322013,32104],[120.679449,31.3177836,30000],[120.67899775973288,31.31867005558644,24113],[120.69023502717094,31.304248654946242,38426],[120.67494819185,31.318921248383,11263],[120.694888980035,31.300244685065678,30677],[120.68662830809072,31.32647334711968,42562],[120.68471283957382,31.31340666292837,39991],[120.65964904326866,31.326861872118887,32037],[120.67228624797957,31.322132964529068,33147],[120.68790417499977,31.31894001898813,40017],[120.67890590676,31.312846858276,44774],[120.68094690931657,31.313472837840408,44774],[120.67749919570147,31.315593014299058,41950],[120.6784513923556,31.323753099444502,40015],[120.68152904199,31.325225377919,40015],[120.67814787917803,31.316119979144606,42346],[120.68708576208694,31.300523256324666,33459],[120.66583247355166,31.32424782342395,32561],[120.67693344289128,31.32860050212612,30655],[120.68332422544192,31.329919613646,30777],[120.67983396089143,31.31736965859905,41911],[120.673792,31.321775,28241],[120.73374015705315,31.160652214216434,32977],[120.67571530468753,31.318002453469024,52944],[120.68472120581,31.329811038326,31336],[121.00994187642628,31.34704838473243,38138],[120.66103400695,31.322680450169,23965],[120.65793881959469,31.319992863565144,29913],[120.75306965509,31.271050571574,58548],[120.679077148438,31.312370300293,28219],[120.68811201109477,31.330126362631944,36751],[120.68100162343,31.320000116952,33664],[120.68684547973591,31.31527133548045,50363],[120.65958539113684,31.31249869860497,25133],[120.65742107223096,31.320391354690095,23400],[120.63537288482787,30.907680625000847,28606],[120.66582564463317,31.31726605588175,39880],[120.67209189239604,31.317340725894137,42653],[120.67028424030306,31.327645150123306,27683],[120.68154071939,31.312235724693,25229],[120.66568936180596,31.32117714135773,31452],[120.66230334291497,31.317244823837118,30683],[120.68330197261784,31.314321922761252,43059],[120.66788705006661,31.326698372841733,27943],[120.6786431177006,31.323047086881218,37905],[0,0,31412],[120.68932369488,31.314463898059,54174],[120.67668290787,31.319479914487,38829],[120.72509450048,31.330590399482,26269],[120.77369,31.313714,24780],[120.95003403108456,31.417598043407022,36543],[120.72683962653,31.331872125454,27943],[120.66358784972641,31.28393419737604,20299],[120.75032945796,31.250473388371,16867],[120.67503598989138,31.291008018978122,26723],[120.679814538628,31.287467101953006,25665],[120.66372353248555,31.2971569223084,24851],[120.66050551469104,31.31064249043116,34446],[120.66283900595,31.297361483012,24851],[120.668942119,31.292047860213,20307],[120.662376403809,31.2957820892334,22051],[120.66349329298,31.295796705575,20830],[120.666030883789,31.2998065948486,18251],[120.67230967758388,31.291693174449854,21688],[120.69071182527799,31.345524345964503,17424],[120.66368363694123,31.29832706970747,20296],[120.66970325223144,31.295587716340506,21276],[120.66701448999255,31.296012970909043,25977],[120.67357830774374,31.2969869785152,20509],[120.66859236791,31.29464303935,18290],[120.67830799584705,31.290509403088215,21323],[120.67544454552548,31.295441279311305,21160],[120.6792746893555,31.292650269238923,21264],[120.67805227521752,31.294305431209864,21160],[120.67834724191647,31.294179672956922,20476],[120.66919949777262,31.34484546397746,17672],[120.67320889397564,31.29546451445512,27011],[120.67244015556089,31.296899832477127,22157],[120.670333862305,31.2942237854004,19943],[120.67124087368812,31.292889690001953,20599],[120.669120788574,31.2929153442383,19382],[120.66435119471487,31.347995072214733,17886],[120.67357648073,31.292722136665,19780],[120.67389798772557,31.292199271542245,21943],[120.69994912163,31.346562449578,18827],[120.66983795166,31.2925872802734,15797],[120.66376360858928,31.297646822159884,20296],[120.66740469234675,31.292373287419892,20661],[120.66766438528325,31.294543469491746,19843],[120.60792848100597,31.272121141149036,19745],[120.67042297999586,31.291840292996994,19328],[0,0,14594],[120.38872503225826,30.957569897959164,25665],[120.68014292588514,31.288930997836314,21535],[120.74998285204,31.292273409505,19642],[120.63701839695,31.427159782153,13675],[120.66139877621558,31.313238106793932,20656],[120.738092,31.249162,16812],[120.75064513375,31.248713050464,17478],[120.74863233585,31.295165038441,19687],[120.73767374044,31.251153670382,14750],[120.66907996951,31.29240517594,17329],[120.67094264973339,31.290872452806532,21990],[120.73926286297252,31.379732925964152,25461],[120.7637733938124,31.373385428442546,21138],[120.73926286297252,31.379732925964152,27697],[120.74137878418,31.3807468414307,24370],[120.72800057682771,31.365136326136785,23921],[120.74555044638957,31.37781624474047,25338],[120.73443400463584,31.35485778237499,20050],[120.73926286297252,31.379732925964152,26732],[120.720251,31.3684864,10917],[120.72017376129223,31.383297848500746,25987],[120.742268,31.373105,22636],[120.72366189775697,31.381319605602638,23748],[120.72728188930108,31.380433213134804,23590],[120.72464497815453,31.377472747059432,25046],[120.718544006348,31.3630981445312,17935],[120.72272226343,31.368478420394,11785],[120.72277480166,31.367469760767,13327],[120.74301329477,31.382095307228,23538],[120.7453845652941,31.380059868141508,29183],[120.72928390685895,31.366022400991483,23671],[120.71904716915,31.370429157531,12493],[120.82780152847742,31.30794904515,13711],[120.82780152847742,31.30794904515,13711],[120.825242,31.3137165,16281],[120.83325476215,31.33783147961,15828],[120.8355870596883,31.311292183884024,16369],[120.53791832244143,31.858129005807257,16103],[120.83243530539974,31.309585660468244,15765],[120.83186877645359,31.311838717194636,12246],[120.83049811226238,31.30094868078354,14478],[120.83584562614968,31.31020460817934,15558],[120.8321768422435,31.310592512667323,14950],[120.83144854105127,31.31090199094582,14950],[120.82847416167719,31.30855761351376,14951],[120.83720809779463,31.301406368815755,14623],[120.82824889629937,31.306475848055605,14482],[120.8120512621912,31.35554048786329,14451],[120.83511315322667,31.300495956265117,14583],[120.83725378381625,31.3124282238797,14430],[120.82672190539009,31.315883114920165,15650],[120.83198712498,31.308253484531,13575],[120.83257124327764,31.304846751232613,14483],[120.8274033381,31.310190376013,25501],[121.08024066863594,31.315691720638938,14110],[120.78664537909,31.37119810994,16311],[120.73692614037488,31.356727876074814,19505],[120.728196,31.35701,24517],[120.715352087603,31.375005570210554,25859],[120.71628768446962,31.37725446431066,25782],[120.808784484863,31.368293762207,15537],[120.53791832244143,31.858129005807257,17292],[120.807139,31.3672936,16969],[120.72736476337421,31.37739388021541,23745],[120.96004380087375,31.407138428585355,12028],[120.65951394440812,31.34716819656788,27154],[120.769577026367,31.3676261901856,16487],[120.703132629395,31.3501491546631,7142],[120.66153207756683,31.346971130318185,18251],[120.78995513916,31.3636817932129,13063],[120.66091890569,31.345441080401,6547],[120.78245620358852,31.369739800049846,16297],[120.7337620757076,31.357960727434982,9326],[120.80435160449555,31.36640774940383,16579],[120.69696698705256,31.353593402632725,16514],[120.70456948671917,31.34933342805073,17909],[120.80885193274452,31.380819189577647,13380],[120.78797878499,31.36804970535,16068],[120.78540263488156,31.360403146573827,16524],[120.80308494118,31.384979306569,16019],[120.70937376292558,31.34800209983858,17368],[120.69614971768263,31.351788725500807,17380],[120.80000766854094,31.365580717291174,10778],[120.70005107288536,31.350201591603433,19958],[120.78990119706192,31.36127770780199,16288],[120.78248339260139,31.420630981414497,15978],[120.7889254791763,31.372783346068182,13486],[120.79697661394,31.37784123819,15925],[120.698944091797,31.3461875915527,18684],[120.69920108183894,31.34523992086029,18365],[121.13352731601,31.291938606595,9433],[121.03266905501,31.253997944754,11454],[121.08168336308,31.294444268982,8547],[121.07755192186,31.302385199395,16153],[121.0702116212105,31.307095698797816,14984],[121.06927366444,31.374074888777,13111],[121.07057606195927,31.325694731103304,18780],[120.76215644136,31.374503856048,21468],[120.79548375739,31.365402330641,8319],[120.704538,31.353935,5446],[120.7848598733,31.372663337684,17235],[120.90366654142365,31.392199738332636,20250],[120.79894244708755,31.3782626981814,14848],[120.80276087457,31.364492375828,10855],[120.79178581532,31.372684063434,14601],[120.80367617307412,31.36454780884349,17292],[120.7018968895,31.353273064003,16145],[120.77668366583,31.371771786589,16714],[120.87534892356128,31.391480105014708,11076],[120.806333811722,31.367599020706127,17500],[120.87391488211972,31.378390685268467,9172],[120.79986951544164,31.36465612415158,13571],[120.64301798363,31.371821898941,14476],[120.79716779963731,31.36348622285737,14417],[120.70443371143456,31.352403098032386,8906],[120.70534698720584,31.353107036300873,17354],[120.69754398485112,31.35263435068889,20878],[120.74677668102089,31.303820753370985,19819],[0,0,37322],[120.74325236709832,31.25207013118225,16264],[120.74751941514,31.297359068126,19130],[120.63718925587413,31.232816790564442,11535],[120.634993,31.2750859,8593],[120.65690975673468,31.216376134547765,14085],[120.634503,31.2404967,18694],[120.64073823546939,31.2580727427089,20780],[120.64552269236131,31.25516872801659,22301],[120.62645129718094,31.22958584003925,15631],[120.63563477142642,31.239241478340627,17171],[120.63387450045757,31.244804041515764,19216],[120.63785582641,31.237409684693592,14587],[120.64232635498,31.2581787109375,25429],[120.637535095215,31.2366371154785,10068],[120.63850737147,31.251020009092,17428],[120.64188143163766,31.260391239367717,16930],[120.6363369621,31.253767570881,11735],[120.6470164253057,31.258103383722688,14383],[120.6461696205489,31.261486313033423,14908],[120.63521720578808,31.241691197322268,16454],[120.64266603233109,31.25025612315077,15169],[120.63827238145466,31.250810330765407,15251],[120.63857177262,31.252254547004,13977],[120.64003349102,31.260587230326,15697],[120.63665997026,31.252918387471,15318],[120.63375386734,31.244916411508,16364],[120.62902363377,31.227024223935,19542],[120.639569,31.253602,7673],[120.94274480879,31.291240337282,6159],[120.94360851105986,31.286858297438478,7894],[120.62268057955,31.254144822744,19323],[120.63844237050122,31.25195690650451,16901],[120.61976263742149,31.25014096848413,16210],[120.63968306605463,31.258212239373012,18161],[120.61197540899,31.252589104929,22566],[120.64125031362703,31.24450603437881,20416],[120.64437915932847,31.25334866978077,28258],[120.6290624880441,31.243381605324785,19915],[120.635157801743,31.249979163479505,15635],[120.618122,31.2528802,6917],[120.636817,31.261583,16852],[120.619846,31.2503658,10440],[120.63723630642183,31.25222953820174,18275],[120.621118,31.2486076,12209],[120.635131835937,31.2703552246094,10645],[120.6423808086537,31.252374182158317,19822],[120.63343866418346,31.2511611300124,21737],[120.62907803624,31.246728044635,19180],[120.65095,31.2674112,24517],[120.6418157044201,31.255403707430467,17307],[120.64223537331,31.25797060681,12837],[120.64898181804962,31.26074205621656,25715],[120.64844632825377,31.253392010801825,17379],[120.64148024061,31.260938126933,11428],[120.62358801214756,31.251450158215032,17922],[120.61314161737202,31.25404424651977,16373],[120.62658260339562,31.2508225404123,16669],[120.61564003406319,31.25215382366766,16666],[120.61338685477625,31.25328405613613,16373],[120.64457849376,31.282647977363,18997],[120.64415285101796,31.259351125661297,26462],[120.635565595,31.256560169464,11060],[120.64631498254992,31.25644522858295,27156],[120.63108387396706,31.2557034277704,24293],[120.6221485584153,31.26391665966605,17518],[120.62589945373325,31.241174912131445,18667],[120.63467870307555,31.2583062790985,16690],[120.64574479300883,31.264502545216303,20337],[120.63676731728457,31.259936509127176,18899],[120.6524906999818,31.2537949763751,15081],[120.64189760023852,31.264339857886075,17119],[120.63836278602287,31.262275833537768,16478],[120.64745424593667,31.26224527515153,12911],[120.6304601822481,31.266891671402288,19981],[120.64987202084389,31.263958040499187,25907],[120.64683025993,31.262705460411,16326],[120.63958658894116,31.264382357233952,17158],[120.67085202687693,31.17270197563766,20013],[120.83257124327764,31.304846751232613,18658],[120.6357421875,31.2559490203857,23115],[120.6357587737,31.255956672031,11755],[120.63771861473488,31.263327652209135,16566],[120.64226470232,31.243727617426,23115],[120.64374577219814,31.260764422331107,17013],[120.64815451101393,31.254196331935475,10482],[120.63401096114927,31.27876134206769,14383],[120.6397112324239,31.260291166256582,17000],[120.63846390904,31.261634241609,16976],[120.62074862309,31.192281332083,18271],[120.62493421236,31.266816983779,27363],[120.64121948557853,31.259173622577013,19444],[120.62132914804,31.252417750766,8837],[120.63271044539,31.279098601343,16926],[120.62077331543,31.2521152496338,8837],[120.64754465996,31.271221493658,17539],[120.63560320362,31.26344862544,19948],[120.63723171695,31.252288205761,19099],[120.61034312203,31.317182803109,10697],[120.31561295110671,31.134583932450724,7189],[120.40989694991,31.0928496783,16399],[120.42289719638353,31.0913368280222,12903],[120.388629,31.0771531,15052],[120.41987415130845,31.09335672563141,16684],[120.41360204210213,31.095511344790047,14252],[0,0,9166],[120.41681711884439,31.091496361751663,5555],[120.41431762508493,31.08862129183759,11072],[120.423171,31.091422,83161],[120.39815323151,31.305631208166,10489],[120.40438926965,31.304663850437,13157],[120.4027926250022,31.303848639456824,13004],[120.39617554621,31.299876820408,7063],[120.40049167292995,31.30363034049143,10779],[120.40645047671,31.298714689626,12534],[120.3956625936101,31.226010281244967,10057],[120.37402469377412,31.265222977211693,23077],[120.60792848100597,31.272121141149036,8102],[120.39353669882411,31.29995013953179,8052],[120.39489825491,31.299635808565,7552],[120.39903510729,31.2954210407,8243],[120.40559456205737,31.30195994354867,7877],[120.399384,31.294258,7407],[120.408449,31.299617,11520],[120.70650941696,31.252815001192,19898],[120.68038886101,31.273234848076,16473],[120.6774703762641,31.253627989026786,16497],[120.68432178972,31.247707453962,17715],[121.1458851136254,31.28765815790396,19004],[120.67048387073656,31.252808444702442,17208],[120.70965600422866,31.24809476192299,19048],[120.64246640099931,31.228244087805873,16071],[120.68541626219495,31.2494940901599,22006],[120.702627,31.2517997,19851],[120.683121,31.2813788,26182],[120.68033215394082,31.274195787869033,12108],[120.66868609281774,31.25541357690993,18073],[120.68914949505,31.255394886707,22245],[120.68489488028713,31.291377748640862,28571],[120.68531281602735,31.293404231639915,34658],[120.68286895752,31.281608581543,21636],[120.68619401542,31.289558740372,25380],[120.68606072992375,31.28910648213606,21994],[120.68475795765,31.289497870943,16304],[120.71758466874459,31.242068598064947,10551],[120.69174689241203,31.26227114834105,16433],[120.70798413933,31.245099888561,20888],[120.72335059858,31.252130879943,22452],[120.64246091151,31.272730504632,8310],[120.709656004,31.248094893131,18676],[120.69928677120153,31.255205272821456,18477],[120.69540614848,31.275436962893,22721],[120.57266937308,31.294792935601,19530],[120.7113826415,31.257327507446,24475],[120.66366347133001,31.278037342285973,11538],[120.94116684389,31.756405771754,18297],[120.68175403564,31.248479445732,17451],[120.686302,31.258168,18214],[120.66199013522434,31.277165463384446,13800],[120.68638547327,31.282844667518,67513],[120.68404789267,31.290834915495,26216],[120.69702923577,31.245273452051,22996],[120.53967220419,31.173786734238,10027],[120.54172233097094,31.168875155627195,11443],[120.54012514826573,31.20254793855171,15818],[120.46801407409652,31.139700932505928,11470],[120.53563965779,31.202565335654,12500],[120.55248077731792,31.18198066441861,10326],[120.54333205042786,31.178425460119733,15334],[120.5402791259149,31.17605268663921,13197],[120.42688146877805,31.227953259345533,12668],[120.68591541463462,31.26991753956378,21011],[120.75499452714826,31.25335156769799,12701],[120.68302565517,31.2711330566,12749],[120.47384896276,31.138363754728,12496],[120.50767951385606,31.172934981151485,11182],[120.46441416237548,31.133538870290653,11165],[120.46064527399817,31.13584968569116,11235],[120.50855603905065,31.16747846990976,9498],[120.50677657308964,31.16932031887654,14186],[120.46799970120836,31.13968856920546,13242],[120.68554279571246,31.286849328372394,24417],[120.46770837174843,31.135543279692723,12294],[120.434439,31.2249339,10894],[120.6961529075655,31.274961156970882,25676],[120.50673580079916,31.171270825979988,13915],[120.47823670096952,31.137440739587774,11961],[120.356392,31.188244,19873],[120.47113646277796,31.13421416762704,6049],[0,0,5042],[0,0,8970],[120.45997270632,31.136127969091,11321],[120.42634078318314,31.099282021585495,15850],[120.467702,31.125095,6292],[120.473389,31.135145,13242],[120.96373817107,31.391318573387,3496],[120.509053,31.171962,7598],[120.4634176325478,31.13480109604101,10894],[120.51623592675,31.154957069677,7974],[120.50949760246245,31.173083584014197,12337],[120.475482,31.138396,13158],[120.41640313992,31.220434016464,7817],[120.489435,31.174078,4175],[120.63562325388,31.27732157157,12670],[120.86717858748,31.248587530355,19280],[120.89300815912404,31.279811353185718,4794],[120.8767087649677,31.268235298606097,16342],[120.87595259205042,31.270748892903054,15229],[120.88648657128,31.282981499896,13636],[120.87000691184,31.272116700199,7853],[120.88200333811807,31.28030363278894,14474],[120.87340166115,31.272377539111,14918],[120.88857996301091,31.28326213038949,13825],[120.89477153463675,31.28259027081291,6353],[120.87624182666191,31.237523955851902,31476],[120.87918314839324,31.241145949790067,17199],[120.88371852942151,31.28446223661263,12427],[120.87786384392126,31.279870551647182,9914],[120.89639625310076,31.281973645948998,8352],[120.88132225276176,31.23247497521886,15235],[120.70089818665923,31.43555049442157,17397],[120.8015798639801,31.75325203703704,14098],[120.84426936030673,31.2738682139812,10979],[120.8730440216397,31.27554225848374,14728],[120.84447973177919,31.25232387289993,13041],[120.87410309329356,31.283430797538244,12195],[120.87861335320825,31.28670112449085,15924],[120.87995067687,31.290135597924,5161],[120.8764478979459,31.237717162249396,16826],[120.87167033551,31.275155924313,10869],[120.88343914023842,31.286495829709274,18469],[120.8844352658286,31.27924070820189,11459],[120.88314776496489,31.281532838591463,11000],[120.87219696625567,31.27913710280262,16292],[0,0,14997],[120.87364929659,31.262894545889,14915],[120.88032887778306,31.265638086447566,13184],[120.87312968135821,31.127377642886206,14593],[120.85138471818,31.270989074706,10867],[120.87375496936606,31.278458309146046,16108],[120.86540281488696,31.130891866635316,17875],[120.87839540722372,31.281270259048924,13095],[120.88953501897149,31.281188179388693,9672],[120.87367266255,31.263641901222,14128],[120.83968519069,31.286206032588,14268],[120.8839234434,31.27993259899,13084],[120.94611559280597,31.30064112230703,9695],[120.87842826723929,31.26709318263835,15871],[120.8930644631,31.27264245638,10569],[120.46986394115864,31.130446942489804,16547],[120.88078222203154,31.28372928226965,16090],[120.96022941504636,31.38765357583842,8175],[120.875497,31.26867,15076],[120.88580631394,31.268223272793,10938],[120.875527,31.277344,11475],[120.88036130571365,31.28755254602597,17500],[120.87105,31.26964,13693],[120.87611071897274,31.28747237954578,17765],[120.87577313712,31.27799257432,8733],[120.8733871914123,31.27283156388836,7000],[120.86835890286,31.279296864266,14068],[120.63029713620482,31.269173954711384,12313],[120.62312403735164,31.27306134864675,19359],[120.62944760149759,31.275067467413898,17797],[120.62259789981445,31.27654701379619,20934],[120.62561625262,31.278200292593,15056],[120.62781781358,31.277964096651,17187],[120.62677480753746,31.276192847677436,16445],[120.62607427566347,31.273524957043435,17541],[120.62990302091,31.271510468392,17385],[120.62854139808557,31.277502685379634,17539],[120.6280331646755,31.282197439187126,19220],[120.62559940801495,31.280481904155625,19446],[120.62604958483823,31.267996849404877,21069],[120.61961566116547,31.26829826471303,25749],[120.62212130831767,31.282892347753613,21069],[120.61767761014636,31.27070947184423,21880],[120.61844259454237,31.26786196815325,21707],[120.62791676673905,31.281166571031967,18035],[120.62462128087397,31.28211592888375,18810],[120.6218889427331,31.27262785452056,16832],[120.62828354577708,31.273788038684515,18590],[120.61830055537345,31.280650395939375,18840],[120.63315227091229,31.271144194962435,18227],[120.62669659836484,31.27277801423618,15464],[120.62507369268134,31.281259078755436,19446],[120.62230346401407,31.280730228026485,17364],[120.62476396682287,31.279234311465213,17472],[120.61685257043378,31.27368708517228,23301],[120.62394458471,31.275844692332,16960],[120.61984180149285,31.274780842305315,19032],[120.62142335098727,31.276983062008068,17497],[120.62518699595532,31.275231390127104,17346],[120.62123578417,31.278277380575,17934],[120.627199,31.277733,16708],[120.62221959871,31.284615820976,18754],[120.63135745650337,31.27116194227912,17529],[120.61937828303614,31.272983802141045,18813],[120.62721,31.277496,16708],[120.62810180235,31.273723296095,15765],[120.62837961326322,31.278805179142704,18442],[120.62271726754894,31.277805028071498,18538],[120.62513543321904,31.27567736737468,15333],[120.630664,31.281411,20390],[120.62793289315,31.281106468099,17618],[120.62628639523845,31.28201742673725,16960],[120.63226753042,31.28302799237,15350],[120.64821801402704,31.271600725787444,17977],[120.6329925845316,31.276912747257846,18864],[120.62312403735164,31.27306134864675,17424],[120.692016,31.2725803,11984],[120.640084,31.2721574,25854],[120.64416639464,31.273052261094,17049],[120.632804870605,31.2777614593506,16400],[120.65151543214726,31.274575537365205,24696],[120.62988362012771,31.282638097434255,20390],[120.63545705964738,31.274027336368764,22727],[120.64944310957,31.272871841867,18453],[120.64117139119983,31.27777952097188,19259],[120.647811889648,31.275691986084,22373],[120.63844972403014,31.27614043672296,21583],[120.65271140466255,31.27473672572226,18734],[120.64571085233175,31.27926928685036,20845],[120.63855378194378,31.282848203909744,17220],[120.628410339355,31.2861423492432,18021],[120.63561639006,31.272369897143,10384],[120.64620564058,31.270633315525,35128],[120.64809219915392,31.27750120867178,23703],[120.87375496936606,31.278458309146046,18836],[120.64301128257927,31.276226655179933,18078],[120.63293343830024,31.275604161204328,18500],[120.65229147109089,31.273162447974325,18007],[120.64664527960458,31.278703974972533,15762],[120.64764019248233,31.27771823617611,17026],[120.64563339672,31.273555066261,18453],[120.64737349455947,31.272753678841234,17522],[120.64169224633,31.268707489914,17371],[120.63622758209688,31.277711911476786,18791],[120.64454829498482,31.27615974361319,17671],[120.62530266536601,31.27236677395238,15800],[120.643653869629,31.2692794799805,19081],[120.63951154847,31.281640503687,18431],[120.63538004971261,31.282256933252437,17777],[120.63294061061,31.279017356928,16445],[120.63206254986,31.281539038006,16829],[120.65408198081981,31.271188177436734,16025],[120.6417679190585,31.27448063123118,18078],[120.64289514517,31.278144403648,19259],[120.63453479288,31.27601730406,16807],[120.63321269072,31.280632964294,18048],[120.642563,31.278075,16525],[120.642939,31.278139,16525],[120.62923163897163,31.269802654500115,17186],[120.621714,31.247917,10384],[120.63521130777,31.285709679198,28000],[120.63769822031,31.277140449989,17759],[120.63535771305,31.282603416297,17055],[120.64114025601,31.273229337865,17514],[120.37532726233,31.218991701403,63000],[120.48581098486005,31.249944926699005,15064],[120.49560546875,31.2604427337646,9546],[120.4237,31.222381,12904],[120.460223,31.2857908,18525],[120.42986781627646,31.223417870261553,13412],[120.478688,31.2368095,14500],[120.49434332415325,31.23310571544235,15686],[120.486923217773,31.2299404144287,14192],[120.469582,31.22963,15716],[120.48159837937439,31.239494747975524,18134],[120.48840591908841,31.239404328146094,13850],[120.485191345215,31.2411918640137,16025],[120.48535503193236,31.241765557523756,10144],[120.49043621530373,31.243898015491048,23038],[120.48923527066745,31.24364207050853,19424],[120.48374604459443,31.240852628150062,16695],[120.48863562928189,31.241333747323534,11235],[120.49925181503,31.245316662932,21274],[120.48446037444104,31.251462933188098,12290],[120.59724480301,31.301351766419,19241],[120.49181309272,31.245652613858,14411],[120.47631202038,31.231863673195,33986],[0,0,12506],[120.54605903427,31.282194685675,10019],[120.492404,31.245185,7585],[120.485449,31.240671,10384],[120.4967690113354,31.237364751473528,8326],[120.54252225046827,31.178321393760864,14647],[120.60792848100597,31.272121141149036,8102],[120.495232,31.247928,18525],[120.49024489137,31.246932845401,12793],[120.48546471862834,31.242685595670363,16025],[120.29880475670952,31.0854784037869,29107],[120.46298663095395,31.228655132986496,20687],[120.32721915980414,31.140511827783396,8542],[120.55725407756,31.878176818107,6000],[120.313165,31.1208588,25528],[120.31831600358966,31.135707387672934,7706],[120.32288038424,31.112264643184,10534],[120.36704881609904,31.198588749699866,16969],[120.31222184780655,31.100963365613296,26113],[120.31505155777317,31.106648137553446,9985],[120.34395089502,31.173930394606,18890],[120.38728135110028,31.22263082432001,18250],[120.31547512055,31.141050650362,7816],[120.32950996725,31.143524795512,32556],[120.31739802181,31.136246735086,7011],[120.73896656727,31.808009662561,7841],[120.31032563135,31.1103084434,13854],[120.43275149928,31.232053982612,12574],[120.43160656025206,31.232187812594233,12349],[120.43101,31.3423559,7817],[120.41237225287591,31.220277564466407,23275],[120.4439446364146,31.226492403374824,14593],[120.41515615285475,31.23104640138568,10238],[120.4272688082326,31.247877505688432,9782],[120.51770489444,31.87772415897,11803],[120.42480538232,31.222806280894,25000],[120.62955569639622,31.23217321482066,21218],[120.61369028890294,31.220493597428025,19140],[120.60733970462556,31.2207446748114,19238],[120.59727303471,31.209404873129,18176],[120.5897285320008,31.204781382014893,18910],[120.59679663975,31.219875977503,20412],[120.59539130879,31.215235258703,18565],[120.62425130811,31.233841902341,21848],[120.62907306559148,31.22908670720736,19246],[120.60683337472486,31.226865988589697,20520],[120.62775578949334,31.226803825930094,11000],[120.565464,31.2185325,8326],[120.62617782693283,31.220021799674473,19343],[120.62948124034402,31.222753378333145,19542],[120.613563537598,31.2186908721924,17847],[120.608773,31.2215314,16864],[120.59318393780597,31.212209531306083,18081],[120.60683337472486,31.226865988589697,20515],[120.598762512207,31.2227535247803,20390],[120.598670959473,31.2212295532227,7332],[120.61543498505085,31.230437032618667,22727],[120.59357402427877,31.203345894609992,15057],[120.6161244884281,31.225520345544233,22560],[120.607421875,31.2223224639893,18302],[120.607376098633,31.2183589935303,10791],[120.60683337472486,31.226865988589697,20515],[120.595465,31.219417,19294],[120.60585161753131,31.23565953120196,21436],[120.58807835981,31.212115382014,16216],[120.59046533206144,31.213340056490477,12083],[120.59597244519378,31.219571925251437,19882],[120.61633963169943,31.21778689902744,19152],[120.63909492798,31.273819062836,35467],[120.60870822359,31.222087891427,20480],[120.61543498505085,31.230437032618667,22727],[120.61190287384,31.252580335289,21202],[120.61612253916,31.219017272285,19152],[120.59204278438443,31.21785643207037,12941],[120.60739654781,31.220514711899,14993],[120.60777001991401,31.21719043805443,14999],[120.87432318663,31.055518702576,13926],[120.85558196772959,31.026776322049336,6476],[120.8450536406,31.068804667823,27131],[120.86763320779,31.040668995368,16329],[120.83194956286471,31.029092305534963,7058],[120.85741328568122,31.061689027688683,9565],[120.8685693993012,31.060348380000523,13599],[120.8685693993012,31.060348380000523,13599],[120.86378824188539,31.042428937597172,14421],[120.86457940470058,31.03267915508873,16941],[120.71923783455,30.998094695136,24453],[120.64597831274,31.272036704697,11111],[120.85991979520671,31.026687508824903,5988],[120.853927612305,31.0463752746582,5480],[120.65915103102,31.14956005835,19625],[120.55131779956402,31.01796115320254,8069],[120.53997614812741,31.016821977931734,7968],[120.60677355566266,31.071948162472097,10144],[120.6432928285939,30.977017321716378,5975],[120.64637101615273,30.976551561318846,6640],[120.65444029243012,30.983492697363715,8732],[120.64158870768,30.984194466317,5184],[120.61669980549703,31.149007717733593,19402],[120.64644800093492,31.134524508085097,17592],[120.62222105574,31.14191632822,16097],[120.63689265875068,31.13469544275093,12470],[120.67146576267594,31.189125858739345,14361],[120.60587609819,31.134288606631,16398],[120.65538014819,31.137159750974,15652],[120.6241947164,31.079641715943,10000],[120.64725079950138,31.1549250741936,16171],[120.66505938464334,31.126483282358496,7194],[120.6570023926938,31.155549933320838,16181],[120.65715177551027,31.15666832666345,12649],[120.67085202687693,31.17270197563766,11387],[120.63263210620843,31.17416696599829,16500],[120.66408852659053,31.14971992131735,8991],[120.648719839,31.160931981312,10449],[120.64182600079785,31.155858036884197,19555],[120.65761158666014,31.158153972001333,12012],[120.65495595056,31.163910764764,12124],[120.66015054775,31.218678641372,14569],[120.65353732528,31.184589460301,15389],[120.65204612651,31.133597858543,14188],[120.64332119532,31.1276973974,15052],[120.62540436661,31.143226144672,16229],[120.60446002551664,31.132423078383535,18468],[120.69523856640386,31.162163364771818,12162],[120.95915222168,31.3859844207764,5562],[120.661942,31.1481461,15404],[120.66714847585257,31.14053934283782,11984],[120.66850362467,31.157606913267,13483],[120.65542237750516,31.102001826744356,10632],[120.63636835645165,31.119237619989303,15000],[120.65029410585726,30.945116824160152,13510],[120.63164,31.153144,10940],[120.41137433158,30.962085147085,7507],[120.632311,31.1664876,17403],[120.6701092449,31.138580513191,12914],[120.60912750147186,31.075715330300742,6456],[120.49747844206,30.806121180257,12857],[120.65682220459,31.2149677276611,14736],[120.41946335619873,30.96789601856141,4822],[120.65775437860908,31.17510073745899,12497],[120.63834798284637,31.14695478582574,16906],[120.64038553152,31.175970867441,16476],[120.65630776448361,31.148138349764576,15999],[120.63129112292958,31.127121357427605,13561],[120.6350593429676,31.161053197938053,14398],[120.66788502977752,31.16909401524259,12409],[120.667202,30.9063161,7930],[120.66948845929925,31.171600165073674,11056],[120.65263380723599,31.129933926885094,13795],[120.649599,31.1667475,8105],[120.6340881255926,31.13216280344148,14155],[120.637150839839,31.123822500676706,13997],[120.65513380674145,31.17498070358584,12857],[120.63279279419976,31.17687397236357,18436],[120.63743065734,31.1663517587,14166],[120.64743312677415,31.167069845311197,11431],[120.63141231186,31.165148316714,15384],[120.63925733751412,31.187133573567923,16813],[120.64774147103874,31.17675739748721,13695],[120.63938678064319,31.18230755321274,14360],[120.63672239751754,31.18070046001052,14667],[120.64046032040561,31.179960465755865,18070],[120.68451889451592,31.186912578586377,13924],[120.66025391997873,31.14003910554138,14432],[120.63686346831314,31.13353625752215,12883],[120.63568759628194,31.170410034964327,14503],[120.63278665787482,31.163695167339124,14814],[120.6609235240923,31.16402951569714,9632],[120.66906032689319,31.174893961255744,12924],[120.651588439941,31.1671562194824,8526],[120.642936706543,31.149829864502,8936],[120.6479233114299,31.206607114658667,12216],[120.64113293923249,31.145313503358025,16880],[120.65736516497,31.150265161576,11137],[0,0,12962],[120.6397701217399,31.129992458573295,10795],[120.743271,31.0891425,9701],[120.638854980469,31.1772174835205,16186],[120.65506790794754,31.17303650933008,12857],[120.66829830564,31.16790588966,8004],[120.66819723765411,31.164035068701537,11516],[120.65339287269701,31.17719550925638,13256],[120.6692056727247,31.17194722334395,13378],[120.75279317649603,31.677237049451143,24209],[120.66185548641482,31.16279497940141,10553],[120.63126093936,31.157530551257,14705],[120.63338106932568,31.157416410164387,14401],[120.65655502038031,31.16409238730933,12237],[120.68449287124,31.169284813429,9734],[120.66957748137528,31.18719419569183,13193],[120.6505532687935,31.17472254349959,11919],[120.66716657940351,31.16580369650869,9834],[120.61831694495747,31.088964498194265,11351],[120.650583526418,31.17828215789753,13636],[120.65884736039764,31.170272268338355,12596],[120.65491490708,31.176074181943,13548],[120.6323764295959,31.161093223737183,14862],[120.64327057549,31.168164029657,11420],[120.63871808202155,31.16829922371924,12563],[120.64436815598428,31.17827029431739,11458],[120.64462327564742,31.150969772637133,14250],[0,0,5975],[120.64239904964539,31.176935012657072,18870],[120.634454666,31.172431546691,14218],[120.64675459260548,31.175701673685595,13953],[120.63698812527046,31.175650308418344,16186],[120.64568695363,31.16668454103,12168],[120.65485351026977,31.159660503748427,12842],[120.63782319546236,31.16044123979734,16528],[120.66766245351,31.165781580486,10940],[120.65307189825693,31.173799415154676,12252],[120.63797796182375,31.1747666612955,13200],[120.64417392706183,31.148288277109227,15142],[120.658699035645,31.1795692443848,11248],[120.64150157147479,31.129627625697307,13141],[120.63708358550208,31.175303492255455,15251],[120.3968306566715,30.954460589358554,11914],[120.64165824673539,31.152541925840985,15331],[120.65138849529058,31.185091670888077,14351],[120.64714220334828,31.15212912214737,18576],[120.64338355295888,31.176077462515124,12418],[120.65474042434,31.17082831546,11349],[120.63473375483042,31.16814820069089,11441],[120.64325496142344,31.15324306779131,14516],[120.63968623527647,31.174514703613013,12439],[120.63515438818207,31.17320990226028,12679],[120.63875070218954,31.156644666268523,13260],[120.6481796456021,31.161019102222543,11447],[120.65109520842292,31.176715038073038,12139],[120.65373385779061,31.175781441263645,11964],[120.64459886868671,31.155589002083385,14254],[120.63875070218954,31.156644666268523,13016],[120.64358795916,31.164191969153,12232],[120.65639087167,31.170571351559,11523],[120.64118674683422,31.164357946338537,11807],[120.6485054834682,31.175402583226195,11423],[120.65134761430511,31.183402021385522,14267],[120.63604897740215,31.171893118952053,13707],[120.63971713608771,31.170384339220913,13486],[120.64521280480785,31.1542088550314,13376],[120.6503045163198,31.1716229521573,10795],[120.65031742317339,31.17153087330332,11684],[0,0,10000],[120.64781357802202,31.18150353188614,14375],[120.64699825311,31.161870751143,11500],[120.64249024292585,31.170343590506924,12223],[120.64254824022449,31.17364520753926,12176],[121.11666152131,31.456109665973,11971],[120.64940288617,30.982768607496,10273],[0,0,29384],[120.67903802634,31.186698363793,15324],[120.66993909291,31.138455368169,14166],[120.64365429391,31.135131023092,8085],[120.65226570818,31.226549565275,17345],[120.53015980397,31.256996110491,15048],[120.61828053242,31.143799999606,15613],[120.65261158188,31.098703782474,11425],[0,0,14049],[0,0,15122],[0,0,15228],[120.65022983117,31.143241219516,10960],[120.6009177472805,31.148976109140996,18394],[0,0,16111],[120.6142974815,31.134741372151,31964],[120.59606007395,31.135912327688,26982],[120.66203874237,31.147667729451,8015],[120.95725109112,31.403758022908,12903],[120.62334811341,31.148948332998,20555],[120.67783918578,31.078348324577,8677],[120.64761621092,31.18876771821,13253],[120.67268379398132,31.16247237124721,4428],[120.65664274656,31.217875052758,17782],[120.77703088536,31.162874006151,6864],[120.87435050639374,31.086960635992817,19625],[120.6399037067,31.17164692375,11000],[120.63173882494,31.129511978281,25006],[120.65348590843,31.165235288868,12155],[120.62882091684,31.227665802127,13863],[120.69437562897843,31.16245594911882,9308],[120.69443602205786,31.161447256634467,12444],[120.65604108632347,31.170226646621188,11953],[120.67961910956939,31.082558284982657,6987],[120.60825167901,31.143285011272,16756],[121.12951730014,31.300124474151,13924],[120.65981513035,31.184537610359,10000],[120.64967839737936,31.16430700970055,10465],[120.65752050117632,31.159284517575085,11139],[120.63590003655199,31.13193477092189,12643],[120.6398440244359,31.123352070763378,14802],[120.67963938881627,31.071936171555713,9455],[120.63175167697811,31.12976251879899,12185],[120.65901992147,31.143942540803,8108],[120.46962455659,31.149467738667,9523],[120.66905265686,31.211406148076,15122],[120.681721,31.076182,7742],[120.65690975673468,31.216376134547765,14085],[120.56126313945,31.2958842016,15142],[120.68388801186134,31.0761546538822,9243],[120.66926846315,31.164359448069,11516],[120.673648,31.185909,10350],[120.683213,31.08778,8047],[120.653442,31.170431,9706],[120.654,31.164553,9747],[120.66866509943,31.146052606581,6579],[120.64998486367,31.140262535089,12958],[120.65712924365,31.169785967983,10000],[120.64515872789411,31.301941289865717,11046],[120.6340881255926,31.13216280344148,12500],[120.649606,31.157667,10000],[120.7409387534099,31.694094706341073,11984],[120.63782314785217,30.98607955313271,7926],[120.667202,30.9063161,21775],[120.52167731814323,30.912374721238205,6225],[120.851776123047,31.0399742126465,11149],[120.65923243292,31.165255797331,13969],[120.66221,31.147779,17243],[120.649599,31.1667475,11342],[120.78649496450035,31.06229283195548,10087],[120.63111945045848,31.15079868850604,18055],[120.64959962841,31.166747511931,12203],[120.64084453449,31.172252574454,10677],[120.65446339356,31.162542406101,11520],[120.659956,31.170867,10000],[120.65749038099257,31.159354763677584,11133],[120.65232,31.166713,10483],[120.65503521615,31.189074174682,10178],[120.64959962841,31.166747511931,14473],[120.65126504346,31.168747210502,10745],[120.65166928565,31.173682469761,10251],[120.647484,31.147041,8492],[120.675941467285,31.0773334503174,5574],[120.679393,31.079834,8727],[120.64959962841,31.166747511931,10810],[120.64740122165735,31.173079860894834,11423],[120.63454943891,31.173306404735,10143],[120.65418874076,31.168023732995,10461],[120.65368741592,31.1673176456,10400],[120.64856722306,31.168168195887,10869],[120.64690625369,31.164486788719,12374],[121.1073827576198,31.464750520064623,9647],[120.64116759997,31.164457422542,11807],[120.65698341509159,31.181097694153976,9869],[120.64995136089,31.176364699316,10526],[120.654662,31.17897,12928],[120.64959962841,31.166747511931,12226],[120.6523300861,31.170593013328,10634],[120.65692729614976,31.15012198266263,14294],[120.62634615184,31.323779002937,11408],[120.64809452413,31.2081160021,15565],[120.64009090484092,31.165527953000016,15475],[120.6495104007744,31.169467799519122,10869],[120.68671767331948,31.169347250310224,11358],[120.65253014816997,31.177496159718732,10914],[120.63873423085973,30.902508765688175,11019],[120.65647587517336,31.37335055178787,7419],[120.68125081658,30.89953531443,7762],[120.63909525728,30.871554387326,7740],[120.65229414175317,30.88674874078853,9133],[120.66000262260553,30.925235674279826,8258],[120.63232376374044,30.91129550554962,11043],[120.66613904905272,30.920594460178254,9572],[120.66698164503,30.906545247221,9572],[120.69066390157734,30.900021812473955,8105],[120.68754673205092,30.92320190211021,9200],[120.6789605743763,30.908980528230355,8506],[120.66378077430926,30.896294145646813,8353],[120.65748843885606,30.909617104839068,10185],[120.63537288482787,30.907680625000847,26766],[120.67412304289991,30.919112548899843,9838],[120.6547208206646,30.910294183398914,9073],[120.64770271548,30.904200919752,9475],[120.62951174140932,30.911377295781428,11593],[120.65232202515621,30.91184237758014,10237],[120.65714393476,30.893691364634,6632],[120.67420500383,30.906076323341,8579],[120.67030999472203,30.89634698420044,6547],[120.64684431805473,30.985618591833823,7032],[0,0,6029],[120.63440122458826,30.904709714005687,9678],[0,0,25231],[0,0,7424],[0,0,6129],[120.6296595126657,30.91443389077284,8902],[0,0,7000],[120.66925891287,30.898443343222,6765],[120.66795521557,30.897756916467,7079],[120.67417491914479,30.89919262268792,5641],[120.67635299290465,30.90354473422011,6939],[120.67659854036,30.911374281212,6029],[120.66564962975325,30.88497270497141,5851],[120.6789605743763,30.908980528230355,8506],[120.67236998262938,30.914342175479728,10000],[120.67279403696,30.898388745881,6080],[120.62967354509608,30.900267482431342,8526],[120.624785,31.3851653,7361],[120.629399,30.907041,10568],[120.67964632553142,30.911198056330072,6718],[120.68606072992375,31.28910648213606,11076],[120.66810902135812,30.897869927246212,6541],[120.64267079335029,30.89367862995176,7760],[120.6725435269,30.899018498044,596],[120.68191130585784,30.913865603447395,8842],[120.63224664926,30.869082511933,8151],[120.67668838293,30.911448678245,6900],[120.7294327947091,31.151286202290244,11046],[120.72703767776176,31.155509512533836,7570],[120.741574,31.176661,20328],[121.13974274039573,31.45005077155554,10475],[120.73218852831866,31.159452351518947,7357],[120.72058313887584,31.162077733988635,13522],[120.74753627744,31.157321183718,12153],[120.73219680634,31.15789278002,14617],[120.72240896907911,31.156271650593617,11054],[120.73223631368025,31.162581479186763,17326],[120.72833975902219,31.15371827796321,11999],[120.73663028615007,31.177916340520174,18813],[120.73218593580896,31.151204316781776,11407],[120.41844878570153,31.34002447980013,10698],[120.77237474939,31.161329415246,5597],[120.726931,31.160743,8783],[120.72103082918946,31.135380386021282,6299],[120.72746663660887,31.15678885716852,13793],[120.73085388887331,31.163548284194867,11627],[120.723663330078,31.1594429016113,9720],[120.73475400082121,31.15826505064786,13139],[120.53105758238019,30.924846635289523,7768],[120.534698486328,30.9268970489502,7000],[120.51879906823838,30.91880331492989,7467],[120.51319170061791,30.908441197715884,25428],[120.542470332003,30.916303947509586,6342],[120.67030999472203,30.89634698420044,6547],[120.53111520774,30.92939528727,4954],[120.649816,31.1636416,19196],[120.51809872141534,30.915237275143728,7168],[120.51800398252301,30.92047786849949,7611],[120.60673470484765,31.51763884233195,9278],[120.61230716790922,31.509113871887074,8737],[120.60994285475611,31.510584415650406,8009],[120.608008,31.5160336,10609],[120.60905512050539,31.518215276951846,8649],[120.6136165272409,31.501977468103004,9256],[120.6077977020966,31.501085185872146,8958],[120.620617,31.331803,6170],[120.58483228504,31.488624709227,9210],[120.56780165325,31.423260839946,14647],[120.56737807198006,31.438306058331925,9791],[120.5585093711717,31.441174228145897,14968],[120.56176430303452,31.433433958343983,16374],[120.56159917921059,31.438292780959678,11456],[120.56541492230498,31.438759038109854,10838],[120.555523,31.44093,14337],[120.553516,31.44106,14337],[120.553046,31.4338839,19994],[120.56294085238808,31.444923070099076,15106],[120.64234174455,31.409765063,8038],[120.55475141786737,31.449983960027158,8612],[120.55624053441971,31.433010516792432,16616],[120.56052131949698,31.43661830916576,11243],[120.55354820950119,31.431837755127646,16616],[120.56193389143682,31.432398063967955,14361],[120.565784,31.4352913,20756],[120.55200282937983,31.43784072157937,12538],[120.58139094534216,31.44107074581544,11050],[120.56181513544841,31.435347371038127,12142],[120.56522995401403,31.45003689646295,15545],[120.56558544494504,31.44997448813254,11243],[120.61967544788868,31.469323061586103,9815],[120.55891575380475,31.435908779882265,11071],[120.565887455,31.438242580615,11318],[120.56607939170428,31.44117022302938,10295],[120.57005933426623,31.439934174197123,9171],[120.56282677297814,31.440430329780927,10684],[120.56537494052336,31.439720590561617,11199],[120.54288848064162,31.430141357513897,10915],[120.56481827609,31.427187553323,14076],[120.51329053398673,31.430836205819556,8500],[120.54413372153,31.448966852437,8497],[120.47265265163,31.131083684648,6590],[120.545819458385,31.429234670271203,10639],[120.64680257853,31.450765278283,10488],[120.52692332530451,31.440576564185598,5825],[120.56547315522,31.442228062188,8067],[120.56691158192872,31.431795928252885,8897],[120.55258905277597,31.44501579330129,10738],[120.65600875630817,31.326835639807758,11235],[120.56238962248307,31.441674444581757,10022],[120.56730438128416,31.395489381070995,5088],[120.59526420675682,31.407127374263453,11931],[120.60137081395261,31.38467959020376,16170],[120.61116354863906,31.38588947915869,18098],[120.5888480246179,31.39121745011718,10217],[120.59402902859587,31.382309086371933,12900],[120.5115849015522,31.43421833114713,8225],[120.59802047755309,31.380678700959525,8275],[120.59876715736,31.383184876522,8275],[120.60639008341333,31.392130192313484,24584],[120.58578674586369,31.420135066833986,5640],[121.12815255642,31.299635161279,8240],[120.59970208750165,31.385869694280146,13872],[120.62965526996878,31.497668568799018,9423],[120.65019889265965,31.36454761574557,10205],[120.63078996629,31.42841177733,16378],[120.64576724336,31.426137329654,12683],[120.65639261037,31.421083326262,17491],[120.72003343235,31.328522693779,19367],[120.65372181921,31.406623401483,6987],[120.71244433363,31.439707674929,11875],[120.69166427525427,31.436206490360398,15512],[120.69115073914678,31.440468022226135,15544],[120.69722800867,31.437504853733,12505],[120.71939822360308,31.46076226288637,18327],[120.7036087076542,31.435956801167457,10599],[120.71276262046197,31.438009130914267,7285],[120.69843617469719,31.43872198619122,10889],[120.69192683309,31.440292359419,14448],[120.64494602427,31.427908131389,15046],[120.69185879882093,31.441951395629413,11018],[120.45903910374633,31.425028892880874,11657],[120.44401701827937,31.434826756404043,8067],[120.44772589175,31.434226373871,5921],[120.462422204941,31.42062611866624,10878],[120.4595632650114,31.42511848438818,11501],[120.46277267075098,31.42622295183661,10257],[120.44964241668804,31.43453970888996,9029],[120.50780622578,31.363880097544,10919],[120.62880658366,31.32340445426,20367],[120.61879430722,31.309597544956,18000],[120.63789678851,31.315498876602,27135],[120.62274711669,31.317886500162,22021],[120.62310082606,31.318308533558,24942],[120.62027146414,31.317874655603,36688],[120.63941207699,31.318711307709,19038],[120.61887328075,31.320213023188,23121],[120.62831823139,31.326238678513,21606],[0,0,41481],[120.63645354186485,31.319709012132318,21699],[120.62450653107,31.317489402637,23505],[120.639916,31.317748,12416],[120.64433691291865,31.31482281882643,30691],[120.634254,31.314074,19714],[120.65590081306,31.31663679065,21020],[120.628165,31.325834,19583],[120.631063,31.321362,19583],[120.633261,31.315409,29902],[120.60717067447,31.072555410973,22869],[120.63672935486,31.319137781878,20439],[120.628079,31.323301,21428],[120.63196631144,31.305094720518,29541],[120.63771124808,31.320773267872,20538],[120.63821170001914,31.30600298466773,27215],[120.643467,31.316152,30012],[120.64351630637,31.323600972522,14285],[120.63208265854156,31.321182078560305,21732],[120.62568785226,31.318942538605,18596],[120.64941878373,31.326614503191,18920],[120.63136,31.320026,19960],[120.63135937465,31.317074331227,26997],[120.63875460042,31.316209953267,31983],[120.62604991838,31.320142380531,21630],[120.62610442393,31.320242031843,20833],[120.62531566654165,31.31254556932432,20833],[120.63777265499775,31.32241490140787,34624],[120.625192,31.312522,20833],[120.62134444113637,31.317174511111528,24500],[120.63311263353,31.314579180257,13829],[120.630777,31.326708,23209],[120.61976045199,31.318560128924,19285],[120.637,31.327,26875],[120.64363155085594,31.312314964309593,22292],[120.61707068317,31.320679498651,21138],[120.96647200234041,31.390181770704213,8164],[120.65167047159353,31.329393572120814,20308],[120.64866327083104,31.33352759825662,21323],[120.606013703286,31.348426201396556,20339],[120.62784420811,31.328314350758,21500],[121.01889021830624,31.25141191455436,10714],[120.65050193063361,31.32504835997137,27384],[120.65046453237862,31.327759638029747,22328],[120.65396347725525,31.314481101447843,32860],[120.63303873318058,31.34408915685911,19849],[121.19582877189441,31.597803853210173,20400],[120.63926207295,31.334781500501,17368],[120.65310552273047,31.324765971819456,19230],[120.63433737371,31.321981555206,11546],[120.65503334923628,31.331763698521396,21440],[120.65094038367165,31.32192139491667,23147],[120.64936779196,31.330157257592,17754],[120.64824960114369,31.331403382796122,18544],[120.64514035107864,31.32895976867211,17856],[120.64126106275076,31.331523916089022,18862],[120.616755,31.319024,17126],[0,0,7505],[120.63473919056,31.333998337702,16717],[120.655687,31.317531,16839],[120.643631,31.327334,21512],[120.64402086697,31.327824315246,22569],[120.657098,31.332222,16816],[120.65414745920675,31.3183199142502,22722],[120.63710406686769,31.337731604037884,18428],[120.63679653601,31.305591218443,18902],[120.64008632358,31.328785567404,37002],[120.62535009949015,31.302113443858058,21920],[120.60279990483248,31.339408367376663,22210],[120.60387206928917,31.331569833313008,21609],[120.62882644120356,31.340334386470108,25916],[120.6196195615,31.339117174295,10647],[120.616748,31.3436779,28692],[120.62253,31.3455677,11977],[120.62551751848466,31.343167373793,29801],[120.60315576137381,31.35039117155668,13351],[120.616807,31.3373528,12054],[120.60761964357164,31.339829202011142,33165],[120.63154634140632,31.344226400676366,20190],[120.60821556687067,31.335752455460973,20456],[120.63716955423769,31.34521181816335,18369],[120.61811787237171,31.342989992613358,19913],[120.61580137063108,31.342182744188154,20830],[120.63437535069465,31.34430426770465,17531],[120.61256670184564,31.343256862384013,20291],[120.60967898649562,31.34413981035188,20249],[120.6129834832,31.344952871809,22002],[120.6025765214047,31.351189194611766,21367],[121.10860804004727,31.28764126235683,10942],[120.6272335245,31.319610831189,19718],[120.62102224197,31.309413339338,28032],[120.63585437487,31.337068120991,18428],[120.60843711073,31.337375455797,6074],[120.63318162933297,31.33402432125916,19214],[120.63217196178722,31.32904163064673,24801],[120.45832617701,31.423998389864,10594],[120.64327814934,31.243564740975,14771],[120.66626291370457,30.9160500660059,7031],[120.62909296034,30.90825565221,9708],[120.44781525641,31.426786628184,12359],[120.56550467560172,31.306138110489012,23308],[120.58374418071,31.277521925762,25057],[120.5068363023213,31.373697603081983,13407],[120.51566642926,31.374988646379,16284],[120.54044116944924,31.288152097718623,22390],[120.56840670994156,31.31476703477453,23666],[120.63162238944,31.359029305914,10414],[120.67779088824,31.327332015559,10510],[120.484078118,31.338401690753,24657],[120.48493851820976,31.339433415582143,22273],[120.55881999623399,31.270858755454196,16738],[120.64518737793,31.3676280975342,10236],[120.65682379748,31.302479399949,18533],[120.65680374588,31.302469584291,17796],[120.63845638501,31.306933652639,23306],[120.60155007890187,31.29982516590193,17173],[120.60384913015966,31.30188281205039,20526],[120.60072285361198,31.287691315213436,22114],[120.61664230855457,31.2868165169328,19015],[120.5978121236748,31.3104579559601,17806],[120.63028692845,31.322944232729,20673],[120.66018594479,31.328843044062,21052],[120.75502648478,31.250961599045,23476],[120.70322551926942,31.33431729648261,40968],[120.71570172942,31.327566895768,48210],[120.80132453134,31.423203100136,36822],[120.66457266834513,31.352934952179528,17907],[120.59923548156891,31.32919714325396,19200],[120.74720616896995,31.29877021369589,18260],[120.73745777747,31.304456633754,19501],[120.8746300803,31.266825050999,16126],[120.87679076508,31.266644323865,15648],[120.51959162163051,31.269350927435944,13099],[120.54735216611053,31.016180871884586,7194],[120.54285017316,31.016497636444,8505],[120.69523856640386,31.162163364771818,12162],[120.65610089979,31.133854191962,19942],[120.68187909817,31.079956093586,7560],[120.6517542973,30.907621051825,6770],[120.67037508417,30.911463623818,7661],[120.65438419366,30.915274826948,7846],[120.62130343706,30.9068174529,9644],[120.59217630872,31.46407944369,10937],[120.62608089377,31.456199653775,8365],[120.62988200829,31.341356177572,26011],[120.61832381043,31.313582605843,23927],[120.63068354770978,31.318580831670197,19499],[120.63457143102477,31.326886423521405,31932],[120.65375939931118,31.31431343883848,23081],[120.63022650962901,31.33288794624241,15291],[120.63225590158,31.32559423878,21040],[120.62830248279,31.318407811797,20000],[120.63833760149,31.324595016589,21037],[120.63085929324,31.323631143445,20802],[120.617246546,31.321093835963,37176],[120.6394045670923,31.3203307371343,24113],[120.61907679262,31.31905137531,33177],[120.64286236149182,31.317469791856922,27588],[120.62383032635,31.320126295037,24000],[120.62332676355,31.315940842684,19237],[120.62902689268827,31.323741608747603,20000],[120.62977176761716,31.325192895693846,22155],[120.6137928143074,31.315732302491096,18437],[120.63073342621,31.343661872078,22152],[120.62490888056942,31.32746475177705,16875],[120.56708145150067,31.29904151266186,23040],[120.56234935863351,31.871143618538817,21897],[120.575187683105,31.2995491027832,27058],[120.55359291996304,31.28203858964566,20722],[120.57202264473798,31.29854083107759,28955],[120.5691063569846,31.298598067343264,26308],[120.57392325438343,31.296806331015425,26993],[120.57705131316926,31.307626547357224,22476],[120.56048210217332,31.28818558520116,21668],[120.5627432278708,31.291325809931372,21046],[120.58740186503502,31.273484385769812,16096],[120.563828634249,31.294611546936284,32700],[120.54951550676171,31.286588051560148,21825],[120.57375783771191,31.301541406415943,23457],[120.54062843021585,31.2808839449498,18230],[120.55153014461368,31.314527557387777,18604],[120.54257837569821,31.27658370856824,11665],[120.56412749869556,31.297306049470947,23040],[120.56649410252771,31.304304251834818,22016],[120.55950402803236,31.292403269630753,41714],[120.54679665667808,31.286483819449103,20364],[120.575248718262,31.2977161407471,22745],[120.56298196154313,31.297959136164447,23163],[120.56590502790988,31.295807160701877,30082],[120.55228549647973,31.281330603091586,14054],[120.5690464570749,31.294776972640012,25274],[120.5710172755841,31.294982312312257,25274],[120.5667764823,31.312491929289,9572],[120.575256347656,31.2970657348633,19938],[120.57025551969808,31.309389616323198,24355],[120.60714219419309,31.30021648958119,27074],[120.5713465503671,31.301578535134222,26739],[120.56692677586811,31.30168084479631,29108],[120.56751497373978,31.300965653065045,30481],[120.5711185343778,31.304064576884763,33856],[120.55299315806,31.307934578128,32396],[120.57661333227,31.29960658379,7161],[120.56357020813,31.30052796484,32106],[0,0,20300],[120.57120645333467,31.2939857871572,28244],[0,0,34260],[120.56602471152,31.287030408452,28619],[120.56612487746,31.324932036499,12843],[120.58106577985,31.284347253282,29873],[120.56637758718,31.287072590621,23940],[120.56547303794,31.296802062954,25536],[120.61599332134,31.248511465086,16331],[120.57634869928,31.304041800449,25352],[120.55969380764762,31.30063563062984,32144],[121.00271139651205,31.41070927449521,9259],[120.46169562939367,31.42051289084792,28732],[121.00705826723075,31.277147081277985,7446],[120.55921,31.286589,26212],[120.34629458029153,31.1742430835667,15341],[120.57469753428,31.295858441023,26911],[120.57357706896,31.298239963766,24993],[120.46640695613236,31.38329823338566,13150],[120.48895878570606,31.387276834699257,13000],[120.47773337738,31.38833419626,13684],[0,0,10119],[120.47773337738,31.38833419626,13684],[120.48895878570606,31.387276834699257,13207],[120.48069263409819,31.383795894727022,15581],[121.0322234992958,31.315271559993594,9594],[120.58615928214174,31.26130706285428,20352],[120.54243889131016,31.346341307797612,15023],[120.50384533866,31.372092107844,13606],[120.63315686574498,31.340426281452917,20744],[120.6036426222992,31.344331913616298,22768],[120.6372045186,31.344834217976,18365],[120.62330204304,31.349556393919,33189],[120.64071375664422,31.340454772891718,16789],[120.60401,31.349363,13824],[120.62482990244729,31.35234955087458,20460],[120.62207693425,31.347173841806,21604],[121.08330086133877,31.450279351668435,22778],[120.60762198994563,31.344635083632845,24195],[120.6018359933762,31.342246966692148,25481],[120.6082149524297,31.350914929209605,22662],[120.59632118895209,31.339495339069046,27742],[120.60540445452304,31.350185935076304,20092],[120.63803654927,31.330689199971,49412],[120.60106807152117,31.35040230254947,20207],[120.64318721301849,31.34310052164012,17531],[120.63704857853635,31.344523990809712,18737],[120.644057369227,31.33783415802323,18084],[120.64466818822801,31.343509681557194,15161],[120.6511755160372,31.32618934938515,19079],[120.60764919782291,31.332370491890362,17809],[120.62235550083,31.351608410781,12912],[0,0,20049],[120.61779315675,31.348192918914,11758],[120.63242267202,31.345377253012,15354],[120.62944857439,31.309569905609,21919],[120.631282,31.343867,9643],[120.526774,31.26566,19037],[120.63752631088116,31.317018099539037,38403],[120.62861942130894,31.318866109376234,14360],[120.6437548783211,31.31568356878868,28007],[120.63161907720348,31.324941385097045,21268],[120.63571264694,31.320483303017,24124],[120.620827,31.321553,22758],[120.62239314787178,31.32465650578621,13888],[120.6368736020976,31.332454984846162,58938],[120.663481,31.148799,8992],[120.63333248531,31.314349357272,17194],[120.632766723633,31.3168563842773,17194],[120.63890116926078,31.314881769025842,27756],[120.61647905949424,31.31621003227272,23389],[120.61737785098751,31.311830192784832,24257],[120.6191809253156,31.312646718678213,21905],[120.63718153044675,31.327151353062483,30150],[120.62722410153,31.313017793164,41274],[120.63473919056,31.333998337702,20102],[120.571224,31.037244,19932],[120.62060616867,31.325887539627,23028],[120.61958934426,31.331611584769,14693],[120.6283107434,31.322792845468,16158],[120.61354880488682,31.345581103896265,16988],[120.51755440846274,31.355185427613655,15636],[120.5196018596184,31.379143593066136,15730],[120.74743905632,31.634112565569,8867],[120.52631450778,31.387382593032,15393],[120.5326633250386,31.37072756038811,15978],[120.4982220869724,31.324984183914623,13193],[120.52477665450867,31.378420775541706,15281],[120.52784910973,31.362522022165,19039],[120.52149319156455,31.35274219007556,15879],[120.903725,31.279117,2601],[120.50282955409,31.37993574453,8823],[120.88267651748758,31.226289845576105,16097],[120.51455017031182,31.38631647636803,9149],[120.52452478221996,31.389292103687954,14532],[120.44340267342923,31.339663359960497,20758],[120.43029934876887,31.346289778719488,20819],[120.44153474641,31.348788557148,18708],[120.43844145875869,31.34259982539873,17871],[120.42981,31.3438178,8210],[120.41801329347842,31.35036942079561,24539],[120.42981698835409,31.335915134534122,25432],[121.03407820732632,31.327024719709907,15335],[120.43934504555,31.353291286841,19565],[120.44160389210317,31.347312372315873,17525],[120.41653235706,31.346370241253,13269],[120.42888559286234,31.35301415144499,19896],[120.43280058793593,31.34985322122551,20875],[120.55202119968,31.311429698011,9076],[120.42857274629051,31.33781579295703,19512],[120.42663520036,31.341686503699,19196],[120.42396184468,31.350717090963,25561],[120.4176185477,31.345630340313,23690],[120.39872308154,31.354615646117,16446],[0,0,18866],[0,0,9333],[120.56748010451,31.300784200429,27398],[120.57597018452189,31.2965981736077,29353],[120.57798970556263,31.296873024442743,29384],[120.57011302059674,31.303446293066973,28821],[120.53923827908321,31.29084971727405,19046],[120.55103391615845,31.286933546646946,22332],[120.57209339348334,31.302852401513846,30196],[120.56694587923309,31.297750967674276,24943],[120.5514776844702,31.27979668569261,24007],[120.573536,31.298697,25624],[120.55877345278,31.313037673022,16899],[120.55358480287445,31.32278150326964,25475],[120.44691435987122,31.3514198919545,18958],[120.56572980504,31.296907998771,25536],[120.5648851169864,31.290597845903118,29098],[120.57925200473,31.295699536841,30535],[120.60983252936492,31.279314702982973,32500],[120.56105901463286,31.316365168475404,22977],[120.57056,31.2944841,33201],[120.57859329230597,31.285175711296823,20396],[120.56609,31.2763699,19450],[120.55960902844,31.272274188448,14675],[121.1458851136254,31.28765815790396,23506],[120.5597876458,31.268255889298,10433],[120.55440250765,31.311460328536,20944],[120.537152,31.2726145,10653],[120.57279873398672,31.29502522215535,28697],[120.57094569231293,31.315148176014493,28689],[120.57717286687,31.285936781901,16277],[120.58116360487861,31.280874483374532,15083],[120.581008911133,31.288969039917,13508],[120.56572101811092,31.296960904116013,25754],[120.5027204137967,31.37298117324668,15991],[120.5453357415289,31.282080572270566,24132],[120.57406513388,31.306431406373,12765],[120.55630562743359,31.284740022673283,23942],[120.55365825192615,31.28464260148168,23283],[120.52962918409386,31.276318519283993,17500],[120.57276852187,31.300393061841,19172],[120.554794903,31.306323120654,49041],[120.56450654319703,31.29095196510134,24627],[120.56182455535,31.308985092607,21289],[120.55763952487858,31.291892469798604,24256],[120.57618226996128,31.298399210196006,27058],[120.5568079805358,31.294874745671876,28080],[120.5636394690747,31.297998753072395,27082],[120.58084441986311,31.281878408089376,18789],[120.57014184542395,31.30008656163562,29431],[120.5896444730627,31.26201155830403,19806],[120.57133779188838,31.304748661984394,31492],[120.58768542684722,31.27953761847066,19435],[120.568954467773,31.2989177703857,24497],[120.55957757230446,31.30823506954056,24022],[120.574094,31.300232,26430],[0,0,26430],[120.58429322216,31.279320212386,21765],[120.56475443581,31.291429888375,24844],[120.6308401942246,30.908944247342674,18560],[120.62786036846,31.328403101177,17746],[120.61923087200027,31.330784625071857,29126],[120.61352396045132,31.327807304003716,14676],[120.61800046743477,31.072273736660392,19264],[120.61460734455,31.32413444713,15185],[120.62390897041813,31.332592409895035,18642],[120.627728,31.324848,9500],[120.606111,31.320238,13703],[120.62235247521,31.320642939675,16000],[120.45331774115664,31.437867754694665,8696],[120.450317382812,31.4381561279297,8695],[120.53791832244143,31.858129005807257,12523],[120.44240904525,31.44116493433,10989],[120.45435634402116,31.430225790127892,11931],[120.45435634402116,31.430225790127892,11931],[120.4477090889593,31.442887957816215,5127],[120.45974966430303,31.430287942518895,9071],[121.2251361863,31.602908022868,25457],[120.451378,31.438529,6881],[120.67561333174096,31.47784245729605,11837],[120.50872174497654,31.37702490710796,15841],[120.672876,31.465638,9409],[120.652627,31.4663246,19010],[120.67363489679,31.465822637037,6696],[120.63475421912823,31.468469778758468,9074],[120.66763217474258,31.468253111102932,14732],[120.6610978366833,31.469462673044976,8989],[120.67124081889148,31.473083498381964,13706],[120.671577453613,31.4643592834473,7661],[120.66432167010767,31.46835521393513,12494],[120.63548085576035,31.46451356952989,7630],[120.66754827480455,31.47563188971461,11139],[120.65519668812715,31.47020754852335,6724],[120.66081835497472,31.469239213315173,10398],[0,0,5578],[120.65309795181,31.46653714151,12415],[120.6728239716,31.461930826643,14699],[0,0,15933],[120.747515,31.310898,9490],[120.66077901099001,31.47188962588229,6161],[120.66754827480455,31.47563188971461,8420],[120.658973,31.469202,7754],[120.65489521199,31.469450098593,5556],[120.65912021289,31.394748984594,14539],[120.63062990180302,31.470134006850234,13641],[120.68947461034,31.439401641456,14055],[120.61347672395439,31.39183577229049,21265],[120.63549563969,31.393585844291,17647],[120.61393362189948,31.38578417046008,20186],[120.64734350572,31.362876370291,8583],[120.619962,31.3840239,11818],[120.69580094842,31.435071158192,13356],[120.65699876264122,31.37939424539082,15806],[120.61707796696419,31.388456242721997,15239],[120.644622802734,31.3686962127686,12308],[120.62472718031393,31.395035868582,13860],[120.6567067989776,31.380706597882327,16707],[120.628431,31.393199,13774],[120.62530799770752,31.404996742925842,7615],[120.64849675074,31.382145171686,10521],[120.6325577314,31.369152987978,15031],[120.62974836675862,31.38532481698439,17492],[120.6563484388588,31.378060688184764,17032],[120.62647814932923,31.402996281325088,13991],[120.64327607629,31.370998628546,6868],[120.61593669973,31.39739494813,17515],[120.6323858774,31.390165835653,10808],[120.58909993953,31.388322061901,14983],[120.63313970039,31.367187540631,12815],[120.60941957832198,31.36859828137923,22510],[120.61772588104,31.368391619435,24918],[120.66626406867,31.375300671591,17672],[120.63363673535,31.410794009288,11577],[120.72168512258392,31.302971492866895,17590],[120.63653208943,31.384080936657,13493],[121.14657499159603,31.494659226323243,15354],[120.516635,31.435598,12966],[120.62641796596,31.374736632335,12969],[120.62709001724,31.373990703878,14297],[120.63422836904881,31.376215277778687,17200],[120.637555,31.359931,20041],[120.625518798828,31.3803253173828,14250],[120.62540633736,31.395698201345,14375],[120.60307027412996,31.372389489153388,20775],[120.61216515928268,31.367975767929938,23996],[120.612265,31.3677282,20775],[120.634016,31.3697816,9375],[120.76603411347577,31.497224293995977,11349],[120.73842753965,31.489386052354,10840],[120.616404,31.3672292,10861],[120.73663320626,31.48857080507,12004],[120.73875576052909,31.49445225783596,11512],[120.61521,31.3680917,8510],[120.56237389405189,31.87701261910611,8285],[120.717848,31.4934917,21927],[120.65247346554,31.371807767612,30630],[120.74449797638287,31.491695677164778,21927],[120.65559012707611,31.373909246957535,16073],[120.7413667438837,31.491080699384973,5535],[120.66742460239007,31.373414217953535,25185],[120.66502330779575,31.375821626153865,22657],[120.74274130043268,31.491591662087743,7460],[120.60645257493444,31.366576017587775,17590],[120.73603923526011,31.493560333622504,10108],[120.63721843283709,31.36908052248132,15934],[120.62786246228,31.369571387526,11078],[120.66270295501938,31.37433824951797,16875],[120.74095785988,31.499904122092,11788],[120.72681867626825,31.50017454142229,9004],[120.7273953449,31.500582599886,7256],[120.6567199599,31.375149973949,22154],[120.40863696202298,31.337859476449655,11338],[120.55154151762,31.320372100888,17499],[120.55755399900758,31.320865107448967,18293],[120.50198777822,31.327269933957,16001],[120.55329696278,31.320042172031,12540],[120.51682524687352,31.31406848420885,12537],[120.56893251061419,31.321988708327588,24920],[120.56032274636908,31.317756054670067,19388],[120.55202698571328,31.31140945563434,10074],[120.51955255612047,31.309417315399518,16387],[120.550547,31.3138983,18504],[120.51586806624074,31.36685028449331,13934],[120.49815585612,31.325341243366,13193],[120.55145915332585,31.31322694097324,22861],[120.50210827159167,31.31731392280785,13433],[120.55901749402,31.319497883898,18658],[120.55895098265192,31.310478095541594,17553],[120.56042300085721,31.31837745782521,21247],[120.55966365073,31.318600278546,21228],[120.55771997913,31.294330351323,27526],[120.54681209046504,31.313085212655828,17668],[120.56435975648347,31.306930349156726,24037],[120.54956103737649,31.313189592295647,31778],[120.54864021134736,31.3224695038046,17050],[120.56276108708263,31.314227990807748,23887],[120.56240012996263,31.311342328720087,25670],[120.559577941895,31.3119468688965,17553],[120.549324461434,31.316949756091038,17741],[120.56241317493,31.32453458631,18529],[120.5500997627,31.317950505877,17741],[120.55838568258771,31.31437249193817,18317],[120.55740200571529,31.318382952622606,18130],[120.54239235369491,31.316044516310864,17329],[120.55483191412581,31.311128063948253,17540],[120.555145263672,31.3155841827393,9569],[120.55491833827,31.31883052897,10201],[120.49955805821,31.316616810065,19401],[0,0,15362],[120.53960708821,31.35408743504,8046],[120.51807811828,31.316007619429,18181],[120.51513799374,31.320654137814,17446],[120.55767354835,31.319466946273,18658],[120.553148,31.313011,17222],[120.49673796508,31.31762369352,23306],[120.54753425271,31.315770340886,24068],[120.54683973332,31.316189024386,16950],[120.55893912052767,31.318887703760193,15903],[120.58163909145964,31.261123206639862,10238],[120.593565,31.2646915,19098],[120.58898469102158,31.264311190633972,15616],[120.577247,31.2606494,7116],[120.58615928214174,31.26130706285428,20792],[120.54692721280767,31.260444359099726,10344],[120.5865169559551,31.26211278542089,18646],[120.58842236455,31.273412948583,11954],[120.589585,31.262934,15616],[120.53235272063733,31.392332156185248,15374],[120.499283513085,31.389141720363767,11920],[120.52870929769232,31.371138721758864,17661],[120.50088139107869,31.325982667857772,16593],[120.524344,31.3546975,14580],[120.51920448644,31.370016222302,18059],[120.50872174497654,31.37702490710796,16208],[120.52473640844,31.35588790556,14580],[120.51917506119602,31.373123019654958,19039],[120.515626,31.3729226,20227],[120.51571,31.3757785,7871],[120.52468915685708,31.354667583591,15879],[120.53054872149,31.391000821227,16600],[120.52776104100614,31.351697958380722,18347],[120.534662,31.3871917,8673],[120.49757555463,31.37336279399,16289],[120.51779045652,31.353820074016,15343],[120.51743525003346,31.364843867036402,15243],[120.52953632535498,31.38859190094389,16565],[120.54345353262,31.347906943687,15733],[120.51470313467236,31.373277031725863,16170],[120.54202958559097,31.349153370137817,15878],[120.52477665450867,31.378420775541706,14782],[120.62440540967,31.346976238152,29955],[120.622885,31.332284,31967],[120.6266717296751,31.33269028517503,29048],[120.61627951799301,31.327534872821516,23924],[120.6199234398,31.330176275814,31311],[120.62920614142,31.329124087672,41223],[120.6622580898766,31.34514155043556,18151],[120.63927144270724,31.33404001836385,30708],[120.63084038197046,31.33395720854421,25106],[120.63552438944197,31.325188033970427,27586],[120.61744675102013,31.321781849981466,15586],[120.63749423957783,31.32536096643421,35379],[120.55958208111,31.266478857509,17399],[120.53545867987,31.276886099201,20412],[120.54048458487,31.267089327497,10213],[120.49545514879821,31.260229739336744,15027],[120.46931988961296,31.229889974772053,14537],[120.53137515493731,31.261378029710254,11945],[120.50830025553972,31.256752213843946,18349],[120.517519,31.26995,17140],[120.68775253338,31.299104585486,18390],[120.51472122385042,31.2468064014144,17924],[120.61482506773,31.261442618419,15238],[120.53366001406,31.245322563736,24171],[120.56339707660405,31.258251696110655,15413],[120.53782807882,31.255273431739,20183],[120.52481318713,31.294390881513,26094],[120.53693180957,31.279648903062,11927],[120.5159409161227,31.28536582992933,22500],[120.53632032676974,31.263663786619272,17575],[120.53629754631,31.26366911752,17786],[120.5150246570788,31.253370946287077,20662],[120.544488,31.2597275,18276],[120.537253,31.2571617,21820],[120.537592936423,31.276854744252123,11555],[120.54645770444984,31.259566824760505,15210],[120.53965843004481,31.26713167159692,8952],[120.50974544225772,31.2437694378037,10161],[120.53479470936958,31.27828173220496,11806],[120.53563725827,31.250927790443,17674],[120.49560272781723,31.260441901200466,9546],[120.4087,31.220297,19568],[120.51672421911,31.275139293893,17749],[120.53885545541046,31.276964615670714,11555],[120.411082,31.3060814,8333],[120.53352964997413,31.257347318328605,18545],[120.544943,31.2601283,8861],[120.560111999512,31.2755928039551,18259],[120.494341,31.2572982,8931],[120.433394,31.2230522,13412],[120.4972450153404,31.262195941382775,20000],[120.52842892306806,31.271527704465694,13037],[120.51916009183302,31.245004705042223,12374],[120.4481705053811,31.226298311017146,21782],[120.55076632442162,31.26087806440654,8923],[120.54450282906683,31.183099166038264,14508],[120.45028365051701,31.285219821945635,7211],[120.5202276264231,31.26639995749998,16039],[120.53155482322573,31.25695669545406,18759],[120.51837110471375,31.258874668187804,15420],[120.51781025754995,31.250639080110155,18138],[120.56276805254356,31.269669817369568,10840],[120.5279737768187,31.29294105057085,15382],[120.51308836673849,31.261105179756672,21246],[120.52937069398845,31.287840244570173,19286],[120.46882358929327,31.27627569003715,10171],[120.5635499762866,31.275069915977987,19524],[120.54142518498284,31.260832687773384,17289],[120.51980865314002,31.273505774068138,25707],[120.55396199028,31.261570027265,8129],[120.51819053758,31.271717598286,17140],[120.551827,31.261094,8066],[120.52544752702963,31.248181590752644,14886],[120.51056982530899,31.276419526663158,30639],[120.52655125434873,31.27971112712195,23871],[120.52960012386,31.280691845894,24137],[120.52149379432755,31.270950517504673,53009],[120.45509125943686,31.283889355107277,10869],[120.51905231403623,31.26607189906414,16031],[120.63167994818144,31.343741065627587,15877],[120.5259196477,31.275755900525,20644],[120.52268593377323,31.28111149781461,24489],[120.51525871147773,31.26124457033836,17937],[120.52841434177303,31.266009440446986,17460],[120.4795416424347,31.23777302653508,17777],[120.52753348045775,31.273471146678204,17672],[120.52047958405083,31.276032723067384,27177],[120.5261102321569,31.270634936202796,14250],[120.5230119611818,31.26513973504688,16019],[120.5273327801424,31.2531250713758,15633],[120.5267255651431,31.25771837582197,15389],[120.5202665104,30.906491339281,15124],[120.5210692709537,31.259025409660776,15274],[120.52772811484,31.288065389741,25974],[120.51447833159,31.242473090886,10625],[120.52332343978,31.296938778003,10300],[120.54106281195,31.272821553796,22741],[120.4932571327,31.240450521676,13382],[120.53479470936958,31.27828173220496,11806],[0,0,17857],[0,0,9782],[0,0,13143],[120.56625461491,31.269293515562,18666],[120.52586663955,31.287265619099,5408],[120.52222500396,31.287830835075,3200],[120.79176092684,31.216823551715,5048],[120.61071236618,31.370776389167,11806],[120.54461570564568,31.263230830122513,12574],[120.50830148413,31.256730064407,11846],[120.515668,31.266766,14104],[120.52989887463,31.258045596472,15136],[120.52996,31.256092,19947],[120.52945862372499,31.2553565542654,6428],[120.560056,31.273825,17942],[120.5150246570788,31.253370946287077,20662],[120.44398579407815,31.946523234665417,4103],[120.959657,31.38633,15571],[120.52807730473212,31.271753069982974,8125],[120.515191,31.25836,12345],[120.52109441747,31.257535554788,13674],[120.52750275861,31.253101130774,15399],[120.52274335959,31.275869759397,26190],[120.5403907376,31.237544502745,6122],[120.51434174991,31.264130446205,16109],[120.41344171252,31.222412246777,20003],[120.51833840639318,31.261558530913252,16380],[120.56663705976487,31.870047562811337,14690],[120.52051195381,31.273067268341,22513],[120.34811431513,31.172379475999,21243],[120.46986394115864,31.130446942489804,25547],[120.47905177799,31.00378937816,7378],[120.39484179479783,30.955388187884207,4988],[120.40637414661285,30.953004714111557,10594],[120.6491147510956,31.364613461344018,20217],[120.61587467176,31.398455269804,20562],[120.6317269363,31.358680410982,21588],[120.6583057234972,31.39157918530553,17615],[120.6407523433574,31.373503618973487,24121],[120.65139336141152,31.36417106909575,18359],[120.63834726060874,31.362280211012237,19024],[120.64238492558786,31.366205255174737,16697],[120.65312889753815,31.364758653192645,17158],[120.613431533,31.389919693212,19083],[120.63486679376,31.39913033625,19737],[120.60595643091992,31.3765780477844,19990],[120.62816,31.369981,21426],[120.61396061971,31.395001664015,19726],[120.6147393365,31.368864088601,12228],[120.65173697315045,31.380007660068863,11495],[120.62327619593215,31.380131684097538,18635],[120.63770264286293,31.36584191785898,21030],[120.63834726060874,31.362280211012237,20808],[120.63245746214271,31.365150341873075,19910],[120.68367045389,31.416408066308,12673],[120.60941957832198,31.36859828137923,22510],[120.6168065834798,31.381471758717083,20667],[120.63678067329089,31.37637720235842,17200],[120.62857209740689,31.372527787080944,17340],[120.65861771411,31.38114722344,15806],[120.669045,31.3732382,25185],[120.64442081285667,31.382815564481287,7090],[120.648227,31.3751346,9952],[120.65033111186,31.364502936045,9068],[120.65017582507245,31.36982712350034,21189],[120.62706205689378,31.36604167131751,17892],[120.61964637063762,31.360673587742486,15354],[120.64445191742,31.368763473455,13739],[120.64330900707614,31.36657870856644,21463],[120.64259565809,31.370428823062,18482],[120.64960698209131,31.407414586955838,15899],[120.63666,31.3595659,19269],[120.6424157311787,31.378602093413765,8149],[120.64652444673384,31.364078412273297,7970],[120.65931027788795,31.371667346317416,46497],[120.6418707615648,31.369214052385956,16346],[120.61655534539476,31.366776395154695,17690],[120.6298917345214,31.382623029881895,19486],[120.62989531859,31.383111243262,22820],[120.62544272736451,31.38218817935259,17200],[120.64779592452216,31.405194380612937,14669],[120.63267163075257,31.37532447393622,16429],[120.62529902183886,31.385299585989184,17117],[120.65082483912545,31.413558792004732,15822],[120.62900199159,31.374738837801,16429],[120.64529720447,31.370383870638,51964],[120.650056951406,31.367319259779176,16376],[120.64438647254,31.404970818587,13839],[120.63939580556,31.384302066485,13493],[120.63099894273,31.378833189162,8595],[120.6289293070658,31.368343283153816,15789],[120.59629201109082,31.328368466235066,18663],[120.63605836828795,31.385478366563547,15962],[120.65126709379241,31.410182921620336,13739],[120.63825212336,31.369625082677,16044],[120.62871157654,31.367052817179,13032],[120.62877054683811,31.36457658466955,10740],[120.5259014866174,31.27951621920874,9142],[120.6400571008,31.383194079478,7920],[120.63128379545154,31.362495835787893,20808],[120.63834726060874,31.362280211012237,20031],[120.6414392290724,31.361960852556617,20758],[0,0,21557],[120.65756480319,31.418362508186,18077],[120.60911077076,31.389353392893,19175],[120.63858568616229,31.368134973134705,8433],[120.609496,31.27992,42857],[120.616235,31.385993,11795],[120.69069820487,31.362777126323,16144],[120.656623840332,31.3734130859375,6000],[120.636708,31.360317,18820],[120.62326315778,31.383415876932,17117],[120.64488140871,31.367665525234,14716],[120.64971086611,31.362530996804,19514],[120.63013156149,31.370376676391,7481],[120.6526830442593,31.304914810130438,19793],[120.6562426139782,31.303144852133823,25498],[120.58893903554234,31.84549441353464,24330],[120.65999259585,31.303711530115,21873],[120.65172449658522,31.312328438841238,31265],[120.6596284073945,31.294586538990938,18339],[120.65416571906286,31.292416516221415,20014],[120.6527624580596,31.30291358696648,23737],[120.66076027323537,31.297259530261616,17354],[120.64793367787549,31.298981492866915,26892],[120.6573854613,31.305614712461,21499],[120.65162834465833,31.302018127116124,29085],[120.62987285412,31.310065497608,12820],[120.6552261053,31.303577339827,21594],[120.639213562012,31.3095245361328,30824],[120.66094218964,31.300845808207,20696],[120.65245913902,31.304544713822,16061],[120.655827,31.311237,23397],[120.65405630365511,31.30239801144626,18268],[120.65327361635242,31.301517173704745,17354],[120.65326004469,31.302905588726,18274],[120.60792848100597,31.272121141149036,22117],[120.6554102369062,31.302613184571676,19236],[120.6529993465,31.305495078295,23748],[120.6521819137509,31.30598133137854,23331],[120.65387258580544,31.297347906124973,25276],[120.65125557302426,31.315615462603265,38432],[120.658625,31.306199,22642],[120.652132,31.309946,24852],[120.59949678965872,31.308824313616572,22596],[120.65368632125964,31.30513262816708,20964],[120.651386,31.309565,19490],[120.62901305878341,31.289887417522856,42368],[120.64544403625,31.29362504115,20786],[120.62532995065,31.304645143929,24452],[120.62429066851408,31.31137118762244,15293],[120.62827177707659,31.297381847983445,20920],[120.62770943782735,31.288711616230394,34107],[120.65503929422214,31.315765877871353,44642],[120.62812176175,31.291201872365,34074],[120.63581718403819,31.285687144408204,27438],[120.63751899508108,31.284666201383583,23175],[120.63566810305237,31.30343057206716,23804],[120.64110372184577,31.290778708236694,29166],[120.63234937449,31.283909332951,17942],[120.63154084225,31.297827930517,9615],[120.648376464844,31.3048038482666,26052],[120.64865505075,31.279238301106,21108],[120.5947438022054,31.2980112857091,23210],[120.62642945488244,31.3113774568222,18936],[120.59781694038894,31.302070955355116,18721],[120.62473702664062,31.299722852199544,16118],[120.645616,31.292268,24376],[120.64308434535961,31.304713325436772,29123],[120.62665879,31.294004253139,16860],[120.88680004891,31.459683107332,21527],[120.62296334235,31.303855768735,25547],[120.62800660972,31.3103790496,53987],[120.62854291083205,31.29594030547754,21767],[120.63364836503,31.303711615748,20508],[120.63745542559336,31.295116487036342,24071],[120.62605131321,31.299092180401,19936],[120.63249090605686,31.303783757292035,26474],[120.62557057600131,31.300489832279165,18946],[120.63060017771,31.309979489188,21881],[120.62976051362,31.306083752655,25459],[120.62549493508413,31.298784947325046,19936],[120.62180166806,31.297638631661,35426],[120.6219752842655,31.297165159861155,18324],[120.62449660684885,31.290516693023175,16074],[120.63002068807396,31.29547838492272,23187],[120.63302384735996,31.296999689328953,24065],[120.64705557435812,31.302964535897946,26953],[120.62728984734,31.30040287649,19029],[120.63215962819,31.301178990819,21181],[120.63302384825828,31.29701968956804,21075],[120.63436478958,31.282756045168,17889],[120.63604414811174,31.289134354643643,21797],[120.60137046627,31.275536986365,15448],[120.63265833672932,31.311938204732375,29923],[120.633824,31.30305,18965],[120.63308997881501,31.311340088430217,32944],[120.640508,31.299685,29189],[120.62117382956407,31.300154015384813,62688],[120.635955,31.297235,25892],[120.62794930943,31.306536719802,20023],[120.63478134862,31.296593980187,21625],[120.6675041671057,31.315665810885573,39708],[120.62944727720931,31.299374608704564,25531],[120.63498284411,31.296126830772,20665],[120.61492595065,31.283908369161,17733],[120.64658145272,31.300754316068,29640],[120.62037477333837,31.304707600667346,27500],[120.62144288341,31.306163152353,33225],[120.62446151824,31.274573251442,30037],[120.62686560633,31.305046676684,27940],[120.62275787969,31.306697067797,25263],[120.629234313965,31.308048248291,14116],[120.65560926209,31.305984650886,10824],[120.63538995842,31.288057994932,20833],[120.6345327814302,31.30400198154022,27637],[120.64336510625523,31.3145741262947,22387],[120.64701132832023,31.30579596235657,34330],[120.63428144093834,31.307956449960322,29339],[120.6214671128385,31.304206456363122,24659],[120.64333733244547,31.308149350530982,31676],[120.62688155048629,31.3116000698304,29518],[120.64353156576,31.302637309839,30797],[120.6385403167,31.310920783342,19960],[120.63320452873,31.312673361832,17509],[120.63618029349821,31.30255083100132,24897],[120.645706176758,31.3047523498535,8000],[120.64214721041,31.308808845342,23739],[120.64324807283,31.304653538232,28043],[120.6347849771089,31.306107518477962,32527],[120.63965959602658,31.307273059434703,24517],[120.64904971198007,31.304244862686105,23770],[120.62732836225712,31.301761204720233,28686],[120.6019496290232,31.296625867302005,16250],[120.64154890501,31.304114998394,28672],[120.63486192989,31.302797798197,22719],[120.64209956626634,31.304270909055493,33737],[120.65013872414,31.303941010323,24247],[120.633964538574,31.3065891265869,35770],[120.63928018331,31.306546182912,29069],[120.63680321254,31.308510011484,25907],[120.63624376636,31.308986641242,23079],[120.64408734388526,31.31423554096608,25968],[120.63783949734,31.305215994876,27585],[120.63169813913,31.308048245804,24079],[120.64549233747,31.306996078635,31080],[120.6461520192,31.308390305074,25614],[120.63251785073062,31.31219085172109,23176],[120.64535072721,31.314145853207,19663],[120.64150538132,31.307481259192,31575],[120.6295576006,31.310358131022,18368],[120.651385,31.30951,19642],[120.63943200613,31.312986703859,17851],[120.64458219174,31.305079839069,32836],[120.6334058123,31.305696163204,29541],[120.634233,31.304301,23174],[120.63355681896,31.305842340891,21577],[120.63120539068,31.30512857014,21969],[120.63538120006,31.32230703292,20588],[120.62104985484,31.310467373193,21000],[120.64314219875,31.302203158093,30285],[120.638613,31.30896,25174],[120.62385132206,31.305260921696,19327],[120.633018,31.304615,25777],[120.63919352113,31.307896011752,27354],[120.63248479812,31.307120621222,25078],[120.64256583435,31.3112537808,16167],[120.64108751641437,31.312759182888595,24735],[120.8257728105849,31.311956588394825,28017],[120.64532260019881,31.292913992300488,27377],[120.63086706344072,31.28444017227805,25266],[120.63971063864395,31.282955429275912,8719],[120.61552036270145,31.28542699961245,21025],[120.63914399561301,31.29218489760278,32722],[120.6242088804923,31.28329200928802,21761],[120.64098318721244,31.290640928177744,26050],[120.60221388086016,31.282559262481108,37909],[120.64411706701797,31.29721462033864,29437],[120.63975739993728,31.290363592003157,23731],[120.64295003798,31.288667651325,21190],[120.62713033889219,31.284245293754932,18446],[120.6339397848105,31.288373052221736,23255],[120.61409027919399,31.280929285611926,22347],[120.64919924661017,31.30138234418583,28670],[120.61141502028352,31.282325534345212,18750],[120.64028826122,31.302452958744,29966],[120.6234440793506,31.28657290665029,17414],[120.61325521678,31.288938073677,15918],[120.64232206086,31.299169592103,29189],[120.64254944485218,31.290707406915903,18841],[120.64593103869021,31.28028540159752,17849],[120.63855119392561,31.300066011131715,24897],[120.635898766348,31.302096095744037,25024],[120.63582078624329,31.284538236041676,22259],[120.64125384756092,31.297835796088847,25987],[120.6384063700096,31.297434920682853,23115],[120.6384703769721,31.296867408501065,23115],[120.64149923767707,31.285198049110914,20000],[120.62752842747047,31.296747617478783,26809],[120.62720369182522,31.288710844753002,18085],[120.63604414811174,31.289134354643643,20833],[120.63447178089,31.290023053032,19890],[120.60137046627,31.275536986365,14704],[120.639724,31.284613,21304],[120.61760470367116,31.28704680971751,25600],[120.639873,31.28452,15942],[120.61720398721,31.288526884038,21202],[120.63566572972921,31.286763615484684,18366],[120.64745162108797,31.293119059818423,23521],[120.62035941329,31.301467721301,30291],[120.59797588297266,31.29864207159948,25185],[120.6262928100381,31.304393662654142,20000],[120.62227216467,31.308580202455,18341],[120.61561457326,31.307306314911,23038],[120.60661807874159,31.30345697047912,22726],[120.62545745776,31.290605844323,16364],[120.63892717185,31.312237810792,29338],[120.60426015793051,31.286005118113156,25246],[120.59431594288421,31.29021677161419,26337],[120.62431860401882,31.291678285410523,15731],[120.60290030574441,31.290455833177138,28756],[120.5898013746963,31.29354468890517,27474]]
//---------------------------------------------
var option = {
bmap: {
center: [120.631007, 31.308762],
zoom: 12,
roam: true,
enableMapClick: false,
mapStyle: {
styleJson: [{
"featureType": "all",
"elementType": "all",
"stylers": {
"lightness": 47,
"saturation": -100
}
}, {
"featureType": "highway",
"elementType": "geometry.fill",
"stylers": {
"color": "#ffffff"
}
}, {
"featureType": "poi",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
}, {
"featureType": "road",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
}]
}
}
}
myChart.setOption(option);
setTimeout(init, 0)
function init() {
initMap();
initMapv();
}
function getMap() {
return myChart.getModel().getComponent('bmap').getBMap();
}
function initMap() {
var top_left_navigation = new BMap.NavigationControl({
type: BMAP_NAVIGATION_CONTROL_SMALL
});
var map = getMap();
//map.centerAndZoom("苏州", 13);
map.addControl(top_left_navigation);
map.disableDoubleClickZoom();
return map;
}
function initMapv() {
var map = getMap();
var data = [];
var randomCount = points.length;
// 构造数据
while (randomCount--) {
var cityCenter = points[randomCount];
data.push({
geometry: {
type: 'Point',
coordinates: [cityCenter[0], cityCenter[1]]
},
count: cityCenter[2]
});
}
var dataSet = new mapv.DataSet(data);
//console.log(dataSet)
var options = {
fillStyle: '#99C1DB',
strokeStyle: 'white', // 描边颜色
lineWidth: 1,
//shadowColor: 'white',
//shadowBlur: 1,
size: 60,
globalAlpha: 1,
gradient: {
0.4: "rgba(64, 134, 181,0.4)",
0.6: "rgba(64, 134, 181,0.6)",
0.8: "rgba(64, 134, 181,0.8)",
1.0: "rgba(64, 134, 181,1)"
},
label: {
show: true,
fillStyle: 'white',
average: true
//shadowColor: 'black',
// font: '20px Arial',
//shadowBlur: 10,
},
max: 30000,
draw: 'grid',
methods: { // 一些事件回调函数
click: function(item) { // 点击事件,返回对应点击元素的对象值
console.log(item);
}
}
}
var mapvLayer = new mapv.baiduMapLayer(map, dataSet, options);
var options = {
fillStyle: 'rgba(55, 50, 250, 0.8)',
shadowColor: 'rgba(55, 50, 250, 1)',
shadowBlur: 20,
size: 3,
draw: 'simple'
}
}
//---------------------------------------------
var mapv = {};
(function(global, factory) {
// console.log(global,factory)
// typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
// typeof define === 'function' && define.amd ? define(['exports'], factory) :
// (factory((global.mapv = global.mapv || {})));
factory(mapv)
}(window, (function(exports) {
'use strict';
var version = "2.0.13";
/**
* @author kyle / http://nikai.us/
*/
var clear = function(context) {
context && context.clearRect && context.clearRect(0, 0, context.canvas.width, context.canvas.height);
//context.canvas.width = context.canvas.width;
//context.canvas.height = context.canvas.height;
};
/**
* @author kyle / http://nikai.us/
*/
var resolutionScale$1 = function(context) {
var devicePixelRatio = window.devicePixelRatio;
context.canvas.width = context.canvas.width * devicePixelRatio;
context.canvas.height = context.canvas.height * devicePixelRatio;
context.canvas.style.width = context.canvas.width / devicePixelRatio + 'px';
context.canvas.style.height = context.canvas.height / devicePixelRatio + 'px';
context.scale(devicePixelRatio, devicePixelRatio);
};
function Event() {
this._subscribers = {}; // event subscribers
}
/**
* Subscribe to an event, add an event listener
* @param {String} event Event name. Available events: 'put', 'update',
* 'remove'
* @param {function} callback Callback method. Called with three parameters:
* {String} event
* {Object | null} params
* {String | Number} senderId
*/
Event.prototype.on = function(event, callback) {
var subscribers = this._subscribers[event];
if (!subscribers) {
subscribers = [];
this._subscribers[event] = subscribers;
}
subscribers.push({
callback: callback
});
};
/**
* Unsubscribe from an event, remove an event listener
* @param {String} event
* @param {function} callback
*/
Event.prototype.off = function(event, callback) {
var subscribers = this._subscribers[event];
if (subscribers) {
//this._subscribers[event] = subscribers.filter(listener => listener.callback != callback);
for (var i = 0; i < subscribers.length; i++) {
if (subscribers[i].callback == callback) {
subscribers.splice(i, 1);
i--;
}
}
}
};
/**
* Trigger an event
* @param {String} event
* @param {Object | null} params
* @param {String} [senderId] Optional id of the sender.
* @private
*/
Event.prototype._trigger = function(event, params, senderId) {
if (event == '*') {
throw new Error('Cannot trigger event *');
}
var subscribers = [];
if (event in this._subscribers) {
subscribers = subscribers.concat(this._subscribers[event]);
}
if ('*' in this._subscribers) {
subscribers = subscribers.concat(this._subscribers['*']);
}
for (var i = 0, len = subscribers.length; i < len; i++) {
var subscriber = subscribers[i];
if (subscriber.callback) {
subscriber.callback(event, params, senderId || null);
}
}
};
var classCallCheck = function(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
var createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
var get = function get(object, property, receiver) {
if (object === null) object = Function.prototype;
var desc = Object.getOwnPropertyDescriptor(object, property);
if (desc === undefined) {
var parent = Object.getPrototypeOf(object);
if (parent === null) {
return undefined;
} else {
return get(parent, property, receiver);
}
} else if ("value" in desc) {
return desc.value;
} else {
var getter = desc.get;
if (getter === undefined) {
return undefined;
}
return getter.call(receiver);
}
};
var inherits = function(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
};
var possibleConstructorReturn = function(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
};
/**
* @author kyle / http://nikai.us/
*/
/**
* DataSet
*
* A data set can:
* - add/remove/update data
* - gives triggers upon changes in the data
* - can import/export data in various data formats
* @param {Array} [data] Optional array with initial data
* the field geometry is like geojson, it can be:
* {
* "type": "Point",
* "coordinates": [125.6, 10.1]
* }
* {
* "type": "LineString",
* "coordinates": [
* [102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]
* ]
* }
* {
* "type": "Polygon",
* "coordinates": [
* [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0],
* [100.0, 1.0], [100.0, 0.0] ]
* ]
* }
* @param {Object} [options] Available options:
*
*/
function DataSet(data, options) {
this._options = options || {};
this._data = []; // map with data indexed by id
// add initial data when provided
if (data) {
this.add(data);
}
}
DataSet.prototype = new Event();
/**
* Add data.
*/
DataSet.prototype.add = function(data, senderId) {
if (Array.isArray(data)) {
// Array
for (var i = 0, len = data.length; i < len; i++) {
if (data[i].time && data[i].time.length == 14 && data[i].time.substr(0, 2) == '20') {
var time = data[i].time;
data[i].time = new Date(time.substr(0, 4) + '-' + time.substr(4, 2) + '-' + time.substr(6, 2) + ' ' + time.substr(8, 2) + ':' + time.substr(10, 2) + ':' + time.substr(12, 2)).getTime();
}
this._data.push(data[i]);
}
} else if (data instanceof Object) {
// Single item
this._data.push(data);
} else {
throw new Error('Unknown dataType');
}
};
/**
* get data.
*/
DataSet.prototype.get = function(args) {
args = args || {};
//console.time('copy data time')
var start = new Date();
// TODO: 不修改原始数据,在数据上挂载新的名称,每次修改数据直接修改新名称下的数据,可以省去deepCopy
// var data = deepCopy(this._data);
var data = this._data;
// console.timeEnd('copy data time')
// console.time('transferCoordinate time')
var start = new Date();
if (args.filter) {
var newData = [];
for (var i = 0; i < data.length; i++) {
if (args.filter(data[i])) {
newData.push(data[i]);
}
}
data = newData;
}
if (args.transferCoordinate) {
data = this.transferCoordinate(data, args.transferCoordinate, args.fromColumn, args.toColumn);
}
// console.timeEnd('transferCoordinate time')
return data;
};
/**
* set data.
*/
DataSet.prototype.set = function(data) {
this._set(data);
this._trigger('change');
};
/**
* set data.
*/
DataSet.prototype._set = function(data) {
this.clear();
this.add(data);
};
/**
* clear data.
*/
DataSet.prototype.clear = function(args) {
this._data = []; // map with data indexed by id
};
/**
* remove data.
*/
DataSet.prototype.remove = function(args) {};
/**
* update data.
*/
DataSet.prototype.update = function(args) {};
/**
* transfer coordinate.
*/
DataSet.prototype.transferCoordinate = function(data, transferFn, fromColumn, toColumnName) {
toColumnName = toColumnName || '_coordinates';
fromColumn = fromColumn || 'coordinates';
for (var i = 0; i < data.length; i++) {
var geometry = data[i].geometry;
var coordinates = geometry[fromColumn];
switch (geometry.type) {
case 'Point':
geometry[toColumnName] = transferFn(coordinates);
break;
case 'LineString':
var newCoordinates = [];
for (var j = 0; j < coordinates.length; j++) {
newCoordinates.push(transferFn(coordinates[j]));
}
geometry[toColumnName] = newCoordinates;
break;
case 'Polygon':
var newCoordinates = getPolygon(coordinates);
geometry[toColumnName] = newCoordinates;
break;
case 'MultiPolygon':
var newCoordinates = [];
for (var c = 0; c < coordinates.length; c++) {
var polygon = coordinates[c];
var polygon = getPolygon(polygon);
newCoordinates.push(polygon);
}
geometry[toColumnName] = newCoordinates;
break;
}
}
function getPolygon(coordinates) {
var newCoordinates = [];
for (var c = 0; c < coordinates.length; c++) {
var coordinate = coordinates[c];
var newcoordinate = [];
for (var j = 0; j < coordinate.length; j++) {
newcoordinate.push(transferFn(coordinate[j]));
}
newCoordinates.push(newcoordinate);
}
return newCoordinates;
}
return data;
};
DataSet.prototype.initGeometry = function(transferFn) {
if (transferFn) {
this._data.forEach(function(item) {
item.geometry = transferFn(item);
});
} else {
this._data.forEach(function(item) {
if (!item.geometry && item.lng && item.lat) {
item.geometry = {
type: 'Point',
coordinates: [item.lng, item.lat]
};
}
});
}
};
/**
* 获取当前列的最大值
*/
DataSet.prototype.getMax = function(columnName) {
var data = this._data;
if (!data || data.length <= 0) {
return;
}
var max = parseFloat(data[0][columnName]);
for (var i = 1; i < data.length; i++) {
var value = parseFloat(data[i][columnName]);
if (value > max) {
max = value;
}
}
return max;
};
/**
* 获取当前列的总和
*/
DataSet.prototype.getSum = function(columnName) {
var data = this._data;
if (!data || data.length <= 0) {
return;
}
var sum = 0;
for (var i = 0; i < data.length; i++) {
if (data[i][columnName]) {
sum += parseFloat(data[i][columnName]);
}
}
return sum;
};
/**
* 获取当前列的最小值
*/
DataSet.prototype.getMin = function(columnName) {
var data = this._data;
if (!data || data.length <= 0) {
return;
}
var min = parseFloat(data[0][columnName]);
for (var i = 1; i < data.length; i++) {
var value = parseFloat(data[i][columnName]);
if (value < min) {
min = value;
}
}
return min;
};
/**
* @author kyle / http://nikai.us/
*/
var pathSimple = {
drawDataSet: function drawDataSet(context, dataSet, options) {
var data = dataSet instanceof DataSet ? dataSet.get() : dataSet;
for (var i = 0, len = data.length; i < len; i++) {
var item = data[i];
this.draw(context, item, options);
}
},
draw: function draw(context, data, options) {
var type = data.geometry.type;
var coordinates = data.geometry._coordinates || data.geometry.coordinates;
var symbol = options.symbol || 'circle';
switch (type) {
case 'Point':
var size = data._size || data.size || options._size || options.size || 5;
if (options.symbol === 'rect') {
context.rect(coordinates[0] - size / 2, coordinates[1] - size / 2, size, size);
} else {
if (options.bigData === 'Point') {
context.moveTo(coordinates[0], coordinates[1]);
}
context.arc(coordinates[0], coordinates[1], size, 0, Math.PI * 2);
}
break;
case 'LineString':
for (var j = 0; j < coordinates.length; j++) {
var x = coordinates[j][0];
var y = coordinates[j][1];
if (j == 0) {
context.moveTo(x, y);
} else {
context.lineTo(x, y);
}
}
break;
case 'Polygon':
this.drawPolygon(context, coordinates);
break;
case 'MultiPolygon':
for (var i = 0; i < coordinates.length; i++) {
var polygon = coordinates[i];
this.drawPolygon(context, polygon);
}
context.closePath();
break;
default:
console.log('type' + type + 'is not support now!');
break;
}
},
drawPolygon: function drawPolygon(context, coordinates) {
for (var i = 0; i < coordinates.length; i++) {
var coordinate = coordinates[i];
context.moveTo(coordinate[0][0], coordinate[0][1]);
for (var j = 1; j < coordinate.length; j++) {
context.lineTo(coordinate[j][0], coordinate[j][1]);
}
context.lineTo(coordinate[0][0], coordinate[0][1]);
}
}
};
/**
* @author kyle / http://nikai.us/
*/
var drawSimple = {
draw: function draw(context, dataSet, options) {
var data = dataSet instanceof DataSet ? dataSet.get() : dataSet;
// console.log('xxxx',options)
context.save();
for (var key in options) {
context[key] = options[key];
}
// console.log(data);
if (options.bigData) {
context.save();
context.beginPath();
for (var i = 0, len = data.length; i < len; i++) {
var item = data[i];
pathSimple.draw(context, item, options);
}
var type = options.bigData;
if (type == 'Point' || type == 'Polygon' || type == 'MultiPolygon') {
context.fill();
if ((item.strokeStyle || options.strokeStyle) && options.lineWidth) {
context.stroke();
}
} else if (type == 'LineString') {
context.stroke();
}
context.restore();
} else {
for (var i = 0, len = data.length; i < len; i++) {
var item = data[i];
context.save();
if (item.fillStyle) {
context.fillStyle = item.fillStyle;
}
if (item.strokeStyle) {
context.strokeStyle = item.strokeStyle;
}
var type = item.geometry.type;
context.beginPath();
pathSimple.draw(context, item, options);
if (type == 'Point' || type == 'Polygon' || type == 'MultiPolygon') {
context.fill();
if ((item.strokeStyle || options.strokeStyle) && options.lineWidth) {
context.stroke();
}
} else if (type == 'LineString') {
context.stroke();
}
context.restore();
}
}
context.restore();
}
};
function Canvas(width, height) {
var canvas;
if (typeof document === 'undefined') {
var Canvas = require('canvas');
canvas = new Canvas(width, height);
} else {
var canvas = document.createElement('canvas');
if (width) {
canvas.width = width;
}
if (height) {
canvas.height = height;
}
}
return canvas;
}
/**
* @author kyle / http://nikai.us/
*/
/**
* Category
* @param {Object} [options] Available options:
* {Object} gradient: { 0.25: "rgb(0,0,255)", 0.55: "rgb(0,255,0)", 0.85: "yellow", 1.0: "rgb(255,0,0)"}
*/
function Intensity(options) {
options = options || {};
this.gradient = options.gradient || {
0.25: "rgba(0, 0, 255, 1)",
0.55: "rgba(0, 255, 0, 1)",
0.85: "rgba(255, 255, 0, 1)",
1.0: "rgba(255, 0, 0, 1)"
};
this.maxSize = options.maxSize || 35;
this.minSize = options.minSize || 0;
this.max = options.max || 100;
this.min = options.min || 0;
this.initPalette();
}
Intensity.prototype.setMax = function(value) {
this.max = value || 100;
};
Intensity.prototype.setMin = function(value) {
this.min = value || 0;
};
Intensity.prototype.setMaxSize = function(maxSize) {
this.maxSize = maxSize || 35;
};
Intensity.prototype.setMinSize = function(minSize) {
this.minSize = minSize || 0;
};
Intensity.prototype.initPalette = function() {
var gradient = this.gradient;
var canvas = new Canvas(256, 1);
var paletteCtx = this.paletteCtx = canvas.getContext('2d');
var lineGradient = paletteCtx.createLinearGradient(0, 0, 256, 1);
for (var key in gradient) {
lineGradient.addColorStop(parseFloat(key), gradient[key]);
}
paletteCtx.fillStyle = lineGradient;
paletteCtx.fillRect(0, 0, 256, 1);
};
Intensity.prototype.getColor = function(value) {
var imageData = this.getImageData(value);
return "rgba(" + imageData[0] + ", " + imageData[1] + ", " + imageData[2] + ", " + imageData[3] / 256 + ")";
};
Intensity.prototype.getImageData = function(value) {
var imageData = this.paletteCtx.getImageData(0, 0, 256, 1).data;
if (value === undefined) {
return imageData;
}
var max = this.max;
var min = this.min;
if (value > max) {
value = max;
}
if (value < min) {
value = min;
}
var index = Math.floor((value - min) / (max - min) * (256 - 1)) * 4;
return [imageData[index], imageData[index + 1], imageData[index + 2], imageData[index + 3]];
};
/**
* @param Number value
* @param Number max of value
* @param Number max of size
* @param Object other options
*/
Intensity.prototype.getSize = function(value) {
var size = 0;
var max = this.max;
var min = this.min;
var maxSize = this.maxSize;
var minSize = this.minSize;
if (value > max) {
value = max;
}
if (value < min) {
value = min;
}
size = minSize + (value - min) / (max - min) * (maxSize - minSize);
return size;
};
Intensity.prototype.getLegend = function(options) {
var gradient = this.gradient;
var width = options.width || 20;
var height = options.height || 180;
var canvas = new Canvas(width, height);
var paletteCtx = canvas.getContext('2d');
var lineGradient = paletteCtx.createLinearGradient(0, height, 0, 0);
for (var key in gradient) {
lineGradient.addColorStop(parseFloat(key), gradient[key]);
}
paletteCtx.fillStyle = lineGradient;
paletteCtx.fillRect(0, 0, width, height);
return canvas;
};
var global$1 = typeof window === 'undefined' ? {} : window;
var devicePixelRatio = global$1.devicePixelRatio;
/**
* @author kyle / http://nikai.us/
*/
function createCircle(size) {
var shadowBlur = size / 2;
var r2 = size + shadowBlur;
var offsetDistance = 10000;
var circle = new Canvas(r2 * 2, r2 * 2);
var context = circle.getContext('2d');
context.shadowBlur = shadowBlur;
context.shadowColor = 'black';
context.shadowOffsetX = context.shadowOffsetY = offsetDistance;
context.beginPath();
context.arc(r2 - offsetDistance, r2 - offsetDistance, size, 0, Math.PI * 2, true);
context.closePath();
context.fill();
return circle;
}
function colorize(pixels, gradient, options) {
var maxOpacity = options.maxOpacity || 0.8;
for (var i = 3, len = pixels.length, j; i < len; i += 4) {
j = pixels[i] * 4; // get gradient color from opacity value
if (pixels[i] / 256 > maxOpacity) {
pixels[i] = 256 * maxOpacity;
}
pixels[i - 3] = gradient[j];
pixels[i - 2] = gradient[j + 1];
pixels[i - 1] = gradient[j + 2];
}
}
function drawGray(context, dataSet, options) {
var max = options.max || 100;
var min = options.min || 0;
// console.log(max)
var size = options._size;
if (size == undefined) {
size = options.size;
if (size == undefined) {
size = 13;
}
}
var intensity = new Intensity({
gradient: options.gradient,
max: max,
min: min
});
var circle = createCircle(size);
var circleHalfWidth = circle.width / 2;
var circleHalfHeight = circle.height / 2;
var data = dataSet;
var dataOrderByAlpha = {};
data.forEach(function(item, index) {
var count = item.count === undefined ? 1 : item.count;
var alpha = Math.min(1, count / max).toFixed(2);
dataOrderByAlpha[alpha] = dataOrderByAlpha[alpha] || [];
dataOrderByAlpha[alpha].push(item);
});
for (var i in dataOrderByAlpha) {
if (isNaN(i)) continue;
var _data = dataOrderByAlpha[i];
context.beginPath();
if (!options.withoutAlpha) {
context.globalAlpha = i;
}
context.strokeStyle = intensity.getColor(i * max);
_data.forEach(function(item, index) {
if (!item.geometry) {
return;
}
var coordinates = item.geometry._coordinates || item.geometry.coordinates;
var type = item.geometry.type;
if (type === 'Point') {
var count = item.count === undefined ? 1 : item.count;
context.globalAlpha = count / max;
context.drawImage(circle, coordinates[0] - circleHalfWidth, coordinates[1] - circleHalfHeight);
} else if (type === 'LineString') {
var count = item.count === undefined ? 1 : item.count;
context.globalAlpha = count / max;
context.beginPath();
pathSimple.draw(context, item, options);
context.stroke();
} else if (type === 'Polygon') {}
});
}
}
function draw(context, dataSet, options) {
var strength = options.strength || 0.3;
context.strokeStyle = 'rgba(0,0,0,' + strength + ')';
var shadowCanvas = new Canvas(context.canvas.width, context.canvas.height);
var shadowContext = shadowCanvas.getContext('2d');
shadowContext.scale(devicePixelRatio, devicePixelRatio);
options = options || {};
var data = dataSet instanceof DataSet ? dataSet.get() : dataSet;
context.save();
var intensity = new Intensity({
gradient: options.gradient
});
//console.time('drawGray')
drawGray(shadowContext, data, options);
//console.timeEnd('drawGray');
// return false;
if (!options.absolute) {
//console.time('changeColor');
var colored = shadowContext.getImageData(0, 0, context.canvas.width, context.canvas.height);
colorize(colored.data, intensity.getImageData(), options);
//console.timeEnd('changeColor');
context.putImageData(colored, 0, 0);
context.restore();
}
intensity = null;
shadowCanvas = null;
}
var drawHeatmap = {
draw: draw
};
/**
* @author kyle / http://nikai.us/
*/
var drawGrid = {
draw: function draw(context, dataSet, options) {
context.save();
var data = dataSet instanceof DataSet ? dataSet.get() : dataSet;
var grids = {};
var gridIndexData = {};
var size = options._size || options.size || 50;
var offset = options.offset || {
x: 0,
y: 0
};
for (var i = 0; i < data.length; i++) {
var coordinates = data[i].geometry._coordinates || data[i].geometry.coordinates;
var gridKey = Math.floor((coordinates[0] - offset.x) / size) + "," + Math.floor((coordinates[1] - offset.y) / size);
if (!grids[gridKey]) {
grids[gridKey] = 0;
gridIndexData[gridKey] = []
}
var count = ~~(data[i].count || 1)
grids[gridKey] += count;
gridIndexData[gridKey].push(data[i]);
}
for (var gridKey in grids) {
var total = grids[gridKey]
gridIndexData[gridKey].forEach((i) => {
i.total = total;
i.average = parseInt(total / gridIndexData[gridKey].length)
})
}
var intensity = new Intensity({
max: options.max || 100,
gradient: options.gradient
});
for (var gridKey in grids) {
gridKey = gridKey.split(",");
context.beginPath();
context.rect(gridKey[0] * size + .5 + offset.x, gridKey[1] * size + .5 + offset.y, size, size);
var text = grids[gridKey];
if (options.label.average) {
text = parseInt(grids[gridKey] / gridIndexData[gridKey].length)
}
context.fillStyle = intensity.getColor(text);
context.fill();
if (options.strokeStyle && options.lineWidth) {
context.stroke();
}
}
if (options.label && options.label.show !== false) {
context.fillStyle = options.label.fillStyle || 'white';
if (options.label.font) {
context.font = options.label.font;
}
if (options.label.shadowColor) {
context.shadowColor = options.label.shadowColor;
}
if (options.label.shadowBlur) {
context.shadowBlur = options.label.shadowBlur;
}
for (var gridKey in grids) {
gridKey = gridKey.split(",");
var text = grids[gridKey];
if (options.label.average) {
text = parseInt(text / gridIndexData[gridKey].length)
}
var textWidth = context.measureText(text).width;
context.fillText(text, gridKey[0] * size + .5 + offset.x + size / 2 - textWidth / 2, gridKey[1] * size + .5 + offset.y + size / 2 + 5);
}
}
context.restore();
}
};
/**
* @author kyle / http://nikai.us/
*/
function hex_corner(center, size, i) {
var angle_deg = 60 * i + 30;
var angle_rad = Math.PI / 180 * angle_deg;
return [center.x + size * Math.cos(angle_rad), center.y + size * Math.sin(angle_rad)];
}
var drawHoneycomb = {
draw: function draw(context, dataSet, options) {
context.save();
var data = dataSet instanceof DataSet ? dataSet.get() : dataSet;
for (var key in options) {
context[key] = options[key];
}
var grids = {};
var offset = options.offset || {
x: 10,
y: 10
};
//
var r = options._size || options.size || 40;
r = r / 2 / Math.sin(Math.PI / 3);
var dx = r * 2 * Math.sin(Math.PI / 3);
var dy = r * 1.5;
var binsById = {};
for (var i = 0; i < data.length; i++) {
var coordinates = data[i].geometry._coordinates || data[i].geometry.coordinates;
var py = (coordinates[1] - offset.y) / dy,
pj = Math.round(py),
px = (coordinates[0] - offset.x) / dx - (pj & 1 ? .5 : 0),
pi = Math.round(px),
py1 = py - pj;
if (Math.abs(py1) * 3 > 1) {
var px1 = px - pi,
pi2 = pi + (px < pi ? -1 : 1) / 2,
pj2 = pj + (py < pj ? -1 : 1),
px2 = px - pi2,
py2 = py - pj2;
if (px1 * px1 + py1 * py1 > px2 * px2 + py2 * py2) pi = pi2 + (pj & 1 ? 1 : -1) / 2, pj = pj2;
}
var id = pi + "-" + pj,
bin = binsById[id];
if (bin) {
bin.push(data[i]);
} else {
bin = binsById[id] = [data[i]];
bin.i = pi;
bin.j = pj;
bin.x = (pi + (pj & 1 ? 1 / 2 : 0)) * dx;
bin.y = pj * dy;
}
}
var intensity = new Intensity({
max: options.max || 100,
maxSize: r,
gradient: options.gradient
});
for (var key in binsById) {
var item = binsById[key];
context.beginPath();
for (var j = 0; j < 6; j++) {
var radius = r;
var result = hex_corner({
x: item.x + offset.x,
y: item.y + offset.y
}, radius, j);
context.lineTo(result[0], result[1]);
}
context.closePath();
var count = 0;
for (var i = 0; i < item.length; i++) {
count += item[i].count || 1;
}
item.count = count;
context.fillStyle = intensity.getColor(count);
context.fill();
if (options.strokeStyle && options.lineWidth) {
context.stroke();
}
}
if (options.label && options.label.show !== false) {
context.fillStyle = options.label.fillStyle || 'white';
if (options.label.font) {
context.font = options.label.font;
}
if (options.label.shadowColor) {
context.shadowColor = options.label.shadowColor;
}
if (options.label.shadowBlur) {
context.shadowBlur = options.label.shadowBlur;
}
for (var key in binsById) {
var item = binsById[key];
var text = item.count;
if (text < 0) {
text = text.toFixed(2);
} else {
text = ~~text;
}
var textWidth = context.measureText(text).width;
context.fillText(text, item.x + offset.x - textWidth / 2, item.y + offset.y + 5);
}
}
context.restore();
}
};
function createShader(gl, src, type) {
var shader = gl.createShader(type);
gl.shaderSource(shader, src);
gl.compileShader(shader);
return shader;
}
function initShaders(gl, vs_source, fs_source) {
var vertexShader = createShader(gl, vs_source, gl.VERTEX_SHADER);
var fragmentShader = createShader(gl, fs_source, gl.FRAGMENT_SHADER);
var glProgram = gl.createProgram();
gl.attachShader(glProgram, vertexShader);
gl.attachShader(glProgram, fragmentShader);
gl.linkProgram(glProgram);
gl.useProgram(glProgram);
return glProgram;
}
function getColorData(color) {
var tmpCanvas = document.createElement('canvas');
var tmpCtx = tmpCanvas.getContext('2d');
tmpCanvas.width = 1;
tmpCanvas.height = 1;
tmpCtx.fillStyle = color;
tmpCtx.fillRect(0, 0, 1, 1);
return tmpCtx.getImageData(0, 0, 1, 1).data;
}
var vs_s = ['attribute vec4 a_Position;', 'void main() {', 'gl_Position = a_Position;', 'gl_PointSize = 30.0;', '}'].join('');
var fs_s = ['precision mediump float;', 'uniform vec4 u_FragColor;', 'void main() {', 'gl_FragColor = u_FragColor;', '}'].join('');
function draw$1(gl, data, options) {
if (!data) {
return;
}
var program = initShaders(gl, vs_s, fs_s);
gl.enable(gl.BLEND);
gl.blendFunc(gl.SRC_ALPHA, gl.ONE);
//gl.clearColor(0.0, 0.0, 1.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT);
var halfCanvasWidth = gl.canvas.width / 2;
var halfCanvasHeight = gl.canvas.height / 2;
// Create a buffer object
var vertexBuffer = gl.createBuffer();
// Bind the buffer object to target
gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);
var a_Position = gl.getAttribLocation(program, 'a_Position');
// Assign the buffer object to a_Position variable
gl.vertexAttribPointer(a_Position, 2, gl.FLOAT, false, 0, 0);
// Enable the assignment to a_Position variable
gl.enableVertexAttribArray(a_Position);
var uFragColor = gl.getUniformLocation(program, 'u_FragColor');
var colored = getColorData(options.strokeStyle || 'red');
gl.uniform4f(uFragColor, colored[0] / 255, colored[1] / 255, colored[2] / 255, colored[3] / 255);
gl.lineWidth(options.lineWidth || 1);
for (var i = 0, len = data.length; i < len; i++) {
var _geometry = data[i].geometry._coordinates;
var verticesData = [];
for (var j = 0; j < _geometry.length; j++) {
var item = _geometry[j];
var x = (item[0] - halfCanvasWidth) / halfCanvasWidth;
var y = (halfCanvasHeight - item[1]) / halfCanvasHeight;
verticesData.push(x, y);
}
var vertices = new Float32Array(verticesData);
// Write date into the buffer object
gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);
gl.drawArrays(gl.LINE_STRIP, 0, _geometry.length);
}
}
var line = {
draw: draw$1
};
var vs_s$1 = ['attribute vec4 a_Position;', 'attribute float a_PointSize;', 'void main() {', 'gl_Position = a_Position;', 'gl_PointSize = a_PointSize;', '}'].join('');
var fs_s$1 = ['precision mediump float;', 'uniform vec4 u_FragColor;', 'void main() {', 'gl_FragColor = u_FragColor;', '}'].join('');
function draw$2(gl, data, options) {
if (!data) {
return;
}
var program = initShaders(gl, vs_s$1, fs_s$1);
var a_Position = gl.getAttribLocation(program, 'a_Position');
var a_PointSize = gl.getAttribLocation(program, 'a_PointSize');
var uFragColor = gl.getUniformLocation(program, 'u_FragColor');
//gl.clearColor(0.0, 0.0, 1.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT);
var halfCanvasWidth = gl.canvas.width / 2;
var halfCanvasHeight = gl.canvas.height / 2;
var verticesData = [];
var count = 0;
for (var i = 0; i < data.length; i++) {
var item = data[i].geometry._coordinates;
var x = (item[0] - halfCanvasWidth) / halfCanvasWidth;
var y = (halfCanvasHeight - item[1]) / halfCanvasHeight;
if (x < -1 || x > 1 || y < -1 || y > 1) {
continue;
}
verticesData.push(x, y);
count++;
}
var vertices = new Float32Array(verticesData);
var n = count; // The number of vertices
// Create a buffer object
var vertexBuffer = gl.createBuffer();
// Bind the buffer object to target
gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);
// Write date into the buffer object
gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);
// Assign the buffer object to a_Position variable
gl.vertexAttribPointer(a_Position, 2, gl.FLOAT, false, 0, 0);
// Enable the assignment to a_Position variable
gl.enableVertexAttribArray(a_Position);
gl.vertexAttrib1f(a_PointSize, options._size);
var colored = getColorData(options.fillStyle || 'red');
gl.uniform4f(uFragColor, colored[0] / 255, colored[1] / 255, colored[2] / 255, colored[3] / 255);
gl.drawArrays(gl.POINTS, 0, n);
}
var point = {
draw: draw$2
};
function earcut(data, holeIndices, dim) {
dim = dim || 2;
var hasHoles = holeIndices && holeIndices.length,
outerLen = hasHoles ? holeIndices[0] * dim : data.length,
outerNode = linkedList(data, 0, outerLen, dim, true),
triangles = [];
if (!outerNode) return triangles;
var minX, minY, maxX, maxY, x, y, size;
if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);
// if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox
if (data.length > 80 * dim) {
minX = maxX = data[0];
minY = maxY = data[1];
for (var i = dim; i < outerLen; i += dim) {
x = data[i];
y = data[i + 1];
if (x < minX) minX = x;
if (y < minY) minY = y;
if (x > maxX) maxX = x;
if (y > maxY) maxY = y;
}
// minX, minY and size are later used to transform coords into integers for z-order calculation
size = Math.max(maxX - minX, maxY - minY);
}
earcutLinked(outerNode, triangles, dim, minX, minY, size);
return triangles;
}
// create a circular doubly linked list from polygon points in the specified winding order
function linkedList(data, start, end, dim, clockwise) {
var i, last;
if (clockwise === signedArea(data, start, end, dim) > 0) {
for (i = start; i < end; i += dim) {
last = insertNode(i, data[i], data[i + 1], last);
}
} else {
for (i = end - dim; i >= start; i -= dim) {
last = insertNode(i, data[i], data[i + 1], last);
}
}
if (last && equals(last, last.next)) {
removeNode(last);
last = last.next;
}
return last;
}
// eliminate colinear or duplicate points
function filterPoints(start, end) {
if (!start) return start;
if (!end) end = start;
var p = start,
again;
do {
again = false;
if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {
removeNode(p);
p = end = p.prev;
if (p === p.next) return null;
again = true;
} else {
p = p.next;
}
} while (again || p !== end);
return end;
}
// main ear slicing loop which triangulates a polygon (given as a linked list)
function earcutLinked(ear, triangles, dim, minX, minY, size, pass) {
if (!ear) return;
// interlink polygon nodes in z-order
if (!pass && size) indexCurve(ear, minX, minY, size);
var stop = ear,
prev,
next;
// iterate through ears, slicing them one by one
while (ear.prev !== ear.next) {
prev = ear.prev;
next = ear.next;
if (size ? isEarHashed(ear, minX, minY, size) : isEar(ear)) {
// cut off the triangle
triangles.push(prev.i / dim);
triangles.push(ear.i / dim);
triangles.push(next.i / dim);
removeNode(ear);
// skipping the next vertice leads to less sliver triangles
ear = next.next;
stop = next.next;
continue;
}
ear = next;
// if we looped through the whole remaining polygon and can't find any more ears
if (ear === stop) {
// try filtering points and slicing again
if (!pass) {
earcutLinked(filterPoints(ear), triangles, dim, minX, minY, size, 1);
// if this didn't work, try curing all small self-intersections locally
} else if (pass === 1) {
ear = cureLocalIntersections(ear, triangles, dim);
earcutLinked(ear, triangles, dim, minX, minY, size, 2);
// as a last resort, try splitting the remaining polygon into two
} else if (pass === 2) {
splitEarcut(ear, triangles, dim, minX, minY, size);
}
break;
}
}
}
// check whether a polygon node forms a valid ear with adjacent nodes
function isEar(ear) {
var a = ear.prev,
b = ear,
c = ear.next;
if (area(a, b, c) >= 0) return false; // reflex, can't be an ear
// now make sure we don't have other points inside the potential ear
var p = ear.next.next;
while (p !== ear.prev) {
if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;
p = p.next;
}
return true;
}
function isEarHashed(ear, minX, minY, size) {
var a = ear.prev,
b = ear,
c = ear.next;
if (area(a, b, c) >= 0) return false; // reflex, can't be an ear
// triangle bbox; min & max are calculated like this for speed
var minTX = a.x < b.x ? a.x < c.x ? a.x : c.x : b.x < c.x ? b.x : c.x,
minTY = a.y < b.y ? a.y < c.y ? a.y : c.y : b.y < c.y ? b.y : c.y,
maxTX = a.x > b.x ? a.x > c.x ? a.x : c.x : b.x > c.x ? b.x : c.x,
maxTY = a.y > b.y ? a.y > c.y ? a.y : c.y : b.y > c.y ? b.y : c.y;
// z-order range for the current triangle bbox;
var minZ = zOrder(minTX, minTY, minX, minY, size),
maxZ = zOrder(maxTX, maxTY, minX, minY, size);
// first look for points inside the triangle in increasing z-order
var p = ear.nextZ;
while (p && p.z <= maxZ) {
if (p !== ear.prev && p !== ear.next && pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;
p = p.nextZ;
}
// then look for points in decreasing z-order
p = ear.prevZ;
while (p && p.z >= minZ) {
if (p !== ear.prev && p !== ear.next && pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;
p = p.prevZ;
}
return true;
}
// go through all polygon nodes and cure small local self-intersections
function cureLocalIntersections(start, triangles, dim) {
var p = start;
do {
var a = p.prev,
b = p.next.next;
if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {
triangles.push(a.i / dim);
triangles.push(p.i / dim);
triangles.push(b.i / dim);
// remove two nodes involved
removeNode(p);
removeNode(p.next);
p = start = b;
}
p = p.next;
} while (p !== start);
return p;
}
// try splitting polygon into two and triangulate them independently
function splitEarcut(start, triangles, dim, minX, minY, size) {
// look for a valid diagonal that divides the polygon into two
var a = start;
do {
var b = a.next.next;
while (b !== a.prev) {
if (a.i !== b.i && isValidDiagonal(a, b)) {
// split the polygon in two by the diagonal
var c = splitPolygon(a, b);
// filter colinear points around the cuts
a = filterPoints(a, a.next);
c = filterPoints(c, c.next);
// run earcut on each half
earcutLinked(a, triangles, dim, minX, minY, size);
earcutLinked(c, triangles, dim, minX, minY, size);
return;
}
b = b.next;
}
a = a.next;
} while (a !== start);
}
// link every hole into the outer loop, producing a single-ring polygon without holes
function eliminateHoles(data, holeIndices, outerNode, dim) {
var queue = [],
i,
len,
start,
end,
list;
for (i = 0, len = holeIndices.length; i < len; i++) {
start = holeIndices[i] * dim;
end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;
list = linkedList(data, start, end, dim, false);
if (list === list.next) list.steiner = true;
queue.push(getLeftmost(list));
}
queue.sort(compareX);
// process holes from left to right
for (i = 0; i < queue.length; i++) {
eliminateHole(queue[i], outerNode);
outerNode = filterPoints(outerNode, outerNode.next);
}
return outerNode;
}
function compareX(a, b) {
return a.x - b.x;
}
// find a bridge between vertices that connects hole with an outer ring and and link it
function eliminateHole(hole, outerNode) {
outerNode = findHoleBridge(hole, outerNode);
if (outerNode) {
var b = splitPolygon(outerNode, hole);
filterPoints(b, b.next);
}
}
// David Eberly's algorithm for finding a bridge between hole and outer polygon
function findHoleBridge(hole, outerNode) {
var p = outerNode,
hx = hole.x,
hy = hole.y,
qx = -Infinity,
m;
// find a segment intersected by a ray from the hole's leftmost point to the left;
// segment's endpoint with lesser x will be potential connection point
do {
if (hy <= p.y && hy >= p.next.y) {
var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);
if (x <= hx && x > qx) {
qx = x;
if (x === hx) {
if (hy === p.y) return p;
if (hy === p.next.y) return p.next;
}
m = p.x < p.next.x ? p : p.next;
}
}
p = p.next;
} while (p !== outerNode);
if (!m) return null;
if (hx === qx) return m.prev; // hole touches outer segment; pick lower endpoint
// look for points inside the triangle of hole point, segment intersection and endpoint;
// if there are no points found, we have a valid connection;
// otherwise choose the point of the minimum angle with the ray as connection point
var stop = m,
mx = m.x,
my = m.y,
tanMin = Infinity,
tan;
p = m.next;
while (p !== stop) {
if (hx >= p.x && p.x >= mx && pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {
tan = Math.abs(hy - p.y) / (hx - p.x); // tangential
if ((tan < tanMin || tan === tanMin && p.x > m.x) && locallyInside(p, hole)) {
m = p;
tanMin = tan;
}
}
p = p.next;
}
return m;
}
// interlink polygon nodes in z-order
function indexCurve(start, minX, minY, size) {
var p = start;
do {
if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, size);
p.prevZ = p.prev;
p.nextZ = p.next;
p = p.next;
} while (p !== start);
p.prevZ.nextZ = null;
p.prevZ = null;
sortLinked(p);
}
// Simon Tatham's linked list merge sort algorithm
// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html
function sortLinked(list) {
var i,
p,
q,
e,
tail,
numMerges,
pSize,
qSize,
inSize = 1;
do {
p = list;
list = null;
tail = null;
numMerges = 0;
while (p) {
numMerges++;
q = p;
pSize = 0;
for (i = 0; i < inSize; i++) {
pSize++;
q = q.nextZ;
if (!q) break;
}
qSize = inSize;
while (pSize > 0 || qSize > 0 && q) {
if (pSize === 0) {
e = q;
q = q.nextZ;
qSize--;
} else if (qSize === 0 || !q) {
e = p;
p = p.nextZ;
pSize--;
} else if (p.z <= q.z) {
e = p;
p = p.nextZ;
pSize--;
} else {
e = q;
q = q.nextZ;
qSize--;
}
if (tail) tail.nextZ = e;
else list = e;
e.prevZ = tail;
tail = e;
}
p = q;
}
tail.nextZ = null;
inSize *= 2;
} while (numMerges > 1);
return list;
}
// z-order of a point given coords and size of the data bounding box
function zOrder(x, y, minX, minY, size) {
// coords are transformed into non-negative 15-bit integer range
x = 32767 * (x - minX) / size;
y = 32767 * (y - minY) / size;
x = (x | x << 8) & 0x00FF00FF;
x = (x | x << 4) & 0x0F0F0F0F;
x = (x | x << 2) & 0x33333333;
x = (x | x << 1) & 0x55555555;
y = (y | y << 8) & 0x00FF00FF;
y = (y | y << 4) & 0x0F0F0F0F;
y = (y | y << 2) & 0x33333333;
y = (y | y << 1) & 0x55555555;
return x | y << 1;
}
// find the leftmost node of a polygon ring
function getLeftmost(start) {
var p = start,
leftmost = start;
do {
if (p.x < leftmost.x) leftmost = p;
p = p.next;
} while (p !== start);
return leftmost;
}
// check if a point lies within a convex triangle
function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {
return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 && (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 && (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;
}
// check if a diagonal between two polygon nodes is valid (lies in polygon interior)
function isValidDiagonal(a, b) {
return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b);
}
// signed area of a triangle
function area(p, q, r) {
return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
}
// check if two points are equal
function equals(p1, p2) {
return p1.x === p2.x && p1.y === p2.y;
}
// check if two segments intersect
function intersects(p1, q1, p2, q2) {
if (equals(p1, q1) && equals(p2, q2) || equals(p1, q2) && equals(p2, q1)) return true;
return area(p1, q1, p2) > 0 !== area(p1, q1, q2) > 0 && area(p2, q2, p1) > 0 !== area(p2, q2, q1) > 0;
}
// check if a polygon diagonal intersects any polygon segments
function intersectsPolygon(a, b) {
var p = a;
do {
if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i && intersects(p, p.next, a, b)) return true;
p = p.next;
} while (p !== a);
return false;
}
// check if a polygon diagonal is locally inside the polygon
function locallyInside(a, b) {
return area(a.prev, a, a.next) < 0 ? area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 : area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;
}
// check if the middle point of a polygon diagonal is inside the polygon
function middleInside(a, b) {
var p = a,
inside = false,
px = (a.x + b.x) / 2,
py = (a.y + b.y) / 2;
do {
if (p.y > py !== p.next.y > py && px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x) inside = !inside;
p = p.next;
} while (p !== a);
return inside;
}
// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;
// if one belongs to the outer ring and another to a hole, it merges it into a single ring
function splitPolygon(a, b) {
var a2 = new Node(a.i, a.x, a.y),
b2 = new Node(b.i, b.x, b.y),
an = a.next,
bp = b.prev;
a.next = b;
b.prev = a;
a2.next = an;
an.prev = a2;
b2.next = a2;
a2.prev = b2;
bp.next = b2;
b2.prev = bp;
return b2;
}
// create a node and optionally link it with previous one (in a circular doubly linked list)
function insertNode(i, x, y, last) {
var p = new Node(i, x, y);
if (!last) {
p.prev = p;
p.next = p;
} else {
p.next = last.next;
p.prev = last;
last.next.prev = p;
last.next = p;
}
return p;
}
function removeNode(p) {
p.next.prev = p.prev;
p.prev.next = p.next;
if (p.prevZ) p.prevZ.nextZ = p.nextZ;
if (p.nextZ) p.nextZ.prevZ = p.prevZ;
}
function Node(i, x, y) {
// vertice index in coordinates array
this.i = i;
// vertex coordinates
this.x = x;
this.y = y;
// previous and next vertice nodes in a polygon ring
this.prev = null;
this.next = null;
// z-order curve value
this.z = null;
// previous and next nodes in z-order
this.prevZ = null;
this.nextZ = null;
// indicates whether this is a steiner point
this.steiner = false;
}
// return a percentage difference between the polygon area and its triangulation area;
// used to verify correctness of triangulation
earcut.deviation = function(data, holeIndices, dim, triangles) {
var hasHoles = holeIndices && holeIndices.length;
var outerLen = hasHoles ? holeIndices[0] * dim : data.length;
var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));
if (hasHoles) {
for (var i = 0, len = holeIndices.length; i < len; i++) {
var start = holeIndices[i] * dim;
var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;
polygonArea -= Math.abs(signedArea(data, start, end, dim));
}
}
var trianglesArea = 0;
for (i = 0; i < triangles.length; i += 3) {
var a = triangles[i] * dim;
var b = triangles[i + 1] * dim;
var c = triangles[i + 2] * dim;
trianglesArea += Math.abs((data[a] - data[c]) * (data[b + 1] - data[a + 1]) - (data[a] - data[b]) * (data[c + 1] - data[a + 1]));
}
return polygonArea === 0 && trianglesArea === 0 ? 0 : Math.abs((trianglesArea - polygonArea) / polygonArea);
};
function signedArea(data, start, end, dim) {
var sum = 0;
for (var i = start, j = end - dim; i < end; i += dim) {
sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);
j = i;
}
return sum;
}
// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts
earcut.flatten = function(data) {
var dim = data[0][0].length,
result = {
vertices: [],
holes: [],
dimensions: dim
},
holeIndex = 0;
for (var i = 0; i < data.length; i++) {
for (var j = 0; j < data[i].length; j++) {
for (var d = 0; d < dim; d++) {
result.vertices.push(data[i][j][d]);
}
}
if (i > 0) {
holeIndex += data[i - 1].length;
result.holes.push(holeIndex);
}
}
return result;
};
var vs_s$2 = ['attribute vec4 a_Position;', 'void main() {', 'gl_Position = a_Position;', 'gl_PointSize = 30.0;', '}'].join('');
var fs_s$2 = ['precision mediump float;', 'uniform vec4 u_FragColor;', 'void main() {', 'gl_FragColor = u_FragColor;', '}'].join('');
function draw$3(gl, data, options) {
if (!data) {
return;
}
// gl.clearColor(0.0, 0.0, 0.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT);
gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);
var program = initShaders(gl, vs_s$2, fs_s$2);
gl.enable(gl.BLEND);
gl.blendFunc(gl.SRC_ALPHA, gl.ONE);
var halfCanvasWidth = gl.canvas.width / 2;
var halfCanvasHeight = gl.canvas.height / 2;
// Bind the buffer object to target
gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, gl.createBuffer());
var a_Position = gl.getAttribLocation(program, 'a_Position');
// Assign the buffer object to a_Position variable
gl.vertexAttribPointer(a_Position, 2, gl.FLOAT, false, 0, 0);
// Enable the assignment to a_Position variable
gl.enableVertexAttribArray(a_Position);
var uFragColor = gl.getUniformLocation(program, 'u_FragColor');
var colored = getColorData(options.fillStyle || 'red');
gl.uniform4f(uFragColor, colored[0] / 255, colored[1] / 255, colored[2] / 255, colored[3] / 255);
gl.lineWidth(options.lineWidth || 1);
var verticesArr = [];
var trianglesArr = [];
var maxSize = 65536;
var indexOffset = 0;
for (var i = 0, len = data.length; i < len; i++) {
var flatten = earcut.flatten(data[i].geometry._coordinates || data[i].geometry.coordinates);
var vertices = flatten.vertices;
indexOffset = verticesArr.length / 2;
for (var j = 0; j < vertices.length; j += 2) {
vertices[j] = (vertices[j] - halfCanvasWidth) / halfCanvasWidth;
vertices[j + 1] = (halfCanvasHeight - vertices[j + 1]) / halfCanvasHeight;
}
if ((verticesArr.length + vertices.length) / 2 > maxSize) {
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(verticesArr), gl.STATIC_DRAW);
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(trianglesArr), gl.STATIC_DRAW);
gl.drawElements(gl.TRIANGLES, trianglesArr.length, gl.UNSIGNED_SHORT, 0);
verticesArr.length = 0;
trianglesArr.length = 0;
indexOffset = 0;
}
for (var j = 0; j < vertices.length; j++) {
verticesArr.push(vertices[j]);
}
var triangles = earcut(vertices, flatten.holes, flatten.dimensions);
for (var j = 0; j < triangles.length; j++) {
trianglesArr.push(triangles[j] + indexOffset);
}
}
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(verticesArr), gl.STATIC_DRAW);
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(trianglesArr), gl.STATIC_DRAW);
gl.drawElements(gl.TRIANGLES, trianglesArr.length, gl.UNSIGNED_SHORT, 0);
gl.bindBuffer(gl.ARRAY_BUFFER, null);
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
}
var polygon = {
draw: draw$3
};
/**
* @author kyle / http://nikai.us/
*/
var webglDrawSimple = {
draw: function draw(gl, dataSet, options) {
var data = dataSet instanceof DataSet ? dataSet.get() : dataSet;
if (data.length > 0) {
if (data[0].geometry.type == "LineString") {
line.draw(gl, data, options);
} else if (data[0].geometry.type == "Polygon" || data[0].geometry.type == "MultiPolygon") {
polygon.draw(gl, data, options);
} else {
point.draw(gl, data, options);
}
}
}
};
/**
* get the center by the city name
* @author kyle / http://nikai.us/
*/
var citycenter = {
municipalities: [{
n: "北京",
g: "116.395645,39.929986|12"
}, {
n: "上海",
g: "121.487899,31.249162|12"
}, {
n: "天津",
g: "117.210813,39.14393|12"
}, {
n: "重庆",
g: "106.530635,29.544606|12"
}],
provinces: [{
n: "安徽",
g: "117.216005,31.859252|8",
cities: [{
n: "合肥",
g: "117.282699,31.866942|12"
}, {
n: "安庆",
g: "117.058739,30.537898|13"
}, {
n: "蚌埠",
g: "117.35708,32.929499|13"
}, {
n: "亳州",
g: "115.787928,33.871211|13"
}, {
n: "巢湖",
g: "117.88049,31.608733|13"
}, {
n: "池州",
g: "117.494477,30.660019|14"
}, {
n: "滁州",
g: "118.32457,32.317351|13"
}, {
n: "阜阳",
g: "115.820932,32.901211|13"
}, {
n: "淮北",
g: "116.791447,33.960023|13"
}, {
n: "淮南",
g: "117.018639,32.642812|13"
}, {
n: "黄山",
g: "118.29357,29.734435|13"
}, {
n: "六安",
g: "116.505253,31.755558|13"
}, {
n: "马鞍山",
g: "118.515882,31.688528|13"
}, {
n: "宿州",
g: "116.988692,33.636772|13"
}, {
n: "铜陵",
g: "117.819429,30.94093|14"
}, {
n: "芜湖",
g: "118.384108,31.36602|12"
}, {
n: "宣城",
g: "118.752096,30.951642|13"
}]
}, {
n: "福建",
g: "117.984943,26.050118|8",
cities: [{
n: "福州",
g: "119.330221,26.047125|12"
}, {
n: "龙岩",
g: "117.017997,25.078685|13"
}, {
n: "南平",
g: "118.181883,26.643626|13"
}, {
n: "宁德",
g: "119.542082,26.656527|14"
}, {
n: "莆田",
g: "119.077731,25.44845|13"
}, {
n: "泉州",
g: "118.600362,24.901652|12"
}, {
n: "三明",
g: "117.642194,26.270835|14"
}, {
n: "厦门",
g: "118.103886,24.489231|12"
}, {
n: "漳州",
g: "117.676205,24.517065|12"
}]
}, {
n: "甘肃",
g: "102.457625,38.103267|6",
cities: [{
n: "兰州",
g: "103.823305,36.064226|12"
}, {
n: "白银",
g: "104.171241,36.546682|13"
}, {
n: "定西",
g: "104.626638,35.586056|13"
}, {
n: "甘南州",
g: "102.917442,34.992211|14"
}, {
n: "嘉峪关",
g: "98.281635,39.802397|13"
}, {
n: "金昌",
g: "102.208126,38.516072|13"
}, {
n: "酒泉",
g: "98.508415,39.741474|13"
}, {
n: "临夏州",
g: "103.215249,35.598514|13"
}, {
n: "陇南",
g: "104.934573,33.39448|14"
}, {
n: "平凉",
g: "106.688911,35.55011|13"
}, {
n: "庆阳",
g: "107.644227,35.726801|13"
}, {
n: "天水",
g: "105.736932,34.584319|13"
}, {
n: "武威",
g: "102.640147,37.933172|13"
}, {
n: "张掖",
g: "100.459892,38.93932|13"
}]
}, {
n: "广东",
g: "113.394818,23.408004|8",
cities: [{
n: "广州",
g: "113.30765,23.120049|12"
}, {
n: "潮州",
g: "116.630076,23.661812|13"
}, {
n: "东莞",
g: "113.763434,23.043024|12"
}, {
n: "佛山",
g: "113.134026,23.035095|13"
}, {
n: "河源",
g: "114.713721,23.757251|12"
}, {
n: "惠州",
g: "114.410658,23.11354|12"
}, {
n: "江门",
g: "113.078125,22.575117|13"
}, {
n: "揭阳",
g: "116.379501,23.547999|13"
}, {
n: "茂名",
g: "110.931245,21.668226|13"
}, {
n: "梅州",
g: "116.126403,24.304571|13"
}, {
n: "清远",
g: "113.040773,23.698469|13"
}, {
n: "汕头",
g: "116.72865,23.383908|13"
}, {
n: "汕尾",
g: "115.372924,22.778731|14"
}, {
n: "韶关",
g: "113.594461,24.80296|13"
}, {
n: "深圳",
g: "114.025974,22.546054|12"
}, {
n: "阳江",
g: "111.97701,21.871517|14"
}, {
n: "云浮",
g: "112.050946,22.937976|13"
}, {
n: "湛江",
g: "110.365067,21.257463|13"
}, {
n: "肇庆",
g: "112.479653,23.078663|13"
}, {
n: "中山",
g: "113.42206,22.545178|12"
}, {
n: "珠海",
g: "113.562447,22.256915|13"
}]
}, {
n: "广西",
g: "108.924274,23.552255|7",
cities: [{
n: "南宁",
g: "108.297234,22.806493|12"
}, {
n: "百色",
g: "106.631821,23.901512|13"
}, {
n: "北海",
g: "109.122628,21.472718|13"
}, {
n: "崇左",
g: "107.357322,22.415455|14"
}, {
n: "防城港",
g: "108.351791,21.617398|15"
}, {
n: "桂林",
g: "110.26092,25.262901|12"
}, {
n: "贵港",
g: "109.613708,23.103373|13"
}, {
n: "河池",
g: "108.069948,24.699521|14"
}, {
n: "贺州",
g: "111.552594,24.411054|14"
}, {
n: "来宾",
g: "109.231817,23.741166|14"
}, {
n: "柳州",
g: "109.422402,24.329053|12"
}, {
n: "钦州",
g: "108.638798,21.97335|13"
}, {
n: "梧州",
g: "111.305472,23.485395|13"
}, {
n: "玉林",
g: "110.151676,22.643974|14"
}]
}, {
n: "贵州",
g: "106.734996,26.902826|8",
cities: [{
n: "贵阳",
g: "106.709177,26.629907|12"
}, {
n: "安顺",
g: "105.92827,26.228595|13"
}, {
n: "毕节地区",
g: "105.300492,27.302612|14"
}, {
n: "六盘水",
g: "104.852087,26.591866|13"
}, {
n: "铜仁地区",
g: "109.196161,27.726271|14"
}, {
n: "遵义",
g: "106.93126,27.699961|13"
}, {
n: "黔西南州",
g: "104.900558,25.095148|11"
}, {
n: "黔东南州",
g: "107.985353,26.583992|11"
}, {
n: "黔南州",
g: "107.523205,26.264536|11"
}]
}, {
n: "海南",
g: "109.733755,19.180501|9",
cities: [{
n: "海口",
g: "110.330802,20.022071|13"
}, {
n: "白沙",
g: "109.358586,19.216056|12"
}, {
n: "保亭",
g: "109.656113,18.597592|12"
}, {
n: "昌江",
g: "109.0113,19.222483|12"
}, {
n: "儋州",
g: "109.413973,19.571153|13"
}, {
n: "澄迈",
g: "109.996736,19.693135|13"
}, {
n: "东方",
g: "108.85101,18.998161|13"
}, {
n: "定安",
g: "110.32009,19.490991|13"
}, {
n: "琼海",
g: "110.414359,19.21483|13"
}, {
n: "琼中",
g: "109.861849,19.039771|12"
}, {
n: "乐东",
g: "109.062698,18.658614|12"
}, {
n: "临高",
g: "109.724101,19.805922|13"
}, {
n: "陵水",
g: "109.948661,18.575985|12"
}, {
n: "三亚",
g: "109.522771,18.257776|12"
}, {
n: "屯昌",
g: "110.063364,19.347749|13"
}, {
n: "万宁",
g: "110.292505,18.839886|13"
}, {
n: "文昌",
g: "110.780909,19.750947|13"
}, {
n: "五指山",
g: "109.51775,18.831306|13"
}]
}, {
n: "河北",
g: "115.661434,38.61384|7",
cities: [{
n: "石家庄",
g: "114.522082,38.048958|12"
}, {
n: "保定",
g: "115.49481,38.886565|13"
}, {
n: "沧州",
g: "116.863806,38.297615|13"
}, {
n: "承德",
g: "117.933822,40.992521|14"
}, {
n: "邯郸",
g: "114.482694,36.609308|13"
}, {
n: "衡水",
g: "115.686229,37.746929|13"
}, {
n: "廊坊",
g: "116.703602,39.518611|13"
}, {
n: "秦皇岛",
g: "119.604368,39.945462|12"
}, {
n: "唐山",
g: "118.183451,39.650531|13"
}, {
n: "邢台",
g: "114.520487,37.069531|13"
}, {
n: "张家口",
g: "114.893782,40.811188|13"
}]
}, {
n: "河南",
g: "113.486804,34.157184|7",
cities: [{
n: "郑州",
g: "113.649644,34.75661|12"
}, {
n: "安阳",
g: "114.351807,36.110267|12"
}, {
n: "鹤壁",
g: "114.29777,35.755426|13"
}, {
n: "焦作",
g: "113.211836,35.234608|13"
}, {
n: "开封",
g: "114.351642,34.801854|13"
}, {
n: "洛阳",
g: "112.447525,34.657368|12"
}, {
n: "漯河",
g: "114.046061,33.576279|13"
}, {
n: "南阳",
g: "112.542842,33.01142|13"
}, {
n: "平顶山",
g: "113.300849,33.745301|13"
}, {
n: "濮阳",
g: "115.026627,35.753298|12"
}, {
n: "三门峡",
g: "111.181262,34.78332|13"
}, {
n: "商丘",
g: "115.641886,34.438589|13"
}, {
n: "新乡",
g: "113.91269,35.307258|13"
}, {
n: "信阳",
g: "114.085491,32.128582|13"
}, {
n: "许昌",
g: "113.835312,34.02674|13"
}, {
n: "周口",
g: "114.654102,33.623741|13"
}, {
n: "驻马店",
g: "114.049154,32.983158|13"
}]
}, {
n: "黑龙江",
g: "128.047414,47.356592|6",
cities: [{
n: "哈尔滨",
g: "126.657717,45.773225|12"
}, {
n: "大庆",
g: "125.02184,46.596709|12"
}, {
n: "大兴安岭地区",
g: "124.196104,51.991789|10"
}, {
n: "鹤岗",
g: "130.292472,47.338666|13"
}, {
n: "黑河",
g: "127.50083,50.25069|14"
}, {
n: "鸡西",
g: "130.941767,45.32154|13"
}, {
n: "佳木斯",
g: "130.284735,46.81378|12"
}, {
n: "牡丹江",
g: "129.608035,44.588521|13"
}, {
n: "七台河",
g: "131.019048,45.775005|14"
}, {
n: "齐齐哈尔",
g: "123.987289,47.3477|13"
}, {
n: "双鸭山",
g: "131.171402,46.655102|13"
}, {
n: "绥化",
g: "126.989095,46.646064|13"
}, {
n: "伊春",
g: "128.910766,47.734685|14"
}]
}, {
n: "湖北",
g: "112.410562,31.209316|8",
cities: [{
n: "武汉",
g: "114.3162,30.581084|12"
}, {
n: "鄂州",
g: "114.895594,30.384439|14"
}, {
n: "恩施",
g: "109.517433,30.308978|14"
}, {
n: "黄冈",
g: "114.906618,30.446109|14"
}, {
n: "黄石",
g: "115.050683,30.216127|13"
}, {
n: "荆门",
g: "112.21733,31.042611|13"
}, {
n: "荆州",
g: "112.241866,30.332591|12"
}, {
n: "潜江",
g: "112.768768,30.343116|13"
}, {
n: "神农架林区",
g: "110.487231,31.595768|13"
}, {
n: "十堰",
g: "110.801229,32.636994|13"
}, {
n: "随州",
g: "113.379358,31.717858|13"
}, {
n: "天门",
g: "113.12623,30.649047|13"
}, {
n: "仙桃",
g: "113.387448,30.293966|13"
}, {
n: "咸宁",
g: "114.300061,29.880657|13"
}, {
n: "襄阳",
g: "112.176326,32.094934|12"
}, {
n: "孝感",
g: "113.935734,30.927955|13"
}, {
n: "宜昌",
g: "111.310981,30.732758|13"
}]
}, {
n: "湖南",
g: "111.720664,27.695864|7",
cities: [{
n: "长沙",
g: "112.979353,28.213478|12"
}, {
n: "常德",
g: "111.653718,29.012149|12"
}, {
n: "郴州",
g: "113.037704,25.782264|13"
}, {
n: "衡阳",
g: "112.583819,26.898164|13"
}, {
n: "怀化",
g: "109.986959,27.557483|13"
}, {
n: "娄底",
g: "111.996396,27.741073|13"
}, {
n: "邵阳",
g: "111.461525,27.236811|13"
}, {
n: "湘潭",
g: "112.935556,27.835095|13"
}, {
n: "湘西州",
g: "109.745746,28.317951|14"
}, {
n: "益阳",
g: "112.366547,28.588088|13"
}, {
n: "永州",
g: "111.614648,26.435972|13"
}, {
n: "岳阳",
g: "113.146196,29.378007|13"
}, {
n: "张家界",
g: "110.48162,29.124889|13"
}, {
n: "株洲",
g: "113.131695,27.827433|13"
}]
}, {
n: "江苏",
g: "119.368489,33.013797|8",
cities: [{
n: "南京",
g: "118.778074,32.057236|12"
}, {
n: "常州",
g: "119.981861,31.771397|12"
}, {
n: "淮安",
g: "119.030186,33.606513|12"
}, {
n: "连云港",
g: "119.173872,34.601549|12"
}, {
n: "南通",
g: "120.873801,32.014665|12"
}, {
n: "苏州",
g: "120.619907,31.317987|12"
}, {
n: "宿迁",
g: "118.296893,33.95205|13"
}, {
n: "泰州",
g: "119.919606,32.476053|13"
}, {
n: "无锡",
g: "120.305456,31.570037|12"
}, {
n: "徐州",
g: "117.188107,34.271553|12"
}, {
n: "盐城",
g: "120.148872,33.379862|12"
}, {
n: "扬州",
g: "119.427778,32.408505|13"
}, {
n: "镇江",
g: "119.455835,32.204409|13"
}]
}, {
n: "江西",
g: "115.676082,27.757258|7",
cities: [{
n: "南昌",
g: "115.893528,28.689578|12"
}, {
n: "抚州",
g: "116.360919,27.954545|13"
}, {
n: "赣州",
g: "114.935909,25.845296|13"
}, {
n: "吉安",
g: "114.992039,27.113848|13"
}, {
n: "景德镇",
g: "117.186523,29.303563|12"
}, {
n: "九江",
g: "115.999848,29.71964|13"
}, {
n: "萍乡",
g: "113.859917,27.639544|13"
}, {
n: "上饶",
g: "117.955464,28.457623|13"
}, {
n: "新余",
g: "114.947117,27.822322|13"
}, {
n: "宜春",
g: "114.400039,27.81113|13"
}, {
n: "鹰潭",
g: "117.03545,28.24131|13"
}]
}, {
n: "吉林",
g: "126.262876,43.678846|7",
cities: [{
n: "长春",
g: "125.313642,43.898338|12"
}, {
n: "白城",
g: "122.840777,45.621086|13"
}, {
n: "白山",
g: "126.435798,41.945859|13"
}, {
n: "吉林市",
g: "126.564544,43.871988|12"
}, {
n: "辽源",
g: "125.133686,42.923303|13"
}, {
n: "四平",
g: "124.391382,43.175525|12"
}, {
n: "松原",
g: "124.832995,45.136049|13"
}, {
n: "通化",
g: "125.94265,41.736397|13"
}, {
n: "延边",
g: "129.485902,42.896414|13"
}]
}, {
n: "辽宁",
g: "122.753592,41.6216|8",
cities: [{
n: "沈阳",
g: "123.432791,41.808645|12"
}, {
n: "鞍山",
g: "123.007763,41.118744|13"
}, {
n: "本溪",
g: "123.778062,41.325838|12"
}, {
n: "朝阳",
g: "120.446163,41.571828|13"
}, {
n: "大连",
g: "121.593478,38.94871|12"
}, {
n: "丹东",
g: "124.338543,40.129023|12"
}, {
n: "抚顺",
g: "123.92982,41.877304|12"
}, {
n: "阜新",
g: "121.660822,42.01925|14"
}, {
n: "葫芦岛",
g: "120.860758,40.74303|13"
}, {
n: "锦州",
g: "121.147749,41.130879|13"
}, {
n: "辽阳",
g: "123.172451,41.273339|14"
}, {
n: "盘锦",
g: "122.073228,41.141248|13"
}, {
n: "铁岭",
g: "123.85485,42.299757|13"
}, {
n: "营口",
g: "122.233391,40.668651|13"
}]
}, {
n: "内蒙古",
g: "114.415868,43.468238|5",
cities: [{
n: "呼和浩特",
g: "111.660351,40.828319|12"
}, {
n: "阿拉善盟",
g: "105.695683,38.843075|14"
}, {
n: "包头",
g: "109.846239,40.647119|12"
}, {
n: "巴彦淖尔",
g: "107.423807,40.76918|12"
}, {
n: "赤峰",
g: "118.930761,42.297112|12"
}, {
n: "鄂尔多斯",
g: "109.993706,39.81649|12"
}, {
n: "呼伦贝尔",
g: "119.760822,49.201636|12"
}, {
n: "通辽",
g: "122.260363,43.633756|12"
}, {
n: "乌海",
g: "106.831999,39.683177|13"
}, {
n: "乌兰察布",
g: "113.112846,41.022363|12"
}, {
n: "锡林郭勒盟",
g: "116.02734,43.939705|11"
}, {
n: "兴安盟",
g: "122.048167,46.083757|11"
}]
}, {
n: "宁夏",
g: "106.155481,37.321323|8",
cities: [{
n: "银川",
g: "106.206479,38.502621|12"
}, {
n: "固原",
g: "106.285268,36.021523|13"
}, {
n: "石嘴山",
g: "106.379337,39.020223|13"
}, {
n: "吴忠",
g: "106.208254,37.993561|14"
}, {
n: "中卫",
g: "105.196754,37.521124|14"
}]
}, {
n: "青海",
g: "96.202544,35.499761|7",
cities: [{
n: "西宁",
g: "101.767921,36.640739|12"
}, {
n: "果洛州",
g: "100.223723,34.480485|11"
}, {
n: "海东地区",
g: "102.085207,36.51761|11"
}, {
n: "海北州",
g: "100.879802,36.960654|11"
}, {
n: "海南州",
g: "100.624066,36.284364|11"
}, {
n: "海西州",
g: "97.342625,37.373799|11"
}, {
n: "黄南州",
g: "102.0076,35.522852|11"
}, {
n: "玉树州",
g: "97.013316,33.00624|14"
}]
}, {
n: "山东",
g: "118.527663,36.09929|8",
cities: [{
n: "济南",
g: "117.024967,36.682785|12"
}, {
n: "滨州",
g: "117.968292,37.405314|12"
}, {
n: "东营",
g: "118.583926,37.487121|12"
}, {
n: "德州",
g: "116.328161,37.460826|12"
}, {
n: "菏泽",
g: "115.46336,35.26244|13"
}, {
n: "济宁",
g: "116.600798,35.402122|13"
}, {
n: "莱芜",
g: "117.684667,36.233654|13"
}, {
n: "聊城",
g: "115.986869,36.455829|12"
}, {
n: "临沂",
g: "118.340768,35.072409|12"
}, {
n: "青岛",
g: "120.384428,36.105215|12"
}, {
n: "日照",
g: "119.50718,35.420225|12"
}, {
n: "泰安",
g: "117.089415,36.188078|13"
}, {
n: "威海",
g: "122.093958,37.528787|13"
}, {
n: "潍坊",
g: "119.142634,36.716115|12"
}, {
n: "烟台",
g: "121.309555,37.536562|12"
}, {
n: "枣庄",
g: "117.279305,34.807883|13"
}, {
n: "淄博",
g: "118.059134,36.804685|12"
}]
}, {
n: "山西",
g: "112.515496,37.866566|7",
cities: [{
n: "太原",
g: "112.550864,37.890277|12"
}, {
n: "长治",
g: "113.120292,36.201664|12"
}, {
n: "大同",
g: "113.290509,40.113744|12"
}, {
n: "晋城",
g: "112.867333,35.499834|13"
}, {
n: "晋中",
g: "112.738514,37.693362|13"
}, {
n: "临汾",
g: "111.538788,36.099745|13"
}, {
n: "吕梁",
g: "111.143157,37.527316|14"
}, {
n: "朔州",
g: "112.479928,39.337672|13"
}, {
n: "忻州",
g: "112.727939,38.461031|12"
}, {
n: "阳泉",
g: "113.569238,37.869529|13"
}, {
n: "运城",
g: "111.006854,35.038859|13"
}]
}, {
n: "陕西",
g: "109.503789,35.860026|7",
cities: [{
n: "西安",
g: "108.953098,34.2778|12"
}, {
n: "安康",
g: "109.038045,32.70437|13"
}, {
n: "宝鸡",
g: "107.170645,34.364081|12"
}, {
n: "汉中",
g: "107.045478,33.081569|13"
}, {
n: "商洛",
g: "109.934208,33.873907|13"
}, {
n: "铜川",
g: "108.968067,34.908368|13"
}, {
n: "渭南",
g: "109.483933,34.502358|13"
}, {
n: "咸阳",
g: "108.707509,34.345373|13"
}, {
n: "延安",
g: "109.50051,36.60332|13"
}, {
n: "榆林",
g: "109.745926,38.279439|12"
}]
}, {
n: "四川",
g: "102.89916,30.367481|7",
cities: [{
n: "成都",
g: "104.067923,30.679943|12"
}, {
n: "阿坝州",
g: "102.228565,31.905763|15"
}, {
n: "巴中",
g: "106.757916,31.869189|14"
}, {
n: "达州",
g: "107.494973,31.214199|14"
}, {
n: "德阳",
g: "104.402398,31.13114|13"
}, {
n: "甘孜州",
g: "101.969232,30.055144|15"
}, {
n: "广安",
g: "106.63572,30.463984|13"
}, {
n: "广元",
g: "105.819687,32.44104|13"
}, {
n: "乐山",
g: "103.760824,29.600958|13"
}, {
n: "凉山州",
g: "102.259591,27.892393|14"
}, {
n: "泸州",
g: "105.44397,28.89593|14"
}, {
n: "南充",
g: "106.105554,30.800965|13"
}, {
n: "眉山",
g: "103.84143,30.061115|13"
}, {
n: "绵阳",
g: "104.705519,31.504701|12"
}, {
n: "内江",
g: "105.073056,29.599462|13"
}, {
n: "攀枝花",
g: "101.722423,26.587571|14"
}, {
n: "遂宁",
g: "105.564888,30.557491|12"
}, {
n: "雅安",
g: "103.009356,29.999716|13"
}, {
n: "宜宾",
g: "104.633019,28.769675|13"
}, {
n: "资阳",
g: "104.63593,30.132191|13"
}, {
n: "自贡",
g: "104.776071,29.359157|13"
}]
}, {
n: "西藏",
g: "89.137982,31.367315|6",
cities: [{
n: "拉萨",
g: "91.111891,29.662557|13"
}, {
n: "阿里地区",
g: "81.107669,30.404557|11"
}, {
n: "昌都地区",
g: "97.185582,31.140576|15"
}, {
n: "林芝地区",
g: "94.349985,29.666941|11"
}, {
n: "那曲地区",
g: "92.067018,31.48068|14"
}, {
n: "日喀则地区",
g: "88.891486,29.269023|14"
}, {
n: "山南地区",
g: "91.750644,29.229027|11"
}]
}, {
n: "新疆",
g: "85.614899,42.127001|6",
cities: [{
n: "乌鲁木齐",
g: "87.564988,43.84038|12"
}, {
n: "阿拉尔",
g: "81.291737,40.61568|13"
}, {
n: "阿克苏地区",
g: "80.269846,41.171731|12"
}, {
n: "阿勒泰地区",
g: "88.137915,47.839744|13"
}, {
n: "巴音郭楞",
g: "86.121688,41.771362|12"
}, {
n: "博尔塔拉州",
g: "82.052436,44.913651|11"
}, {
n: "昌吉州",
g: "87.296038,44.007058|13"
}, {
n: "哈密地区",
g: "93.528355,42.858596|13"
}, {
n: "和田地区",
g: "79.930239,37.116774|13"
}, {
n: "喀什地区",
g: "75.992973,39.470627|12"
}, {
n: "克拉玛依",
g: "84.88118,45.594331|13"
}, {
n: "克孜勒苏州",
g: "76.137564,39.750346|11"
}, {
n: "石河子",
g: "86.041865,44.308259|13"
}, {
n: "塔城地区",
g: "82.974881,46.758684|12"
}, {
n: "图木舒克",
g: "79.198155,39.889223|13"
}, {
n: "吐鲁番地区",
g: "89.181595,42.96047|13"
}, {
n: "五家渠",
g: "87.565449,44.368899|13"
}, {
n: "伊犁州",
g: "81.297854,43.922248|11"
}]
}, {
n: "云南",
g: "101.592952,24.864213|7",
cities: [{
n: "昆明",
g: "102.714601,25.049153|12"
}, {
n: "保山",
g: "99.177996,25.120489|13"
}, {
n: "楚雄州",
g: "101.529382,25.066356|13"
}, {
n: "大理州",
g: "100.223675,25.5969|14"
}, {
n: "德宏州",
g: "98.589434,24.44124|14"
}, {
n: "迪庆州",
g: "99.713682,27.831029|14"
}, {
n: "红河州",
g: "103.384065,23.367718|11"
}, {
n: "丽江",
g: "100.229628,26.875351|13"
}, {
n: "临沧",
g: "100.092613,23.887806|14"
}, {
n: "怒江州",
g: "98.859932,25.860677|14"
}, {
n: "普洱",
g: "100.980058,22.788778|14"
}, {
n: "曲靖",
g: "103.782539,25.520758|12"
}, {
n: "昭通",
g: "103.725021,27.340633|13"
}, {
n: "文山",
g: "104.089112,23.401781|14"
}, {
n: "西双版纳",
g: "100.803038,22.009433|13"
}, {
n: "玉溪",
g: "102.545068,24.370447|13"
}]
}, {
n: "浙江",
g: "119.957202,29.159494|8",
cities: [{
n: "杭州",
g: "120.219375,30.259244|12"
}, {
n: "湖州",
g: "120.137243,30.877925|12"
}, {
n: "嘉兴",
g: "120.760428,30.773992|13"
}, {
n: "金华",
g: "119.652576,29.102899|12"
}, {
n: "丽水",
g: "119.929576,28.4563|13"
}, {
n: "宁波",
g: "121.579006,29.885259|12"
}, {
n: "衢州",
g: "118.875842,28.95691|12"
}, {
n: "绍兴",
g: "120.592467,30.002365|13"
}, {
n: "台州",
g: "121.440613,28.668283|13"
}, {
n: "温州",
g: "120.690635,28.002838|12"
}, {
n: "舟山",
g: "122.169872,30.03601|13"
}]
}],
other: [{
n: "香港",
g: "114.186124,22.293586|11"
}, {
n: "澳门",
g: "113.557519,22.204118|13"
}, {
n: "台湾",
g: "120.961454,23.80406|8"
}]
};
function getCenter(g) {
var item = g.split("|");
item[0] = item[0].split(",");
return {
lng: parseFloat(item[0][0]),
lat: parseFloat(item[0][1])
};
}
var cityCenter = {
getCenterByCityName: function getCenterByCityName(name) {
for (var i = 0; i < citycenter.municipalities.length; i++) {
if (citycenter.municipalities[i].n == name) {
return getCenter(citycenter.municipalities[i].g);
}
}
var provinces = citycenter.provinces;
for (var i = 0; i < provinces.length; i++) {
if (provinces[i].n == name) {
return getCenter(provinces[i].g);
}
var cities = provinces[i].cities;
for (var j = 0; j < cities.length; j++) {
if (cities[j].n == name) {
return getCenter(cities[j].g);
}
}
}
return null;
}
};
/**
* 根据弧线的坐标节点数组
*/
function getCurvePoints(points) {
var curvePoints = [];
for (var i = 0; i < points.length - 1; i++) {
var p = getCurveByTwoPoints(points[i], points[i + 1]);
if (p && p.length > 0) {
curvePoints = curvePoints.concat(p);
}
}
return curvePoints;
}
/**
* 根据两点获取曲线坐标点数组
* @param Point 起点
* @param Point 终点
*/
function getCurveByTwoPoints(obj1, obj2) {
if (!obj1 || !obj2) {
return null;
}
var B1 = function B1(x) {
return 1 - 2 * x + x * x;
};
var B2 = function B2(x) {
return 2 * x - 2 * x * x;
};
var B3 = function B3(x) {
return x * x;
};
var curveCoordinates = [];
var count = 40; // 曲线是由一些小的线段组成的,这个表示这个曲线所有到的折线的个数
var isFuture = false;
var t, h, h2, lat3, lng3, j, t2;
var LnArray = [];
var i = 0;
var inc = 0;
if (typeof obj2 == "undefined") {
if (typeof curveCoordinates != "undefined") {
curveCoordinates = [];
}
return;
}
var lat1 = parseFloat(obj1.lat);
var lat2 = parseFloat(obj2.lat);
var lng1 = parseFloat(obj1.lng);
var lng2 = parseFloat(obj2.lng);
// 计算曲线角度的方法
if (lng2 > lng1) {
if (parseFloat(lng2 - lng1) > 180) {
if (lng1 < 0) {
lng1 = parseFloat(180 + 180 + lng1);
}
}
}
if (lng1 > lng2) {
if (parseFloat(lng1 - lng2) > 180) {
if (lng2 < 0) {
lng2 = parseFloat(180 + 180 + lng2);
}
}
}
j = 0;
t2 = 0;
if (lat2 == lat1) {
t = 0;
h = lng1 - lng2;
} else if (lng2 == lng1) {
t = Math.PI / 2;
h = lat1 - lat2;
} else {
t = Math.atan((lat2 - lat1) / (lng2 - lng1));
h = (lat2 - lat1) / Math.sin(t);
}
if (t2 == 0) {
t2 = t + Math.PI / 5;
}
h2 = h / 2;
lng3 = h2 * Math.cos(t2) + lng1;
lat3 = h2 * Math.sin(t2) + lat1;
for (i = 0; i < count + 1; i++) {
curveCoordinates.push([lng1 * B1(inc) + lng3 * B2(inc) + lng2 * B3(inc), lat1 * B1(inc) + lat3 * B2(inc) + lat2 * B3(inc)]);
inc = inc + 1 / count;
}
return curveCoordinates;
}
var curve = {
getPoints: getCurvePoints
};
/*
FDEB algorithm implementation [www.win.tue.nl/~dholten/papers/forcebundles_eurovis.pdf].
Author: (github.com/upphiminn)
2013
*/
var ForceEdgeBundling = function ForceEdgeBundling() {
var data_nodes = {},
// {'nodeid':{'x':,'y':},..}
data_edges = [],
// [{'source':'nodeid1', 'target':'nodeid2'},..]
compatibility_list_for_edge = [],
subdivision_points_for_edge = [],
K = 0.1,
// global bundling constant controling edge stiffness
S_initial = 0.1,
// init. distance to move points
P_initial = 1,
// init. subdivision number
P_rate = 2,
// subdivision rate increase
C = 6,
// number of cycles to perform
I_initial = 70,
// init. number of iterations for cycle
I_rate = 0.6666667,
// rate at which iteration number decreases i.e. 2/3
compatibility_threshold = 0.6,
invers_quadratic_mode = false,
eps = 1e-8;
/*** Geometry Helper Methods ***/
function vector_dot_product(p, q) {
return p.x * q.x + p.y * q.y;
}
function edge_as_vector(P) {
return {
'x': data_nodes[P.target].x - data_nodes[P.source].x,
'y': data_nodes[P.target].y - data_nodes[P.source].y
};
}
function edge_length(e) {
return Math.sqrt(Math.pow(data_nodes[e.source].x - data_nodes[e.target].x, 2) + Math.pow(data_nodes[e.source].y - data_nodes[e.target].y, 2));
}
function custom_edge_length(e) {
return Math.sqrt(Math.pow(e.source.x - e.target.x, 2) + Math.pow(e.source.y - e.target.y, 2));
}
function edge_midpoint(e) {
var middle_x = (data_nodes[e.source].x + data_nodes[e.target].x) / 2.0;
var middle_y = (data_nodes[e.source].y + data_nodes[e.target].y) / 2.0;
return {
'x': middle_x,
'y': middle_y
};
}
function compute_divided_edge_length(e_idx) {
var length = 0;
for (var i = 1; i < subdivision_points_for_edge[e_idx].length; i++) {
var segment_length = euclidean_distance(subdivision_points_for_edge[e_idx][i], subdivision_points_for_edge[e_idx][i - 1]);
length += segment_length;
}
return length;
}
function euclidean_distance(p, q) {
return Math.sqrt(Math.pow(p.x - q.x, 2) + Math.pow(p.y - q.y, 2));
}
function project_point_on_line(p, Q) {
var L = Math.sqrt((Q.target.x - Q.source.x) * (Q.target.x - Q.source.x) + (Q.target.y - Q.source.y) * (Q.target.y - Q.source.y));
var r = ((Q.source.y - p.y) * (Q.source.y - Q.target.y) - (Q.source.x - p.x) * (Q.target.x - Q.source.x)) / (L * L);
return {
'x': Q.source.x + r * (Q.target.x - Q.source.x),
'y': Q.source.y + r * (Q.target.y - Q.source.y)
};
}
/*** ********************** ***/
/*** Initialization Methods ***/
function initialize_edge_subdivisions() {
for (var i = 0; i < data_edges.length; i++) {
if (P_initial == 1) subdivision_points_for_edge[i] = []; //0 subdivisions
else {
subdivision_points_for_edge[i] = [];
subdivision_points_for_edge[i].push(data_nodes[data_edges[i].source]);
subdivision_points_for_edge[i].push(data_nodes[data_edges[i].target]);
}
}
}
function initialize_compatibility_lists() {
for (var i = 0; i < data_edges.length; i++) {
compatibility_list_for_edge[i] = [];
} //0 compatible edges.
}
function filter_self_loops(edgelist) {
var filtered_edge_list = [];
for (var e = 0; e < edgelist.length; e++) {
if (data_nodes[edgelist[e].source].x != data_nodes[edgelist[e].target].x && data_nodes[edgelist[e].source].y != data_nodes[edgelist[e].target].y) {
//or smaller than eps
filtered_edge_list.push(edgelist[e]);
}
}
return filtered_edge_list;
}
/*** ********************** ***/
/*** Force Calculation Methods ***/
function apply_spring_force(e_idx, i, kP) {
var prev = subdivision_points_for_edge[e_idx][i - 1];
var next = subdivision_points_for_edge[e_idx][i + 1];
var crnt = subdivision_points_for_edge[e_idx][i];
var x = prev.x - crnt.x + next.x - crnt.x;
var y = prev.y - crnt.y + next.y - crnt.y;
x *= kP;
y *= kP;
return {
'x': x,
'y': y
};
}
function apply_electrostatic_force(e_idx, i, S) {
var sum_of_forces = {
'x': 0,
'y': 0
};
var compatible_edges_list = compatibility_list_for_edge[e_idx];
for (var oe = 0; oe < compatible_edges_list.length; oe++) {
var force = {
'x': subdivision_points_for_edge[compatible_edges_list[oe]][i].x - subdivision_points_for_edge[e_idx][i].x,
'y': subdivision_points_for_edge[compatible_edges_list[oe]][i].y - subdivision_points_for_edge[e_idx][i].y
};
if (Math.abs(force.x) > eps || Math.abs(force.y) > eps) {
var diff = 1 / Math.pow(custom_edge_length({
'source': subdivision_points_for_edge[compatible_edges_list[oe]][i],
'target': subdivision_points_for_edge[e_idx][i]
}), 1);
sum_of_forces.x += force.x * diff;
sum_of_forces.y += force.y * diff;
}
}
return sum_of_forces;
}
function apply_resulting_forces_on_subdivision_points(e_idx, P, S) {
var kP = K / (edge_length(data_edges[e_idx]) * (P + 1)); // kP=K/|P|(number of segments), where |P| is the initial length of edge P.
// (length * (num of sub division pts - 1))
var resulting_forces_for_subdivision_points = [{
'x': 0,
'y': 0
}];
for (var i = 1; i < P + 1; i++) {
// exclude initial end points of the edge 0 and P+1
var resulting_force = {
'x': 0,
'y': 0
};
var spring_force = apply_spring_force(e_idx, i, kP);
var electrostatic_force = apply_electrostatic_force(e_idx, i, S);
resulting_force.x = S * (spring_force.x + electrostatic_force.x);
resulting_force.y = S * (spring_force.y + electrostatic_force.y);
resulting_forces_for_subdivision_points.push(resulting_force);
}
resulting_forces_for_subdivision_points.push({
'x': 0,
'y': 0
});
return resulting_forces_for_subdivision_points;
}
/*** ********************** ***/
/*** Edge Division Calculation Methods ***/
function update_edge_divisions(P) {
for (var e_idx = 0; e_idx < data_edges.length; e_idx++) {
if (P == 1) {
subdivision_points_for_edge[e_idx].push(data_nodes[data_edges[e_idx].source]); // source
subdivision_points_for_edge[e_idx].push(edge_midpoint(data_edges[e_idx])); // mid point
subdivision_points_for_edge[e_idx].push(data_nodes[data_edges[e_idx].target]); // target
} else {
var divided_edge_length = compute_divided_edge_length(e_idx);
var segment_length = divided_edge_length / (P + 1);
var current_segment_length = segment_length;
var new_subdivision_points = [];
new_subdivision_points.push(data_nodes[data_edges[e_idx].source]); //source
for (var i = 1; i < subdivision_points_for_edge[e_idx].length; i++) {
var old_segment_length = euclidean_distance(subdivision_points_for_edge[e_idx][i], subdivision_points_for_edge[e_idx][i - 1]);
while (old_segment_length > current_segment_length) {
var percent_position = current_segment_length / old_segment_length;
var new_subdivision_point_x = subdivision_points_for_edge[e_idx][i - 1].x;
var new_subdivision_point_y = subdivision_points_for_edge[e_idx][i - 1].y;
new_subdivision_point_x += percent_position * (subdivision_points_for_edge[e_idx][i].x - subdivision_points_for_edge[e_idx][i - 1].x);
new_subdivision_point_y += percent_position * (subdivision_points_for_edge[e_idx][i].y - subdivision_points_for_edge[e_idx][i - 1].y);
new_subdivision_points.push({
'x': new_subdivision_point_x,
'y': new_subdivision_point_y
});
old_segment_length -= current_segment_length;
current_segment_length = segment_length;
}
current_segment_length -= old_segment_length;
}
new_subdivision_points.push(data_nodes[data_edges[e_idx].target]); //target
subdivision_points_for_edge[e_idx] = new_subdivision_points;
}
}
}
/*** ********************** ***/
/*** Edge compatibility measures ***/
function angle_compatibility(P, Q) {
var result = Math.abs(vector_dot_product(edge_as_vector(P), edge_as_vector(Q)) / (edge_length(P) * edge_length(Q)));
return result;
}
function scale_compatibility(P, Q) {
var lavg = (edge_length(P) + edge_length(Q)) / 2.0;
var result = 2.0 / (lavg / Math.min(edge_length(P), edge_length(Q)) + Math.max(edge_length(P), edge_length(Q)) / lavg);
return result;
}
function position_compatibility(P, Q) {
var lavg = (edge_length(P) + edge_length(Q)) / 2.0;
var midP = {
'x': (data_nodes[P.source].x + data_nodes[P.target].x) / 2.0,
'y': (data_nodes[P.source].y + data_nodes[P.target].y) / 2.0
};
var midQ = {
'x': (data_nodes[Q.source].x + data_nodes[Q.target].x) / 2.0,
'y': (data_nodes[Q.source].y + data_nodes[Q.target].y) / 2.0
};
var result = lavg / (lavg + euclidean_distance(midP, midQ));
return result;
}
function edge_visibility(P, Q) {
var I0 = project_point_on_line(data_nodes[Q.source], {
'source': data_nodes[P.source],
'target': data_nodes[P.target]
});
var I1 = project_point_on_line(data_nodes[Q.target], {
'source': data_nodes[P.source],
'target': data_nodes[P.target]
}); //send acutal edge points positions
var midI = {
'x': (I0.x + I1.x) / 2.0,
'y': (I0.y + I1.y) / 2.0
};
var midP = {
'x': (data_nodes[P.source].x + data_nodes[P.target].x) / 2.0,
'y': (data_nodes[P.source].y + data_nodes[P.target].y) / 2.0
};
var result = Math.max(0, 1 - 2 * euclidean_distance(midP, midI) / euclidean_distance(I0, I1));
return result;
}
function visibility_compatibility(P, Q) {
return Math.min(edge_visibility(P, Q), edge_visibility(Q, P));
}
function compatibility_score(P, Q) {
var result = angle_compatibility(P, Q) * scale_compatibility(P, Q) * position_compatibility(P, Q) * visibility_compatibility(P, Q);
return result;
}
function are_compatible(P, Q) {
// console.log('compatibility ' + P.source +' - '+ P.target + ' and ' + Q.source +' '+ Q.target);
return compatibility_score(P, Q) >= compatibility_threshold;
}
function compute_compatibility_lists() {
for (var e = 0; e < data_edges.length - 1; e++) {
for (var oe = e + 1; oe < data_edges.length; oe++) {
// don't want any duplicates
if (e == oe) continue;
else {
if (are_compatible(data_edges[e], data_edges[oe])) {
compatibility_list_for_edge[e].push(oe);
compatibility_list_for_edge[oe].push(e);
}
}
}
}
}
/*** ************************ ***/
/*** Main Bundling Loop Methods ***/
var forcebundle = function forcebundle() {
var S = S_initial;
var I = I_initial;
var P = P_initial;
initialize_edge_subdivisions();
initialize_compatibility_lists();
update_edge_divisions(P);
compute_compatibility_lists();
for (var cycle = 0; cycle < C; cycle++) {
for (var iteration = 0; iteration < I; iteration++) {
var forces = [];
for (var edge = 0; edge < data_edges.length; edge++) {
forces[edge] = apply_resulting_forces_on_subdivision_points(edge, P, S);
}
for (var e = 0; e < data_edges.length; e++) {
for (var i = 0; i < P + 1; i++) {
subdivision_points_for_edge[e][i].x += forces[e][i].x;
subdivision_points_for_edge[e][i].y += forces[e][i].y;
}
}
}
//prepare for next cycle
S = S / 2;
P = P * 2;
I = I_rate * I;
update_edge_divisions(P);
// console.log('C' + cycle);
// console.log('P' + P);
// console.log('S' + S);
}
return subdivision_points_for_edge;
};
/*** ************************ ***/
/*** Getters/Setters Methods ***/
forcebundle.nodes = function(nl) {
if (arguments.length == 0) {
return data_nodes;
} else {
data_nodes = nl;
}
return forcebundle;
};
forcebundle.edges = function(ll) {
if (arguments.length == 0) {
return data_edges;
} else {
data_edges = filter_self_loops(ll); //remove edges to from to the same point
}
return forcebundle;
};
forcebundle.bundling_stiffness = function(k) {
if (arguments.length == 0) {
return K;
} else {
K = k;
}
return forcebundle;
};
forcebundle.step_size = function(step) {
if (arguments.length == 0) {
return S_initial;
} else {
S_initial = step;
}
return forcebundle;
};
forcebundle.cycles = function(c) {
if (arguments.length == 0) {
return C;
} else {
C = c;
}
return forcebundle;
};
forcebundle.iterations = function(i) {
if (arguments.length == 0) {
return I_initial;
} else {
I_initial = i;
}
return forcebundle;
};
forcebundle.iterations_rate = function(i) {
if (arguments.length == 0) {
return I_rate;
} else {
I_rate = i;
}
return forcebundle;
};
forcebundle.subdivision_points_seed = function(p) {
if (arguments.length == 0) {
return P;
} else {
P = p;
}
return forcebundle;
};
forcebundle.subdivision_rate = function(r) {
if (arguments.length == 0) {
return P_rate;
} else {
P_rate = r;
}
return forcebundle;
};
forcebundle.compatbility_threshold = function(t) {
if (arguments.length == 0) {
return compatbility_threshold;
} else {
compatibility_threshold = t;
}
return forcebundle;
};
/*** ************************ ***/
return forcebundle;
};
/**
* @author kyle / http://nikai.us/
*/
/**
* Category
* @param {Object} splitList:
* {
* other: 1,
* 1: 2,
* 2: 3,
* 3: 4,
* 4: 5,
* 5: 6,
* 6: 7
* }
*/
function Category(splitList) {
this.splitList = splitList || {
other: 1
};
}
Category.prototype.get = function(count) {
var splitList = this.splitList;
var value = splitList['other'];
for (var i in splitList) {
if (count == i) {
value = splitList[i];
break;
}
}
return value;
};
/**
* 根据DataSet自动生成对应的splitList
*/
Category.prototype.generateByDataSet = function(dataSet) {
var colors = ['rgba(255, 255, 0, 0.8)', 'rgba(253, 98, 104, 0.8)', 'rgba(255, 146, 149, 0.8)', 'rgba(255, 241, 193, 0.8)', 'rgba(110, 176, 253, 0.8)', 'rgba(52, 139, 251, 0.8)', 'rgba(17, 102, 252, 0.8)'];
var data = dataSet.get();
this.splitList = {};
var count = 0;
for (var i = 0; i < data.length; i++) {
if (this.splitList[data[i].count] === undefined) {
this.splitList[data[i].count] = colors[count];
count++;
}
if (count >= colors.length - 1) {
break;
}
}
this.splitList['other'] = colors[colors.length - 1];
};
/**
* @author kyle / http://nikai.us/
*/
/**
* Choropleth
* @param {Object} splitList:
* [
* {
* start: 0,
* end: 2,
* value: randomColor()
* },{
* start: 2,
* end: 4,
* value: randomColor()
* },{
* start: 4,
* value: randomColor()
* }
* ];
*
*/
function Choropleth(splitList) {
this.splitList = splitList || [{
start: 0,
value: 'red'
}];
}
Choropleth.prototype.get = function(count) {
var splitList = this.splitList;
var value = false;
for (var i = 0; i < splitList.length; i++) {
if ((splitList[i].start === undefined || splitList[i].start !== undefined && count >= splitList[i].start) && (splitList[i].end === undefined || splitList[i].end !== undefined && count < splitList[i].end)) {
value = splitList[i].value;
break;
}
}
return value;
};
/**
* 根据DataSet自动生成对应的splitList
*/
Choropleth.prototype.generateByDataSet = function(dataSet) {
var min = dataSet.getMin('count');
var max = dataSet.getMax('count');
this.generateByMinMax(min, max);
};
/**
* 根据DataSet自动生成对应的splitList
*/
Choropleth.prototype.generateByMinMax = function(min, max) {
var colors = ['rgba(255, 255, 0, 0.8)', 'rgba(253, 98, 104, 0.8)', 'rgba(255, 146, 149, 0.8)', 'rgba(255, 241, 193, 0.8)', 'rgba(110, 176, 253, 0.8)', 'rgba(52, 139, 251, 0.8)', 'rgba(17, 102, 252, 0.8)'];
var splitNum = (max - min) / 7;
var index = min;
this.splitList = [];
var count = 0;
while (index < max) {
this.splitList.push({
start: index,
end: index + splitNum,
value: colors[count]
});
count++;
index += splitNum;
}
};
/**
* @author Mofei<http://www.zhuwenlong.com>
*/
var MapHelper = function() {
function MapHelper(id, type, opt) {
classCallCheck(this, MapHelper);
if (!id || !type) {
console.warn('id 和 type 为必填项');
return false;
}
if (type == 'baidu') {
if (!BMap) {
console.warn('请先引入百度地图JS API');
return false;
}
} else {
console.warn('暂不支持你的地图类型');
}
this.type = type;
var center = opt && opt.center ? opt.center : [106.962497, 38.208726];
var zoom = opt && opt.zoom ? opt.zoom : 5;
var map = this.map = new BMap.Map(id, {
enableMapClick: false
});
map.centerAndZoom(new BMap.Point(center[0], center[1]), zoom);
map.enableScrollWheelZoom(true);
map.setMapStyle({
style: 'light'
});
}
createClass(MapHelper, [{
key: 'addLayer',
value: function addLayer(datas, options) {
if (this.type == 'baidu') {
return new mapv.baiduMapLayer(this.map, dataSet, options);
}
}
}, {
key: 'getMap',
value: function getMap() {
return this.map;
}
}]);
return MapHelper;
}();
/**
* 一直覆盖在当前地图视野的Canvas对象
*
* @author nikai (@胖嘟嘟的骨头, nikai@baidu.com)
*
* @param
* {
* map 地图实例对象
* }
*/
function CanvasLayer(options) {
this.options = options || {};
this.paneName = this.options.paneName || 'mapPane';
this.context = this.options.context || '2d';
this.zIndex = this.options.zIndex || 0;
this.mixBlendMode = this.options.mixBlendMode || null;
this.enableMassClear = this.options.enableMassClear;
this._map = options.map;
this._lastDrawTime = null;
this.show();
}
var global$3 = typeof window === 'undefined' ? {} : window;
if (global$3.BMap) {
CanvasLayer.prototype = new BMap.Overlay();
CanvasLayer.prototype.initialize = function(map) {
this._map = map;
var canvas = this.canvas = document.createElement("canvas");
canvas.style.cssText = "position:absolute;" + "left:0;" + "top:0;" + "z-index:" + this.zIndex + ";user-select:none;";
canvas.style.mixBlendMode = this.mixBlendMode;
this.adjustSize();
map.getPanes()[this.paneName].appendChild(canvas);
var that = this;
map.addEventListener('resize', function() {
that.adjustSize();
that._draw();
});
return this.canvas;
};
CanvasLayer.prototype.adjustSize = function() {
var size = this._map.getSize();
var canvas = this.canvas;
var devicePixelRatio = this.devicePixelRatio = global$3.devicePixelRatio;
canvas.width = size.width * devicePixelRatio;
canvas.height = size.height * devicePixelRatio;
if (this.context == '2d') {
canvas.getContext(this.context).scale(devicePixelRatio, devicePixelRatio);
}
canvas.style.width = size.width + "px";
canvas.style.height = size.height + "px";
};
CanvasLayer.prototype.draw = function() {
var self = this;
clearTimeout(self.timeoutID);
self.timeoutID = setTimeout(function() {
self._draw();
}, 15);
};
CanvasLayer.prototype._draw = function() {
var map = this._map;
var size = map.getSize();
var center = map.getCenter();
if (center) {
var pixel = map.pointToOverlayPixel(center);
this.canvas.style.left = pixel.x - size.width / 2 + 'px';
this.canvas.style.top = pixel.y - size.height / 2 + 'px';
this.dispatchEvent('draw');
this.options.update && this.options.update.call(this);
}
};
CanvasLayer.prototype.getContainer = function() {
return this.canvas;
};
CanvasLayer.prototype.show = function() {
if (!this.canvas) {
this._map.addOverlay(this);
}
this.canvas.style.display = "block";
};
CanvasLayer.prototype.hide = function() {
this.canvas.style.display = "none";
//this._map.removeOverlay(this);
};
CanvasLayer.prototype.setZIndex = function(zIndex) {
this.canvas.style.zIndex = zIndex;
};
CanvasLayer.prototype.getZIndex = function() {
return this.zIndex;
};
}
/**
* Tween.js - Licensed under the MIT license
* https://github.com/tweenjs/tween.js
* ----------------------------------------------
*
* See https://github.com/tweenjs/tween.js/graphs/contributors for the full list of contributors.
* Thank you all, you're awesome!
*/
var TWEEN = TWEEN || function() {
var _tweens = [];
return {
getAll: function getAll() {
return _tweens;
},
removeAll: function removeAll() {
_tweens = [];
},
add: function add(tween) {
_tweens.push(tween);
},
remove: function remove(tween) {
var i = _tweens.indexOf(tween);
if (i !== -1) {
_tweens.splice(i, 1);
}
},
update: function update(time, preserve) {
if (_tweens.length === 0) {
return false;
}
var i = 0;
time = time !== undefined ? time : TWEEN.now();
while (i < _tweens.length) {
if (_tweens[i].update(time) || preserve) {
i++;
} else {
_tweens.splice(i, 1);
}
}
return true;
}
};
}();
// Include a performance.now polyfill.
// In node.js, use process.hrtime.
if (typeof window === 'undefined' && typeof process !== 'undefined') {
TWEEN.now = function() {
var time = process.hrtime();
// Convert [seconds, nanoseconds] to milliseconds.
return time[0] * 1000 + time[1] / 1000000;
};
}
// In a browser, use window.performance.now if it is available.
else if (typeof window !== 'undefined' && window.performance !== undefined && window.performance.now !== undefined) {
// This must be bound, because directly assigning this function
// leads to an invocation exception in Chrome.
TWEEN.now = window.performance.now.bind(window.performance);
}
// Use Date.now if it is available.
else if (Date.now !== undefined) {
TWEEN.now = Date.now;
}
// Otherwise, use 'new Date().getTime()'.
else {
TWEEN.now = function() {
return new Date().getTime();
};
}
TWEEN.Tween = function(object) {
var _object = object;
var _valuesStart = {};
var _valuesEnd = {};
var _valuesStartRepeat = {};
var _duration = 1000;
var _repeat = 0;
var _repeatDelayTime;
var _yoyo = false;
var _isPlaying = false;
var _reversed = false;
var _delayTime = 0;
var _startTime = null;
var _easingFunction = TWEEN.Easing.Linear.None;
var _interpolationFunction = TWEEN.Interpolation.Linear;
var _chainedTweens = [];
var _onStartCallback = null;
var _onStartCallbackFired = false;
var _onUpdateCallback = null;
var _onCompleteCallback = null;
var _onStopCallback = null;
this.to = function(properties, duration) {
_valuesEnd = properties;
if (duration !== undefined) {
_duration = duration;
}
return this;
};
this.start = function(time) {
TWEEN.add(this);
_isPlaying = true;
_onStartCallbackFired = false;
_startTime = time !== undefined ? time : TWEEN.now();
_startTime += _delayTime;
for (var property in _valuesEnd) {
// Check if an Array was provided as property value
if (_valuesEnd[property] instanceof Array) {
if (_valuesEnd[property].length === 0) {
continue;
}
// Create a local copy of the Array with the start value at the front
_valuesEnd[property] = [_object[property]].concat(_valuesEnd[property]);
}
// If `to()` specifies a property that doesn't exist in the source object,
// we should not set that property in the object
if (_object[property] === undefined) {
continue;
}
// Save the starting value.
_valuesStart[property] = _object[property];
if (_valuesStart[property] instanceof Array === false) {
_valuesStart[property] *= 1.0; // Ensures we're using numbers, not strings
}
_valuesStartRepeat[property] = _valuesStart[property] || 0;
}
return this;
};
this.stop = function() {
if (!_isPlaying) {
return this;
}
TWEEN.remove(this);
_isPlaying = false;
if (_onStopCallback !== null) {
_onStopCallback.call(_object, _object);
}
this.stopChainedTweens();
return this;
};
this.end = function() {
this.update(_startTime + _duration);
return this;
};
this.stopChainedTweens = function() {
for (var i = 0, numChainedTweens = _chainedTweens.length; i < numChainedTweens; i++) {
_chainedTweens[i].stop();
}
};
this.delay = function(amount) {
_delayTime = amount;
return this;
};
this.repeat = function(times) {
_repeat = times;
return this;
};
this.repeatDelay = function(amount) {
_repeatDelayTime = amount;
return this;
};
this.yoyo = function(yoyo) {
_yoyo = yoyo;
return this;
};
this.easing = function(easing) {
_easingFunction = easing;
return this;
};
this.interpolation = function(interpolation) {
_interpolationFunction = interpolation;
return this;
};
this.chain = function() {
_chainedTweens = arguments;
return this;
};
this.onStart = function(callback) {
_onStartCallback = callback;
return this;
};
this.onUpdate = function(callback) {
_onUpdateCallback = callback;
return this;
};
this.onComplete = function(callback) {
_onCompleteCallback = callback;
return this;
};
this.onStop = function(callback) {
_onStopCallback = callback;
return this;
};
this.update = function(time) {
var property;
var elapsed;
var value;
if (time < _startTime) {
return true;
}
if (_onStartCallbackFired === false) {
if (_onStartCallback !== null) {
_onStartCallback.call(_object, _object);
}
_onStartCallbackFired = true;
}
elapsed = (time - _startTime) / _duration;
elapsed = elapsed > 1 ? 1 : elapsed;
value = _easingFunction(elapsed);
for (property in _valuesEnd) {
// Don't update properties that do not exist in the source object
if (_valuesStart[property] === undefined) {
continue;
}
var start = _valuesStart[property] || 0;
var end = _valuesEnd[property];
if (end instanceof Array) {
_object[property] = _interpolationFunction(end, value);
} else {
// Parses relative end values with start as base (e.g.: +10, -3)
if (typeof end === 'string') {
if (end.charAt(0) === '+' || end.charAt(0) === '-') {
end = start + parseFloat(end);
} else {
end = parseFloat(end);
}
}
// Protect against non numeric properties.
if (typeof end === 'number') {
_object[property] = start + (end - start) * value;
}
}
}
if (_onUpdateCallback !== null) {
_onUpdateCallback.call(_object, value);
}
if (elapsed === 1) {
if (_repeat > 0) {
if (isFinite(_repeat)) {
_repeat--;
}
// Reassign starting values, restart by making startTime = now
for (property in _valuesStartRepeat) {
if (typeof _valuesEnd[property] === 'string') {
_valuesStartRepeat[property] = _valuesStartRepeat[property] + parseFloat(_valuesEnd[property]);
}
if (_yoyo) {
var tmp = _valuesStartRepeat[property];
_valuesStartRepeat[property] = _valuesEnd[property];
_valuesEnd[property] = tmp;
}
_valuesStart[property] = _valuesStartRepeat[property];
}
if (_yoyo) {
_reversed = !_reversed;
}
if (_repeatDelayTime !== undefined) {
_startTime = time + _repeatDelayTime;
} else {
_startTime = time + _delayTime;
}
return true;
} else {
if (_onCompleteCallback !== null) {
_onCompleteCallback.call(_object, _object);
}
for (var i = 0, numChainedTweens = _chainedTweens.length; i < numChainedTweens; i++) {
// Make the chained tweens start exactly at the time they should,
// even if the `update()` method was called way past the duration of the tween
_chainedTweens[i].start(_startTime + _duration);
}
return false;
}
}
return true;
};
};
TWEEN.Easing = {
Linear: {
None: function None(k) {
return k;
}
},
Quadratic: {
In: function In(k) {
return k * k;
},
Out: function Out(k) {
return k * (2 - k);
},
InOut: function InOut(k) {
if ((k *= 2) < 1) {
return 0.5 * k * k;
}
return -0.5 * (--k * (k - 2) - 1);
}
},
Cubic: {
In: function In(k) {
return k * k * k;
},
Out: function Out(k) {
return --k * k * k + 1;
},
InOut: function InOut(k) {
if ((k *= 2) < 1) {
return 0.5 * k * k * k;
}
return 0.5 * ((k -= 2) * k * k + 2);
}
},
Quartic: {
In: function In(k) {
return k * k * k * k;
},
Out: function Out(k) {
return 1 - --k * k * k * k;
},
InOut: function InOut(k) {
if ((k *= 2) < 1) {
return 0.5 * k * k * k * k;
}
return -0.5 * ((k -= 2) * k * k * k - 2);
}
},
Quintic: {
In: function In(k) {
return k * k * k * k * k;
},
Out: function Out(k) {
return --k * k * k * k * k + 1;
},
InOut: function InOut(k) {
if ((k *= 2) < 1) {
return 0.5 * k * k * k * k * k;
}
return 0.5 * ((k -= 2) * k * k * k * k + 2);
}
},
Sinusoidal: {
In: function In(k) {
return 1 - Math.cos(k * Math.PI / 2);
},
Out: function Out(k) {
return Math.sin(k * Math.PI / 2);
},
InOut: function InOut(k) {
return 0.5 * (1 - Math.cos(Math.PI * k));
}
},
Exponential: {
In: function In(k) {
return k === 0 ? 0 : Math.pow(1024, k - 1);
},
Out: function Out(k) {
return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);
},
InOut: function InOut(k) {
if (k === 0) {
return 0;
}
if (k === 1) {
return 1;
}
if ((k *= 2) < 1) {
return 0.5 * Math.pow(1024, k - 1);
}
return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);
}
},
Circular: {
In: function In(k) {
return 1 - Math.sqrt(1 - k * k);
},
Out: function Out(k) {
return Math.sqrt(1 - --k * k);
},
InOut: function InOut(k) {
if ((k *= 2) < 1) {
return -0.5 * (Math.sqrt(1 - k * k) - 1);
}
return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);
}
},
Elastic: {
In: function In(k) {
if (k === 0) {
return 0;
}
if (k === 1) {
return 1;
}
return -Math.pow(2, 10 * (k - 1)) * Math.sin((k - 1.1) * 5 * Math.PI);
},
Out: function Out(k) {
if (k === 0) {
return 0;
}
if (k === 1) {
return 1;
}
return Math.pow(2, -10 * k) * Math.sin((k - 0.1) * 5 * Math.PI) + 1;
},
InOut: function InOut(k) {
if (k === 0) {
return 0;
}
if (k === 1) {
return 1;
}
k *= 2;
if (k < 1) {
return -0.5 * Math.pow(2, 10 * (k - 1)) * Math.sin((k - 1.1) * 5 * Math.PI);
}
return 0.5 * Math.pow(2, -10 * (k - 1)) * Math.sin((k - 1.1) * 5 * Math.PI) + 1;
}
},
Back: {
In: function In(k) {
var s = 1.70158;
return k * k * ((s + 1) * k - s);
},
Out: function Out(k) {
var s = 1.70158;
return --k * k * ((s + 1) * k + s) + 1;
},
InOut: function InOut(k) {
var s = 1.70158 * 1.525;
if ((k *= 2) < 1) {
return 0.5 * (k * k * ((s + 1) * k - s));
}
return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);
}
},
Bounce: {
In: function In(k) {
return 1 - TWEEN.Easing.Bounce.Out(1 - k);
},
Out: function Out(k) {
if (k < 1 / 2.75) {
return 7.5625 * k * k;
} else if (k < 2 / 2.75) {
return 7.5625 * (k -= 1.5 / 2.75) * k + 0.75;
} else if (k < 2.5 / 2.75) {
return 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375;
} else {
return 7.5625 * (k -= 2.625 / 2.75) * k + 0.984375;
}
},
InOut: function InOut(k) {
if (k < 0.5) {
return TWEEN.Easing.Bounce.In(k * 2) * 0.5;
}
return TWEEN.Easing.Bounce.Out(k * 2 - 1) * 0.5 + 0.5;
}
}
};
TWEEN.Interpolation = {
Linear: function Linear(v, k) {
var m = v.length - 1;
var f = m * k;
var i = Math.floor(f);
var fn = TWEEN.Interpolation.Utils.Linear;
if (k < 0) {
return fn(v[0], v[1], f);
}
if (k > 1) {
return fn(v[m], v[m - 1], m - f);
}
return fn(v[i], v[i + 1 > m ? m : i + 1], f - i);
},
Bezier: function Bezier(v, k) {
var b = 0;
var n = v.length - 1;
var pw = Math.pow;
var bn = TWEEN.Interpolation.Utils.Bernstein;
for (var i = 0; i <= n; i++) {
b += pw(1 - k, n - i) * pw(k, i) * v[i] * bn(n, i);
}
return b;
},
CatmullRom: function CatmullRom(v, k) {
var m = v.length - 1;
var f = m * k;
var i = Math.floor(f);
var fn = TWEEN.Interpolation.Utils.CatmullRom;
if (v[0] === v[m]) {
if (k < 0) {
i = Math.floor(f = m * (1 + k));
}
return fn(v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m], f - i);
} else {
if (k < 0) {
return v[0] - (fn(v[0], v[0], v[1], v[1], -f) - v[0]);
}
if (k > 1) {
return v[m] - (fn(v[m], v[m], v[m - 1], v[m - 1], f - m) - v[m]);
}
return fn(v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2], f - i);
}
},
Utils: {
Linear: function Linear(p0, p1, t) {
return (p1 - p0) * t + p0;
},
Bernstein: function Bernstein(n, i) {
var fc = TWEEN.Interpolation.Utils.Factorial;
return fc(n) / fc(i) / fc(n - i);
},
Factorial: function() {
var a = [1];
return function(n) {
var s = 1;
if (a[n]) {
return a[n];
}
for (var i = n; i > 1; i--) {
s *= i;
}
a[n] = s;
return s;
};
}(),
CatmullRom: function CatmullRom(p0, p1, p2, p3, t) {
var v0 = (p2 - p0) * 0.5;
var v1 = (p3 - p1) * 0.5;
var t2 = t * t;
var t3 = t * t2;
return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;
}
}
};
/**
* @author Mofei Zhu<mapv@zhuwenlong.com>
* This file is to draw text
*/
var drawText = {
draw: function draw(context, dataSet, options) {
var data = dataSet instanceof DataSet ? dataSet.get() : dataSet;
context.save();
// set from options
for (var key in options) {
context[key] = options[key];
}
var offset = options.offset || {
x: 0,
y: 0
};
var rects = [];
var size = options._size || options.size;
if (size) {
context.font = "bold " + size + "px Arial";
} else {
size = 12;
}
var textKey = options.textKey || 'text';
context.textAlign = 'center';
context.textBaseline = 'middle';
if (options.avoid) {
// 标注避让
for (var i = 0, len = data.length; i < len; i++) {
var coordinates = data[i].geometry._coordinates || data[i].geometry.coordinates;
var x = coordinates[0] + offset.x;
var y = coordinates[1] + offset.y;
var text = data[i][textKey];
var textWidth = context.measureText(text).width;
// 根据文本宽度和高度调整x,y位置,使得绘制文本时候坐标点在文本中心点,这个计算出的是左上角坐标
var px = x - textWidth / 2;
var py = y - size / 2;
var rect = {
sw: {
x: px,
y: py + size
},
ne: {
x: px + textWidth,
y: py
}
};
if (!hasOverlay(rects, rect)) {
rects.push(rect);
px = px + textWidth / 2;
py = py + size / 2;
context.fillText(text, px, py);
}
}
} else {
for (var i = 0, len = data.length; i < len; i++) {
var coordinates = data[i].geometry._coordinates || data[i].geometry.coordinates;
var x = coordinates[0] + offset.x;
var y = coordinates[1] + offset.y;
var text = data[i][textKey];
context.fillText(text, x, y);
}
}
context.restore();
}
};
/*
* 当前文字区域和已有的文字区域是否有重叠部分
*/
function hasOverlay(rects, overlay) {
for (var i = 0; i < rects.length; i++) {
if (isRectOverlay(rects[i], overlay)) {
return true;
}
}
return false;
}
//判断2个矩形是否有重叠部分
function isRectOverlay(rect1, rect2) {
//minx、miny 2个矩形右下角最小的x和y
//maxx、maxy 2个矩形左上角最大的x和y
var minx = Math.min(rect1.ne.x, rect2.ne.x);
var miny = Math.min(rect1.sw.y, rect2.sw.y);
var maxx = Math.max(rect1.sw.x, rect2.sw.x);
var maxy = Math.max(rect1.ne.y, rect2.ne.y);
if (minx > maxx && miny > maxy) {
return true;
}
return false;
}
/**
* @author Mofei Zhu<mapv@zhuwenlong.com>
* This file is to draw text
*/
var drawIcon = {
draw: function draw(context, dataSet, options) {
var data = dataSet instanceof DataSet ? dataSet.get() : dataSet;
context.fillStyle = 'white';
context.textAlign = 'center';
context.textBaseline = 'middle';
var offset = options.offset || {
x: 0,
y: 0
};
// set from options
// for (var key in options) {
// context[key] = options[key];
// }
// console.log(data)
for (var i = 0, len = data.length; i < len; i++) {
if (data[i].geometry) {
var deg = data[i].deg || options.deg;
var icon = data[i].icon || options.icon;
var coordinates = data[i].geometry._coordinates || data[i].geometry.coordinates;
var x = coordinates[0];
var y = coordinates[1];
if (deg) {
context.save();
context.translate(x, y);
context.rotate(deg * Math.PI / 180);
context.translate(-x, -y);
}
var width = options._width || options.width || icon.width;
var height = options._height || options.height || icon.height;
x = x - width / 2 + offset.x;
y = y - height / 2 + offset.y;
if (options.sx && options.sy && options.swidth && options.sheight && options.width && options.height) {
context.drawImage(icon, options.sx, options.sy, options.swidth, options.sheight, x, y, width, height);
} else if (options.width && options.height) {
context.drawImage(icon, x, y, width, height);
} else {
context.drawImage(icon, x, y);
}
if (deg) {
context.restore();
}
}
}
}
};
/**
* @author kyle / http://nikai.us/
*/
if (typeof window !== 'undefined') {
requestAnimationFrame(animate);
}
function animate(time) {
requestAnimationFrame(animate);
TWEEN.update(time);
}
var BaseLayer = function() {
function BaseLayer(map, dataSet, options) {
classCallCheck(this, BaseLayer);
if (!(dataSet instanceof DataSet)) {
dataSet = new DataSet(dataSet);
}
this.dataSet = dataSet;
this.map = map;
}
createClass(BaseLayer, [{
key: "getDefaultContextConfig",
value: function getDefaultContextConfig() {
return {
globalAlpha: 1,
globalCompositeOperation: 'source-over',
imageSmoothingEnabled: true,
strokeStyle: '#000000',
fillStyle: '#000000',
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowBlur: 0,
shadowColor: 'rgba(0, 0, 0, 0)',
lineWidth: 1,
lineCap: 'butt',
lineJoin: 'miter',
miterLimit: 10,
lineDashOffset: 0,
font: '10px sans-serif',
textAlign: 'start',
textBaseline: 'alphabetic'
};
}
}, {
key: "initDataRange",
value: function initDataRange(options) {
var self = this;
self.intensity = new Intensity({
maxSize: self.options.maxSize,
minSize: self.options.minSize,
gradient: self.options.gradient,
max: self.options.max || this.dataSet.getMax('count')
});
self.category = new Category(self.options.splitList);
self.choropleth = new Choropleth(self.options.splitList);
if (self.options.splitList === undefined) {
self.category.generateByDataSet(this.dataSet);
}
if (self.options.splitList === undefined) {
var min = self.options.min || this.dataSet.getMin('count');
var max = self.options.max || this.dataSet.getMax('count');
self.choropleth.generateByMinMax(min, max);
}
}
}, {
key: "getLegend",
value: function getLegend(options) {
var draw = this.options.draw;
var legend = null;
if (self.options.draw == 'intensity' || self.options.draw == 'heatmap') {
return this.intensity.getLegend(options);
}
}
}, {
key: "processData",
value: function processData(data) {
var self = this;
var draw = self.options.draw;
if (draw == 'bubble' || draw == 'intensity' || draw == 'category' || draw == 'choropleth' || draw == 'simple') {
for (var i = 0; i < data.length; i++) {
var item = data[i];
if (self.options.draw == 'bubble') {
data[i]._size = self.intensity.getSize(item.count);
} else {
data[i]._size = undefined;
}
var styleType = 'fillStyle';
if (data[i].geometry.type === 'LineString' || self.options.styleType === 'stroke') {
styleType = 'strokeStyle';
}
if (self.options.draw == 'intensity') {
data[i][styleType] = self.intensity.getColor(item.count);
} else if (self.options.draw == 'category') {
data[i][styleType] = self.category.get(item.count);
} else if (self.options.draw == 'choropleth') {
data[i][styleType] = self.choropleth.get(item.count);
}
}
}
}
}, {
key: "isEnabledTime",
value: function isEnabledTime() {
var animationOptions = this.options.animation;
var flag = animationOptions && !(animationOptions.enabled === false);
return flag;
}
}, {
key: "argCheck",
value: function argCheck(options) {
if (options.draw == 'heatmap') {
if (options.strokeStyle) {
console.warn('[heatmap] options.strokeStyle is discard, pleause use options.strength [eg: options.strength = 0.1]');
}
}
}
}, {
key: "drawContext",
value: function drawContext(context, dataSet, options, nwPixel) {
var self = this;
switch (self.options.draw) {
case 'heatmap':
drawHeatmap.draw(context, dataSet, self.options);
break;
case 'grid':
case 'honeycomb':
self.options.offset = {
x: nwPixel.x,
y: nwPixel.y
};
if (self.options.draw == 'grid') {
drawGrid.draw(context, dataSet, self.options);
} else {
drawHoneycomb.draw(context, dataSet, self.options);
}
break;
case 'text':
drawText.draw(context, dataSet, self.options);
break;
case 'icon':
drawIcon.draw(context, dataSet, self.options);
break;
case 'clip':
context.save();
context.fillStyle = self.options.fillStyle || 'rgba(0, 0, 0, 0.5)';
context.fillRect(0, 0, context.canvas.width, context.canvas.height);
drawSimple.draw(context, dataSet, self.options);
context.beginPath();
pathSimple.drawDataSet(context, dataSet, self.options);
context.clip();
clear(context);
context.restore();
break;
default:
if (self.options.context == "webgl") {
webglDrawSimple.draw(self.canvasLayer.canvas.getContext('webgl'), dataSet, self.options);
} else {
drawSimple.draw(context, dataSet, self.options);
}
}
}
}, {
key: "isPointInPath",
value: function isPointInPath(context, pixel) {
var context = this.canvasLayer.canvas.getContext(this.context);
var data = this.dataSet.get();
for (var i = 0; i < data.length; i++) {
context.beginPath();
pathSimple.draw(context, data[i], this.options);
if (context.isPointInPath(pixel.x * this.canvasLayer.devicePixelRatio, pixel.y * this.canvasLayer.devicePixelRatio)) {
return data[i];
}
}
}
}, {
key: "clickEvent",
value: function clickEvent(pixel, e) {
var dataItem = this.isPointInPath(this.getContext(), pixel);
if (dataItem) {
this.options.methods.click(dataItem, e);
} else {
this.options.methods.click(null, e);
}
}
}, {
key: "mousemoveEvent",
value: function mousemoveEvent(pixel, e) {
var dataItem = this.isPointInPath(this.getContext(), pixel);
if (dataItem) {
this.options.methods.mousemove(dataItem, e);
} else {
this.options.methods.mousemove(null, e);
}
}
/**
* obj.options
*/
}, {
key: "update",
value: function update(obj, isDraw) {
var self = this;
var _options = obj.options;
var options = self.options;
for (var i in _options) {
options[i] = _options[i];
}
self.init(options);
if (isDraw !== false) {
self.draw();
}
}
}, {
key: "setOptions",
value: function setOptions(options) {
var self = this;
self.init(options);
self.draw();
}
}, {
key: "set",
value: function set$$1(obj) {
var self = this;
var ctx = this.getContext();
var conf = this.getDefaultContextConfig();
for (var i in conf) {
ctx[i] = conf[i];
}
self.init(obj.options);
self.draw();
}
}, {
key: "destroy",
value: function destroy() {
this.unbindEvent();
this.hide();
}
}, {
key: "initAnimator",
value: function initAnimator() {
var self = this;
var animationOptions = self.options.animation;
if (self.options.draw == 'time' || self.isEnabledTime()) {
if (!animationOptions.stepsRange) {
animationOptions.stepsRange = {
start: this.dataSet.getMin('time') || 0,
end: this.dataSet.getMax('time') || 0
};
}
this.steps = {
step: animationOptions.stepsRange.start
};
self.animator = new TWEEN.Tween(this.steps).onUpdate(function() {
self._canvasUpdate(this.step);
}).repeat(Infinity);
this.addAnimatorEvent();
var duration = animationOptions.duration * 1000 || 5000;
self.animator.to({
step: animationOptions.stepsRange.end
}, duration);
self.animator.start();
} else {
self.animator && self.animator.stop();
}
}
}, {
key: "addAnimatorEvent",
value: function addAnimatorEvent() {}
}, {
key: "animatorMovestartEvent",
value: function animatorMovestartEvent() {
var animationOptions = this.options.animation;
if (this.isEnabledTime() && this.animator) {
this.steps.step = animationOptions.stepsRange.start;
this.animator.stop();
}
}
}, {
key: "animatorMoveendEvent",
value: function animatorMoveendEvent() {
if (this.isEnabledTime() && this.animator) {
this.animator.start();
}
}
}]);
return BaseLayer;
}();
var AnimationLayer = function(_BaseLayer) {
inherits(AnimationLayer, _BaseLayer);
function AnimationLayer(map, dataSet, options) {
classCallCheck(this, AnimationLayer);
var _this = possibleConstructorReturn(this, (AnimationLayer.__proto__ || Object.getPrototypeOf(AnimationLayer)).call(this, map, dataSet, options));
_this.map = map;
_this.options = options || {};
_this.dataSet = dataSet;
_this.init(options);
var canvasLayer = new CanvasLayer({
map: map,
update: _this._canvasUpdate.bind(_this)
});
_this.transferToMercator();
var self = _this;
dataSet.on('change', function() {
self.transferToMercator();
canvasLayer.draw();
});
_this.ctx = canvasLayer.canvas.getContext('2d');
_this.start();
return _this;
}
createClass(AnimationLayer, [{
key: "init",
value: function init(options) {
var self = this;
self.options = options;
this.initDataRange(options);
this.context = self.options.context || '2d';
if (self.options.zIndex) {
this.canvasLayer && this.canvasLayer.setZIndex(self.options.zIndex);
}
if (self.options.max) {
this.intensity.setMax(self.options.max);
}
if (self.options.min) {
this.intensity.setMin(self.options.min);
}
this.initAnimator();
}
// 经纬度左边转换为墨卡托坐标
}, {
key: "transferToMercator",
value: function transferToMercator() {
var projection = this.map.getMapType().getProjection();
if (this.options.coordType !== 'bd09mc') {
var data = this.dataSet.get();
data = this.dataSet.transferCoordinate(data, function(coordinates) {
var pixel = projection.lngLatToPoint({
lng: coordinates[0],
lat: coordinates[1]
});
return [pixel.x, pixel.y];
}, 'coordinates', 'coordinates_mercator');
this.dataSet._set(data);
}
}
}, {
key: "_canvasUpdate",
value: function _canvasUpdate() {
var ctx = this.ctx;
if (!ctx) {
return;
}
//clear(ctx);
var map = this.map;
var zoomUnit = Math.pow(2, 18 - map.getZoom());
var projection = map.getMapType().getProjection();
var mcCenter = projection.lngLatToPoint(map.getCenter());
var nwMc = new BMap.Pixel(mcCenter.x - map.getSize().width / 2 * zoomUnit, mcCenter.y + map.getSize().height / 2 * zoomUnit); //左上角墨卡托坐标
clear(ctx);
var dataGetOptions = {
fromColumn: this.options.coordType == 'bd09mc' ? 'coordinates' : 'coordinates_mercator',
transferCoordinate: function transferCoordinate(coordinate) {
if (!coordinate) {
return;
}
var x = (coordinate[0] - nwMc.x) / zoomUnit;
var y = (nwMc.y - coordinate[1]) / zoomUnit;
return [x, y];
}
};
this.data = this.dataSet.get(dataGetOptions);
this.processData(this.data);
this.drawAnimation();
}
}, {
key: "drawAnimation",
value: function drawAnimation() {
var ctx = this.ctx;
var data = this.data;
if (!data) {
return;
}
ctx.save();
ctx.globalCompositeOperation = 'destination-out';
ctx.fillStyle = 'rgba(0, 0, 0, .1)';
ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
ctx.restore();
ctx.save();
if (this.options.shadowColor) {
ctx.shadowColor = this.options.shadowColor;
}
if (this.options.shadowBlur) {
ctx.shadowBlur = this.options.shadowBlur;
}
if (this.options.globalAlpha) {
ctx.globalAlpha = this.options.globalAlpha;
}
if (this.options.globalCompositeOperation) {
ctx.globalCompositeOperation = this.options.globalCompositeOperation;
}
var options = this.options;
for (var i = 0; i < data.length; i++) {
if (data[i].geometry.type === 'Point') {
ctx.beginPath();
var maxSize = data[i].size || this.options.size;
var minSize = data[i].minSize || this.options.minSize || 0;
if (data[i]._size === undefined) {
data[i]._size = minSize;
}
ctx.arc(data[i].geometry._coordinates[0], data[i].geometry._coordinates[1], data[i]._size, 0, Math.PI * 2, true);
ctx.closePath();
data[i]._size++;
if (data[i]._size > maxSize) {
data[i]._size = minSize;
}
ctx.lineWidth = 1;
ctx.strokeStyle = data[i].strokeStyle || options.strokeStyle || 'yellow';
ctx.stroke();
var fillStyle = data[i].fillStyle || options.fillStyle;
if (fillStyle) {
ctx.fillStyle = fillStyle;
ctx.fill();
}
} else if (data[i].geometry.type === 'LineString') {
ctx.beginPath();
var size = data[i].size || this.options.size || 5;
var minSize = data[i].minSize || this.options.minSize || 0;
if (data[i]._index === undefined) {
data[i]._index = 0;
}
var index = data[i]._index;
ctx.arc(data[i].geometry._coordinates[index][0], data[i].geometry._coordinates[index][1], size, 0, Math.PI * 2, true);
ctx.closePath();
data[i]._index++;
if (data[i]._index >= data[i].geometry._coordinates.length) {
data[i]._index = 0;
}
ctx.lineWidth = options.lineWidth || 1;
var strokeStyle = data[i].strokeStyle || options.strokeStyle;
var fillStyle = data[i].fillStyle || options.fillStyle || 'yellow';
ctx.fillStyle = fillStyle;
ctx.fill();
if (strokeStyle) {
ctx.strokeStyle = strokeStyle;
ctx.stroke();
}
}
}
ctx.restore();
}
}, {
key: "animate",
value: function animate() {
this.drawAnimation();
var animateTime = this.options.animateTime || 100;
this.timeout = setTimeout(this.animate.bind(this), animateTime);
}
}, {
key: "start",
value: function start() {
this.stop();
this.animate();
}
}, {
key: "stop",
value: function stop() {
clearTimeout(this.timeout);
}
}]);
return AnimationLayer;
}(BaseLayer);
/**
* @author kyle / http://nikai.us/
*/
var Layer = function(_BaseLayer) {
inherits(Layer, _BaseLayer);
function Layer(map, dataSet, options) {
classCallCheck(this, Layer);
var _this = possibleConstructorReturn(this, (Layer.__proto__ || Object.getPrototypeOf(Layer)).call(this, map, dataSet, options));
var self = _this;
var data = null;
options = options || {};
self.init(options);
self.argCheck(options);
self.transferToMercator();
var canvasLayer = _this.canvasLayer = new CanvasLayer({
map: map,
context: _this.context,
paneName: options.paneName,
mixBlendMode: options.mixBlendMode,
enableMassClear: options.enableMassClear,
zIndex: options.zIndex,
update: function update() {
self._canvasUpdate();
}
});
dataSet.on('change', function() {
self.transferToMercator();
canvasLayer.draw();
});
_this.clickEvent = _this.clickEvent.bind(_this);
_this.mousemoveEvent = _this.mousemoveEvent.bind(_this);
_this.bindEvent();
return _this;
}
createClass(Layer, [{
key: "clickEvent",
value: function clickEvent(e) {
var pixel = e.pixel;
get(Layer.prototype.__proto__ || Object.getPrototypeOf(Layer.prototype), "clickEvent", this).call(this, pixel, e);
}
}, {
key: "mousemoveEvent",
value: function mousemoveEvent(e) {
var pixel = e.pixel;
get(Layer.prototype.__proto__ || Object.getPrototypeOf(Layer.prototype), "mousemoveEvent", this).call(this, pixel, e);
}
}, {
key: "bindEvent",
value: function bindEvent(e) {
var map = this.map;
if (this.options.methods) {
if (this.options.methods.click) {
map.setDefaultCursor("default");
map.addEventListener('click', this.clickEvent);
}
if (this.options.methods.mousemove) {
map.addEventListener('mousemove', this.mousemoveEvent);
}
}
}
}, {
key: "unbindEvent",
value: function unbindEvent(e) {
var map = this.map;
if (this.options.methods) {
if (this.options.methods.click) {
map.removeEventListener('click', this.clickEvent);
}
if (this.options.methods.mousemove) {
map.removeEventListener('mousemove', this.mousemoveEvent);
}
}
}
// 经纬度左边转换为墨卡托坐标
}, {
key: "transferToMercator",
value: function transferToMercator() {
var projection = this.map.getMapType().getProjection();
if (this.options.coordType !== 'bd09mc') {
var data = this.dataSet.get();
data = this.dataSet.transferCoordinate(data, function(coordinates) {
var pixel = projection.lngLatToPoint({
lng: coordinates[0],
lat: coordinates[1]
});
return [pixel.x, pixel.y];
}, 'coordinates', 'coordinates_mercator');
this.dataSet._set(data);
}
}
}, {
key: "getContext",
value: function getContext() {
return this.canvasLayer.canvas.getContext(this.context);
}
}, {
key: "_canvasUpdate",
value: function _canvasUpdate(time) {
if (!this.canvasLayer) {
return;
}
var self = this;
var animationOptions = self.options.animation;
var map = this.canvasLayer._map;
var zoomUnit = Math.pow(2, 18 - map.getZoom());
var projection = map.getMapType().getProjection();
var mcCenter = projection.lngLatToPoint(map.getCenter());
var nwMc = new BMap.Pixel(mcCenter.x - map.getSize().width / 2 * zoomUnit, mcCenter.y + map.getSize().height / 2 * zoomUnit); //左上角墨卡托坐标
var context = this.getContext();
if (self.isEnabledTime()) {
if (time === undefined) {
clear(context);
return;
}
if (this.context == '2d') {
context.save();
context.globalCompositeOperation = 'destination-out';
context.fillStyle = 'rgba(0, 0, 0, .1)';
context.fillRect(0, 0, context.canvas.width, context.canvas.height);
context.restore();
}
} else {
clear(context);
}
if (this.context == '2d') {
for (var key in self.options) {
context[key] = self.options[key];
}
} else {
context.clear(context.COLOR_BUFFER_BIT);
}
if (self.options.minZoom && map.getZoom() < self.options.minZoom || self.options.maxZoom && map.getZoom() > self.options.maxZoom) {
return;
}
var scale = 1;
if (this.context != '2d') {
scale = this.canvasLayer.devicePixelRatio;
}
var dataGetOptions = {
fromColumn: self.options.coordType == 'bd09mc' ? 'coordinates' : 'coordinates_mercator',
transferCoordinate: function transferCoordinate(coordinate) {
var x = (coordinate[0] - nwMc.x) / zoomUnit * scale;
var y = (nwMc.y - coordinate[1]) / zoomUnit * scale;
return [x, y];
}
};
if (time !== undefined) {
dataGetOptions.filter = function(item) {
var trails = animationOptions.trails || 10;
if (time && item.time > time - trails && item.time < time) {
return true;
} else {
return false;
}
};
}
// get data from data set
var data = self.dataSet.get(dataGetOptions);
this.processData(data);
var nwPixel = map.pointToPixel(new BMap.Point(0, 0));
if (self.options.unit == 'm') {
if (self.options.size) {
self.options._size = self.options.size / zoomUnit;
}
if (self.options.width) {
self.options._width = self.options.width / zoomUnit;
}
if (self.options.height) {
self.options._height = self.options.height / zoomUnit;
}
} else {
self.options._size = self.options.size;
self.options._height = self.options.height;
self.options._width = self.options.width;
}
this.drawContext(context, data, self.options, nwPixel);
//console.timeEnd('draw');
//console.timeEnd('update')
self.options.updateCallback && self.options.updateCallback(time);
}
}, {
key: "init",
value: function init(options) {
var self = this;
self.options = options;
this.initDataRange(options);
this.context = self.options.context || '2d';
if (self.options.zIndex) {
this.canvasLayer && this.canvasLayer.setZIndex(self.options.zIndex);
}
if (self.options.max) {
this.intensity.setMax(self.options.max);
}
if (self.options.min) {
this.intensity.setMin(self.options.min);
}
this.initAnimator();
}
}, {
key: "addAnimatorEvent",
value: function addAnimatorEvent() {
this.map.addEventListener('movestart', this.animatorMovestartEvent.bind(this));
this.map.addEventListener('moveend', this.animatorMoveendEvent.bind(this));
}
}, {
key: "show",
value: function show() {
this.map.addOverlay(this.canvasLayer);
}
}, {
key: "hide",
value: function hide() {
this.map.removeOverlay(this.canvasLayer);
}
}, {
key: "draw",
value: function draw() {
this.canvasLayer.draw();
}
}]);
return Layer;
}(BaseLayer);
/**
* Copyright 2012 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Extends OverlayView to provide a canvas "Layer".
* @author Brendan Kenny
*/
/**
* A map layer that provides a canvas over the slippy map and a callback
* system for efficient animation. Requires canvas and CSS 2D transform
* support.
* @constructor
* @extends google.maps.OverlayView
* @param {CanvasLayerOptions=} opt_options Options to set in this CanvasLayer.
*/
function CanvasLayer$2(opt_options) {
/**
* If true, canvas is in a map pane and the OverlayView is fully functional.
* See google.maps.OverlayView.onAdd for more information.
* @type {boolean}
* @private
*/
this.isAdded_ = false;
/**
* If true, each update will immediately schedule the next.
* @type {boolean}
* @private
*/
this.isAnimated_ = false;
/**
* The name of the MapPane in which this layer will be displayed.
* @type {string}
* @private
*/
this.paneName_ = CanvasLayer$2.DEFAULT_PANE_NAME_;
/**
* A user-supplied function called whenever an update is required. Null or
* undefined if a callback is not provided.
* @type {?function=}
* @private
*/
this.updateHandler_ = null;
/**
* A user-supplied function called whenever an update is required and the
* map has been resized since the last update. Null or undefined if a
* callback is not provided.
* @type {?function}
* @private
*/
this.resizeHandler_ = null;
/**
* The LatLng coordinate of the top left of the current view of the map. Will
* be null when this.isAdded_ is false.
* @type {google.maps.LatLng}
* @private
*/
this.topLeft_ = null;
/**
* The map-pan event listener. Will be null when this.isAdded_ is false. Will
* be null when this.isAdded_ is false.
* @type {?function}
* @private
*/
this.centerListener_ = null;
/**
* The map-resize event listener. Will be null when this.isAdded_ is false.
* @type {?function}
* @private
*/
this.resizeListener_ = null;
/**
* If true, the map size has changed and this.resizeHandler_ must be called
* on the next update.
* @type {boolean}
* @private
*/
this.needsResize_ = true;
/**
* A browser-defined id for the currently requested callback. Null when no
* callback is queued.
* @type {?number}
* @private
*/
this.requestAnimationFrameId_ = null;
var canvas = document.createElement('canvas');
canvas.style.position = 'absolute';
canvas.style.top = 0;
canvas.style.left = 0;
canvas.style.pointerEvents = 'none';
/**
* The canvas element.
* @type {!HTMLCanvasElement}
*/
this.canvas = canvas;
/**
* The CSS width of the canvas, which may be different than the width of the
* backing store.
* @private {number}
*/
this.canvasCssWidth_ = 300;
/**
* The CSS height of the canvas, which may be different than the height of
* the backing store.
* @private {number}
*/
this.canvasCssHeight_ = 150;
/**
* A value for scaling the CanvasLayer resolution relative to the CanvasLayer
* display size.
* @private {number}
*/
this.resolutionScale_ = 1;
/**
* Simple bind for functions with no args for bind-less browsers (Safari).
* @param {Object} thisArg The this value used for the target function.
* @param {function} func The function to be bound.
*/
function simpleBindShim(thisArg, func) {
return function() {
func.apply(thisArg);
};
}
/**
* A reference to this.repositionCanvas_ with this bound as its this value.
* @type {function}
* @private
*/
this.repositionFunction_ = simpleBindShim(this, this.repositionCanvas_);
/**
* A reference to this.resize_ with this bound as its this value.
* @type {function}
* @private
*/
this.resizeFunction_ = simpleBindShim(this, this.resize_);
/**
* A reference to this.update_ with this bound as its this value.
* @type {function}
* @private
*/
this.requestUpdateFunction_ = simpleBindShim(this, this.update_);
// set provided options, if any
if (opt_options) {
this.setOptions(opt_options);
}
}
var global$4 = typeof window === 'undefined' ? {} : window;
if (global$4.google && global$4.google.maps) {
CanvasLayer$2.prototype = new google.maps.OverlayView();
/**
* The default MapPane to contain the canvas.
* @type {string}
* @const
* @private
*/
CanvasLayer$2.DEFAULT_PANE_NAME_ = 'overlayLayer';
/**
* Transform CSS property name, with vendor prefix if required. If browser
* does not support transforms, property will be ignored.
* @type {string}
* @const
* @private
*/
CanvasLayer$2.CSS_TRANSFORM_ = function() {
var div = document.createElement('div');
var transformProps = ['transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform'];
for (var i = 0; i < transformProps.length; i++) {
var prop = transformProps[i];
if (div.style[prop] !== undefined) {
return prop;
}
}
// return unprefixed version by default
return transformProps[0];
}();
/**
* The requestAnimationFrame function, with vendor-prefixed or setTimeout-based
* fallbacks. MUST be called with window as thisArg.
* @type {function}
* @param {function} callback The function to add to the frame request queue.
* @return {number} The browser-defined id for the requested callback.
* @private
*/
CanvasLayer$2.prototype.requestAnimFrame_ = global$4.requestAnimationFrame || global$4.webkitRequestAnimationFrame || global$4.mozRequestAnimationFrame || global$4.oRequestAnimationFrame || global$4.msRequestAnimationFrame || function(callback) {
return global$4.setTimeout(callback, 1000 / 60);
};
/**
* The cancelAnimationFrame function, with vendor-prefixed fallback. Does not
* fall back to clearTimeout as some platforms implement requestAnimationFrame
* but not cancelAnimationFrame, and the cost is an extra frame on onRemove.
* MUST be called with window as thisArg.
* @type {function}
* @param {number=} requestId The id of the frame request to cancel.
* @private
*/
CanvasLayer$2.prototype.cancelAnimFrame_ = global$4.cancelAnimationFrame || global$4.webkitCancelAnimationFrame || global$4.mozCancelAnimationFrame || global$4.oCancelAnimationFrame || global$4.msCancelAnimationFrame || function(requestId) {};
/**
* Sets any options provided. See CanvasLayerOptions for more information.
* @param {CanvasLayerOptions} options The options to set.
*/
CanvasLayer$2.prototype.setOptions = function(options) {
if (options.animate !== undefined) {
this.setAnimate(options.animate);
}
if (options.paneName !== undefined) {
this.setPaneName(options.paneName);
}
if (options.updateHandler !== undefined) {
this.setUpdateHandler(options.updateHandler);
}
if (options.resizeHandler !== undefined) {
this.setResizeHandler(options.resizeHandler);
}
if (options.resolutionScale !== undefined) {
this.setResolutionScale(options.resolutionScale);
}
if (options.map !== undefined) {
this.setMap(options.map);
}
};
/**
* Set the animated state of the layer. If true, updateHandler will be called
* repeatedly, once per frame. If false, updateHandler will only be called when
* a map property changes that could require the canvas content to be redrawn.
* @param {boolean} animate Whether the canvas is animated.
*/
CanvasLayer$2.prototype.setAnimate = function(animate) {
this.isAnimated_ = !!animate;
if (this.isAnimated_) {
this.scheduleUpdate();
}
};
/**
* @return {boolean} Whether the canvas is animated.
*/
CanvasLayer$2.prototype.isAnimated = function() {
return this.isAnimated_;
};
/**
* Set the MapPane in which this layer will be displayed, by name. See
* {@code google.maps.MapPanes} for the panes available.
* @param {string} paneName The name of the desired MapPane.
*/
CanvasLayer$2.prototype.setPaneName = function(paneName) {
this.paneName_ = paneName;
this.setPane_();
};
/**
* @return {string} The name of the current container pane.
*/
CanvasLayer$2.prototype.getPaneName = function() {
return this.paneName_;
};
/**
* Adds the canvas to the specified container pane. Since this is guaranteed to
* execute only after onAdd is called, this is when paneName's existence is
* checked (and an error is thrown if it doesn't exist).
* @private
*/
CanvasLayer$2.prototype.setPane_ = function() {
if (!this.isAdded_) {
return;
}
// onAdd has been called, so panes can be used
var panes = this.getPanes();
if (!panes[this.paneName_]) {
throw new Error('"' + this.paneName_ + '" is not a valid MapPane name.');
}
panes[this.paneName_].appendChild(this.canvas);
};
/**
* Set a function that will be called whenever the parent map and the overlay's
* canvas have been resized. If opt_resizeHandler is null or unspecified, any
* existing callback is removed.
* @param {?function=} opt_resizeHandler The resize callback function.
*/
CanvasLayer$2.prototype.setResizeHandler = function(opt_resizeHandler) {
this.resizeHandler_ = opt_resizeHandler;
};
/**
* Sets a value for scaling the canvas resolution relative to the canvas
* display size. This can be used to save computation by scaling the backing
* buffer down, or to support high DPI devices by scaling it up (by e.g.
* window.devicePixelRatio).
* @param {number} scale
*/
CanvasLayer$2.prototype.setResolutionScale = function(scale) {
if (typeof scale === 'number') {
this.resolutionScale_ = scale;
this.resize_();
}
};
/**
* Set a function that will be called when a repaint of the canvas is required.
* If opt_updateHandler is null or unspecified, any existing callback is
* removed.
* @param {?function=} opt_updateHandler The update callback function.
*/
CanvasLayer$2.prototype.setUpdateHandler = function(opt_updateHandler) {
this.updateHandler_ = opt_updateHandler;
};
/**
* @inheritDoc
*/
CanvasLayer$2.prototype.onAdd = function() {
if (this.isAdded_) {
return;
}
this.isAdded_ = true;
this.setPane_();
this.resizeListener_ = google.maps.event.addListener(this.getMap(), 'resize', this.resizeFunction_);
this.centerListener_ = google.maps.event.addListener(this.getMap(), 'center_changed', this.repositionFunction_);
this.resize_();
this.repositionCanvas_();
};
/**
* @inheritDoc
*/
CanvasLayer$2.prototype.onRemove = function() {
if (!this.isAdded_) {
return;
}
this.isAdded_ = false;
this.topLeft_ = null;
// remove canvas and listeners for pan and resize from map
this.canvas.parentElement.removeChild(this.canvas);
if (this.centerListener_) {
google.maps.event.removeListener(this.centerListener_);
this.centerListener_ = null;
}
if (this.resizeListener_) {
google.maps.event.removeListener(this.resizeListener_);
this.resizeListener_ = null;
}
// cease canvas update callbacks
if (this.requestAnimationFrameId_) {
this.cancelAnimFrame_.call(global$4, this.requestAnimationFrameId_);
this.requestAnimationFrameId_ = null;
}
};
/**
* The internal callback for resize events that resizes the canvas to keep the
* map properly covered.
* @private
*/
CanvasLayer$2.prototype.resize_ = function() {
if (!this.isAdded_) {
return;
}
var map = this.getMap();
var mapWidth = map.getDiv().offsetWidth;
var mapHeight = map.getDiv().offsetHeight;
var newWidth = mapWidth * this.resolutionScale_;
var newHeight = mapHeight * this.resolutionScale_;
var oldWidth = this.canvas.width;
var oldHeight = this.canvas.height;
// resizing may allocate a new back buffer, so do so conservatively
if (oldWidth !== newWidth || oldHeight !== newHeight) {
this.canvas.width = newWidth;
this.canvas.height = newHeight;
this.needsResize_ = true;
this.scheduleUpdate();
}
// reset styling if new sizes don't match; resize of data not needed
if (this.canvasCssWidth_ !== mapWidth || this.canvasCssHeight_ !== mapHeight) {
this.canvasCssWidth_ = mapWidth;
this.canvasCssHeight_ = mapHeight;
this.canvas.style.width = mapWidth + 'px';
this.canvas.style.height = mapHeight + 'px';
}
};
/**
* @inheritDoc
*/
CanvasLayer$2.prototype.draw = function() {
this.repositionCanvas_();
};
/**
* Internal callback for map view changes. Since the Maps API moves the overlay
* along with the map, this function calculates the opposite translation to
* keep the canvas in place.
* @private
*/
CanvasLayer$2.prototype.repositionCanvas_ = function() {
// TODO(bckenny): *should* only be executed on RAF, but in current browsers
// this causes noticeable hitches in map and overlay relative
// positioning.
var map = this.getMap();
// topLeft can't be calculated from map.getBounds(), because bounds are
// clamped to -180 and 180 when completely zoomed out. Instead, calculate
// left as an offset from the center, which is an unwrapped LatLng.
var top = map.getBounds().getNorthEast().lat();
var center = map.getCenter();
var scale = Math.pow(2, map.getZoom());
var left = center.lng() - this.canvasCssWidth_ * 180 / (256 * scale);
this.topLeft_ = new google.maps.LatLng(top, left);
// Canvas position relative to draggable map's container depends on
// overlayView's projection, not the map's. Have to use the center of the
// map for this, not the top left, for the same reason as above.
var projection = this.getProjection();
var divCenter = projection.fromLatLngToDivPixel(center);
var offsetX = -Math.round(this.canvasCssWidth_ / 2 - divCenter.x);
var offsetY = -Math.round(this.canvasCssHeight_ / 2 - divCenter.y);
this.canvas.style[CanvasLayer$2.CSS_TRANSFORM_] = 'translate(' + offsetX + 'px,' + offsetY + 'px)';
this.scheduleUpdate();
};
/**
* Internal callback that serves as main animation scheduler via
* requestAnimationFrame. Calls resize and update callbacks if set, and
* schedules the next frame if overlay is animated.
* @private
*/
CanvasLayer$2.prototype.update_ = function() {
this.requestAnimationFrameId_ = null;
if (!this.isAdded_) {
return;
}
if (this.isAnimated_) {
this.scheduleUpdate();
}
if (this.needsResize_ && this.resizeHandler_) {
this.needsResize_ = false;
this.resizeHandler_();
}
if (this.updateHandler_) {
this.updateHandler_();
}
};
/**
* A convenience method to get the current LatLng coordinate of the top left of
* the current view of the map.
* @return {google.maps.LatLng} The top left coordinate.
*/
CanvasLayer$2.prototype.getTopLeft = function() {
return this.topLeft_;
};
/**
* Schedule a requestAnimationFrame callback to updateHandler. If one is
* already scheduled, there is no effect.
*/
CanvasLayer$2.prototype.scheduleUpdate = function() {
if (this.isAdded_ && !this.requestAnimationFrameId_) {
this.requestAnimationFrameId_ = this.requestAnimFrame_.call(global$4, this.requestUpdateFunction_);
}
};
}
/**
* @author kyle / http://nikai.us/
*/
var Layer$2 = function(_BaseLayer) {
inherits(Layer, _BaseLayer);
function Layer(map, dataSet, options) {
classCallCheck(this, Layer);
var _this = possibleConstructorReturn(this, (Layer.__proto__ || Object.getPrototypeOf(Layer)).call(this, map, dataSet, options));
var self = _this;
var data = null;
options = options || {};
self.init(options);
self.argCheck(options);
var canvasLayerOptions = {
map: map,
animate: false,
updateHandler: function updateHandler() {
self._canvasUpdate();
},
resolutionScale: resolutionScale
};
var canvasLayer = _this.canvasLayer = new CanvasLayer$2(canvasLayerOptions);
_this.clickEvent = _this.clickEvent.bind(_this);
_this.mousemoveEvent = _this.mousemoveEvent.bind(_this);
_this.bindEvent();
return _this;
}
createClass(Layer, [{
key: "clickEvent",
value: function clickEvent(e) {
var pixel = e.pixel;
get(Layer.prototype.__proto__ || Object.getPrototypeOf(Layer.prototype), "clickEvent", this).call(this, pixel, e);
}
}, {
key: "mousemoveEvent",
value: function mousemoveEvent(e) {
var pixel = e.pixel;
get(Layer.prototype.__proto__ || Object.getPrototypeOf(Layer.prototype), "mousemoveEvent", this).call(this, pixel, e);
}
}, {
key: "bindEvent",
value: function bindEvent(e) {
var map = this.map;
if (this.options.methods) {
if (this.options.methods.click) {
map.setDefaultCursor("default");
map.addListener('click', this.clickEvent);
}
if (this.options.methods.mousemove) {
map.addListener('mousemove', this.mousemoveEvent);
}
}
}
}, {
key: "unbindEvent",
value: function unbindEvent(e) {
var map = this.map;
if (this.options.methods) {
if (this.options.methods.click) {
map.removeListener('click', this.clickEvent);
}
if (this.options.methods.mousemove) {
map.removeListener('mousemove', this.mousemoveEvent);
}
}
}
}, {
key: "getContext",
value: function getContext() {
return this.canvasLayer.canvas.getContext(this.context);
}
}, {
key: "_canvasUpdate",
value: function _canvasUpdate(time) {
if (!this.canvasLayer) {
return;
}
var self = this;
var animationOptions = self.options.animation;
var context = this.getContext();
if (self.isEnabledTime()) {
if (time === undefined) {
clear(context);
return;
}
if (this.context == '2d') {
context.save();
context.globalCompositeOperation = 'destination-out';
context.fillStyle = 'rgba(0, 0, 0, .1)';
context.fillRect(0, 0, context.canvas.width, context.canvas.height);
context.restore();
}
} else {
clear(context);
}
if (this.context == '2d') {
for (var key in self.options) {
context[key] = self.options[key];
}
} else {
context.clear(context.COLOR_BUFFER_BIT);
}
if (self.options.minZoom && map.getZoom() < self.options.minZoom || self.options.maxZoom && map.getZoom() > self.options.maxZoom) {
return;
}
var scale = 1;
if (this.context != '2d') {
scale = this.canvasLayer.devicePixelRatio;
}
var map = this.map;
var mapProjection = map.getProjection();
var scale = Math.pow(2, map.zoom) * resolutionScale;
var offset = mapProjection.fromLatLngToPoint(this.canvasLayer.getTopLeft());
var dataGetOptions = {
//fromColumn: self.options.coordType == 'bd09mc' ? 'coordinates' : 'coordinates_mercator',
transferCoordinate: function transferCoordinate(coordinate) {
var latLng = new google.maps.LatLng(coordinate[1], coordinate[0]);
var worldPoint = mapProjection.fromLatLngToPoint(latLng);
var pixel = {
x: (worldPoint.x - offset.x) * scale,
y: (worldPoint.y - offset.y) * scale
};
return [pixel.x, pixel.y];
}
};
if (time !== undefined) {
dataGetOptions.filter = function(item) {
var trails = animationOptions.trails || 10;
if (time && item.time > time - trails && item.time < time) {
return true;
} else {
return false;
}
};
}
// get data from data set
var data = self.dataSet.get(dataGetOptions);
this.processData(data);
var latLng = new google.maps.LatLng(0, 0);
var worldPoint = mapProjection.fromLatLngToPoint(latLng);
var pixel = {
x: (worldPoint.x - offset.x) * scale,
y: (worldPoint.y - offset.y) * scale
};
if (self.options.unit == 'm' && self.options.size) {
self.options._size = self.options.size / zoomUnit;
} else {
self.options._size = self.options.size;
}
this.drawContext(context, new DataSet(data), self.options, pixel);
//console.timeEnd('draw');
//console.timeEnd('update')
self.options.updateCallback && self.options.updateCallback(time);
}
}, {
key: "init",
value: function init(options) {
var self = this;
self.options = options;
this.initDataRange(options);
this.context = self.options.context || '2d';
if (self.options.zIndex) {
this.canvasLayer && this.canvasLayer.setZIndex(self.options.zIndex);
}
this.initAnimator();
}
}, {
key: "addAnimatorEvent",
value: function addAnimatorEvent() {
this.map.addListener('movestart', this.animatorMovestartEvent.bind(this));
this.map.addListener('moveend', this.animatorMoveendEvent.bind(this));
}
}, {
key: "show",
value: function show() {
this.map.addOverlay(this.canvasLayer);
}
}, {
key: "hide",
value: function hide() {
this.map.removeOverlay(this.canvasLayer);
}
}, {
key: "draw",
value: function draw() {
self.canvasLayer.draw();
}
}]);
return Layer;
}(BaseLayer);
/**
* @author kyle / http://nikai.us/
*/
var geojson = {
getDataSet: function getDataSet(geoJson) {
var data = [];
var features = geoJson.features;
for (var i = 0; i < features.length; i++) {
var feature = features[i];
var geometry = feature.geometry;
var properties = feature.properties;
var item = {};
for (var key in properties) {
item[key] = properties[key];
}
item.geometry = geometry;
data.push(item);
}
return new DataSet(data);
}
};
/**
* @author kyle / http://nikai.us/
*/
var csv = {
CSVToArray: function CSVToArray(strData, strDelimiter) {
// Check to see if the delimiter is defined. If not,
// then default to comma.
strDelimiter = strDelimiter || ",";
// Create a regular expression to parse the CSV values.
var objPattern = new RegExp(
// Delimiters.
"(\\" + strDelimiter + "|\\r?\\n|\\r|^)" +
// Quoted fields.
"(?:\"([^\"]*(?:\"\"[^\"]*)*)\"|" +
// Standard fields.
"([^\"\\" + strDelimiter + "\\r\\n]*))", "gi");
// Create an array to hold our data. Give the array
// a default empty first row.
var arrData = [
[]
];
// Create an array to hold our individual pattern
// matching groups.
var arrMatches = null;
// Keep looping over the regular expression matches
// until we can no longer find a match.
while (arrMatches = objPattern.exec(strData)) {
// Get the delimiter that was found.
var strMatchedDelimiter = arrMatches[1];
// Check to see if the given delimiter has a length
// (is not the start of string) and if it matches
// field delimiter. If id does not, then we know
// that this delimiter is a row delimiter.
if (strMatchedDelimiter.length && strMatchedDelimiter !== strDelimiter) {
// Since we have reached a new row of data,
// add an empty row to our data array.
arrData.push([]);
}
var strMatchedValue;
// Now that we have our delimiter out of the way,
// let's check to see which kind of value we
// captured (quoted or unquoted).
if (arrMatches[2]) {
// We found a quoted value. When we capture
// this value, unescape any double quotes.
strMatchedValue = arrMatches[2].replace(new RegExp("\"\"", "g"), "\"");
} else {
// We found a non-quoted value.
strMatchedValue = arrMatches[3];
}
// Now that we have our value string, let's add
// it to the data array.
arrData[arrData.length - 1].push(strMatchedValue);
}
// Return the parsed data.
return arrData;
},
getDataSet: function getDataSet(csvStr) {
var arr = this.CSVToArray(csvStr, ',');
var data = [];
var header = arr[0];
for (var i = 1; i < arr.length - 1; i++) {
var line = arr[i];
var item = {};
for (var j = 0; j < line.length; j++) {
var value = line[j];
if (header[j] == 'geometry') {
value = JSON.parse(value);
}
item[header[j]] = value;
}
data.push(item);
}
return new DataSet(data);
}
};
exports.version = version;
exports.canvasClear = clear;
exports.canvasResolutionScale = resolutionScale$1;
exports.canvasDrawSimple = drawSimple;
exports.canvasDrawHeatmap = drawHeatmap;
exports.canvasDrawGrid = drawGrid;
exports.canvasDrawHoneycomb = drawHoneycomb;
exports.webglDrawSimple = webglDrawSimple;
exports.webglDrawPoint = point;
exports.webglDrawLine = line;
exports.webglDrawPolygon = polygon;
exports.utilCityCenter = cityCenter;
exports.utilCurve = curve;
exports.utilForceEdgeBundling = ForceEdgeBundling;
exports.utilDataRangeIntensity = Intensity;
exports.utilDataRangeCategory = Category;
exports.utilDataRangeChoropleth = Choropleth;
exports.Map = MapHelper;
exports.baiduMapCanvasLayer = CanvasLayer;
exports.baiduMapAnimationLayer = AnimationLayer;
exports.baiduMapLayer = Layer;
exports.googleMapCanvasLayer = CanvasLayer$2;
exports.googleMapLayer = Layer$2;
exports.DataSet = DataSet;
exports.geojson = geojson;
exports.csv = csv;
Object.defineProperty(exports, '__esModule', {
value: true
});
})));