1

我正在寻找一份详尽的谷歌地图导航标记列表。

为避免混淆,我不是在寻找这个

我正在寻找导航标记的完整列表,例如左转、右转、回旋处、左叉、右叉、微左、微右等。

我知道文本表示会有一些变量,比如 Roundabout 3rd exit。这可以是第一个出口第二个出口等。但我希望从中提取 Roundabout 并将该指令的可变部分放在一边。为此,我需要一个完整的标记列表。

我搜索了很多,但我只能找到像酒吧、高尔夫球场等感兴趣的地方的标记。

提前致谢 :)

编辑:进一步阐明我的要求:Google Maps API包含“html_instructions”标签。我想将图像分配给尽可能多的不同指令。为此,我需要确定一份详尽的驾驶说明清单。

4

4 回答 4

2

如果我正确理解了您的问题,则可以在此 url的下图中找到完整列表(以视觉形式) 。我找不到翻译列表,但这无论如何都会是语言无关的。

方向图标

于 2012-07-26T04:39:28.473 回答
2

正如@edb 在他的回答中所建议的那样,文本取决于语言和地区。因为,我不需要在我的项目中处理本地化,所以我编制了一份英文说明列表。可以从@edb 的答案中使用相应的方向符号。

方向命令

  • 采取<nth> <left | 对>
  • 转<向左| 对> [<在……> | <到……>]
  • 退出到<...>
  • 从 [...] 出口驶向 <...>
  • 在环岛,<继续直行| 走第 <n> 个出口>
  • 左转合并到 <...>
  • 采取坡道<在<左| 右> 上... | 到……>
  • 合并到 <...>
  • 保持 <左 | 右>在岔路口[继续朝……]
  • 轻微 <左 | 右> [上...]
  • 夏普 <左 | 右>在<...>;
  • 在 <...> 处掉头;

一些没有关联符号的指令。

  • 继续……</li>
  • 头<朝着……,向北,向南,……>
  • 路过<...>

希望这会有所帮助:)

于 2012-07-27T04:27:26.473 回答
1

我希望你期待这个http://mapicons.nicolasmollet.com/

于 2012-07-26T04:08:55.673 回答
0

我没有找到任何官方的东西,所以我做了一个快速的 C# 程序来提取关键短语。

输出在这里:

我的代码是:

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("&lt;b");

                while (posB1 != -1)
                {
                    int posB2 = subString.IndexOf("&lt;/b");

                    string part1 = subString.Substring(0, posB1);
                    string part2 = subString.Substring(posB2 + 6);

                    subString = part1 + " SYM " + part2;

                    posB1 = subString.IndexOf("&lt;b");
                }

                int posSpace = subString.IndexOf("&gt;");

                while (posSpace != -1)
                {
                    string part1 = subString.Substring(0, posSpace);
                    string part2 = subString.Substring(posSpace + 4);

                    subString = part1 + part2;

                    posSpace = subString.IndexOf("&gt;");
                }

                int posDiv1 = subString.IndexOf("&lt;div");

                while (posDiv1 != -1)
                {
                    int posDiv2 = subString.IndexOf("&lt;/div");

                    string part1 = subString.Substring(0, posDiv1);
                    string part2 = subString.Substring(posDiv2 + 8);

                    subString = part1 + " SYM " + part2;

                    posDiv1 = subString.IndexOf("&lt;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”之类的内容。

随意修改我的代码以将其他城市添加到列表中或添加街道地址等。

于 2012-07-26T06:36:03.597 回答