Commit 7437d876 authored by aoobao's avatar aoobao

init

parent a476ce95
......@@ -9,9 +9,10 @@ module.exports = {
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-undef': 'off'
},
parserOptions: {
parser: 'babel-eslint'
}
}
}
\ No newline at end of file
......@@ -8,6 +8,8 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"element-ui": "^2.6.1",
"normalize.css": "^8.0.1",
"vue": "^2.6.6",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"
......
......@@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>amap-line-edit</title>
<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.13&key=c81eeaf774b25626ffb1b32e13acbd99"></script>
</head>
<body>
<noscript>
......
<template>
<div id="app">
<div id="nav">
<router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link>
</div>
<router-view/>
</div>
</template>
......
export default '119.64017620590144,29.431325431477052;119.64129435662383,29.429112515709328;119.63892245010778,29.42265856875005;119.62619011380205,29.41903644519109;119.6212720188047,29.408635982510052;119.62418942235946,29.405661153053565;119.60991052864357,29.391092406254444;119.60561773292116,29.391659627179987;119.61874524588981,29.380647738507612;119.61969543519666,29.370225816044705;119.60312760830381,29.368803059892272;119.58507889706735,29.37876313040132;119.55245742423205,29.366819340688714;119.53569628590073,29.3727257457764;119.5236263404302,29.3652658520835;119.52610751393615,29.35480751914401;119.51046269535131,29.33293148428458;119.50244132511212,29.33623266352004;119.49665489093785,29.331550845876464;119.49333820314533,29.334157883914596;119.49091925722509,29.328945026167467;119.48431555332179,29.33269849947331;119.48959779955061,29.336450159097282;119.47845960265239,29.336224621072027;119.48290766786398,29.33910745148241;119.47691288864493,29.34457764442462;119.47907817322245,29.351767544191183;119.46954322275505,29.355472129909025;119.4659342025613,29.352701714466406;119.4668515809987,29.357672229212145;119.4587048280807,29.36257943744018;119.45871406864718,29.37216000324309;119.46828817963693,29.381732181259817;119.46736117749182,29.389856209350487;119.46027056655686,29.39129782576971;119.46398770627397,29.39818371799684;119.45333524570765,29.40326153196249;119.45385934810527,29.409059420075803;119.44099446913587,29.40999416571856;119.43948103822126,29.415515445683507;119.44337176397435,29.416424632587336;119.4389686851927,29.42364297002241;119.42914019975815,29.422159164626414;119.4299671199661,29.417837412434146;119.42307377694554,29.414311144621017;119.4227142510257,29.409483816772813;119.43009045804918,29.412929088757767;119.42566092203367,29.40464279864108;119.4042915248686,29.405016581621666;119.39288704612889,29.414715210151545;119.39034324859384,29.426992023587346;119.38110497711278,29.43167173770333;119.37150196193103,29.41741107091671;119.36150045597864,29.416424501137904;119.35372738511879,29.40919305179672;119.33452364851473,29.40689875141659;119.32898011241086,29.398296212297918;119.34183135705638,29.39355093500792;119.33422699091061,29.39093575072298;119.33620382111332,29.388434249007897;119.34554700951209,29.38927571175718;119.33631322772341,29.371974787374597;119.3330991788354,29.35063802497142;119.34023911967365,29.349842663332456;119.33823500813756,29.344213904063693;119.34717128248231,29.340274883538125;119.34516786090843,29.323870449211697;119.35267705264212,29.316609528447877;119.32669228840429,29.310108423448035;119.33076905031389,29.287024457276843;119.32617212008354,29.294362585303737;119.32443664210591,29.28109829742999;119.31924891023321,29.28526672771109;119.31498420147,29.2836658509137;119.31796909649223,29.278655886194098;119.30763725187656,29.28220543671603;119.30337914190513,29.27303001203762;119.29728698209117,29.277866944100026;119.2961239294221,29.270637136929224;119.29574619535124,29.28216692027757;119.28438789508586,29.285881568935945;119.28822336105978,29.280812202625473;119.28226548093983,29.27699009872005;119.2862856486044,29.26796435255683;119.27023511484147,29.250089101834217;119.25902165480335,29.247113384382473;119.24473120667376,29.254095522457657;119.24719717649013,29.250027031953977;119.23541781072443,29.247403944806983;119.23084818117641,29.25563201415359;119.23527059566425,29.254149492271882;119.23942562631262,29.259533918292703;119.23115018594972,29.267027916419305;119.23325524973993,29.271837431704196;119.22918386734183,29.27072081701602;119.23121924641916,29.289864064489997;119.20905998977909,29.2950596498035;119.210583320578,29.289958261037505;119.19948371585467,29.28912812554567;119.1952169223305,29.272060638305156;119.18647976605115,29.268743755662125;119.19404220617864,29.25633202093891;119.20060460193227,29.258108329909895;119.20913605741322,29.24769628491995;119.21571721555142,29.24746186866087;119.21161223020088,29.243954973851856;119.21714002355627,29.236310076110335;119.2075064272703,29.235825855721792;119.21431300879509,29.22404380889505;119.20302522533623,29.224491342508543;119.2026315569502,29.22956379384237;119.19046963498569,29.227559929447366;119.19571127894932,29.216467437263134;119.18608633187249,29.20301289360425;119.18292511319513,29.207143506696557;119.17740224036747,29.204088109082445;119.17552384238604,29.213412523454775;119.17086744746727,29.21289070879388;119.16853716072143,29.21846109804185;119.16058332339978,29.21335780883583;119.15215891680589,29.227114256767017;119.1363030752804,29.21998410412537;119.12867642596822,29.225591280142382;119.13164874086571,29.23376703520156;119.125777576348,29.237102677193832;119.10895732229366,29.226079963059806;119.09286324940047,29.231142401862716;119.08429654089811,29.230277103066005;119.07612544225812,29.22285402393508;119.06329726952869,29.227653630644532;119.05428668872767,29.221156131726058;119.02837128981112,29.219920892200005;119.02344024399122,29.21359694895954;119.00274741856332,29.207654927226013;118.9981205650647,29.216882090535087;118.98867664235318,29.21902710564362;118.99055751044915,29.22292264096143;118.98517207204858,29.22015990242617;118.98789642767112,29.22466875999218;118.98406687698342,29.2258879692007;118.98335618840031,29.238402653058802;118.98803693856493,29.247706658676016;118.98276117015497,29.259173692333956;118.97525096860616,29.258401263851677;118.96542541591744,29.268446635021014;118.95959118556068,29.266815630845407;118.95522330546663,29.28215533148521;118.95109268739508,29.279174317801377;118.96411983698202,29.295461550005378;118.94927712872358,29.300056505702866;118.94294649856981,29.307598192537863;118.92585056173274,29.310688364923518;118.90097956075353,29.332526453986063;118.89308712145962,29.330616871082206;118.88938530263712,29.323385564872105;118.87155605878951,29.3247747992519;118.85193521165718,29.299381263266966;118.82875532624222,29.288689329658702;118.82626124027111,29.28056814084281;118.81251770326263,29.28056079365901;118.78716811710035,29.267122738918648;118.7769207411986,29.251683497907432;118.76723356088837,29.251793016702813;118.76099517979134,29.240822205629094;118.76657986309868,29.23574032020007;118.76537968767153,29.219897437899903;118.73235288309158,29.20741625422473;118.7306813190109,29.199261150858053;118.72071802078993,29.198562791438995;118.71156410502135,29.18579759933073;118.68212865668411,29.20283282666532;118.6282771870651,29.192909385462844;118.62595678443634,29.198409209086844;118.63270683935332,29.204160420204577;118.63180844051779,29.218831825049328;118.62057393854862,29.21811972226156;118.60661632730525,29.239097284514013;118.61498321773753,29.248209908028393;118.60579006239742,29.268482810047114;118.6129826114403,29.280662619586977;118.62359720216189,29.265886337987354;118.6367971012964,29.263331677297717;118.62687431947217,29.2854999610103;118.61372983917458,29.29735225265618;118.61698687358385,29.3062200283799;118.60221035591258,29.316432998671658;118.60293155629881,29.325551247489617;118.59352681238616,29.33044546552575;118.58765431924694,29.327416140676647;118.58730325377283,29.33221070461514;118.56528635232797,29.340644449598397;118.54223086854675,29.3368329117885;118.54175941524922,29.34290541035484;118.53433965564831,29.34146807951517;118.5223468515561,29.351291560817945;118.52544931006214,29.36148764245005;118.52080945248177,29.3614094340151;118.51910532547184,29.366838676058194;118.50621052700988,29.35971234188506;118.50151266426208,29.3634393975455;118.49351144391285,29.36068625627986;118.49005677900941,29.36743342137863;118.48250630585724,29.36834465660711;118.46320444077281,29.35883888789948;118.4545933493308,29.37327884802873;118.43745453530497,29.37704020065631;118.41647185948987,29.391422032046357;118.42011838951343,29.392175934623708;118.41625389363539,29.392078502502272;118.41687514806338,29.396998153610298;118.41466412541645,29.39347492908999;118.41606637365324,29.403546661912202;118.40553363305473,29.407194403112836;118.41457420021423,29.419731970095686;118.3905112256101,29.423675135917797;118.38442712506341,29.433294195027084;118.3719486210845,29.438908756141352;118.36508666497309,29.45071489673476;118.3536749019997,29.451865757292378;118.34545019644587,29.46145449415302;118.34502779100458,29.476098173990792;118.36205755765906,29.478837634674136;118.36594650371877,29.484255113296754;118.36201376949963,29.48641344962459;118.38051734803311,29.502187747627495;118.38347961672073,29.51026397159201;118.40494507716046,29.507195633659027;118.41547027144492,29.510281664414375;118.43009822848845,29.50139197324375;118.44092877994635,29.51553960131219;118.44096963137504,29.511819052948216;118.4501590219276,29.513181597958365;118.45943762236018,29.506460670415525;118.45894015670261,29.513426592572465;118.47888002291354,29.509084441895595;118.49474965530497,29.518721476541607;118.49803835239713,29.54175996676764;118.49369096664404,29.550787715099165;118.49949047881422,29.576274540222396;118.53613393866682,29.59106340209433;118.54213341452174,29.604278113628354;118.54984092754324,29.613175056355658;118.55815503538946,29.615089769936578;118.57414590808582,29.638546250022646;118.60204896459321,29.643286163316187;118.6205396817929,29.654265521858523;118.64231113262939,29.640972260949603;118.65068767898649,29.64594924260085;118.67359082914214,29.66862331310543;118.68156073433444,29.679647728564575;118.68219273250558,29.689462651730583;118.69263985106019,29.694088807948162;118.69286927974822,29.700797260693417;118.70106479984723,29.70672063693454;118.71983132612114,29.708700575043046;118.72588771922644,29.726002499419952;118.74552861728964,29.739480359402993;118.74943185575148,29.760755496692294;118.74507093484527,29.767568517347318;118.74754069436584,29.77432759412833;118.73616368883255,29.788794446777427;118.73680633067193,29.804828542354922;118.7378872793419,29.812805855699512;118.74455055106674,29.81812689121087;118.7618151212565,29.819946663355577;118.75784374546211,29.822754393521326;118.76186142598894,29.8269464809602;118.75413563682373,29.830617024910833;118.75275249187297,29.844417940488473;118.76654025155669,29.849485516568254;118.77713647216633,29.842413714133137;118.78438422155577,29.843563271023104;118.8099872044956,29.8703696379169;118.84321940215479,29.892879473340695;118.84685821883086,29.909147072114155;118.84064203356068,29.931537850471976;118.851702100055,29.941059475646245;118.8639588660385,29.937306289719196;118.87246946249185,29.947790300757838;118.89238471649192,29.935391205698597;118.89111401601104,29.962573716918854;118.89917880384981,29.982134647956798;118.89107918440622,29.994776823319224;118.89429961695991,30.003272197955212;118.89003496750722,30.009871846691066;118.9039161795765,30.02641127586512;118.89095715164957,30.036646469259907;118.89302910067994,30.054419482579977;118.89117591458317,30.067501573317323;118.88741750891684,30.06890455010296;118.8896253217482,30.07569696549635;118.88239073038186,30.08335922933305;118.88394512576664,30.09881702896801;118.87487258122894,30.101989827151364;118.86661515151964,30.098261342001035;118.86269310036651,30.109166159851075;118.86607381098052,30.12051181703981;118.85576111970414,30.119596853964296;118.8637958637804,30.133927705547666;118.88178745954195,30.124397944598417;118.89286076566265,30.128862293250194;118.89962539867783,30.144043555089873;118.88882386951822,30.149680855214694;118.88151934688894,30.131931610604422;118.87337790098029,30.13943355142475;118.85681054448807,30.14113522150991;118.8598410469437,30.147365214674736;118.8537599493278,30.15350537018684;118.84649520474358,30.152867158261078;118.84645849316334,30.157146131922797;118.85029436180085,30.164236909323712;118.89984108181234,30.1797880221825;118.91274908811599,30.19568356130794;118.93220945678323,30.205368963617634;118.9230275662534,30.207818910254566;118.9227841683425,30.213250894996996;118.90438533383625,30.215051160945094;118.90782372344178,30.21978625963166;118.9045342145413,30.2244320252795;118.88415848153264,30.237135291716445;118.88211221572631,30.249653747481805;118.89502199519376,30.25760275184833;118.87787112021878,30.28274831767596;118.88380696838776,30.301823743074085;118.88065427305241,30.31493762996615;118.89974188616381,30.32060995664627;118.91122581939574,30.33304846208426;118.92365517257002,30.33329093453497;118.91873911106634,30.338016362592796;118.93953915879642,30.34450996932365;118.94037946839792,30.352775631422915;118.95360585522798,30.35946994033099;118.96030197425345,30.346259845218714;118.9692196247794,30.352120102534265;118.97500432971728,30.34543898815955;118.98747377153619,30.3485956950383;118.98940974152741,30.331072619129767;119.00850664452969,30.326605454073544;119.02434121777621,30.33094557831018;119.031584372296,30.327934620716267;119.03549611295165,30.31186047309777;119.04950558400873,30.31115434765836;119.05551658291922,30.303039581144617;119.06557898309866,30.30376885921712;119.0788921499412,30.318361059711574;119.09109815992291,30.323252540460036;119.09634940833848,30.316521562415247;119.10273378727773,30.317775278920102;119.12729476237557,30.304705598632843;119.15427456491648,30.304554543778206;119.16034972563769,30.297126306890657;119.1664685558192,30.29950753068679;119.18708982100014,30.291638092926963;119.20945292567681,30.2920307630821;119.20658176451613,30.301375392857565;119.21712210852056,30.292087098109093;119.22392660390267,30.300035001995504;119.22800981361931,30.28814734530672;119.24000980414706,30.300111262217868;119.24833151836268,30.323634726238662;119.24133440811092,30.326591258559667;119.24934219538919,30.341498076087575;119.26408690396063,30.33680704102557;119.27245729794856,30.34244896852603;119.27831287463316,30.34094723247086;119.29252514853843,30.350990678691183;119.30048322773293,30.36390818586543;119.3262805628689,30.372059813559495;119.34378873676823,30.363743235154313;119.34950030748199,30.348257687754383;119.37019199284522,30.352734485842902;119.38829960912499,30.36514885661963;119.39898511004928,30.366695073310993;119.40397464338561,30.374586613325096;119.41340746937777,30.373158077563705;119.43296761928704,30.384014532652188;119.4365766376591,30.39103831635704;119.44585444403936,30.39138264144496;119.45046837107272,30.404538087423603;119.44809178466683,30.410419529060917;119.45335708653545,30.412949454595708;119.47471443969137,30.405939418079342;119.49832465384979,30.408244758849996;119.51583774492113,30.40053601886078;119.5358081054899,30.40914510786532;119.53679064461532,30.424813408705884;119.56509743720312,30.44566602639472;119.58281222647575,30.42398065551948;119.60225767232431,30.419178764193692;119.60793230338653,30.426062614836805;119.62782614607153,30.431713571988098;119.6355200684061,30.441797302865083;119.64486009230761,30.438955670768305;119.6493750973607,30.442893488275967;119.64340524590945,30.428600394540734;119.63218656099711,30.425814309685993;119.63742110306717,30.410376051145562;119.6313941946726,30.407760265926207;119.6372296742572,30.402212422382533;119.63326916356606,30.395164820276708;119.64675962774989,30.393812155175315;119.65447588651418,30.401080548004924;119.65597680991617,30.397262024040405;119.65535725630623,30.405177803367163;119.66790545743952,30.39922775140703;119.66851081860534,30.40801789442719;119.67669150577501,30.40370708251342;119.69427393036311,30.42663538583868;119.70646159607512,30.42949648718662;119.70363264235759,30.446404448230194;119.69282103805601,30.451560979717186;119.70862320792506,30.480454919282852;119.71046093347874,30.48896125353812;119.7048112090614,30.49326813141545;119.71021911518277,30.502481278814205;119.7094162545195,30.518150264235906;119.69258982755296,30.557258997200346;119.72182363934328,30.562514902136368;119.72472076195733,30.552169521406746;119.73506818336479,30.552283425857787;119.74081898558613,30.547442331056274;119.76701807605983,30.556081190747637;119.77167893648931,30.552883331149232;119.76727229529557,30.535754998095207;119.77227402376597,30.525543826410555;119.76235349305595,30.515901435509996;119.7848778142343,30.510570489894036;119.790444450076,30.504681475101933;119.80229876994376,30.50406037552847;119.81761692774879,30.51080391901702;119.83603509934355,30.496334986889295;119.849726175164,30.49528356902507;119.85081160080793,30.498963373558016;119.86620039034594,30.48383671290233;119.8648369829324,30.477974529993244;119.8799613639499,30.474707504278246;119.8733079228553,30.46900856300977;119.87474254344507,30.46005354791314;119.91162910781235,30.455563919106837;119.91929736987674,30.460991440678672;119.93924327674644,30.444172929564342;119.94943004292394,30.45083523142381;119.95335062509155,30.435209950841134;119.96430309809018,30.429561164906534;119.98741162543479,30.445819917562666;120.00105145683216,30.445772886665626;120.01423458491979,30.43594609848388;120.0294947877803,30.438580522961523;120.03858323181012,30.435247069881814;120.0361759281338,30.42539554849898;120.0645341432211,30.42989087329235;120.06217581228356,30.435191637681847;120.06820647654888,30.445520963599723;120.05946316349262,30.458027255253356;120.05954658496401,30.472244595420435;120.06875128596765,30.49764918622958;120.1004479626359,30.495484787114925;120.09655403432122,30.484881634222493;120.10687625281236,30.48410545433709;120.10937807388785,30.480205608921136;120.10593917957567,30.479243211934307;120.11497216967116,30.474479367197635;120.11557149888291,30.480760424324632;120.1214821764416,30.483247643165928;120.12634911059189,30.478403925895787;120.1464394343668,30.482914486837227;120.15090190754722,30.467578422148822;120.17921202407136,30.47798712215565;120.17448303156395,30.48499396936309;120.18260783083768,30.4801053093743;120.17372022565304,30.492214664035966;120.18591185120809,30.494642431180782;120.18283368501078,30.50078545917794;120.19434887104792,30.502101718638457;120.19987077630336,30.514572675830557;120.20366532627472,30.504529809321788;120.22778547676128,30.508094008615164;120.22960465020357,30.513865276528296;120.24013942506363,30.504371773343557;120.27863293796904,30.504316850608344;120.29985011542232,30.5196776848026;120.31902570924349,30.52100887689505;120.32786689264083,30.491750507783365;120.32659197610542,30.47070751678997;120.3382677385767,30.47349322295506;120.34325651000862,30.466257344796265;120.33722413342548,30.46429104421643;120.34033332881319,30.433916436263686;120.3307594289082,30.427275293105414;120.33284370071948,30.41594760176041;120.31457288347785,30.399987522953637;120.31103518013948,30.40308472797624;120.3060684150707,30.39328071928026;120.31488989556911,30.395682000249156;120.3194067119126,30.3788123143515;120.34160212694658,30.376258528503378;120.34456975203065,30.367685753148965;120.3515002316539,30.374783853576535;120.39998097084077,30.383894204354316;120.40087593166223,30.372807401759434;120.3877068963673,30.36963917527482;120.37807173962928,30.344932830797887;120.41291975274571,30.31645232296492;120.43882784983427,30.373403647325073;120.45021332078052,30.380047315519953;120.49873394514731,30.38903246807431;120.63387919812922,30.38945616220405;120.66235297374898,30.38474400553037;120.68851798346755,30.369407423514556;120.70209130239154,30.349752368065452;120.7182925586041,30.28917804289654;120.6700196889616,30.232993344008275;120.64439651259045,30.21756397470065;120.61433231325908,30.168606976073736;120.61029755864016,30.151049312066633;120.59883110937544,30.145526667111767;120.58023456181417,30.152388066519816;120.56076940825662,30.147324230884507;120.55573465683334,30.149839531789134;120.55949327002526,30.14999553709709;120.55754496997997,30.155375876063953;120.5389065573397,30.16000421187505;120.51620508063311,30.15466658304517;120.51040688325774,30.159012355392726;120.51082159890052,30.16569322646012;120.49987838524584,30.16604698394127;120.50061630952169,30.173087608925275;120.49479278444744,30.16957955193562;120.48429408085843,30.172844965818406;120.4805367750099,30.16890615993825;120.46132316776968,30.16813754131996;120.46334754915587,30.15350384976103;120.4594875406126,30.1484301593013;120.45082085513262,30.14961809841878;120.44322626498723,30.130610324258218;120.44031686108742,30.1343399522516;120.42491594035444,30.13022306253492;120.42609120941385,30.144271796837952;120.41944562064458,30.15297020949125;120.41817323976946,30.14861780192987;120.41090136004465,30.149540210186068;120.41148795732988,30.13174271584941;120.40457919319307,30.1296088459175;120.40534363567554,30.13663074754332;120.39781046371799,30.13727575197948;120.39825541676547,30.14252981026348;120.3857516625798,30.157538926171178;120.36419099257313,30.153070713493506;120.35909002401553,30.147183433973954;120.35280505169203,30.151679163723085;120.35425267627711,30.142357040242175;120.33950207435998,30.14212020710833;120.32730442250279,30.12475838982496;120.318216235397,30.124810482332073;120.31314644006191,30.137383529697587;120.30220457258774,30.132141499880397;120.29781713012581,30.12713222981656;120.3040600607683,30.125519704258743;120.28696207066577,30.10718221062913;120.28831974940724,30.10028363865354;120.30374865746498,30.100028438346268;120.31325297349618,30.109555903983864;120.32314730506545,30.098534140092706;120.32993947488946,30.101698113444147;120.3385307167073,30.093588435318154;120.33064494900371,30.07596273253243;120.33753260834393,30.058867482778755;120.3240806143473,30.04573581637136;120.3388209075018,30.033637862169883;120.34201247810063,30.03619567872331;120.34233962196436,30.030171370205352;120.34920428553478,30.03277837097442;120.34472082882887,30.019096199839645;120.35186760168783,30.0187287076322;120.35814950145785,30.011849833543895;120.35543553503719,30.00770359685325;120.3611434215538,29.999717193178064;120.3530572477167,29.991548318655813;120.36313966780544,29.986569054259753;120.36413319740457,29.975692975730468;120.34398159011376,29.974235520786625;120.34103355256892,29.95705481644715;120.32692335766457,29.94806323733165;120.32642825687935,29.939139463974872;120.3137364939283,29.928233159444602;120.29076320499608,29.937052205340542;120.28298001290564,29.922240658329844;120.27300735770338,29.920265213213856;120.26484206219597,29.92282221989283;120.26491103360583,29.93242151187189;120.25590133622342,29.942942190274568;120.248092470001,29.93580080354682;120.24405047255884,29.94066356900504;120.22670181510522,29.942181870592947;120.23016539936081,29.939770354768683;120.22722908059104,29.93793638413175;120.22260663608587,29.942377019440972;120.2109274264098,29.93560890694624;120.2214555738657,29.933507184446384;120.22022767499658,29.929340486855533;120.20823601131607,29.934328057167974;120.19988507465298,29.930675728569888;120.2072992239196,29.917772369990605;120.19983327825666,29.91970565120517;120.19643708376113,29.913483291159856;120.18910419141866,29.912010092619425;120.19344141421647,29.9091485486673;120.18754074645736,29.903196758434483;120.17948439690375,29.90904626828876;120.17472218318393,29.905699611959655;120.17726582364672,29.913460536898384;120.1669882864577,29.9180788212741;120.15966376800003,29.906352935259893;120.15004104423542,29.905083950146782;120.14528086841818,29.8929642974682;120.14882457082896,29.887121466352824;120.14404434206926,29.886783668592017;120.14997094039673,29.88329563550965;120.14355125696977,29.872424295901272;120.13245665726178,29.859125821902968;120.12571775903177,29.862962325168933;120.1285366301381,29.85693818212315;120.11611726769524,29.851469736423816;120.11479935927173,29.843585716011177;120.10660680297433,29.842346652093;120.1004006709579,29.831556412783957;120.09992237320436,29.818872404598974;120.09351660875463,29.815478257681516;120.07611457411853,29.827868799612197;120.06341915265939,29.82135652280321;120.04909373477815,29.82485392792229;120.03749303528303,29.82058235561344;120.02988047304913,29.80590963677682;120.03701509401851,29.788507783073978;120.03005581019487,29.784389312358137;120.02888940658536,29.769714500285062;120.02073349591917,29.765622065628456;119.99276547882923,29.759164125606375;119.98747740992951,29.76535790415863;119.98672015660026,29.757020180370024;119.97617315044607,29.766401024587807;119.9624222455544,29.755531147301657;119.94537133028442,29.75585498584016;119.92706054938351,29.74374285259728;119.91449396540713,29.75502162433442;119.90472478071919,29.75369583907629;119.89163293695927,29.762644211480225;119.88897056203432,29.753644870009214;119.90075070422336,29.744792119284977;119.89970515859272,29.730286953800498;119.91242559854268,29.72270535368978;119.91284372071831,29.71101459977056;119.92845999971529,29.70447435463916;119.93012909922084,29.70745365254253;119.93132632455608,29.702999751047795;119.9356372448547,29.712828735582725;119.93921525725523,29.709919607101565;119.94546887738463,29.717448531012753;119.95473571693948,29.71648785493935;119.94980535371879,29.713835622375843;119.95467753354228,29.711378258712404;119.94897123268294,29.709999906753698;119.9475586607119,29.714394662302357;119.94368591886,29.708863273396517;119.96222944766794,29.70091175800748;119.97025380509707,29.692135042121304;119.96771677424543,29.690030278210592;119.97501760470522,29.688113950331356;119.97229054559183,29.67521440081308;119.96788611522953,29.674437928941387;119.97072056739528,29.67121442912657;119.96030150807093,29.672860505655766;119.9555925001795,29.679738473795314;119.95081343465014,29.676036253160632;119.95256794107542,29.681455088641634;119.94588418480865,29.681443385766276;119.926368397615,29.668797535156976;119.92692697419636,29.672911712807903;119.92145909151255,29.664292392814108;119.91250344270306,29.666735768563864;119.89753435586628,29.660725105290325;119.88708898690746,29.662571153625425;119.89132087305285,29.676915773082722;119.88099167822968,29.667583320738107;119.85920711821802,29.671564499312204;119.85412748014359,29.66872777649978;119.83361994571152,29.680274019124827;119.82443919166842,29.67158628016953;119.81534304754668,29.6723661926935;119.79733417348244,29.656197810065397;119.77774547247859,29.650045942829827;119.7775172588726,29.639164449000376;119.76839826548705,29.63119615918077;119.7681348495596,29.625364814545264;119.7791996146347,29.617480552781764;119.78008479364283,29.609889230804466;119.77284317303095,29.605851790267824;119.77079912650689,29.59763636955209;119.76462614898439,29.597297256967153;119.76769557309782,29.608438480340986;119.76447165151626,29.60230633662738;119.76057022542427,29.605249956697204;119.76118926588637,29.594068350718622;119.76725175018524,29.59238848499915;119.76535836986908,29.58566479750058;119.76998008232525,29.581020887362264;119.75139753044023,29.573576045405918;119.7565027234638,29.568219657206537;119.75136101651678,29.563859411071746;119.76093667192154,29.561543254448807;119.76278136943975,29.56533932718294;119.76467580072828,29.55501226847954;119.76203619485187,29.56002297655237;119.75141875975716,29.561446458407282;119.7445658374352,29.551901183132614;119.73155229339751,29.548909585673776;119.72373834826689,29.552711972453046;119.72886064336137,29.54646902388513;119.71734505470212,29.551667937436594;119.72372981250697,29.544647791949732;119.71806921417321,29.53764891549236;119.72254215589962,29.536799251410475;119.72088863318046,29.53331385591809;119.72790741918129,29.536891901866987;119.7285681917465,29.525258562314942;119.73460883264107,29.521378732699965;119.72735538196842,29.516444121372164;119.72468269643805,29.521959866330164;119.72108930289967,29.517467612385005;119.71396413743634,29.520153527304515;119.72721447915899,29.51261806334409;119.72631888751734,29.506642469014967;119.7131755886694,29.50494304829359;119.71918676806648,29.503182735073857;119.71350733392283,29.485185449007187;119.70825564909208,29.49549178158171;119.70257629569524,29.48856289475109;119.70926966225838,29.47588606286044;119.70771363175005,29.463810167452493;119.71701837510368,29.453607567379347;119.71355009884628,29.445389178780943;119.70433789690082,29.441596045639585;119.71014103493042,29.440133232866522;119.7106087988741,29.4365908299727;119.7035277642906,29.43567829206205;119.70946075407937,29.4331011655198;119.70273250833004,29.431275577371473;119.69215050703731,29.44075023118463;119.68999593848093,29.431200420864826;119.68138737460762,29.428952015758103;119.686361894789,29.42848860385628;119.68168912355188,29.42586769627192;119.68939439856094,29.42023205576323;119.68015059748706,29.420840632810748;119.68501914288701,29.416444346302754;119.67932199554265,29.414757989896383;119.68002108377085,29.4222590428298;119.66923422588933,29.43049805145406;119.6567671940103,29.423360365022514;119.64678175148616,29.437102081107557;119.6409745381096,29.43541904024228;119.64302896004658,29.42996440666305;119.64017620590144,29.431325431477052;|119.63247833136839,29.429729779326085;119.63870132432518,29.432029215235058;119.63406521406522,29.434242091730606;119.63247833136839,29.429729779326085;|119.63870132432518,29.432029215235058;119.64017620590144,29.431325431477052;119.63964449020071,29.43237777909814;119.63870132432518,29.432029215235058;'
\ No newline at end of file
// const STATUS = {
// VIEW: 0, // 查看模式
// CLEAR: 1, // 清除模式
// EDIT: 2 // 编辑模式
// }
/**
* opt
* color : String 线段默认颜色 '#fff'
* pointSize : Number 点位大小 3
*/
export default class LineManager {
constructor(map, opt) {
this._initialize(map, opt || {})
}
// static STATUS = {
// VIEW: 0, // 查看模式
// CLEAR: 1, // 清除模式
// EDIT: 2 // 编辑模式
// }
static VIEW = 0
static CLEAR = 1
static EDIT = 2
_initialize(map, opt) {
this._map = map
this._color = opt.color || 'yellow'
this._pointSize = opt.pointSize || 3
this._pointColor = opt.pointColor || this._color
this._lastPointColor = opt.lastPointColor || 'red'
// this._status = LineManager.STATUS.VIEW // 默认查看模式
this._status = LineManager.VIEW
this._lines = []
this._createCustomLayer()
this.show()
}
_createCustomLayer() {
let canvas = this._canvas = document.createElement('canvas')
this._ctx = canvas.getContext('2d')
let size = this._map.getSize()
canvas.width = this._width = size.width
canvas.height = this._height = size.height
this._cus = new AMap.CustomLayer(canvas, {
zIndex: 10
})
this._cus.render = this._redraw.bind(this)
}
_redraw() {
this._lines = this._lines.map(lineObj => {
let pixels = lineObj.line.map(t => this._map.lngLatToContainer(t))
let obj = {
...lineObj,
pixels
}
return obj
})
this._draw()
}
_draw() {
this._clearCanvas()
this._drawCanvas()
}
_clearCanvas() {
this._ctx.clearRect(0, 0, this._width, this._height)
}
_drawCanvas() {
if (!this._lines || this._lines.length == 0) return
let ctx = this._ctx
ctx.save()
this._lines.forEach(lineObj => {
let pixels = lineObj.pixels
// 线条颜色
ctx.strokeStyle = lineObj.color ? lineObj.color : this._color
ctx.lineWidth = 1
ctx.beginPath()
for (let i = 0; i < pixels.length; i++) {
let pixel = pixels[i];
ctx.lineTo(pixel.getX(), pixel.getY())
}
// ctx.closePath()
ctx.stroke()
// 标记每个点位.
if (this._status != LineManager.VIEW) {
ctx.fillStyle = lineObj.pointColor ? lineObj.pointColor : this._pointColor
for (let i = 0; i < pixels.length; i++) {
const pixel = pixels[i];
ctx.beginPath()
ctx.arc(pixel.getX(), pixel.getY(), this._pointSize, 0, 2 * Math.PI)
ctx.fill()
}
}
// 绘制最后一个点
let pixel = pixels[pixels.length - 1] // 最后一个点
ctx.fillStyle = this._lastPointColor
ctx.beginPath()
ctx.arc(pixel.getX(), pixel.getY(), this._pointSize, 0, 2 * Math.PI)
ctx.fill()
});
ctx.restore()
}
getLineList() {
let list = this._lines.map(lineObj => {
let obj = {
...lineObj,
pixels: null
}
delete obj.pixels
return obj
})
return list
}
// 擦除
clearLine(pixel, clearWidth) {
// console.log(pixel, clearWidth)
let flag = false
let lines = this._lines.map(lineObj => {
let obj = this.filterPixels(lineObj, pixel, clearWidth)
if (obj == null) {
return lineObj
} else {
flag = true
return obj
}
})
if (flag) {
this._lines = lines
this._draw()
}
}
filterPixels(lineObj, pixel, clearWidth) {
let minX = pixel.getX() - clearWidth / 2
let minY = pixel.getY() - clearWidth / 2
let maxX = pixel.getX() + clearWidth / 2
let maxY = pixel.getY() + clearWidth / 2
let rowIndex = null
let pixels = lineObj.pixels
let lines = lineObj.line
let points = []
let pointPixels = []
for (let i = 0; i < pixels.length; i++) {
const p = pixels[i]
let line = lines[i]
// 判断当前点位是否在擦除范围内.
if (isInPath(p, minX, minY, maxX, maxY)) {
if (rowIndex == null) rowIndex = i - 1 // 拿到上一个点位.
} else {
if (rowIndex != null) { // 已经有点被擦除.
points.push(line)
pointPixels.push(p)
}
}
}
// 有点位被擦除
if (rowIndex != null) {
if (rowIndex > -1) { // 将头部的点加到新数组的末尾.
points.push(...lines.slice(0, rowIndex + 1))
pointPixels.push(...pixels.slice(0, rowIndex + 1))
}
return {
...lineObj,
pixels: pointPixels,
line: points
}
} else {
// 没有点位被擦除,不需要修改,返回null,优化性能
return null
}
}
setClearModel() {
// this._status = LineManager.STATUS.CLEAR
this._map.setStatus({
dragEnable: false
})
this._status = LineManager.CLEAR
this._draw()
}
setViewModel() {
this._map.setStatus({
dragEnable: true
})
this._status = LineManager.VIEW
this._draw()
}
setEditModel() {
this._map.setStatus({
dragEnable: true
})
this._status = LineManager.EDIT
this._draw()
}
setData(list) {
this._lines = list
this._redraw()
}
show() {
this._cus.setMap(this._map)
}
hide() {
this._cus.setMap(null)
}
destroy() {
this.hide()
}
}
function isInPath(pixel, minX, minY, maxX, maxY) {
let x = pixel.getX()
let y = pixel.getY()
if (x >= minX && x <= maxX) {
if (y >= minY && y <= maxY) {
return true
}
}
return false
}
\ No newline at end of file
export function transposePolyrect(coordinate, sep = '|') {
var arr = []
let pattern = /\d+(\.\d+)?/g
if (typeof coordinate === 'string') {
let temp = coordinate.split(sep)
temp.forEach(t => {
if (t) {
let re = [];
let mat = t.match(pattern);
for (var i = 1; i < mat.length; i += 2) {
var x = parseFloat(mat[i - 1]);
var y = parseFloat(mat[i]);
re.push([x, y]);
}
arr.push(re)
}
})
} else {
console.warn('经纬度格式有误:', coordinate)
}
return arr;
}
export function LineToString(arr) {
let st = arr.toString()
st = st.replace(/(\d+(\.\d+)?,\d+(\.\d+)?)(,|$)/g, '$1;');
return st;
}
\ No newline at end of file
<template>
<el-dialog title="添加线段" width="840px" :visible="visible" :before-close="handleClose">
<el-input v-model="name" placeholder="请输入名称"></el-input>
<el-input style="margin-top:10px;" type="textarea" v-model="text" :rows="10" placeholder="输入内容x,y;x,y"></el-input>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submit">确 定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
text: '',
name: ''
}
},
methods: {
handleClose () {
this.visible = false
},
show () {
this.visible = true
},
submit () {
this.$emit('add', {
name: this.name,
text: this.text
})
this.visible = false
}
},
watch: {
visible (val) {
if (!val) {
this.text = ''
this.name = ''
}
}
}
}
</script>
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br>
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
</ul>
<h3>Essential Links</h3>
<ul>
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
<template>
<div class="line-container">
<div v-if="isClear" class="clearRect" :style="clearStyle()"></div>
</div>
</template>
<script>
import LineManager from '../assets/LineManager'
export default {
props: {
map: {
type: Object,
required: true
},
data: {
type: Array
},
status: {
type: Number
},
clearWidth: {
type: Number,
default: 10
},
x: Number,
y: Number
},
data () {
return {
down: false
}
},
computed: {
isClear () {
return this.status == LineManager.CLEAR
}
},
created () {
// this.map.on('mousemove', this.mapMouseMove, this)
this.map.on('mousedown', this.mapMouseDown, this)
this.map.on('mouseup', this.mapMouseUp, this)
this.map.on('mousemove', this.mapMouseMove, this)
this.manager = new LineManager(this.map, {
color: 'blue',
pointSize: 3
})
if (this.data.length > 0) {
this.manager.setData(this.data)
}
},
beforeDestroy () {
if (this.manager) {
this.manager.destroy()
this.manager = null
}
if (this.map) {
this.map.off('mousedown', this.mapMouseDown, this)
this.map.off('mousedown', this.mapMouseUp, this)
this.map.off('mousemove', this.mapMouseMove, this)
}
},
methods: {
mapMouseUp () {
this.down = false
},
mapMouseDown (e) {
// console.log(e)
this.down = true
if (this.manager) {
this.manager.clearLine(e.pixel, this.clearWidth)
}
},
mapMouseMove (e) {
// console.log(e)
if (this.down && this.manager) {
this.manager.clearLine(e.pixel, this.clearWidth)
}
},
draw () {
if (this.manager) {
this.manager._draw()
}
},
clearStyle () {
let opt = {}
if (this.isClear) {
opt = {
top: this.y + 'px',
left: this.x + 'px',
width: this.clearWidth + 'px',
height: this.clearWidth + 'px',
marginLeft: -(this.clearWidth / 2) + 'px',
marginTop: -(this.clearWidth / 2) + 'px'
}
} else {
opt = {
display: 'none'
}
}
return opt
},
getLineList () {
if (this.manager) {
return this.manager.getLineList()
} else {
return []
}
}
},
watch: {
data (list) {
if (this.manager) {
this.manager.setData(list)
}
},
status (val) {
if (this.manager) {
if (val == LineManager.VIEW) {
this.manager.setViewModel()
} else if (val == LineManager.CLEAR) {
this.manager.setClearModel()
} else if (val == LineManager.EDIT) {
this.manager.setEditModel()
}
}
}
}
}
</script>
<style lang="scss" scoped>
.clearRect {
position: absolute;
background-color: red;
pointer-events: none;
}
</style>
<template>
<div class="line-container" @mouseout="mouseout" @mouseover="mouseover">
<span class="name">{{name}} {{startPointName}}</span>
<el-button type="success" size="mini" @click="reverse">反转</el-button>
<el-button @click="remove" type="danger" icon="el-icon-delete" size="mini" circle></el-button>
<el-button type="primary" size="mini" @click="copyLine">导出</el-button>
</div>
</template>
<script>
export default {
props: {
data: {
type: Object,
required: true
}
},
computed: {
name () {
if (this.data) {
return this.data.name
}
return ''
},
startPoint () {
if (this.data) {
let list = this.data.line
if (list && list.length > 0) {
return list[0]
}
}
return null
},
startPointName () {
if (this.startPoint) {
return `${this.startPoint[0].toFixed(3)},${this.startPoint[1].toFixed(3)}...`
}
return ''
}
},
methods: {
remove () {
this.$emit('remove')
},
reverse () {
this.$emit('reverse')
},
mouseout () {
this.$emit('mouseout')
},
mouseover () {
this.$emit('mouseover')
},
copyLine () {
this.$emit('copyLine')
}
}
}
</script>
<style lang="scss" scoped>
.line-container {
width: 300px;
height: 30px;
display: flex;
justify-content: flex-start;
align-items: center;
margin-left: 10px;
margin-top: 10px;
.name {
// color: #fff;
margin-left: 10px;
margin-right: 10px;
}
}
</style>
<template>
<el-dialog title="导出线段" width="840px" :visible="visible" :before-close="handleClose">
<el-input type="textarea" :rows="10" :value="value"></el-input>
</el-dialog>
</template>
<script>
export default {
props: {
value: String
},
data () {
return {
visible: false
}
},
methods: {
handleClose () {
this.visible = false
this.$emit('close')
},
show () {
this.visible = true
}
}
}
</script>
<template>
<el-dialog title="合并线段" width="840px" :visible="visible" :center="false" :before-close="handleClose">
<div class="context">
<span class="title">待合并线段</span>
<div class="select-container">
<el-button style="margin-left:10px;" @click="addLine(item,index)" v-for="(item,index) in chooseList" :key="item.key">{{item.label}}</el-button>
</div>
<span class="title">需合并线段</span>
<div class="choose-model">
<el-tag style="margin-left:10px;" v-for="(item,index) in data" :key="item.key" closable @close="tagClose(item,index)">{{item.label}}</el-tag>
</div>
</div>
<span slot="footer" class="dialog-footer ">
<el-button type="primary " @click="submit ">确 定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
props: {
dataList: Array
},
data () {
return {
visible: false,
data: []
}
},
computed: {
chooseList () {
let list = this.dataList.filter(t => {
let m = this.data.find(a => a.key == t.key)
return !m
})
return list
}
},
methods: {
handleClose () {
this.visible = false
},
show () {
this.visible = true
},
submit () {
this.$emit('merge', {
data: this.data
})
this.visible = false
},
addLine (data) {
this.data.push(data)
},
tagClose (item, index) {
this.data.splice(index, 1)
}
},
watch: {
visible (val) {
if (!val) {
this.data = []
}
}
}
}
</script>
<style lang="scss" scoped>
.select-container {
width: 100%;
height: 150px;
background-color: aqua;
text-align: left;
}
.title {
text-align: left;
}
.choose-model {
text-align: left;
}
</style>
import Vue from 'vue'
import ElementUI from 'element-ui';
import App from './App.vue'
import router from './router'
import store from './store'
import 'normalize.css'
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
Vue.config.productionTip = false
new Vue({
......
......@@ -12,14 +12,15 @@ export default new Router({
path: '/',
name: 'home',
component: Home
},
{
path: '/about',
name: 'about',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
}
// ,
// {
// path: '/about',
// name: 'about',
// // route level code-splitting
// // this generates a separate chunk (about.[hash].js) for this route
// // which is lazy-loaded when the route is visited.
// component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
// }
]
})
<template>
<div class="about">
<h1>This is an about page</h1>
</div>
</template>
<template>
<div class="home">
<img alt="Vue logo" src="../assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/>
<div class="map-container" @mousemove="mapMouseMove" @mouseout="mapMouseOut">
<div class="map" ref="map"></div>
<LineManagerView v-if="map" :map="map" :data="lineList" ref="lineManager" :status="status" :x="x" :y="y" :clearWidth="clearNumber" />
</div>
<div class="control">
<div class="button-control">
<label>{{statusName}}</label>
<el-button style="margin-left:15px;" type="primary" @click="showAdd">新增</el-button>
<el-button style="margin-left:15px;" type="warning" @click="clearModel">擦除</el-button>
<el-button style="margin-left:15px;" type="success" @click="merge">合并</el-button>
</div>
<div class="line-control">
<template v-if="statusName == '查看'">
<LineView v-for="(line,index) in lineList" :key="line.id" :data="line" @remove="removeLine(index)" @reverse="reverseLine(line,index)" @mouseout="lineMouseOut(line,index)" @mouseover="lineMouseOver(line,index)" @copyLine="copyLine(line)" />
</template>
<template v-else-if="statusName == '擦除'">
<div class="clear-container">
<div v-for="width in clearNumberList" :key="width" class="clear-block" :style="getClearStyle(width)" :class="{active:width == clearNumber}" @click="clearNumber = width"></div>
</div>
</template>
</div>
</div>
<AddDialog ref="addDialog" @add="addLine" />
<TransferDialog ref="transferDialog" :dataList="generateData" @merge="mergeLine" />
<RemarkDialog ref="remarkDialog" :value="remark" @close="remark = null" />
</div>
</template>
<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'
let __id = 0
// import HANG_ZHOU from '../assets/HANGZHOU'
import AddDialog from '@/components/AddDialog'
import RemarkDialog from '@/components/RemarkDialog'
import TransferDialog from '@/components/TransferDialog'
import LineView from '@/components/LineView'
import LineManagerView from '@/components/LineManager'
import LineManager from '@/assets/LineManager'
import { transposePolyrect, LineToString } from '../assets/utils'
export default {
name: 'home',
components: {
HelloWorld
AddDialog,
LineView,
LineManagerView,
TransferDialog,
RemarkDialog
},
data () {
return {
lineList: [],
map: null,
status: LineManager.VIEW,
x: -1000,
y: -1000,
clearNumberList: [10, 15, 20, 30, 40, 50],
clearNumber: 20,
mergeList: [],
remark: null
}
},
computed: {
statusName () {
if (this.status == LineManager.VIEW) {
return '查看'
} else if (this.status == LineManager.CLEAR) {
return '擦除'
} else if (this.status == LineManager.EDIT) {
return '编辑'
}
return 'err'
},
generateData () {
let list = this.lineList.map(t => {
return {
key: t.id,
label: t.name
}
})
return list
}
},
mounted () {
this.map = new AMap.Map(this.$refs.map, {
zoom: 8,
center: [120, 30]
})
// // 测试代码
// setTimeout(() => {
// this.addLine({
// name: '杭州',
// text: HANG_ZHOU
// })
// }, 500);
},
methods: {
copyLine (lineObj) {
let line = lineObj.line
let st = LineToString(line)
// console.log(st)
this.remark = st
this.$refs.remarkDialog.show()
},
// 合并
merge () {
if (this.status == LineManager.VIEW) {
this.$refs.transferDialog.show()
}
},
showAdd () {
if (this.status == LineManager.VIEW) {
this.$refs.addDialog.show();
}
},
clearModel () {
let clear = this.status == LineManager.CLEAR
if (clear) { // 当前状态是清除模式
let list = this.$refs.lineManager.getLineList()
this.lineList = list
}
this.status = clear ? LineManager.VIEW : LineManager.CLEAR
},
mergeLine (obj) {
// console.log(obj, '合并线段')
let data = obj.data
if (data.length == 0) return
let list = data.map(item => {
let obj = this.lineList.find(t => t.id == item.key)
return obj
})
console.log(list)
let name = list.reduce((pre, sur) => {
let name = pre + ',' + sur.name
return name
}, '').substr(1);
let mlist = list.reduce((pre, sur) => {
return [...pre, ...sur.line]
}, [])
let mergeObj = {
id: list[0].id,
color: list[0].color,
name: name,
line: mlist
}
this.lineList = [mergeObj, ...this.lineList.filter(lineObj => {
let m = data.find(d => d.key == lineObj.id)
return !m
})]
},
addLine (obj) {
// console.log(str)
let arr = transposePolyrect(obj.text)
let num = arr.length == 1 ? '' : 1;
// console.log(arr)
let list = arr.map(t => {
let o = {
line: t,
id: ++__id,
name: obj.name + num,
color: 'blue'
}
if (num) num++;
return o;
})
this.lineList.push(...list)
},
removeLine (index) {
this.lineList.splice(index, 1)
// let index = this.lineList.findIndex(t=> t == )
},
reverseLine (data, index) {
this.lineList.splice(index, 1, {
...data,
line: data.line.reverse()
})
},
lineMouseOut (data, index) {
this.lineList.splice(index, 1, {
...data,
color: 'blue'
})
},
lineMouseOver (data, index) {
this.lineList.splice(index, 1, {
...data,
color: 'yellow'
})
//data.color = 'yellow'
},
draw () {
this.$refs.lineManager.draw()
},
mapMouseMove (e) {
this.x = e.clientX
this.y = e.clientY
// console.log(this.x, this.y, 'move')
},
mapMouseOut () {
this.x = -1000
this.y = -1000
},
getClearStyle (width) {
return {
width: width + 'px',
height: width + 'px'
}
}
}
}
</script>
<style lang="scss" scoped>
.home {
width: 100vw;
height: 100vh;
display: flex;
.map-container {
width: 540px;
height: 100%;
flex-shrink: 0;
position: relative;
.map {
width: 100%;
height: 100%;
}
}
.control {
width: 100%;
height: 100%;
display: flex;
flex-flow: column nowrap;
.button-control {
width: 100%;
height: 50px;
display: flex;
align-items: center;
}
.line-control {
width: 100%;
height: 100%;
background-color: aqua;
overflow-y: auto;
// display: flex;
// flex-flow: row wrap;
// justify-content: flex-start;
// align-items: flex-start;
.clear-container {
display: flex;
align-items: center;
margin-top: 15px;
.clear-block {
float: left;
margin-left: 10px;
background-color: #fff;
&.active {
border: 1px solid red;
}
}
}
}
}
}
</style>
module.exports = {
publicPath: '/amap-line-edit/',
}
......@@ -1214,6 +1214,12 @@ async-limiter@~1.0.0:
version "1.0.0"
resolved "http://registry.npm.taobao.org/async-limiter/download/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8"
async-validator@~1.8.1:
version "1.8.5"
resolved "https://registry.yarnpkg.com/async-validator/-/async-validator-1.8.5.tgz#dc3e08ec1fd0dddb67e60842f02c0cd1cec6d7f0"
dependencies:
babel-runtime "6.x"
async@^1.5.2:
version "1.5.2"
resolved "http://registry.npm.taobao.org/async/download/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
......@@ -1264,6 +1270,10 @@ babel-eslint@^10.0.1:
eslint-scope "3.7.1"
eslint-visitor-keys "^1.0.0"
babel-helper-vue-jsx-merge-props@^2.0.0:
version "2.0.3"
resolved "https://registry.yarnpkg.com/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz#22aebd3b33902328e513293a8e4992b384f9f1b6"
babel-loader@^8.0.5:
version "8.0.5"
resolved "http://registry.npm.taobao.org/babel-loader/download/babel-loader-8.0.5.tgz#225322d7509c2157655840bba52e46b6c2f2fe33"
......@@ -1279,6 +1289,13 @@ babel-plugin-dynamic-import-node@^2.2.0:
dependencies:
object.assign "^4.1.0"
babel-runtime@6.x:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe"
dependencies:
core-js "^2.4.0"
regenerator-runtime "^0.11.0"
balanced-match@^1.0.0:
version "1.0.0"
resolved "http://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
......@@ -1951,7 +1968,7 @@ copy-webpack-plugin@^4.6.0:
p-limit "^1.0.0"
serialize-javascript "^1.4.0"
core-js@^2.5.7, core-js@^2.6.5:
core-js@^2.4.0, core-js@^2.5.7, core-js@^2.6.5:
version "2.6.5"
resolved "http://registry.npm.taobao.org/core-js/download/core-js-2.6.5.tgz#44bc8d249e7fb2ff5d00e0341a7ffb94fbf67895"
......@@ -2275,7 +2292,7 @@ deep-is@~0.1.3:
version "0.1.3"
resolved "http://registry.npm.taobao.org/deep-is/download/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
deepmerge@^1.5.2:
deepmerge@^1.2.0, deepmerge@^1.5.2:
version "1.5.2"
resolved "http://registry.npm.taobao.org/deepmerge/download/deepmerge-1.5.2.tgz?cache=0&other_urls=http%3A%2F%2Fregistry.npm.taobao.org%2Fdeepmerge%2Fdownload%2Fdeepmerge-1.5.2.tgz#10499d868844cdad4fee0842df8c7f6f0c95a753"
......@@ -2493,6 +2510,17 @@ electron-to-chromium@^1.3.116:
version "1.3.116"
resolved "http://registry.npm.taobao.org/electron-to-chromium/download/electron-to-chromium-1.3.116.tgz#1dbfee6a592a0c14ade77dbdfe54fef86387d702"
element-ui@^2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/element-ui/-/element-ui-2.6.1.tgz#86db79ff5de9b1bcc3187b65b3772b0c54074718"
dependencies:
async-validator "~1.8.1"
babel-helper-vue-jsx-merge-props "^2.0.0"
deepmerge "^1.2.0"
normalize-wheel "^1.0.1"
resize-observer-polyfill "^1.5.0"
throttle-debounce "^1.0.1"
elliptic@^6.0.0:
version "6.4.1"
resolved "http://registry.npm.taobao.org/elliptic/download/elliptic-6.4.1.tgz#c2d0b7776911b86722c632c3c06c60f2f819939a"
......@@ -4755,6 +4783,14 @@ normalize-url@^3.0.0:
version "3.3.0"
resolved "http://registry.npm.taobao.org/normalize-url/download/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559"
normalize-wheel@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/normalize-wheel/-/normalize-wheel-1.0.1.tgz#aec886affdb045070d856447df62ecf86146ec45"
normalize.css@^8.0.1:
version "8.0.1"
resolved "https://registry.yarnpkg.com/normalize.css/-/normalize.css-8.0.1.tgz#9b98a208738b9cc2634caacbc42d131c97487bf3"
npm-bundled@^1.0.1:
version "1.0.6"
resolved "http://registry.npm.taobao.org/npm-bundled/download/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd"
......@@ -5701,6 +5737,10 @@ regenerate@^1.2.1, regenerate@^1.4.0:
version "1.4.0"
resolved "http://registry.npm.taobao.org/regenerate/download/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11"
regenerator-runtime@^0.11.0:
version "0.11.1"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9"
regenerator-runtime@^0.12.0:
version "0.12.1"
resolved "http://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.12.1.tgz#fa1a71544764c036f8c49b13a08b2594c9f8a0de"
......@@ -5863,6 +5903,10 @@ requires-port@^1.0.0:
version "1.0.0"
resolved "http://registry.npm.taobao.org/requires-port/download/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
resize-observer-polyfill@^1.5.0:
version "1.5.1"
resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464"
resolve-cwd@^2.0.0:
version "2.0.0"
resolved "http://registry.npm.taobao.org/resolve-cwd/download/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a"
......@@ -6609,6 +6653,10 @@ thread-loader@^2.1.2:
loader-utils "^1.1.0"
neo-async "^2.6.0"
throttle-debounce@^1.0.1:
version "1.1.0"
resolved "https://registry.yarnpkg.com/throttle-debounce/-/throttle-debounce-1.1.0.tgz#51853da37be68a155cb6e827b3514a3c422e89cd"
through2@^2.0.0:
version "2.0.5"
resolved "http://registry.npm.taobao.org/through2/download/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment