它无法绑定经度和纬度吗?Bing地图经度纬度数据绑定
<bm:Map x:Name="EventMap" MapType="Birdseye" ZoomLevel="5"
Credentials="xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" Height="480" Width="550"
HorizontalAlignment="Left">
<bm:Map.Center>
<bm:Location Latitude="{Binding Latitude}"
Longitude="{Binding Longitude}"/>
</bm:Map.Center>
</bm:Map>
这里是与纬度和经度绑定的集合。
<CollectionViewSource
x:Name="itemsViewSource"
Source="{Binding EventItems}"
d:Source="{Binding EventItemGroups[0].EventItems, Source={d:DesignInstance Type=data:EventDataSource, IsDesignTimeCreatable=True}}"/>
我应该使用什么样的数据类型?串?双人或其他人?
private string _longitude = string.Empty;
public string Longitude
{
get { return this._longitude; }
set { this.SetProperty(ref this._longitude, value); }
}
private string _latitude = string.Empty;
public string Latitude
{
get { return this._latitude; }
set { this.SetProperty(ref this._latitude, value); }
}
我相信(经度)“151.173248”,(纬度)“-33.840764”是一个有效点,这是悉尼,如果我不是错了。
因为我发现地图没有显示我绑定的经度和纬度。它似乎是没有任何位置的原始地图。最重要的是,编译的过一段时间,就蹦出
未能分配财产“Bing.Maps.Location.Longitude
任何想法笏发生的呢?
您尝试绑定的纬度和经度值在哪里?是否记得为包含地图的UI元素分配正确的DataContext?如果DataContext设置正确,您确定您的经度和纬度值是否有效? – 2012-03-27 17:58:38
@BojinLi 感谢您的回复。这里是信息。 – 2012-03-28 01:10:40