我的 WP7 bingmap 中的图钉都是黑色的。为什么?
我正在尝试使用 WP7 和 Bingmaps。
我有这个代码
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<my:Map Height="389" HorizontalAlignment="Left" Margin="28,28,0,0" Name="map1" VerticalAlignment="Top" Width="409" />
</Grid>
,
public MapInfo()
{
InitializeComponent();
GeoCoordinate lHamburg = new GeoCoordinate(53.550556, 9.993333);
//map1.Radius = 5000;
map1.ZoomLevel = 10.0;
map1.Center = lHamburg;
map1.CredentialsProvider = new ApplicationIdCredentialsProvider(APPLICATION_ID);
//Add a pin to the map
Pushpin pushpin = new Pushpin();
Location location = new Location();
location.Latitude = 53.550556;
location.Longitude = 9.993333;
pushpin.Location = location;
map1.Children.Add(pushpin);
}
但我的图钉是黑色的,没有任何样式。 我是不是忘记了什么?
谢谢, 奥斯卡
编辑:看起来他们是黑人。我必须为其设置某种风格或类似的东西。任何人都可以给我一些关于如何添加简单样式的提示吗?很简单,也许只是改变颜色,或者像谷歌地图那样把它变成圆形或类似的东西。
谢谢, 奥斯卡
I am trying to work with WP7 and Bingmaps.
I have this code
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<my:Map Height="389" HorizontalAlignment="Left" Margin="28,28,0,0" Name="map1" VerticalAlignment="Top" Width="409" />
</Grid>
and
public MapInfo()
{
InitializeComponent();
GeoCoordinate lHamburg = new GeoCoordinate(53.550556, 9.993333);
//map1.Radius = 5000;
map1.ZoomLevel = 10.0;
map1.Center = lHamburg;
map1.CredentialsProvider = new ApplicationIdCredentialsProvider(APPLICATION_ID);
//Add a pin to the map
Pushpin pushpin = new Pushpin();
Location location = new Location();
location.Latitude = 53.550556;
location.Longitude = 9.993333;
pushpin.Location = location;
map1.Children.Add(pushpin);
}
But my pushpin is black, without any style.
Did I forget something?
Thanks,
Oscar
Edit: it looks like that they ARE black. I would have to set some style to it or something like that. Anyone could give me some hints of how to add a simple style? Very simple, maybe only change the color, or make it round like google maps or something like that.
Thanks,
Oscar
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
例如,您可以使用样式:
或在创建它们时直接设置颜色:
[注意:我在这里使用了背景属性。您可能需要设置不同的属性才能将其外观更改为所需的状态。]
You can use a style for example:
or directly set color while creating them:
[NOTE: I used background property here. You may need to set different property/properties to change it's appearance to needed state.]
以下 MSDN 练习将为您提供所需的所有信息: 练习 2:处理和自定义图钉< /a>.向下滚动到第 5 项,这是图钉自定义的开始位置。
The following MSDN exercise will provide you with all the information that you need: Exercise 2: Handling and Customizing Pushpins. Scroll down to item 5 which is where the customizations of pushpins begins.