I work in a Windows mobile application and I want to show my current location using Google maps. I used the dll Location from the samples. As you see below in my code, I call the correct method to update the map in the gps_Locationchanged event , where I use the Invoke method to update the image with the image. The problem is that I canβt use the main menu and the context menu of the application when I want. It is like they freeze until the new card finishes loading. Is there any other way to do this in different threads so that they can be used at any time?
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);
});
}
}
source
share