必应地图Silverlight控制自定义图钉 [英] Bing maps silverlight control custom pushpin

查看:110
本文介绍了必应地图Silverlight控制自定义图钉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试为Bing Maps silverlight控件制作一个自定义图钉,但是我只能添加1个图钉.在第二个图钉时,出现以下错误:

I tried to make a custom pushpin for the Bing Maps silverlight control, but I can only add 1 pushpin. At the second pushpin I get the following error:

System.ArgumentException: Value does not fall within the expected range.
   at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
   at MS.Internal.XcpImports.Collection_AddValue[T](PresentationFrameworkCollection`1 collection, CValue value)
   at MS.Internal.XcpImports.Collection_AddDependencyObject[T](PresentationFrameworkCollection`1 collection, DependencyObject value)
   at System.Windows.PresentationFrameworkCollection`1.AddDependencyObject(DependencyObject value)
   at System.Windows.Controls.UIElementCollection.AddInternal(UIElement value)
   at System.Windows.PresentationFrameworkCollection`1.Add(T value)
   at MapInfo.Silverlight.CitiesControl.MainPage.c_GetCitiesCompleted(Object sender, GetCitiesCompletedEventArgs e)

有人知道我可能做错了吗? 在将其添加到地图之前,我需要设置以下属性:

Does anyone know what I might be doing wrong? I am setting the following properties before adding it to the map:

    public Location Location
    {
        get
        {
            return this.GetValue(MapLayer.PositionProperty) as Location;
        }
        set
        {
            this.SetValue(MapLayer.PositionProperty, value);
        }
    }
   this.SetValue(MapLayer.PositionOriginProperty, PositionOrigin.BottomLeft);

推荐答案

2个图钉不能具有相同的Name属性值.

2 pushpins cannot have the same Name property value.

这篇关于必应地图Silverlight控制自定义图钉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆