private void selectFileButton_Click(object sender, System.EventArgs e) { traceTextBox.Text = "selected: " + Project.togeotiffFileName; GeoTiff geoTiff = new GeoTiff(Project.togeotiffFileName); geoTiff.TopLeftLat = geoTiff.TopRightLat = CameraManager.This.CoverageTopLeft34.Lat; geoTiff.TopLeftLng = geoTiff.BottomLeftLng = CameraManager.This.CoverageTopLeft34.Lng; geoTiff.BottomRightLat = geoTiff.BottomLeftLat = CameraManager.This.CoverageBottomRight34.Lat; geoTiff.BottomRightLng = geoTiff.TopRightLng = CameraManager.This.CoverageBottomRight34.Lng; geoTiff.initImageOnly(); if(geoTiff.isValid) { CustomMapsCache.RemoveCustomMapsBySource(Project.togeotiffFileName); CustomMap cm = new CustomMapGeotiff(geoTiff); Project.customMapId++; cm.Id = Project.customMapId; CustomMapsCache.AddCustomMap(cm); WaypointsCache.pushBoundaries(cm.Location); WaypointsCache.pushBoundaries(new GeoCoord(geoTiff.BottomLeftLng, geoTiff.BottomLeftLat)); WaypointsCache.pushBoundaries(new GeoCoord(geoTiff.TopRightLng, geoTiff.TopRightLat)); WaypointsCache.pushBoundaries(new GeoCoord(geoTiff.BottomRightLng, geoTiff.BottomRightLat)); string msg = "OK: read image file " + Project.togeotiffFileName; LibSys.StatusBar.Trace(msg); LibSys.StatusBar.Trace("* " + msg); toState(2); selectGeotiffPointButton.Enabled = true; selectMapPointButton.Enabled = false; PictureManager.This.Refresh(); } else { LibSys.StatusBar.Error("cannot make a GeoTIFF file: " + Project.togeotiffFileName); } }