C# 如何从LocationName获取地理坐标

C# 如何从LocationName获取地理坐标,c#,xaml,windows-phone-7,windows-phone-8,C#,Xaml,Windows Phone 7,Windows Phone 8,我想知道,是否有可能从一个特定的位置找到地理坐标。我有以下代码: delMap.Heading = 0; delMap.CartographicMode = MapCartographicMode.Road; delMap.LandmarksEnabled = true; delMap.ZoomLevel = 8; delMap.Center = new GeoCoordinate(47.6097, -122.333

我想知道,是否有可能从一个特定的位置找到地理坐标。我有以下代码:

        delMap.Heading = 0;
        delMap.CartographicMode = MapCartographicMode.Road;
        delMap.LandmarksEnabled = true;
        delMap.ZoomLevel = 8;
        delMap.Center = new GeoCoordinate(47.6097, -122.3331);

        MapOverlay overlay = new MapOverlay
        {
            GeoCoordinate = delMap.Center,
            Content = new Ellipse
            {
                Fill = new SolidColorBrush(Colors.Red),
                Width = 10,
                Height = 10
            }
        };
        MapLayer layer = new MapLayer();
        layer.Add(overlay);

        delMap.Layers.Add(layer);
它在delmap.Center位置显示一个点,与expectet一样。但是现在,如果我只知道地理位置的名称,我需要找出如何将地图居中。例如,“纽约”。

地图没有“纽约”的概念,只能在地理坐标处居中。您需要获取给定位置的坐标

要做到这一点,可以使用谷歌地图或必应地图(Bing maps)建立位置坐标列表(如果您的位置数量有限且已知),或者找到一个web服务,为您提供给定名称的坐标



编辑:你需要的是。这是谷歌API参考:。

你知道一个教程,我如何在谷歌或bing地图中实现这一点?