如何使用链接获取Google地图kml文件?
我试过
http://maps.google.com/maps?f=d&hl=en&saddr=-8.703893,115.223558&daddr=-8.36429800000000,115.461588000000&ie=UTF8&0&om=0&output=kml
但它会返回Google地图视图。
一个月前,我尝试了这一步并得到了kml:
<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://earth.google.com/kml/2.2"><Document><name>R. de Viana do Castelo to R. de Sá da Bandeira</name><Style id="roadStyle"><LineStyle><color>7fcf0064</color><width>6</width></LineStyle></Style><Snippet><![CDATA[<font size=+1><a href="http://maps.google.com/maps?hl=en&v=2.2&saddr=40.641963,-8.652592&mrsp=0&daddr=40.211490,-8.429200&mrad=41.149318,-8.607273&ie=UTF8&om=0">Printable view</a></font>]]></Snippet><Placemark><name>Head west on R. de Viana do Castelo toward R. José Estêvão</name><description><![CDATA[go 100 m]]></description><address>R. de Viana do Castelo</address><StyleMap><Pair><key>normal</key><Style><IconStyle><Icon>
....
<coordinates>-8.429200,40.211490,0</coordinates></Point></Placemark><Placemark><name>Route</name><description><![CDATA[Distance: 68.4 km (about 49 mins)<br/>Map data ©2012 Google, Tele Atlas]]></description><GeometryCollection><LineString><coordinates>-8.652610,40.641880,0.000000 -8.653620,40.641430,0.000000 -8.653620,40.641430,0.000000 -8.653820,40.641410,0.000000 -8.653880,40.641330,0.000000 -8.653840,40.641210,0.000000 -8.654680,40.641170,0.000000 -8.655050,40.641110,0.000000 -8.655720,40.640970,0.000000 -8.656380,40.640710,0.000000 -8.656380,40.640710,0.000000 -8.656780,40.640690,0.000000 -8.657100,40.640770,0.000000 -8.657280,40.640880,0.000000 -8.657930,40.641600,0.000000 -8.658400,40.641700,0.000000 -8.658400,40.641700,0.000000 -8.658440,40.641880,0.000000 -8.658610,40.642040,0.000000 -8.658890,40.642130,0.000000 -8.659080,40.642110,0.000000 -8.659290,40.642010,0.000000 -8.659430,40.641810,0.000000 -8.660240,40.641170,0.000000 -8.660420,40.641090,0.000000 -8.660730,40.641050,0.000000 -8.661010,40.641120,0.000000 -8.661110,40.641190,0.000000 -8.661260,40.641460,0.000000 -8.661200,40.641700,0.000000 -8.660880,40.642040,0.000000 -8.660880,40.642040,0.000000 -8.659510,40.643000,0.000000 -8.656300,40.644980,0.000000 -8.654190,40.646160,0.000000 -8.650060,40.648260,0.000000 -8.642070,40.652910,0.000000 -8.640550,40.653600,0.000000 -8.639300,40.654000,0.000000 -8.638260,40.654190,0.000000 -8.636930,40.654290,0.000000 -8.635650,40.654240,0.000000 -8.634620,40.654070,0.000000 -8.633690,40.653840,0.000000 -8.632850,40.653560,0.000000 -8.632020,40.653220,0.000000 -8.630330,40.652430,0.000000 -8.623800,40.649200,0.000000 -8.622170,40.648520,0.000000 -8.620320,40.648110,0.000000 -8.616880,40.647970,0.000000 -8.615880,40.647870,0.000000 -8.615050,40.647720,0.000000 -8.613940,40.647380,0.000000 -8.613090,40.647000,0.000000 -8.612710,40.646780,0.000000 -8.611850,40.646210,0.000000 -8.610560,40.645240,0.000000 -8.609240,40.644340,0.000000 -8.608390,40.643850,0.000000 -8.607770,40.643550,0.000000 -8.606120,40.642920,0.000000 -8.604950,40.642600,0.000000 -8.603840,40.642380,0.000000 -8.603840,40.642380,0.000000 -8.603660,40.642290,0.000000 -8.602670,40.642100,0.000000 -8.602130,40.641850,0.000000 -8.601820,40.641570,0.000000 -8.601540,40.641210,0.000000 -8.601360,40.640540,0.000000 -8.601600,40.639540,0.000000 -8.601590,40.639420,0.000000 -8.602790,40.635880,0.000000 -8.603100,40.634520,0.000000 -8.603120,40.633080,0.000000 -8.602910,40.631890,0.000000 -8.602550,40.630820,0.000000 -8.602110,40.629940,0.000000 -8.597920,40.623920,0.000000 -8.597610,40.623510,0.000000 -8.596790,40.622590,0.000000 -8.595850,40.621770,0.000000 -8.595000,40.621150,0.000000 -8.587700,40.616500,0.000000 -8.586670,40.615680,0.000000 -8.586260,40.615250,0.000000 -8.585680,40.614570,0.000000 -8.585200,40.613840,0.000000 -8.585030,40.613470,0.000000 -8.584490,40.611960,0.000000 -8.584380,40.611110,0.000000 -8.584380,40.610600,0.000000 -8.584490,40.609750,0.000000 -8.584730,40.608800,0.000000 -8.584880,40.608400,0.000000 -8.585650,40.607160,0.000000 -8.586680,40.606020,0.000000 -8.587080,40.605690,0.000000 -8.588150,40.604890,0.000000 -8.591140,40.602800,0.000000 -8.592310,40.601840,0.000000 -8.592920,40.601260,0.000000 -8.593860,40.600170,0.000000 -8.594560,40.599070,0.000000 -8.595060,40.598040,0.000000 -8.595390,40.596960,0.000000 -8.595630,40.595950,0.000000 -8.595760,40.594720,0.000000 -8.595890,40.592520,0.000000 -8.596140,40.591310,0.000000 -8.596330,40.590740,0.000000 -8.596540,40.590200,0.000000 -8.596900,40.589490,0.000000 -8.597560,40.588370,0.000000 -8.598080,40.587670,0.000000 -8.599420,40.586120,0.000000 -8.599420,40.586120,0.000000 -8.599520,40.586120,0.000000 -8.599580,40.586070,0.000000 -8.600460,40.585230,0.000000 -8.601140,40.584700,0.000000 -8.601350,40.584460,0.000000 -8.601350,40.584460,0.000000 -8.601880,40.584390,0.000000 -8.602070,40.584270,0.000000 -8.602210,40.584050,0.000000 -8.602250,40.583760,0.000000 -8.602210,40.583490,0.000000 -8.602060,40.583290,0.000000 -8.601670,40.583050,0.000000 -8.601360,40.583010,0.000000 -8.601020,40.583070,0.000000 -8.600690,40.583290,0.000000 -8.600610,40.583440,0.000000 -8.599470,40.583540,0.000000 -8.595860,40.583160,0.000000 -8.594770,40.582930,0.000000 -8.594130,40.582880,0.000000 -8.593490,40.582880,0.000000 -8.591910,40.582740,0.000000 -8.591240,40.582790,0.000000 -8.590980,40.582770,0.000000 -8.590720,40.582710,0.000000 -8.581530,40.578690,0.000000 -8.575560,40.573340,0.000000 -8.573830,40.571620,0.000000 -8.573050,40.571140,0.000000 -8.571290,40.570160,0.000000 -8.571170,40.570040,0.000000 -8.568990,40.568900,0.000000 -8.568990,40.568900,0.000000 -8.568840,40.569050,0.000000 -8.568740,40.569060,0.000000 -8.567510,40.569970,0.000000 -8.566860,40.570220,0.000000 -8.565970,40.570350,0.000000 -8.564840,40.570380,0.000000 -8.562610,40.570550,0.000000 -8.562610,40.570550,0.000000 -8.561800,40.570500,0.000000 -8.561500,40.570420,0.000000 -8.561240,40.570300,0.000000 -8.560880,40.570000,0.000000 -8.560740,40.569810,0.000000 -8.560580,40.569310,0.000000 -8.560730,40.567730,0.000000 -8.560640,40.567420,0.000000 -8.561140,40.564610,0.000000 -8.561350,40.562640,0.000000 -8.561410,40.561610,0.000000 -8.561380,40.560610,0.000000 -8.561320,40.559590,0.000000 -8.561170,40.558400,0.000000 -8.560340,40.554600,0.000000 -8.560180,40.553680,0.000000 -8.560050,40.552730,0.000000 -8.560010,40.551320,0.000000 -8.560050,40.550820,0.000000 -8.560350,40.549540,0.000000 -8.560750,40.548360,0.000000 -8.561710,40.546010,0.000000 -8.562030,40.544540,0.000000 -8.562080,40.543690,0.000000 -8.562010,40.542690,0.000000 -8.561850,40.541920,0.000000 -8.561590,40.541130,0.000000 -8.561240,40.540350,0.000000 -8.560610,40.539330,0.000000 -8.558140,40.536150,0.000000 -8.557160,40.534710,0.000000 -8.556260,40.533160,0.000000 -8.555290,40.531070,0.000000 -8.553650,40.526410,0.000000 -8.553010,40.524900,0.000000 -8.552630,40.524110,0.000000 -8.552070,40.523170,0.000000 -8.551390,40.522100,0.000000 -8.550670,40.521140,0.000000 -8.549660,40.519940,0.000000 -8.548460,40.518720,0.000000 -8.547190,40.517600,0.000000 -8.545850,40.516570,0.000000 -8.544240,40.515460,0.000000 -8.538960,40.512550,0.000000 -8.537560,40.511610,0.000000 -8.536570,40.510830,0.000000 -8.535830,40.510170,0.000000 -8.535200,40.509510,0.000000 -8.534170,40.508310,0.000000 -8.533380,40.507120,0.000000 -8.532720,40.505930,0.000000 -8.532480,40.505450,0.000000 -8.532040,40.504310,0.000000 -8.531720,40.503070,0.000000 -8.531550,40.502060,0.000000 -8.531390,40.499820,0.000000 -8.531240,40.498570,0.000000 -8.530870,40.497070,0.000000 -8.530440,40.495910,0.000000 -8.529810,40.494730,0.000000 -8.529250,40.493860,0.000000 -8.526170,40.489980,0.000000 -8.524850,40.488010,0.000000 -8.524020,40.486480,0.000000 -8.523290,40.484900,0.000000 -8.522770,40.483510,0.000000 -8.522360,40.482170,0.000000 -8.521900,40.479990,0.000000 -8.521690,40.477840,0.000000 -8.521660,40.476350,0.000000 -8.521800,40.471980,0.000000 -8.521690,40.469830,0.000000 -8.521570,40.468930,0.000000 -8.521270,40.467340,0.000000 -8.520920,40.465960,0.000000 -8.518930,40.460140,0.000000 -8.518590,40.458970,0.000000 -8.518220,40.457390,0.000000 -8.517970,40.455950,0.000000 -8.517780,40.454030,0.000000 -8.517660,40.450520,0.000000 -8.517520,40.448400,0.000000 -8.517370,40.447370,0.000000 -8.517140,40.446310,0.000000 -8.516860,40.445370,0.000000 -8.516490,40.444400,0.000000 -8.515800,40.442920,0.000000 -8.515260,40.441970,0.000000 -8.513490,40.439700,0.000000 -8.512770,40.438940,0.000000 -8.511460,40.437700,0.000000 -8.505890,40.433130,0.000000 -8.503860,40.431310,0.000000 -8.502460,40.429850,0.000000 -8.501720,40.428990,0.000000 -8.500820,40.427820,0.000000 -8.499850,40.426410,0.000000 -8.499130,40.425190,0.000000 -8.498380,40.423750,0.000000 -8.497860,40.422540,0.000000 -8.497100,40.420290,0.000000 -8.496410,40.417970,0.000000 -8.495670,40.415830,0.000000 -8.495380,40.415110,0.000000 -8.494370,40.413030,0.000000 -8.493030,40.410550,0.000000 -8.492570,40.409590,0.000000 -8.492010,40.408130,0.000000 -8.491580,40.406380,0.000000 -8.491420,40.405400,0.000000 -8.491260,40.401690,0.000000 -8.491110,40.400190,0.000000 -8.490950,40.399280,0.000000 -8.490720,40.398380,0.000000 -8.489630,40.394960,0.000000 -8.489350,40.393830,0.000000 -8.489120,40.392570,0.000000 -8.489030,40.391700,0.000000 -8.488980,40.390090,0.000000 -8.489010,40.389270,0.000000 -8.489300,40.387140,0.000000 -8.489440,40.386430,0.000000 -8.489790,40.385230,0.000000 -8.490440,40.383500,0.000000 -8.491990,40.380010,0.000000 -8.492690,40.378090,0.000000 -8.493110,40.376720,0.000000 -8.493490,40.374440,0.000000 -8.493640,40.372620,0.000000 -8.493600,40.370510,0.000000 -8.493480,40.369260,0.000000 -8.492840,40.365420,0.000000 -8.492630,40.363820,0.000000 -8.492620,40.361800,0.000000 -8.492710,40.360830,0.000000 -8.492980,40.359360,0.000000 -8.493310,40.358150,0.000000 -8.494180,40.355460,0.000000 -8.494480,40.354350,0.000000 -8.494750,40.352930,0.000000 -8.494830,40.351640,0.000000 -8.494820,40.349200,0.000000 -8.494880,40.347720,0.000000 -8.495020,40.346800,0.000000 -8.495470,40.344590,0.000000 -8.495660,40.343320,0.000000 -8.495680,40.341170,0.000000 -8.495530,40.340030,0.000000 -8.495270,40.338820,0.000000 -8.494840,40.337510,0.000000 -8.493700,40.334390,0.000000 -8.493170,40.332700,0.000000 -8.492980,40.331690,0.000000 -8.492830,40.330320,0.000000 -8.492700,40.325980,0.000000 -8.492580,40.324730,0.000000 -8.492460,40.324040,0.000000 -8.492270,40.323140,0.000000 -8.491800,40.321540,0.000000 -8.490560,40.318420,0.000000 -8.490190,40.317290,0.000000 -8.489950,40.316290,0.000000 -8.489730,40.314630,0.000000 -8.489590,40.312340,0.000000 -8.489450,40.311200,0.000000 -8.489220,40.310070,0.000000 -8.489070,40.309550,0.000000 -8.488570,40.308240,0.000000 -8.487020,40.304700,0.000000 -8.486760,40.303970,0.000000 -8.486380,40.302480,0.000000 -8.486250,40.301650,0.000000 -8.486170,40.300000,0.000000 -8.486150,40.297740,0.000000 -8.486070,40.296790,0.000000 -8.485860,40.295530,0.000000 -8.485590,40.294470,0.000000 -8.485200,40.293350,0.000000 -8.484870,40.292620,0.000000 -8.484500,40.291910,0.000000 -8.483360,40.290110,0.000000 -8.482780,40.289400,0.000000 -8.481640,40.288270,0.000000 -8.479890,40.286730,0.000000 -8.478940,40.285620,0.000000 -8.478560,40.285020,0.000000 -8.478110,40.284160,0.000000 -8.477780,40.283230,0.000000 -8.477550,40.282080,0.000000 -8.477480,40.281440,0.000000 -8.477520,40.280690,0.000000 -8.477700,40.279720,0.000000 -8.477990,40.278780,0.000000 -8.478400,40.277880,0.000000 -8.478960,40.276940,0.000000 -8.479840,40.275700,0.000000 -8.482320,40.272630,0.000000 -8.482760,40.271860,0.000000 -8.483130,40.271060,0.000000 -8.483370,40.270280,0.000000 -8.483470,40.268720,0.000000 -8.483450,40.268100,0.000000 -8.483070,40.265790,0.000000 -8.483040,40.264570,0.000000 -8.483200,40.263490,0.000000 -8.483430,40.262520,0.000000 -8.483680,40.261790,0.000000 -8.484460,40.260330,0.000000 -8.484950,40.259630,0.000000 -8.486370,40.257880,0.000000 -8.486640,40.257500,0.000000 -8.487000,40.256850,0.000000 -8.487250,40.256320,0.000000 -8.487470,40.255690,0.000000 -8.487670,40.254660,0.000000 -8.487720,40.254270,0.000000 -8.487640,40.251370,0.000000 -8.487700,40.250030,0.000000 -8.487970,40.248080,0.000000 -8.488630,40.245020,0.000000 -8.488750,40.244160,0.000000 -8.488800,40.243090,0.000000 -8.488750,40.242210,0.000000 -8.488620,40.241310,0.000000 -8.488320,40.240040,0.000000 -8.487740,40.237970,0.000000 -8.487330,40.236160,0.000000 -8.487100,40.234690,0.000000 -8.487020,40.233730,0.000000 -8.487000,40.232160,0.000000 -8.487390,40.226040,0.000000 -8.487420,40.223610,0.000000 -8.487370,40.221080,0.000000 -8.487140,40.217210,0.000000 -8.487130,40.216140,0.000000 -8.487260,40.214350,0.000000 -8.487460,40.213100,0.000000 -8.487770,40.211800,0.000000 -8.488630,40.208800,0.000000 -8.488810,40.208000,0.000000 -8.489070,40.205950,0.000000 -8.489090,40.204880,0.000000 -8.489030,40.203850,0.000000 -8.488770,40.202080,0.000000 -8.488420,40.200530,0.000000 -8.488420,40.200530,0.000000 -8.488390,40.200090,0.000000 -8.488480,40.199810,0.000000 -8.488630,40.199630,0.000000 -8.488760,40.199560,0.000000 -8.488930,40.199510,0.000000 -8.489120,40.199520,0.000000 -8.489370,40.199620,0.000000 -8.489510,40.199800,0.000000 -8.489650,40.200040,0.000000 -8.489940,40.200830,0.000000 -8.489940,40.200830,0.000000 -8.489950,40.201110,0.000000 -8.489870,40.201300,0.000000 -8.489720,40.201420,0.000000 -8.489270,40.201540,0.000000 -8.486220,40.201150,0.000000 -8.485420,40.201110,0.000000 -8.484470,40.201120,0.000000 -8.483620,40.201200,0.000000 -8.482360,40.201430,0.000000 -8.481520,40.201640,0.000000 -8.480280,40.202090,0.000000 -8.479550,40.202440,0.000000 -8.478650,40.202980,0.000000 -8.476520,40.204790,0.000000 -8.475410,40.205540,0.000000 -8.473820,40.206320,0.000000 -8.465660,40.209900,0.000000 -8.464990,40.210240,0.000000 -8.462840,40.211740,0.000000 -8.461550,40.212560,0.000000 -8.460230,40.213190,0.000000 -8.458820,40.213680,0.000000 -8.457860,40.213920,0.000000 -8.456050,40.214200,0.000000 -8.454780,40.214260,0.000000 -8.448700,40.214310,0.000000 -8.447990,40.214370,0.000000 -8.446930,40.214560,0.000000 -8.446760,40.214530,0.000000 -8.446670,40.214470,0.000000 -8.446570,40.214170,0.000000 -8.446400,40.214010,0.000000 -8.446090,40.213930,0.000000 -8.445790,40.213940,0.000000 -8.445150,40.214120,0.000000 -8.444990,40.214330,0.000000 -8.444790,40.214430,0.000000 -8.444540,40.214520,0.000000 -8.443610,40.214730,0.000000 -8.443100,40.214800,0.000000 -8.442160,40.214660,0.000000 -8.441560,40.214730,0.000000 -8.440890,40.215050,0.000000 -8.439290,40.216040,0.000000 -8.439290,40.216040,0.000000 -8.438930,40.216190,0.000000 -8.438600,40.216240,0.000000 -8.438240,40.216180,0.000000 -8.437900,40.216020,0.000000 -8.437900,40.216020,0.000000 -8.437730,40.216060,0.000000 -8.436850,40.215460,0.000000 -8.436680,40.215220,0.000000 -8.436530,40.215130,0.000000 -8.436530,40.215130,0.000000 -8.435830,40.215500,0.000000 -8.435830,40.215500,0.000000 -8.435700,40.215440,0.000000 -8.435460,40.215210,0.000000 -8.433630,40.213300,0.000000 -8.433390,40.213220,0.000000 -8.433390,40.213220,0.000000 -8.431690,40.214100,0.000000 -8.431690,40.214100,0.000000 -8.429410,40.211580,0.000000 -8.429310,40.211500,0.000000 -8.429200,40.211490,0.000000 </coordinates></LineString></GeometryCollection><styleUrl>#roadStyle</styleUrl></Placemark></Document></kml>
但现在它不能。
答案 0 :(得分:0)
Google似乎不再支持此url-parameter。
作为一种解决方法,您可以使用其他映射工具,例如mapfab.com 保存地图后,您可以将其下载为kmz文件。 (它还提供捕捉折线)
答案 1 :(得分:0)
如果您点击KML
网站上的google-map路线链接,则可以获取https://code.google.com
附件而非地图窗口。所以你只需要在那里做一个测试项目。
查看详情here