地图上的PushPins锚定不正确 [英] PushPins on Map are anchored incorrectly

查看:95
本文介绍了地图上的PushPins锚定不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加的每个Pushpin都会发生这种情况。似乎Pushpins的左上角有锚点,尽管实际指针位于左下角。我在这个主题上发现的每个建议都不适用于WP8

This happens with every Pushpin that i add. It seems that Pushpins have their anchorpoint in the top left, despite having the actual pointer in the bottom left. Every suggestion I found on this topic is not applicable to WP8

以下是我添加引脚的方法:

Here is how I add the pin:

MapLayer l = new MapLayer();

Pushpin p = new Pushpin();
            
p.Content = b.Name;
p.GeoCoordinate = new System.Device.Location.GeoCoordinate(b.Latitude, b.Longitude);

MapOverlay o = new MapOverlay();
o.Content = p;
o.GeoCoordinate = new System.Device.Location.GeoCoordinate(b.Latitude, b.Longitude);

l.Add(o);
DetailMap.Layers.Add(l);

推荐答案

自己找到答案。 PositionOrigin是必需的属性

Found the answer myself. PositionOrigin is the needed property

o.PositionOrigin = new Point(0.0, 1.0);


这篇关于地图上的PushPins锚定不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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