示例#1
0
 void GPSLocation_Changed(object sender, Framework.EventArguments.GPSLocationEventArgs e)
 {
     if (Visible)
     {
         executeScript(string.Format("setCurrentPosition({0}, {1}, {2})", e.Location.Valid.ToString().ToLower(), e.Location.Position.Lat.ToString(CultureInfo.InvariantCulture), e.Location.Position.Lon.ToString(CultureInfo.InvariantCulture)));
         if (button3.Visible != e.Location.Valid)
         {
             button3.Visible = e.Location.Valid;
         }
     }
 }
示例#2
0
 void GPSLocation_Updated(object sender, Framework.EventArguments.GPSLocationEventArgs e)
 {
     if (this.Visible)
     {
         if (e.Location.Valid)
         {
             MapControl.Marker wpm = new MapControl.Marker();
             wpm.Latitude  = e.Location.Position.Lat;
             wpm.Longitude = e.Location.Position.Lon;
             wpm.ImagePath = System.IO.Path.Combine(new string[] { System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location), "Images", "Map", "curpos.png" });
             this.mapContainerControl1.SetCurposMarker(wpm);
         }
         else
         {
             this.mapContainerControl1.SetCurposMarker(null);
         }
     }
 }