コード例 #1
0
ファイル: MapForm.cs プロジェクト: pheijmans-zz/GAPP
 private void setActiveGeocacheInMap()
 {
     if (this.Visible)
     {
         if (Core.ActiveGeocache != null)
         {
             SetGeocacheInfo sgi = new SetGeocacheInfo();
             sgi.title    = string.Format("{0}, {1}", Core.ActiveGeocache.Code, Core.ActiveGeocache.Name ?? "");
             sgi.icon     = string.Format("file//", Utils.ImageSupport.Instance.GetImagePath(Core, Framework.Data.ImageSize.Map, Core.ActiveGeocache.GeocacheType));
             sgi.speed    = PluginSettings.Instance.FlyToSpeed;
             sgi.applyV   = PluginSettings.Instance.FixedView;
             sgi.altitude = PluginSettings.Instance.AltitudeView;
             sgi.tilt     = PluginSettings.Instance.TiltView;
             if (Core.ActiveGeocache.ContainsCustomLatLon)
             {
                 sgi.lat = (double)Core.ActiveGeocache.CustomLat;
                 sgi.lon = (double)Core.ActiveGeocache.CustomLon;
             }
             else
             {
                 sgi.lat = Core.ActiveGeocache.Lat;
                 sgi.lon = Core.ActiveGeocache.Lon;
             }
             var jsonSerialiser = new JavaScriptSerializer();
             var json           = jsonSerialiser.Serialize(sgi);
             executeScript(string.Format("setGeocache({0})", json));
         }
     }
 }
コード例 #2
0
ファイル: MapForm.cs プロジェクト: gahadzikwa/GAPP
 private void setActiveGeocacheInMap()
 {
     if (this.Visible)
     {
         if (Core.ActiveGeocache != null)
         {
             SetGeocacheInfo sgi = new SetGeocacheInfo();
             sgi.title = string.Format("{0}, {1}", Core.ActiveGeocache.Code, Core.ActiveGeocache.Name ?? "");
             sgi.icon = string.Format("file//", Utils.ImageSupport.Instance.GetImagePath(Core, Framework.Data.ImageSize.Map, Core.ActiveGeocache.GeocacheType));
             sgi.speed = PluginSettings.Instance.FlyToSpeed;
             sgi.applyV = PluginSettings.Instance.FixedView;
             sgi.altitude = PluginSettings.Instance.AltitudeView;
             sgi.tilt = PluginSettings.Instance.TiltView;
             if (Core.ActiveGeocache.ContainsCustomLatLon)
             {
                 sgi.lat = (double)Core.ActiveGeocache.CustomLat;
                 sgi.lon = (double)Core.ActiveGeocache.CustomLon;
             }
             else
             {
                 sgi.lat = Core.ActiveGeocache.Lat;
                 sgi.lon = Core.ActiveGeocache.Lon;
             }
             var jsonSerialiser = new JavaScriptSerializer();
             var json = jsonSerialiser.Serialize(sgi);
             executeScript(string.Format("setGeocache({0})", json));
         }
     }
 }