private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } GSOFeatureLayer pFeatureLayer = geoLayer as GSOFeatureLayer; if (pFeatureLayer != null) { GSOFeature featureFlyTo = dataGridView1.Rows[e.RowIndex].Tag as GSOFeature; if (featureFlyTo == null || globeControl1 == null) { return; } if (featureFlyTo.Geometry != null && featureFlyTo.Geometry.Type == EnumGeometryType.GeoPolyline3D) { GSOGeoPolyline3D line = featureFlyTo.Geometry as GSOGeoPolyline3D; double length = line.GetSpaceLength(true, 6378137); GSOGeoPolyline3D lineLine = line.GetSegment(0, length / 2); GSOPoint3d point3d = lineLine[lineLine.PartCount - 1][lineLine[lineLine.PartCount - 1].Count - 1]; globeControl1.Globe.FlyToPosition(point3d, EnumAltitudeMode.Absolute, 0, 45, 5); } else { globeControl1.Globe.FlyToFeature(featureFlyTo, 0, 45, 3); } globeControl1.Globe.Refresh(); } }