我在一个Windows Mobile应用程序中工作,我想用谷歌地图显示我当前的位置。我使用了示例中的Location dll。正如你在我的代码中看到的,我调用了更新地图的方法,我使用Invoke方法来更新pictureboxe的图像。问题是我无法使用应用程序的主菜单和上下文菜单。这就像他们冻结,直到新地图完成下载。是否有另一种方式在不同的线程中做到这一点,以便随时使用它们?C#在地图上显示gps位置
void gps_LocationChanged(object sender, LocationChangedEventArgs args)
{
if (args.Position.LatitudeValid && args.Position.LongitudeValid)
{
pictureBox1.Invoke((UpdateMap)delegate()
{
center.Latitude = args.Position.Latitude;
center.Longitude = args.Position.Longitude;
LatLongToPixel(center);
image_request2(args.Position.Latitude, args.Position.Longitude);
});
}
}
非常感谢你ctacke它工作:) – stefos 2010-06-30 17:17:40