本文整理汇总了C#中LibGeo.GeoCoord.Normalize方法的典型用法代码示例。如果您正苦于以下问题:C# GeoCoord.Normalize方法的具体用法?C# GeoCoord.Normalize怎么用?C# GeoCoord.Normalize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LibGeo.GeoCoord
的用法示例。
在下文中一共展示了GeoCoord.Normalize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: act
private void act()
{
double lng = 0.0d;
double lat = 0.0d;
double elev = 0.0d;
bool allcool = true;
if(Project.coordStyle == 3) // UTM?
{
// something like "11S 0432345E 3712345N" in the latitudeTextBox
allcool = Project.mainCommand.fromUtmString(latitudeTextBox.Text, out lng, out lat);
if(allcool)
{
latLabel.ForeColor = Color.Black;
}
else
{
latLabel.ForeColor = Color.Red;
}
}
else
{
try
{
lng = GeoCoord.stringLngToDouble(longitudeTextBox.Text);
lngLabel.ForeColor = Color.Black;
}
catch
{
lngLabel.ForeColor = Color.Red;
allcool = false;
}
try
{
lat = GeoCoord.stringLatToDouble(latitudeTextBox.Text);
latLabel.ForeColor = Color.Black;
}
catch
{
latLabel.ForeColor = Color.Red;
allcool = false;
}
}
try
{
Distance elevDist = new Distance(0.0d);
int unitsCompl = elevDist.UnitsCompl;
double nuElev = Convert.ToDouble(elevationTextBox.Text.Replace(",",""));
elevDist.byUnits(nuElev, unitsCompl);
elev = elevDist.Meters;
if(elev < Project.cameraHeightMin*1000.0d)
{
elevDist.byUnits(Project.cameraHeightMin*1000.0d, Distance.UNITS_DISTANCE_M);
elev = elevDist.Meters;
}
else if(elev > Project.CAMERA_HEIGHT_MAX*1000.0d)
{
elevDist.byUnits(Project.CAMERA_HEIGHT_MAX*1000.0d, Distance.UNITS_DISTANCE_M);
elev = elevDist.Meters;
}
elevationUnitsLabel.Text = elevDist.toStringU(unitsCompl);
elevLabel.ForeColor = Color.Black;
}
catch
{
elevLabel.ForeColor = Color.Red;
allcool = false;
}
if(makeWaypointCheckBox.Checked && waypointNameTextBox.Text.Length == 0)
{
waypointNameLabel.ForeColor = Color.Red;
allcool = false;
}
else
{
waypointNameLabel.ForeColor = Color.Black;
}
if(allcool)
{
try
{
GeoCoord location = new GeoCoord(lng, lat, elev);
location.Normalize();
m_cameraManager.MarkLocation(location, 0);
if(makeWaypointCheckBox.Checked)
{
LiveObjectTypes type = LiveObjectTypes.LiveObjectTypeWaypoint;
bool isFound = false;
switch(waypointTypeComboBox.SelectedIndex)
{
//.........这里部分代码省略.........
示例2: act
protected override void act()
{
double lng;
double lat;
double elev;
bool allcool = validateCoord(out lng, out lat, out elev);
if(m_wpt.TrackId == -1)
{
if(waypointNameTextBox.Text.Length == 0)
{
waypointNameLabel.ForeColor = Color.Red;
allcool = false;
}
else
{
waypointNameLabel.ForeColor = Color.Black;
}
}
if(allcool)
{
try
{
GeoCoord location = new GeoCoord(lng, lat, elev);
location.Normalize();
if(m_wpt.TrackId == -1)
{
switch(waypointTypeComboBox.SelectedIndex)
{
case 0:
m_wpt.LiveObjectType = LiveObjectTypes.LiveObjectTypeWaypoint;
m_wpt.Found = false;
break;
case 1:
m_wpt.LiveObjectType = LiveObjectTypes.LiveObjectTypeGeocache;
m_wpt.Found = false;
break;
case 2:
m_wpt.LiveObjectType = LiveObjectTypes.LiveObjectTypeGeocache;
m_wpt.Found = true;
break;
}
m_wpt.WptName = waypointNameTextBox.Text.Trim();
}
m_wpt.Location = location;
if(timePicker.isActive)
{
m_wpt.DateTime = Project.localToZulu(timePicker.dateTime);
}
else
{
m_wpt.DateTime = DateTime.MinValue;
}
m_wpt.UrlName = urlNameTextBox.Text.Trim();
string url = urlTextBox.Text.Trim();
if(url.Equals("http://")) // if something meaningful has been entered
{
url = "";
}
m_wpt.Url = url;
m_wpt.Comment = commentTextBox.Text.Trim();
m_wpt.Sym = symbolTextBox.Text.Trim();
m_wpt.Desc = detailTextBox.Text.Trim();
WaypointsCache.isDirty = true;
Project.drawWaypoints = true;
//this.Hide();
this.ClientSize = new Size(1,1);
Cursor.Current = Cursors.WaitCursor;
m_cameraManager.PictureManager.LayersManager.ShowWaypoints = true;
m_cameraManager.ProcessCameraMove(); // need to put on map
this.Close();
}
catch
{
elevLabel.ForeColor = Color.Red;
allcool = false;
}
}
}