【发布时间】:2015-02-22 15:50:17
【问题描述】:
我是 XAML 编程的新手,我正在使用 MapControl 在 windows phone 8.1 模拟器上制作一个测试应用程序。
我想在我的地图中添加一个 MapIcon,但是当地图缩小时该图标没有出现。我已经搜索了互联网,但找不到任何关于我的问题的信息。
我想要我的缩放级别 12 并在该缩放级别上显示地图图标。
namespace TEST.APPLICATION
{
public partial class MapView : Page
{
Geolocator geo = null;
public MapView()
{
this.InitializeComponent();
this.NavigationCacheMode = NavigationCacheMode.Required;
HardwareButtons.BackPressed += HardwareButtons_BackPressed;
}
void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e)
{
if (Frame.CanGoBack)
{
e.Handled = true;
Frame.GoBack();
}
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
map.Center = new Geopoint(new BasicGeoposition()
{
Latitude = 51.5856935784736,
Longitude = 4.79448171225132
});
map.ZoomLevel = 12;
displaySightings();
}
private void displaySightings()
{
MapIcon sighting1 = new MapIcon();
sighting1.Location = new Geopoint(new BasicGeoposition()
{
Latitude = 51.5940,
Longitude = 4.7795
});
//sighting1.NormalizedAnchorPoint = new Point(0.5, 1.0);
sighting1.Title = "VVV";
map.MapElements.Add(sighting1);
}
}
有什么方法可以让 MapIcon 始终可见?
【问题讨论】: