我正在寻找Google地图导航标记的详尽列表。
为避免混淆,我不寻找this。
我正在寻找完整的导航标记列表,如左转,右转,环形交叉,左叉,右叉,右转,右转等。
据我所知,文字表示会有一些变量,例如Roundabout 3rd exit 。这可以是第一次退出或第二次退出等等。但我想从中提取Roundabout并将此指令的可变部分放在一边。为此,我需要一个完整的标记列表。
我搜索了很多,但我只能找到感兴趣的地方标记,如酒吧,高尔夫球场等。
提前致谢:)
修改:进一步澄清我的要求:Google地图API包含“html_instructions”标记。我想将图像分配给尽可能多的不同指令。为此,我需要确定一份详尽的驾驶指示清单。
答案 0 :(得分:2)
如果我理解你的问题,那么完整的清单(以可视形式)可以在下面this url的图片中找到。我找不到翻译列表,但无论如何这都是语言不足。
答案 1 :(得分:2)
正如@edb在他的回答中所建议的那样,文本依赖于语言和地区。因为,我不需要在我的项目中处理本地化,所以我编写了一份英文说明列表。相应的方向符号可以从@ edb的答案中使用。
方向命令
某些没有相关符号的指令。
希望这有用:)
答案 2 :(得分:1)
我希望你期待这个http://mapicons.nicolasmollet.com/。
答案 3 :(得分:0)
我没有找到任何正式的,所以我做了一个快速的C#程序来提取关键短语。
输出为here:
我的代码是:
static void Main(string[] args)
{
ConcurrentDictionary<string,int> phrases = new ConcurrentDictionary<string,int>();
List<string> citiesOfUS = new List<string>()
{
"Chicago,IL",
"Los+Angeles,CA",
"Montgomery" + "," + "AL",
"Juneau" + "," + "AK",
"Phoenix" + "," + "AZ",
"Little+Rock" + "," + "AR",
"Sacramento" + "," + "CA",
"Denver" + "," + "CO",
"Hartford" + "," + "CT",
"Dover" + "," + "DE",
"Tallahassee" + "," + "FL",
"Atlanta" + "," + "GA",
"Honolulu" + "," + "HI",
"Boise" + "," + "ID",
"Springfield" + "," + "IL",
"Indianapolis" + "," + "IN",
"Des+Moines" + "," + "IA",
"Topeka" + "," + "KS",
"Frankfort" + "," + "KY",
"Baton+Rouge" + "," + "LA",
"Augusta" + "," + "ME",
"Annapolis" + "," + "MD",
"Boston" + "," + "MA",
"Lansing" + "," + "MI",
"St.+Paul" + "," + "MN",
"Jackson" + "," + "MS",
"Jefferson+City" + "," + "MO",
"Helena" + "," + "MT",
"Lincoln" + "," + "NE",
"Carson+City" + "," + "NV",
"Concord" + "," + "NH",
"Trenton" + "," + "NJ",
"Santa+Fe" + "," + "NM",
"Albany" + "," + "NY",
"Raleigh" + "," + "NC",
"Bismarck" + "," + "ND",
"Columbus" + "," + "OH",
"Oklahoma+City" + "," + "OK",
"Salem" + "," + "OR",
"Harrisburg" + "," + "PA",
"Providence" + "," + "RI",
"Columbia" + "," + "SC",
"Pierre" + "," + "SD",
"Nashville" + "," + "TN",
"Austin" + "," + "TX",
"Salt+Lake+City" + "," + "UT",
"Montpelier" + "," + "VT",
"Richmond" + "," + "VA",
"Olympia" + "," + "WA",
"Charleston" + "," + "WV",
"Madison" + "," + "WI",
"Cheyenne" + "," + "WY"
};
Parallel.ForEach(citiesOfUS, (string origin) =>
{
foreach (string destination in citiesOfUS)
{
string json = new WebClient().DownloadString("http://maps.googleapis.com/maps/api/directions/xml?origin=" + origin + "&destination=" + destination + "&sensor=false");
bool shouldExitLoop = false;
while (!shouldExitLoop)
{
int pos1 = json.IndexOf("<html_instructions>");
if (pos1 == -1) { shouldExitLoop = true; break; }
int pos2 = json.IndexOf("</html_instructions>");
if (pos2 == -1) { shouldExitLoop = true; break; }
string subString = json.Substring(pos1 + 19, pos2 - pos1 - 19);
json = json.Substring(pos2 + 20);
int posB1 = subString.IndexOf("<b");
while (posB1 != -1)
{
int posB2 = subString.IndexOf("</b");
string part1 = subString.Substring(0, posB1);
string part2 = subString.Substring(posB2 + 6);
subString = part1 + " SYM " + part2;
posB1 = subString.IndexOf("<b");
}
int posSpace = subString.IndexOf(">");
while (posSpace != -1)
{
string part1 = subString.Substring(0, posSpace);
string part2 = subString.Substring(posSpace + 4);
subString = part1 + part2;
posSpace = subString.IndexOf(">");
}
int posDiv1 = subString.IndexOf("<div");
while (posDiv1 != -1)
{
int posDiv2 = subString.IndexOf("</div");
string part1 = subString.Substring(0, posDiv1);
string part2 = subString.Substring(posDiv2 + 8);
subString = part1 + " SYM " + part2;
posDiv1 = subString.IndexOf("<div");
}
phrases.AddOrUpdate(subString, 1, (key, oldvalue) => oldvalue + 1 );
}
}
});
string[] lines = phrases.Keys.ToArray();
Array.Sort(lines);
System.IO.File.WriteAllLines(@"C:\Users\Xantix\Desktop\WriteLines.txt", lines);
return;
}
基本上这些是你在尝试从美国每个首都城市到其他所有城市时所获得的英语短语。
粗体标签之间出现的任何内容都被替换为“SYM”,左,右,街道名称等等。
注意:我删除了html_instructions中div之间出现的内容,因此缺少“部分收费公路”和“正在建设中直到SomeDate”之类的内容。
随意修改我的代码,以便在其他城市添加到列表中或添加街道地址等。