const tobdMap = (obj) => {
const { lng: x, lat: y } = obj
var x_pi = 3.14159265358979324 * 3000.0 / 180.0;
var z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);
var theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
var bd_lon = z * Math.cos(theta) + 0.0065;
var bd_lat = z * Math.sin(theta) + 0.006;
return { lng: bd_lon, lat: bd_lat }
}
const res = {
"status": "1",
"info": "OK",
"infocode": "10000",
"count": "1",
"route": {
"origin": "121.543504,38.958145",
"destination": "121.568728,38.914145",
"taxi_cost": "132",
"paths": [
{
"distance": "49407",
"restriction": "0",
"steps": [
{
"instruction": "沿虹港路途径迎客路向东南行驶1.8千米靠左沿主路行驶",
"orientation": "东南",
"road_name": "虹港路",
"step_distance": "1779",
"polyline": "121.5435,38.95812;121.54392,38.958088;121.544172,38.958061;121.54429,38.95805;121.545958,38.957916;121.54605,38.957911;121.548313,38.95775;121.549236,38.957669;121.550357,38.957594;121.55091,38.957556;121.551398,38.957519;121.551554,38.957508;121.552294,38.95746;121.552734,38.957417;121.552916,38.957396;121.553141,38.957363;121.553335,38.957299;121.553571,38.957186;121.553737,38.95709;121.55386,38.957009;121.55407,38.956875;121.554552,38.956478;121.554869,38.956226;121.556022,38.955293;121.556489,38.954912;121.557052,38.954456;121.557369,38.954198;121.557599,38.954005;121.557862,38.953791;121.558624,38.953163;121.559123,38.952723;121.559396,38.952498;121.559557,38.952321;121.559922,38.951811;121.56019,38.951296;121.560276,38.951033"
},
{
"instruction": "沿迎客路向东南行驶420米靠左沿主路行驶",
"orientation": "东南",
"road_name": "迎客路",
"step_distance": "420",
"polyline": "121.560276,38.951033;121.560394,38.950701;121.560442,38.950626;121.560636,38.950406;121.560893,38.950068;121.561118,38.949891;121.561247,38.949826;121.561472,38.949746;121.561869,38.94966;121.562808,38.949478;121.564128,38.949231"
},
{
"instruction": "沿迎客路途径香周路向东行驶616米向右前方行驶",
"orientation": "东",
"road_name": "迎客路",
"step_distance": "616",
"polyline": "121.564128,38.949231;121.564342,38.949242;121.564906,38.949354;121.565163,38.949408;121.565313,38.94944;121.565576,38.949472;121.566402,38.949553;121.568366,38.949741;121.56879,38.949767;121.568918,38.949773;121.569583,38.949746;121.570361,38.949698;121.570951,38.94966;121.571091,38.949633;121.571198,38.949596"
},
{
"instruction": "沿香周路向东南行驶1.3千米左转进入主路",
"orientation": "东南",
"road_name": "香周路",
"step_distance": "1331",
"polyline": "121.571198,38.949596;121.571327,38.94951;121.571407,38.949429;121.572443,38.948212;121.572797,38.947799;121.57307,38.947471;121.573392,38.947096;121.573575,38.94693;121.573816,38.946747;121.574143,38.946533;121.574197,38.9465;121.574706,38.946291;121.574728,38.94628;121.575726,38.945926;121.576348,38.945701;121.576772,38.945546;121.57689,38.945503;121.577646,38.945224;121.577973,38.945111;121.578681,38.944864;121.579207,38.944676;121.579701,38.9445;121.580436,38.944242;121.581299,38.943936;121.581632,38.943818;121.582576,38.94348;121.583096,38.943293;121.583418,38.943175;121.58366,38.943067"
},
{
"instruction": "沿西南路向东北行驶328米直行进入左侧道路",
"orientation": "东北",
"road_name": "西南路",
"step_distance": "328",
"polyline": "121.583858,38.943073;121.583912,38.943142;121.584336,38.943512;121.584459,38.943571;121.584641,38.94369;121.585146,38.944113;121.585462,38.944403;121.585811,38.944698;121.585907,38.944789;121.586009,38.944875;121.586433,38.94525"
},
{
"instruction": "沿西南路向北行驶649米向右前方行驶进入辅路",
"orientation": "北",
"road_name": "西南路",
"step_distance": "649",
"polyline": "121.586433,38.94525;121.586524,38.945385;121.586594,38.94546;121.586798,38.945648;121.586926,38.945808;121.587028,38.945953;121.587114,38.946173;121.587152,38.94634;121.587173,38.946522;121.587173,38.946533;121.5872,38.947198;121.587195,38.947611;121.587195,38.947799;121.587216,38.949628;121.587216,38.949826;121.587227,38.950089;121.587286,38.950395;121.587323,38.950518;121.587399,38.950695;121.587522,38.950926"
},
{
"instruction": "沿西南路辅路向东北行驶448米右转",
"orientation": "东北",
"road_name": "西南路辅路",
"step_distance": "448",
"polyline": "121.587522,38.950926;121.587645,38.951017;121.588021,38.95172;121.588461,38.952503;121.58896,38.953399;121.589019,38.953512;121.589223,38.953887;121.589389,38.954188;121.58963,38.954644"
},
{
"instruction": "沿海口路向东行驶2米到达途经地",
"orientation": "东",
"road_name": "海口路",
"step_distance": "2",
"polyline": "121.58963,38.954644;121.589653,38.954644"
},
{
"instruction": "沿海口路向东行驶164米右转",
"orientation": "东",
"road_name": "海口路",
"step_distance": "164",
"polyline": "121.589653,38.954644;121.589963,38.954644;121.590816,38.954644;121.591089,38.954649;121.591572,38.954654"
},
{
"instruction": "沿芳辉街向南行驶697米左转",
"orientation": "南",
"road_name": "芳辉街",
"step_distance": "697",
"polyline": "121.591572,38.954654;121.5914,38.954348;121.591261,38.954;121.591218,38.953844;121.591186,38.953522;121.591202,38.953324;121.591229,38.953141;121.591502,38.952122;121.591991,38.950325;121.592484,38.948523"
},
{
"instruction": "向东行驶1.3千米左转调头",
"orientation": "东",
"step_distance": "1257",
"polyline": "121.592586,38.948475;121.592774,38.948517;121.594453,38.949043;121.594925,38.94914;121.595005,38.94915;121.595279,38.949177;121.59566,38.949177;121.596196,38.949134;121.596465,38.949086;121.596679,38.949032;121.59684,38.94899;121.59809,38.94863;121.598347,38.948582;121.598664,38.948539;121.599071,38.948512;121.599377,38.948507;121.599715,38.948528;121.600756,38.948662;121.601877,38.948802;121.602607,38.948898;121.606721,38.949483"
},
{
"instruction": "向西行驶328米向右前方行驶进入匝道",
"orientation": "西",
"step_distance": "328",
"polyline": "121.606711,38.949574;121.604479,38.949263;121.602977,38.949059"
},
{
"instruction": "沿东北路入口途径东北路向北行驶704米到达途经地",
"orientation": "北",
"road_name": "东北路入口",
"step_distance": "704",
"polyline": "121.602977,38.949059;121.602076,38.949075;121.601941,38.949086;121.601775,38.949124;121.601657,38.949172;121.601545,38.949236;121.601389,38.949381;121.60133,38.949483;121.601282,38.949617;121.60125,38.949918;121.60125,38.950583;121.601217,38.951672;121.601158,38.952375;121.601142,38.95246;121.601073,38.952562;121.601033,38.954346"
},
{
"instruction": "沿东北路向北行驶1.4千米靠左",
"orientation": "北",
"road_name": "东北路",
"step_distance": "1439",
"polyline": "121.601033,38.954346;121.60103,38.954483;121.601008,38.955631;121.600971,38.957519;121.60089,38.961762;121.600885,38.96431;121.600885,38.964884;121.600917,38.965861;121.600971,38.966386;121.601142,38.967304"
},
{
"instruction": "沿东北路向北行驶216米直行进入隧道",
"orientation": "北",
"road_name": "东北路",
"step_distance": "216",
"polyline": "121.601142,38.967304;121.601121,38.96747;121.601201,38.968505;121.601233,38.968999;121.601276,38.969251"
},
{
"instruction": "沿椒金山隧道途径东北路向东北行驶3.3千米向右前方行驶进入匝道",
"orientation": "东北",
"road_name": "椒金山隧道",
"step_distance": "3269",
"polyline": "121.601276,38.969251;121.601743,38.97513;121.602027,38.978333;121.602086,38.979186;121.602108,38.979491;121.602199,38.981246;121.602226,38.981412;121.602263,38.982158;121.602338,38.983139;121.602451,38.984218;121.602639,38.986428;121.602741,38.987061;121.602853,38.987415;121.602934,38.987597;121.603122,38.987925;121.603352,38.988241;121.603621,38.988541;121.604018,38.988895;121.604361,38.989137;121.604747,38.989346;121.605965,38.98985;121.607612,38.990478;121.610975,38.991749;121.61127,38.991873;121.611571,38.992012;121.61215,38.992323;121.612601,38.992608;121.613094,38.992994;121.613572,38.993455;121.613851,38.993766;121.614033,38.994029"
},
{
"instruction": "沿东北路出口途径中华路向东行驶533米左转调头",
"orientation": "东",
"road_name": "东北路出口",
"step_distance": "533",
"polyline": "121.614033,38.994029;121.614162,38.99412;121.614258,38.994169;121.614333,38.994185;121.614484,38.994201;121.614709,38.994206;121.615052,38.994303;121.615143,38.99434;121.615229,38.994394;121.615299,38.994458;121.615353,38.994523;121.61539,38.994598;121.615615,38.995252;121.615685,38.995424;121.615728,38.995494;121.615798,38.995558;121.615857,38.99559;121.615926,38.995612;121.616184,38.995644;121.617868,38.995333;121.618652,38.995199;121.618941,38.99515"
},
{
"instruction": "沿中华路向西行驶441米右转进入匝道",
"orientation": "西",
"road_name": "中华路",
"step_distance": "441",
"polyline": "121.619065,38.995263;121.618652,38.995338;121.617906,38.995478;121.616104,38.995794;121.615546,38.995885;121.614274,38.996137;121.614076,38.99617"
},
{
"instruction": "沿东北快速路入口途径东北路向西南行驶2.7千米靠左",
"orientation": "西南",
"road_name": "东北快速路入口",
"step_distance": "2723",
"polyline": "121.614076,38.99617;121.614001,38.99625;121.613953,38.996346;121.613931,38.996465;121.613936,38.996524;121.613979,38.996685;121.614408,38.998128;121.614441,38.998203;121.614484,38.998272;121.614575,38.998358;121.614628,38.998385;121.61472,38.998417;121.614827,38.998433;121.614966,38.998428;121.615052,38.998406;121.615138,38.998369;121.615224,38.998294;121.615261,38.99823;121.615304,38.998133;121.615342,38.998063;121.615047,38.997055;121.614612,38.995574;121.6145,38.995252;121.614398,38.994995;121.61428,38.994748;121.614092,38.994399;121.613872,38.994088;121.613824,38.993997;121.613577,38.993696;121.613228,38.993326;121.612992,38.993112;121.612676,38.992849;121.612402,38.992656;121.612134,38.992484;121.611764,38.99227;121.611158,38.99198;121.610846,38.991851;121.607215,38.990478;121.606158,38.990076;121.604833,38.98955;121.604441,38.989351;121.604076,38.989126;121.603744,38.988869;121.603444,38.98859;121.603304,38.98844;121.603057,38.988128;121.602853,38.987806;121.602693,38.987458;121.602634,38.987281;121.60258,38.987104;121.602505,38.986739;121.602435,38.986101;121.602124,38.982249;121.602065,38.981471"
},
{
"instruction": "沿东北路向南行驶254米直行进入隧道",
"orientation": "南",
"road_name": "东北路",
"step_distance": "254",
"polyline": "121.602065,38.981471;121.602081,38.981342;121.602081,38.97999;121.602043,38.979491;121.602022,38.979186"
},
{
"instruction": "沿椒金山隧道途径东北路、3号桥向南行驶5.6千米靠右进入中间岔道",
"orientation": "南",
"road_name": "椒金山隧道",
"step_distance": "5608",
"polyline": "121.602022,38.979186;121.602001,38.978714;121.601829,38.976949;121.601395,38.971885;121.601191,38.969251;121.601153,38.968833;121.601083,38.968505;121.600987,38.968081;121.60089,38.967545;121.600847,38.967196;121.600756,38.966177;121.600735,38.964332;121.600745,38.961655;121.60082,38.957519;121.600858,38.955663;121.60088,38.954483;121.600917,38.953034;121.600933,38.952283;121.600928,38.952117;121.600928,38.951521;121.60096,38.950926;121.600992,38.949081;121.601003,38.948346;121.601008,38.948126;121.601013,38.947799;121.601024,38.947402;121.60104,38.946533;121.601056,38.94553;121.601126,38.942445;121.601217,38.937392;121.60126,38.935546;121.60126,38.935423;121.601266,38.93494;121.601266,38.934768;121.601282,38.934044;121.601282,38.933991;121.601287,38.933524;121.601303,38.932977;121.601319,38.932183;121.601325,38.93148;121.601357,38.930069;121.601368,38.929538;121.601395,38.929028;121.601357,38.928664"
},
{
"instruction": "沿香炉礁高架立交桥途径疏港路向东南行驶486米靠右沿当前道路行驶",
"orientation": "东南",
"road_name": "香炉礁高架立交桥",
"step_distance": "486",
"polyline": "121.601357,38.928664;121.601325,38.928605;121.601212,38.928331;121.601137,38.928127;121.601099,38.928052;121.601067,38.927993;121.600971,38.927854;121.600863,38.927736;121.600767,38.92765;121.600145,38.92714;121.600037,38.927049;121.6,38.926985;121.599978,38.926904;121.599978,38.926867;121.599994,38.926802;121.600032,38.926733;121.600107,38.926668;121.600145,38.926647;121.600241,38.926604;121.600338,38.926577;121.60265,38.926566"
},
{
"instruction": "沿疏港路向东行驶2.1千米靠右沿当前道路行驶",
"orientation": "东",
"road_name": "疏港路",
"step_distance": "2124",
"polyline": "121.60265,38.926566;121.603663,38.92655;121.604677,38.92655;121.606421,38.926513;121.606979,38.926459;121.608572,38.926448;121.616726,38.926421;121.617826,38.926438;121.618501,38.926486;121.618652,38.926507;121.619424,38.926652;121.620057,38.926802;121.621704,38.927408;121.622273,38.927612;121.623072,38.927934;121.623834,38.928251;121.625062,38.928717;121.625631,38.928921;121.625813,38.928991;121.626022,38.929066;121.62643,38.9292"
},
{
"instruction": "沿疏港路向东行驶441米向右前方行驶进入辅路",
"orientation": "东",
"road_name": "疏港路",
"step_distance": "441",
"polyline": "121.62643,38.9292;121.627938,38.929624;121.629955,38.930353;121.630287,38.930488;121.631103,38.93081"
},
{
"instruction": "沿疏港路辅路向东北行驶359米左转调头",
"orientation": "东北",
"road_name": "疏港路辅路",
"step_distance": "359",
"polyline": "121.631103,38.93081;121.631253,38.930831;121.632374,38.931298;121.633173,38.931603;121.633447,38.931657;121.633602,38.931732;121.633715,38.931829;121.63379,38.931974;121.633989,38.932231;121.634552,38.932456"
},
{
"instruction": "沿疏港路辅路途径疏港路向西行驶2.3千米靠左沿主路行驶",
"orientation": "西",
"road_name": "疏港路辅路",
"step_distance": "2332",
"polyline": "121.634552,38.932655;121.632798,38.931995;121.632041,38.931668;121.631934,38.93162;121.631778,38.931555;121.630609,38.931115;121.630244,38.930954;121.630046,38.93081;121.629955,38.930777;121.627653,38.929876;121.626741,38.929549;121.626296,38.929404;121.625915,38.92927;121.625658,38.929179;121.625529,38.92913;121.624821,38.928868;121.624198,38.928626;121.622777,38.928058;121.62187,38.927703;121.621339,38.927526;121.620696,38.927339;121.619848,38.927092;121.619242,38.926947;121.618652,38.926829;121.618421,38.926786;121.617037,38.926663;121.61641,38.926625;121.615959,38.92662;121.613759,38.926625;121.612638,38.926641;121.612048,38.926641;121.610289,38.926647;121.610213,38.926647;121.609752,38.926647;121.609296,38.926652"
},
{
"instruction": "沿疏港路向西行驶427米到达途经地",
"orientation": "西",
"road_name": "疏港路",
"step_distance": "427",
"polyline": "121.609296,38.926652;121.609001,38.926582;121.604375,38.926598"
},
{
"instruction": "沿疏港路途径西北路向西行驶3.1千米向右前方行驶",
"orientation": "西",
"road_name": "疏港路",
"step_distance": "3072",
"polyline": "121.604375,38.926598;121.598321,38.92662;121.597414,38.926625;121.596679,38.926652;121.596432,38.926684;121.59456,38.926663;121.593788,38.926657;121.592785,38.926652;121.592393,38.926647;121.590478,38.926641;121.589523,38.926636;121.589056,38.926636;121.587517,38.926641;121.586546,38.926641;121.58411,38.926631;121.583456,38.926663;121.582951,38.926716;121.582308,38.926813;121.581841,38.926904;121.580747,38.927167;121.580232,38.927296;121.578939,38.927618;121.578081,38.927838;121.577464,38.928009;121.57719,38.9281;121.576992,38.928181;121.576798,38.928288;121.576605,38.928417;121.57631,38.928631;121.574985,38.929731;121.574706,38.929967;121.574245,38.930348;121.574068,38.930471;121.573891,38.930563;121.573698,38.930638;121.573483,38.930691;121.573145,38.930745;121.572287,38.930831;121.571804,38.93089;121.571477,38.93097;121.571198,38.931094;121.571075,38.931174;121.570731,38.93148"
},
{
"instruction": "沿西北路向西北行驶58米靠右",
"orientation": "西北",
"road_name": "西北路",
"step_distance": "58",
"polyline": "121.570731,38.93148;121.570324,38.931893"
},
{
"instruction": "沿西北路向西北行驶162米左转调头",
"orientation": "西北",
"road_name": "西北路",
"step_distance": "162",
"polyline": "121.570324,38.931893;121.570061,38.932193;121.5699,38.932451;121.569766,38.932692;121.569503,38.933207"
},
{
"instruction": "沿疏港路途径西北路向东行驶2.7千米靠左沿主路行驶",
"orientation": "东",
"road_name": "疏港路",
"step_distance": "2722",
"polyline": "121.569503,38.933207;121.569299,38.933443;121.569229,38.933465;121.569095,38.933449;121.568999,38.933422;121.568886,38.933368;121.568811,38.933288;121.56879,38.933186;121.568843,38.933095;121.569358,38.932371;121.569723,38.932108;121.569798,38.93206;121.569889,38.932022;121.570297,38.931657;121.570887,38.931206;121.571203,38.930992;121.571472,38.930868;121.571858,38.930788;121.572303,38.93074;121.573247,38.930643;121.573489,38.930611;121.573725,38.930547;121.574009,38.930418;121.574197,38.930295;121.574706,38.929865;121.574991,38.929629;121.576525,38.928347;121.576884,38.928122;121.577083,38.928041;121.577705,38.927843;121.578311,38.927693;121.579433,38.927408;121.580312,38.927188;121.581653,38.926856;121.582131,38.926754;121.582951,38.926625;121.584411,38.926502;121.586336,38.926518;121.587495,38.926513;121.588482,38.926507;121.589249,38.926486;121.590692,38.926395;121.59243,38.926357;121.592827,38.926362;121.593815,38.926373;121.594608,38.926389;121.595064,38.926395;121.596175,38.926421"
},
{
"instruction": "沿疏港路向东行驶560米靠右沿当前道路行驶",
"orientation": "东",
"road_name": "疏港路",
"step_distance": "560",
"polyline": "121.596175,38.926421;121.596609,38.926448;121.596679,38.926454;121.597333,38.926502;121.597688,38.926529;121.59853,38.926534;121.599436,38.926545;121.600338,38.926577;121.60265,38.926566"
},
{
"instruction": "沿疏港路向东行驶2.1千米靠右沿当前道路行驶",
"orientation": "东",
"road_name": "疏港路",
"step_distance": "2124",
"polyline": "121.60265,38.926566;121.603663,38.92655;121.604677,38.92655;121.606421,38.926513;121.606979,38.926459;121.608572,38.926448;121.616726,38.926421;121.617826,38.926438;121.618501,38.926486;121.618652,38.926507;121.619424,38.926652;121.620057,38.926802;121.621704,38.927408;121.622273,38.927612;121.623072,38.927934;121.623834,38.928251;121.625062,38.928717;121.625631,38.928921;121.625813,38.928991;121.626022,38.929066;121.62643,38.9292"
},
{
"instruction": "沿疏港路向东行驶441米向右前方行驶进入辅路",
"orientation": "东",
"road_name": "疏港路",
"step_distance": "441",
"polyline": "121.62643,38.9292;121.627938,38.929624;121.629955,38.930353;121.630287,38.930488;121.631103,38.93081"
},
{
"instruction": "沿疏港路辅路向东北行驶460米直行进入中间岔道",
"orientation": "东北",
"road_name": "疏港路辅路",
"step_distance": "460",
"polyline": "121.631103,38.93081;121.631253,38.930831;121.632374,38.931298;121.633173,38.931603;121.633447,38.931657;121.633602,38.931732;121.633715,38.931829;121.63379,38.931974;121.633989,38.932231;121.634552,38.932456;121.634729,38.932521;121.635603,38.932864"
},
{
"instruction": "沿疏港路辅路向东行驶1.1千米到达途经地",
"orientation": "东",
"road_name": "疏港路辅路",
"step_distance": "1082",
"polyline": "121.635603,38.932864;121.636478,38.933148;121.637095,38.933256;121.637282,38.933315;121.637551,38.933315;121.638409,38.93339;121.63908,38.933416;121.63938,38.933395;121.639626,38.933358;121.64012,38.93324;121.640576,38.933111;121.640625,38.933095;121.641746,38.93273;121.643999,38.932006;121.645586,38.931491;121.646863,38.931115;121.647099,38.93103;121.647353,38.930873"
},
{
"instruction": "向东行驶712米右转",
"orientation": "东",
"step_distance": "712",
"polyline": "121.647353,38.930873;121.647491,38.930804;121.647684,38.930756;121.648113,38.930616;121.648194,38.93059;121.650232,38.92993;121.650484,38.929892;121.65071,38.929892;121.650978,38.929951;121.651187,38.929951;121.651369,38.92994;121.651498,38.929914;121.65498,38.928712"
},
{
"instruction": "沿港通路向西南行驶260米向左前方行驶",
"orientation": "西南",
"road_name": "港通路",
"step_distance": "260",
"polyline": "121.65498,38.928712;121.654803,38.928347;121.654556,38.927816;121.654524,38.927746;121.654186,38.927135;121.654035,38.926877;121.654014,38.926829;121.653858,38.926518"
},
{
"instruction": "沿职工街向东南行驶185米右转",
"orientation": "东南",
"road_name": "职工街",
"step_distance": "185",
"polyline": "121.653896,38.926475;121.653896,38.926389;121.653912,38.926314;121.654068,38.926003;121.654282,38.925574;121.654486,38.925161;121.654604,38.924898"
},
{
"instruction": "沿人民路向西行驶912米进入环岛",
"orientation": "西",
"road_name": "人民路",
"step_distance": "912",
"polyline": "121.654604,38.924898;121.654277,38.924801;121.65373,38.924635;121.653494,38.92456;121.653252,38.924485;121.652539,38.92426;121.651493,38.923932;121.650613,38.923675;121.649545,38.923337;121.649449,38.92331;121.648703,38.923079;121.647856,38.922811;121.647137,38.922596;121.646386,38.922361;121.64563,38.92213;121.645023,38.921953;121.644733,38.921915"
},
{
"instruction": "向西行驶244米离开环岛",
"orientation": "西",
"step_distance": "244",
"polyline": "121.644733,38.921915;121.644658,38.922006;121.644546,38.922103;121.644396,38.922194;121.644245,38.922259;121.64409,38.922301;121.643918,38.922328;121.643795,38.922334;121.643628,38.922312;121.643505,38.922285;121.643323,38.922221;121.643135,38.922119;121.643092,38.922087;121.642958,38.921948;121.642899,38.921872;121.642856,38.921792;121.642835,38.921728;121.642808,38.921604;121.642802,38.921561;121.642802,38.921475;121.642813,38.921411"
},
{
"instruction": "沿中山路途径友好广场向西行驶1.0千米到达途经地",
"orientation": "西",
"road_name": "中山路",
"step_distance": "1045",
"polyline": "121.642813,38.921411;121.642765,38.921282;121.642679,38.921213;121.641568,38.920864;121.640995,38.920687;121.640625,38.920574;121.640571,38.920558;121.640243,38.920467;121.640152,38.920456;121.639691,38.920467;121.639509,38.92044;121.63931,38.920343;121.639192,38.920268;121.63894,38.920086;121.637524,38.919668;121.637416,38.919635;121.63644,38.91933;121.636322,38.919297;121.634573,38.91875;121.634509,38.918729;121.634434,38.918713;121.63312,38.918305;121.63283,38.918198;121.6321,38.917865;121.631891,38.917747;121.631857,38.917722"
},
{
"instruction": "沿中山路向西南行驶534米向右前方行驶",
"orientation": "西南",
"road_name": "中山路",
"step_distance": "534",
"polyline": "121.631857,38.917722;121.631811,38.917688;121.631639,38.917527;121.631569,38.917458;121.631349,38.9172;121.631006,38.916567;121.630985,38.916513;121.630448,38.91543;121.630309,38.915178;121.630169,38.914925;121.629955,38.914577;121.629885,38.914459;121.629241,38.913574;121.629123,38.913407"
},
{
"instruction": "沿中山路向西行驶751米到达途经地",
"orientation": "西",
"road_name": "中山路",
"step_distance": "751",
"polyline": "121.629123,38.913407;121.628576,38.913214;121.628222,38.913134;121.627954,38.913112;121.627465,38.913118;121.626146,38.913091;121.625153,38.913085;121.624526,38.913069;121.623598,38.913048;121.62349,38.913053;121.622353,38.913043;121.621452,38.913037;121.620663,38.913021;121.620482,38.913007"
},
{
"instruction": "沿中山路向西行驶573米右转进入右转专用道",
"orientation": "西",
"road_name": "中山路",
"step_distance": "573",
"polyline": "121.620482,38.913007;121.62046,38.913005;121.619671,38.91286;121.618652,38.912646;121.618625,38.91264;121.617139,38.912291;121.616774,38.912206;121.615433,38.9119;121.615374,38.911884;121.614097,38.911594"
},
{
"instruction": "沿北京街向西北行驶27米右转",
"orientation": "西北",
"road_name": "北京街",
"step_distance": "27",
"polyline": "121.614097,38.911594;121.613845,38.911744"
},
{
"instruction": "沿北京街向西北行驶128米向左前方行驶",
"orientation": "西北",
"road_name": "北京街",
"step_distance": "128",
"polyline": "121.613845,38.911744;121.613502,38.91263;121.613443,38.912731;121.613357,38.912833"
},
{
"instruction": "沿黄河街向西北行驶194米左转",
"orientation": "西北",
"road_name": "黄河街",
"step_distance": "194",
"polyline": "121.613357,38.912833;121.61259,38.913198;121.611753,38.913574;121.611426,38.913735"
},
{
"instruction": "沿黄河路向西行驶3.8千米到达目的地",
"orientation": "西",
"road_name": "黄河路",
"step_distance": "3786",
"polyline": "121.611131,38.913783;121.610224,38.913574;121.609758,38.913461;121.609629,38.913434;121.608964,38.913273;121.608191,38.913096;121.607505,38.912941;121.606743,38.912764;121.606641,38.912742;121.60604,38.912603;121.604999,38.912367;121.603841,38.912071;121.603385,38.91197;121.603084,38.9119;121.602843,38.911852;121.601866,38.911648;121.601518,38.911594;121.600075,38.911455;121.59846,38.911294;121.598326,38.911283;121.596679,38.911133;121.595708,38.911047;121.595284,38.91101;121.594748,38.910956;121.593997,38.910881;121.593686,38.910854;121.593133,38.9108;121.591556,38.910666;121.590585,38.910677;121.589528,38.910693;121.587828,38.910693;121.587474,38.910704;121.587286,38.910704;121.58691,38.910709;121.585784,38.910725;121.585097,38.91073;121.584325,38.910736;121.583354,38.910752;121.582678,38.910768;121.581508,38.910827;121.581289,38.910832;121.580988,38.910827;121.580661,38.910827;121.578944,38.910795;121.577946,38.910779;121.577796,38.910779;121.577651,38.910779;121.577399,38.910784;121.577174,38.910811;121.5769,38.910875;121.576681,38.910945;121.576326,38.911085;121.57505,38.9116;121.574953,38.911642;121.574706,38.911744;121.574497,38.911836;121.573607,38.9122;121.572791,38.912544;121.572121,38.912817;121.571396,38.913118;121.570383,38.91352;121.570254,38.913574;121.56968,38.91381;121.568999,38.914089;121.568779,38.91418;121.568757,38.914188"
}
]
}
]
}
}
const toPointsObj = (str) => {
if (!str) return;
return str.split(';').map(item => {
let lnglat = {};
let point = item.split(',');
let lng = point[0];
let lat = point[1];
lnglat.lng = lng;
lnglat.lat = lat;
return tobdMap(lnglat);
})
}
const all = res.route.paths[0].steps.map(item => {
return toPointsObj(item.polyline);
})
const allData = [...new Set(all.flat(2).map(item=>JSON.stringify(item)))].map(item=>JSON.parse(item));
console.log('allData', JSON.stringify(allData))
var ssssData = allData;