WP7 Pushpins [英] WP7 Pushpins

查看:116
本文介绍了WP7 Pushpins的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello all,



我正在尝试在地图控件上添加一些Pushpins,并且在执行此操作时"参数不正确"抛出错误。

当我开始用这样的不同对象名创建图钉时,我遇到了这个错误。

Hello all,

I'm trying to add a number of Pushpins on a map control, and when doing this "parameter incorrect" error is thrown.
I've faced this error just when I started to create pushpins with different object names like this.

图钉

p = new 图钉 ();

p = newPushpin();

p.Name ="图钉名称";

p.Name = "Pushpin name";

p.Content ="图钉内容" ;;

p.Content="Pushpin Content";

p.Location =图钉位置;

p.Location=Pushpin location;

当我这样做并添加时pushpins到地图控制引发错误。那么,有什么不对?

When I do this and add pushpins to the map control the error is thrown. So, what's wrong??

推荐答案

也许我在某处遗漏了一些代码但是你在哪里定义位置?

Perhaps I'm missing some code somewhere but where are you defining location?

我在WP7.1中使用了以下代码,它成功添加了一个标准(丑陋)图钉。

I used the following code in WP7.1 and it successfully added a standard (ugly) pushpin.

                Dim pushpin = New Maps.Pushpin()
                Dim location = New Maps.Platform.Location()
                location.Latitude = StopLocation.Latitude
                location.Longitude = StopLocation.Longitude
                pushpin.Location = location
                pushpin.Background = New SolidColorBrush(Colors.Red)
                pushpin.Content = "Stop: " & txtStopwatch.Text
                pushpin.Visibility = Windows.Visibility.Visible
                pushpin.FontSize = 30


如果这有助于解决您的问题,请标记为"答案" ;并投票为有帮助。

If this helps resolve your problem, please mark as "the answer" and vote as helpful.


这篇关于WP7 Pushpins的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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