emis-frontend/src/views/lbs/tracker/AMapTracker.vue

1170 lines
28 KiB
Vue
Raw Normal View History

2024-04-22 05:35:19 +00:00
<template>
<div style="position: relative;">
<div style="position: absolute; right: 10px; top: 10px; z-index: 1;">
<el-button @click="startMove">开始回放</el-button>
<el-button @click="pauseAnimation">暂停回放</el-button>
<el-button @click="resumeAnimation">继续回放</el-button>
<el-select v-model="speed" style="width: 100px; margin-left: 10px;" placeholder="选择倍速" @change="handleSelect($event)">
<el-option :value="'1倍速'">1倍速</el-option>
<el-option :value="'2倍速'">2倍速</el-option>
<el-option :value="'3倍速'">3倍速</el-option>
<el-option :value="'4倍速'">4倍速</el-option>
</el-select>
</div>
<!-- <div style="position:absolute; left: 50px; bottom: 30px; z-index: 1; width: 95%; height: 20px;">
<el-progress :percentage="percentage"></el-progress>
</div> -->
<div id="amapcontainer" style="width: 100%; height: 880px"></div>
</div>
</template>
<script>
import coordtransform from 'coordtransform';
import AMapLoader from '@amap/amap-jsapi-loader';
window._AMapSecurityConfig = {
securityJsCode: 'b543a271d91e76c8a0f68aea78117892' // '「申请的安全密钥」',
}
export default {
data() {
return {
map: null, // 高德地图实例
posStart:[],
lineArr1:[[121343533,31158358],
[121343533,31158358],
[121343533,31158358],
[121343533,31158358],
[121343533,31158358],
[121343533,31158358],
[121343533,31158358],
[121343533,31158358],
[121343533,31158358],
[121343533,31158358],
[121343533,31158358],
[121342788,31159333],
[121343751,31159535],
[121343751,31159535],
[121343373,31159430],
[121343196,31159341],
[121343166,31159336],
[121343121,31159331],
[121343076,31159303],
[121342848,31159210],
[121342823,31159208],
[121342788,31159216],
[121342733,31159241],
[121342630,31159323],
[121342165,31160056],
[121339496,31164786],
[121337845,31167555],
[121335593,31170506],
[121335238,31170911],
[121335083,31171056],
[121335016,31171128],
[121333683,31173033],
[121332088,31175051],
[121327361,31180743],
[121324361,31184781],
[121323198,31187271],
[121322925,31188378],
[121322895,31188616],
[121322806,31188928],
[121322686,31189103],
[121322526,31189271],
[121322225,31189483],
[121322101,31189516],
[121321720,31189536],
[121319428,31189430],
[121319330,31189456],
[121319158,31189538],
[121318996,31189696],
[121318935,31189791],
[121318866,31189993],
[121318643,31192953],
[121318533,31194871],
[121318465,31194995],
[121318338,31195105],
[121318251,31195138],
[121318160,31195145],
[121317710,31195110],
[121317665,31195100],
[121317041,31195085],
[121316918,31195105],
[121316580,31194918],
[121316083,31194858],
[121316030,31194833],
[121316060,31194808],
[121316336,31194861],
[121316263,31194845],
[121316578,31194818],
[121316743,31194533],
[121316743,31194533],
[121316743,31194533],
[121316743,31194533],
[121316743,31194533],
[121317611,31196401],
[121317766,31196375],
[121317396,31196528],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[121317858,31196543],
[118786458,32008499],
[118785538,32008511],
[118784611,32008666],
[118783721,32008896],
[118783081,32009371],
[118782460,32009794],
[118781675,32009545],
[118780686,32009614],
[118779836,32009756],
[118779366,32009206],
[118779410,32009161],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118779191,32009253],
[118778535,32009250],
[118778348,32009040],
[118778511,32009276],
[118778543,32009316],
[118778701,32009610],
[118778715,32009636],
[118778798,32009808],
[118778801,32009838],
[118778658,32010140],
[118778453,32010211],
[118778186,32010293],
[118777681,32010365],
[118777588,32010381],
[118777536,32010383],
[118777443,32010396],
[118777110,32010444],
[118776571,32010533],
[118776280,32010598],
[118776171,32010623],
[118775860,32010676],
[118775731,32010681],
[118775531,32010838],
[118775526,32010886],
[118776005,32012753],
[118775988,32012790],
[118775951,32012808],
[118775910,32012800],
[118775873,32012778],
[118775865,32012746],
[118775866,32012726],
[118775878,32012711],
[118775913,32012641],
[118775801,32011971],
[118775801,32011935],
[118774880,32008631],
[118774870,32008535],
[118774840,32008506],
[118774808,32008481],
[118774736,32008386],
[118774740,32008355],
[118774838,32008266],
[118774925,32008251],
[118775080,32008213],
[118776073,32008015],
[118776255,32008038],
[118776336,32008036],
[118776408,32008038],
[118776638,32007933],
[118776641,32007846],
[118776658,32007233],
[118776673,32007195],
[118776745,32006205],
[118776833,32006079],
[118776900,32006018],
[118777005,32005963],
[118777728,32005606],
[118778368,32005151],
[118778698,32004753],
[118779203,32003670],
[118780563,32001001],
[118780688,32000711],
[118780791,32000406],
[118780945,32000123],
[118781115,31999850],
[118782843,31998083],
[118784118,31997368],
[118785606,31996685],
[118785643,31996618],
[118785638,31996538],
[118785583,31996406],
[118785535,31996340],
[118785388,31996258],
[118785063,31996133],
[118782293,31994921],
[118781620,31994826],
[118777960,31994653],
[118777345,31994498],
[118776395,31994435],
[118776170,31994440],
[118775938,31994403],
[118775845,31994358],
[118775768,31994290],
[118775720,31994221],
[118775698,31994156],
[118775681,31994070],
[118775725,31991083],
[118775730,31990994],
[118775665,31990846],
[118775848,31988883],
[118776701,31985806],
[118777723,31981326],
[118777423,31972343],
[118779541,31965475],
[118788091,31939431],
[118790795,31919100],
[118793331,31894408],
[118797785,31884605],
[118810461,31864230],
[118812883,31854956],
[118813401,31848761],
[118815958,31832823],
[118820988,31821710],
[118827571,31812551],
[118852845,31789033],
[118859065,31784726],
[118882475,31767598],
[118884205,31765543],
[118884535,31764818],
[118886056,31763375],
[118889756,31757655],
[118891230,31754460],
[118891383,31753246],
[118891301,31751811],
[118890930,31750458],
[118890385,31749526],
[118889456,31748398],
[118888483,31747553],
[118886220,31746190],
[118879893,31742963],
[118878940,31742680],
[118876971,31741646],
[118876001,31741100],
[118875931,31741063],
[118875815,31740994],
[118875540,31740845],
[118875430,31740773],
[118875416,31740738],
[118875413,31740690],
[118875456,31740586],
[118876331,31739461],
[118877873,31737525],
[118877970,31737495],
[118878086,31737481],
[118878201,31737485],
[118878753,31737725],
[118879950,31738323],
[118880255,31738488],
[118880365,31738450],
[118880383,31738421],
[118880448,31738288],
[118880476,31738246],
[118880523,31738136],
[118880513,31738088],
[118880491,31738051],
[118880393,31737925],
[118880388,31737893],
[118880375,31737868],
[118880420,31737858],
[118880340,31737863],
[118880376,31737778],
[118880331,31737886],
[118880308,31738001],
[118880331,31738016],
[118880380,31738036],
[118880585,31738105],
[118880600,31738128],
[118880596,31738163],
[118880580,31738206],
[118880426,31738381],
[118880385,31738421],
[118880376,31738446],
[118880373,31738481],
[118880383,31738526],
[118880415,31738571],
[118880471,31738618],
[118880831,31738800],
[118884763,31740921],
[118884925,31741048],
[118884983,31741201],
[118884980,31741296],
[118884951,31741396],
[118884840,31741566],
[118883155,31744056],
[118883213,31744106],
[118883278,31744140],
[118883598,31744271],
[118885016,31745016],
[118885256,31745195],
[118885941,31745775],
[118889188,31747816],
[118890093,31748683],
[118890873,31749948],
[118891406,31751168],
[118891635,31752585],
[118891568,31754040],
[118891211,31755276],
[118888965,31759505],
[118887996,31761241],
[118887530,31762713],
[118887216,31763131],
[118887088,31763278],
[118886910,31763373],
[118886738,31763446],
[118886681,31763518],
[118884860,31765640],
[118872443,31776498],
[118850846,31791031],
[118825715,31815230],
[118825715,31815230],
[118820328,31823355],
[118815651,31834826],
[118813810,31844398],
[118812196,31859615],
[118808256,31869730],
[118802513,31878320],
[118798308,31884260],
[118797358,31885876],
[118793543,31894775],
[118791701,31903721],
[118788491,31938475],
[118784023,31952683],
[118777475,31973365],
[118777746,31980145],
[118777851,31982265],
[118777521,31983840],
[118776363,31987880],
[118776056,31989820],
[118776131,31993211],
[118776156,31993956],
[118776140,31994185],
[118776175,31994246],
[118776235,31994303],
[118776311,31994350],
[118776410,31994380],
[118776511,31994385],
[118776621,31994386],
[118777620,31994430],
[118778285,31994488],
[118779731,31994493],
[118781641,31994488],
[118782908,31994785],
[118783741,31995153],
[118786125,31996205],
[118786276,31996385],
[118786255,31996400],
[118786225,31996420],
[118783430,31997893],
[118782775,31998365],
[118781711,31999335],
[118781431,31999675],
[118780811,32000773],
[118780660,32001035],
[118780580,32001230],
[118778740,32004878],
[118778501,32005143],
[118778483,32005168],
[118778463,32005183],
[118778376,32005270],
[118778315,32005326],
[118778245,32005355],
[118778005,32005470],
[118777910,32005495],
[118777870,32005548],
[118777813,32005611],
[118777888,32005658],
[118777981,32005658],
[118778003,32005681],
[118777881,32005725],
[118776808,32006251],
[118776755,32006290],
[118776725,32006356],
[118776703,32006481],
[118776698,32006508],
[118776750,32006860],
[118776743,32006941],
[118776763,32007018],
[118776775,32007095],
[118776696,32007536],
[118776690,32007566],
[118776725,32007868],
[118776801,32007988],
[118776898,32008000],
[118777006,32007888],
[118777165,32007796],
[118777418,32007675],
[118777491,32007648],
[118777601,32007630],
[118777685,32007633],
[118777761,32007653],
[118777940,32007671],
[118778096,32007701],
[118778101,32007738],
[118778076,32007798],
[118778015,32007961],
[118778875,32007305],
[118779136,32007138],
[118779298,32007365],
[118779373,32007423],
[118779985,32007840],
[118780288,32008118],
[118780868,32008029],
[118780958,32007880],
[118781130,32007826],
[118781143,32007823],
[118781016,32007686],
[118780908,32008330],
[118780908,32008426],
[118780945,32008474],
[118781168,32007755],
[118781218,32007778],
[118781313,32007771],
[118781296,32007691],
[118781263,32007705],
[118781261,32007736],
[118781193,32007803],
[118780898,32007938],
[118780783,32007950],
[118779778,32007956],
[118779653,32007941],
[118779606,32007939],
[118779571,32007956],
[118779535,32007968],
[118779513,32007976],
[118779148,32007968],
[118778811,32008023],
[118778318,32008020],
[118777953,32008131],
[118776855,32008388],
[118776775,32008376],
[118776711,32008361],
[118776588,32008290],
[118776458,32008229],
[118776368,32008223],
[118776260,32008255],
[118775351,32008560],
[118775261,32008558],
[118775133,32008560],
[118775085,32008560],
[118775056,32008561],
[118775036,32008583],
[118775028,32008666],
[118775123,32008975],
[118775450,32010046],
[118775481,32010148],
[118775608,32010658],
[118775645,32010676],
[118775686,32010685],
[118775726,32010673],
[118775888,32010635],
[118776030,32010613],
[118776695,32010486],
[118776773,32010530],
[118776885,32010521],
[118776940,32010498],
[118777086,32010469],
[118778040,32010303],
[118778336,32010250],
[118778503,32010244],
[118778758,32009956],
[118778746,32009848],
[118778725,32009603],
[118778666,32009391],
[118778636,32009376],
[118778551,32009318],
[118778456,32009181],
[118778003,32009413],
[118778173,32009278],
[118778311,32009236],
[118778580,32009390],
[118778611,32009445],
[118778658,32009583],
[118778683,32009676],
[118778703,32009761],
[118778721,32009805],
[118778733,32009845],
[118778750,32009876],
[118778765,32009933],
[118778780,32009966],
[118778411,32010205],
[118778043,32010325],
[118777906,32010358],
[118777593,32010398],
[118775883,32010685],
[118775700,32010723],
[118775576,32010779],
[118775521,32010905],
[118775540,32010996],
[118775676,32011350],
[118775851,32012240],
[118775858,32012313],
[118775888,32012394],
[118775941,32012575],
[118776028,32012770],
[118776036,32012808],
[118776005,32012825],
[118775961,32012819],
[118775923,32012798],
[118775886,32012774],
[118775856,32012751],
[118775926,32012500],
[118775920,32012441],
[118775875,32012341],
[118775843,32012195],
[118775828,32012158],
[118775798,32012101],
[118775800,32012061],
[118775798,32011964],
[118775731,32011686],
[118775701,32011590],
[118775671,32011488],
[118774985,32009026],
[118774933,32008893],
[118774823,32008416],
[118775026,32007918],
[118775153,32007908],
[118775345,32007869],
[118775636,32007835],
[118775803,32007824],
[118776263,32007811],
[118776436,32007871],
[118776436,32007871],
[118776586,32007925],
[118776713,32007731],
[118776698,32006510],
[118776808,32006151],
[118776863,32006091],
[118776935,32006040],
[118778380,32005110],
[118778710,32004738],
[118778918,32004338],
[118781313,31999666],
[118782263,31998640],
[118783296,31997783],
[118784323,31997236],
[118785601,31996723],
[118785655,31996620],
[118785666,31996488],
[118785638,31996433],
[118785598,31996380],
[118785478,31996280],
[118782396,31994933],
[118781438,31994776],
[118778070,31994645],
[118777210,31994456],
[118776196,31994456],
[118776111,31994431],
[118775960,31994331],
[118775856,31994258],
[118775688,31994048],
[118775661,31993923],
[118775698,31993825],
[118775730,31991716],
[118775706,31991396],
[118775705,31991265],
[118775693,31991125],
[118775720,31991083],
[118775733,31991036],
[118775690,31990501],
[118775690,31990311],
[118776148,31987446],
[118777718,31982403],
[118777735,31980846],
[118777306,31973243],
[118777861,31970610],
[118788366,31938611],
[118789560,31932881],
[118793423,31893980],
[118797015,31885953],
[118808731,31868471],
[118810543,31864005],
[118812866,31854658],
[118816186,31832160],
[118820501,31822533],
[118827228,31812913],
[118839873,31800698],
[118851805,31789818],
[118883176,31766905],
[118884275,31765528],
[118884396,31765085],
[118884593,31764818],
[118884830,31764575],
[118885808,31763601],
[118887681,31761118],
[118891020,31755128],
[118891370,31753666],
[118891385,31752496],
[118891165,31751105],
[118890726,31750090],
[118889850,31748833],
[118889048,31747966],
[118887818,31747061],
[118880006,31742973],
[118878326,31742351],
[118875776,31740994],
[118875603,31740903],
[118875510,31740886],
[118875463,31740906],
[118875415,31740948],
[118875208,31741220],
[118874990,31741540],
[118874988,31741590],
[118875063,31741688],
[118875985,31742225],
[118876770,31742633],
[118876793,31742665],
[118876798,31742726],
[118876770,31742813],
[118876730,31742841],
[118876596,31742926],
[118876516,31742973],
[118876446,31742975],
[118876393,31742930],
[118876386,31742901],
[118876541,31743180],
[118876481,31743163],
[118876488,31743200],
[118876606,31743098],
[118876703,31742610],
[118876588,31742541],
[118876430,31742476],
[118874905,31741620],
[118874881,31741563],
[118874891,31741496],
[118874916,31741440],
[118875130,31741175],
[118875143,31741131],
[118875343,31740983],
[118875368,31740930],
[118876455,31739311],
[118877086,31738483],
[118877928,31737526],
[118878030,31737508],
[118878136,31737505],
[118878241,31737533],
[118878351,31737578],
[118878838,31737806],
[118879858,31738266],
[118880251,31738463],
[118880295,31738458],
[118880328,31738440],
[118880355,31738416],
[118880396,31738345],
[118880495,31738168],
[118880495,31738118],
[118880483,31738070],
[118880461,31738036],
[118880441,31738001],
[118880411,31737923],
[118880395,31737888],
[118880418,31737851],
[118880500,31737673],
[118880508,31737730],
[118880410,31737855],
[118880433,31737845],
[118880365,31737901],
[118883278,31744111],
[118889333,31747996],
[118890420,31749305],
[118891153,31750546],
[118891498,31751641],
[118891670,31753228],
[118891491,31754418],
[118890881,31756020],
[118887921,31761501],
[118887380,31762670],
[118887340,31762725],
[118886986,31763180],
[118886063,31764358],
[118885510,31765065],
[118874231,31775213],
[118844923,31796516],
[118830941,31809390],
[118823491,31818271],
[118818055,31827840],
[118814790,31838140],
[118811570,31861858],
[118811126,31863125],
[118808635,31868853],
[118795286,31890061],
[118792670,31897788],
[118791391,31910385],
[118790551,31927428],
[118790148,31930513],
[118785205,31948836],
[118777656,31971913],
[118777351,31974775],
[118777705,31983113],
[118777181,31984845],
[118777005,31985486],
[118776693,31986681],
[118776626,31986908],
[118776540,31987185],
[118776501,31987360],
[118776475,31987436],
[118776406,31987596],
[118776395,31987636],
[118776366,31987743],
[118776071,31989313],
[118776053,31989591],
[118776050,31989616],
[118776041,31990073],
[118776040,31990443],
[118776055,31990626],
[118776068,31992356],
[118776160,31994220],
[118776266,31994323],
[118776355,31994351],
[118776436,31994368],
[118776760,31994391],
[118778583,31994465],
[118781866,31994571],
[118782946,31994878],
[118782946,31994878],
[118785266,31995838],
[118785471,31995970],
[118785596,31996015],
[118785656,31996035],
[118785713,31996070],
[118785755,31996111],
[118785783,31996136],
[118786080,31996293],
[118786308,31996398],
[118786328,31996425],
[118786323,31996460],
[118786298,31996496],
[118786160,31996670],
[118785916,31996776],
[118783460,31997885],
[118782621,31998411],
[118781943,31999103],
[118781053,32000256],
[118778675,32004956],
[118778375,32005233],
[118778168,32005383],
[118777960,32005543],
[118777788,32005668],
[118777735,32005716],
[118777425,32005886],
[118777393,32005903],
[118777228,32006003],
[118776748,32006290],
[118776695,32006448],
[118776695,32006480],
[118776706,32007733],
[118776746,32007624],
[118777225,32007583],
[118777283,32007599],
[118777335,32007606],
[118777391,32007591],
[118777503,32007568],
[118777555,32007576],
[118777601,32007590],
[118777665,32007596],
[118778053,32007713],
[118778645,32007653],
[118778715,32007653],
[118779485,32007599],
[118779758,32007646],
[118780046,32007630],
[118780326,32007611],
[118780463,32007610],
[118780588,32007626],
[118780881,32007568],
[118781338,32007469],
[118781381,32007481],
[118781420,32007516],
[118781425,32007626],
[118781288,32007756],
[118781205,32007788],
[118781113,32007798],
[118779988,32008016],
[118779833,32008033],
[118779771,32008038],
[118779720,32008036],
[118779670,32008036],
[118779403,32008031],
[118779011,32008071],
[118776850,32008233],
[118776323,32008415],
[118776141,32008503],
[118775925,32008556],
[118775688,32008584],
[118775465,32008631],
[118775288,32008643],
[118775226,32008631],
[118775168,32008636],
[118775036,32008716],
[118775365,32009976],
[118775430,32010365],
[118775510,32010570],
[118775523,32010610],
[118775880,32010689],
[118775980,32010669],
[118776028,32010663],
[118776231,32010603],
[118776783,32010463],
[118776848,32010453],
[118777466,32010383],
[118777616,32010360],
[118778105,32010263],
[118778531,32009418],
[118778578,32009393],
[118778513,32009116],
[118778443,32009116],
[118778476,32009116],
[118778166,32009111],
[118778263,32009131],
[118778268,32009169],
[118778273,32009216],
[118778318,32009290],
[118778506,32009635],
[118778523,32009675],
[118778073,32010353],
[118777603,32010463],
[118777221,32010491],
[118776745,32010546],
[118776460,32010593],
[118776240,32010624],
[118775810,32010705],
[118775638,32010741],
[118775608,32010816],
[118775513,32010988],
[118775966,32012704],
[118775951,32012538],
[118775793,32012130],
[118775718,32011586],
[118775295,32010286],
[118775013,32009076],
[118774943,32008969],
[118774823,32008568],
[118774815,32008540],
[118774815,32008361],
[118774881,32008276],
[118774953,32008245],
[118774991,32008238],
[118775250,32008201],
[118775425,32008138],
[118775595,32008096],
[118776028,32008090],
[118776110,32008108],
[118776283,32008119],
[118776336,32008131],
[118776513,32007840],
[118776656,32007010],
[118776671,32006846],
[118776738,32006369],
[118776795,32006140],
[118776820,32006106],
[118776930,32006025],
[118777535,32005678],
[118778508,32004971],
[118778768,32004581],
[118781936,31998900],
[118782993,31998035],
[118784538,31997205],
[118785678,31996726],
[118785730,31996666],
[118785750,31996576],
[118785721,31996486],
[118785670,31996403],
[118785616,31996338],
[118785536,31996286],
[118785416,31996246],
[118781973,31994920],
[118780921,31994793],
[118778340,31994721],
[118777701,31994581],
[118777175,31994460],
[118776128,31994458],
[118776023,31994418],
[118775918,31994355],
[118775830,31994286],
[118775760,31994096],
[118775765,31993890],
[118775728,31991651],
[118775751,31991550],
[118775663,31991020]],
lineArr: [[108.478935, 34.997761], [108.478934, 34.997825], [108.478912, 34.998549], [108.478912, 34.998549], [108.478998, 34.998555], [108.478998, 34.998555], [108.479282, 34.99856], [108.479658, 34.998528], [108.480151, 34.998453], [108.480784, 34.998302], [108.480784, 34.998302], [108.481149, 34.998184], [108.481573, 34.997997], [108.481863, 34.997846], [108.482072, 34.997718], [108.482362, 34.997718], [108.483633, 34.998935], [108.48367, 34.998968], [108.484648, 34.999861]], // 轨迹
marker: null,
polyline: null,
speed: '1倍速',
duration: 500, // 轨迹回放时间
percentage: 50, // 进度条进度
}
},
mounted() {
//DOM初始化完成进行地图初始化
this.initAMap()
},
methods: {
// 地图初始化
initAMap() {
AMapLoader.load({
key: "3f8e1addc136673d03794a90bb8ddbd2", // 申请好的Web端开发者Key,首次调用 load 时必填
version: "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
plugins: ["AMap.Scale", "AMap.ToolBar", "AMap.ControlBar", 'AMap.Geocoder', 'AMap.Marker',
'AMap.CitySearch',"AMap.convertFrom", 'AMap.Geolocation', 'AMap.AutoComplete', 'AMap.InfoWindow'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
}).then((AMap) => {
// 获取到作为地图容器的DOM元素,创建地图实例
this.map = new AMap.Map("amapcontainer", { //设置地图容器id
resizeEnable: true,
viewMode: "3D", // 使用3D视图
zoomEnable: true, // 地图是否可缩放,默认值为true
dragEnable: true, // 地图是否可通过鼠标拖拽平移,默认为true
doubleClickZoom: true, // 地图是否可通过双击鼠标放大地图,默认为true
zoom: 17, //初始化地图级别
center: [108.347428, 34.90923], // 初始化中心点坐标 北京
// center: this.lineArr[0], // 初始化中心点坐标 北京
// mapStyle: "amap://styles/darkblue", // 设置颜色底层
})
this.drawTrackerLine();
}).catch(e => {
console.log(e)
})
},
drawTrackerLine(){
this.lineArr=[];
this.lineArr1.forEach(element => {
let newLL = [];
newLL.push(element[0]/1000000);
newLL.push(element[1]/1000000)
// let gdzb=coordtransform.wgs84togcj02(newLL[0], newLL[1])
// console.log(gdzb);
this.lineArr.push(newLL);
// AMap.convertFrom(newLL, "gps", function (status, result) {
// //status:complete 表示查询成功,no_data 为查询无结果,error 代表查询错误
// //查询成功时,result.locations 即为转换后的高德坐标系
// if (status === "complete" && result.info === "ok") {
// var lnglats = result.locations; //转换后的高德坐标 Array.<LngLat>
// console.log(lnglats);
// this.lineArr.push(lnglats[0]);
// }
// });
});
this.posStart=this.lineArr[0];
console.log(this.lineArr);
// this.map.setCenter(this.lineArr[0]);
// this.lineArr[0]
this.marker = new AMap.Marker({
// position: [108.478935, 34.997761],
position: this.lineArr[0],
icon: "https://a.amap.com/jsapi_demos/static/demo-center-v2/car.png",
offset: new AMap.Pixel(-13, -26),
});
this.map.add(this.marker)
// 绘制轨迹
this.polyline = new AMap.Polyline({
path: this.lineArr,
showDir: true,
strokeColor: "#28F", //线颜色
// strokeOpacity: 1, //线透明度
strokeWeight: 6, //线宽
// strokeStyle: "solid" //线样式
});
this.map.add(this.polyline)
// 走过的路径
this.passedPolyline = new AMap.Polyline({
strokeColor: "#AF5", //线颜色
strokeWeight: 6, //线宽
});
this.map.add(this.passedPolyline)
// 监听marker移动
this.marker.on('moving', (e) => {
console.log('marker动了', e)
this.passedPolyline.setPath(e.passedPath); // 设置路径样式
this.map.setCenter(e.target.getPosition(), true) // 设置地图中心点
});
this.map.setFitView(); // 根据覆盖物自适应展示地图
},
// 开始回放
startMove() {
AMap.plugin('AMap.MoveAnimation', () => {
console.log('开始回放')
this.marker.moveAlong(this.lineArr, {
// 每一段的时长
duration: this.duration,//可根据实际采集时间间隔设置
// JSAPI2.0 是否延道路自动设置角度在 moveAlong 里设置
autoRotation: true,
});
})
},
// 暂停回放
pauseAnimation() {
this.marker.pauseMove();
},
// 继续回放
resumeAnimation() {
this.marker.resumeMove();
},
// 倍速控制
handleSelect(e) {
console.log('e',parseInt(e.charAt(0)))
this.duration = 500 / parseInt(e.charAt(0))
}
}
}
</script>
<style lang="less"></style>