ThinkGeo 10 to 12 Conversion Guide

Conversion Plan High Level

  • List all of the 10 dependency NuGet packages
  • Uninstall all 10 NuGet packages
  • Install ThinkGeo 12 dependencies
  • Tackle the using statements to replace them all at once
  • Evaluate the issues that can be mass search and replaced and create a list of them

Conversion Steps Detail

For the conversion we suggest that you create using a source control branch specifically for the upgrade process

List all 10 dependency NuGet packages

Run the following command in the Package Manager Console of Visual Studio. This will list all of the packages that need to be uninstalled. Then make sure to capture that list as we will be using it to install 12 packages.

get-package | Where-Object Id -match 'ThinkGeo|MapSuite' | Where-Object Versions -like '10.*'

The output should look like this.

Id                                  Versions                                 ProjectName                                                                                                                                                                          
--                                  --------                                 -----------                                                                                                                                                                          
MapSuiteDependency-GeoAPI           {10.6.0}                                 Sample                                                                                                                                                                            
MapSuiteDependency-MicrosoftSqlS... {10.6.0}                                 Sample                                                                                                                                                                            
MapSuiteDependency-MicrosoftVisu... {10.6.0}                                 Sample                                                                                                                                                                            
MapSuiteDependency-NetTopologySuite {10.6.0}                                 Sample                                                                                                                                                                            

etc...

Uninstall all 10 NuGet packages

We are now going to uninstall of the 10 NuGet packages using the Package Manager Console. This assumes you have no 12 packages installed. If your solution has many project that have references this could take minutes. We also suggest that you do not have the NuGet UI window open as it slows down the uninstall as it need to constantly refresh the UI.

get-package | Where-Object Id -match 'ThinkGeo|MapSuite' | Where-Object Versions -like '10.*' | Uninstall-Package -RemoveDependencies -Force

We suggest you commit to source control after this step.

Install ThinkGeo 12 NuGet packages

Install the ThinkGeo.Core and ThinkGeo.UI.{PLATFORM} v12 NuGet packages to each projects that had references to the ThinkGeo v10 packages listed in the first step.

Replace Using statements

Perform a solution-wide search and replace for the following using statements:

v10 v12
using ThinkGeo.MapSuite; using ThinkGeo.Core;
using ThinkGeo.MapSuite.WinForms;    using ThinkGeo.UI.WinForms;
using ThinkGeo.MapSuite.Styles;
using ThinkGeo.MapSuite.Drawing;
using ThinkGeo.MapSuite.Shapes;
using ThinkGeo.MapSuite.Layers;
using ThinkGeo.MapSuite.Portable;
using ThinkGeo.MapSuite.Serialize;

Note that in some cases the using ThinkGeo.MapSuite; may not have been added. There may be many error because using ThinkGeo.Core; is not referenced. You will manually need to go into each file and ensure the using ThinkGeo.Core; is there.

NOTE: For WinForms applications, make sure to add a reference to the WindowsFormsIntegration assembly to each project that uses the WinformsMap.

Replace Common API Changes

v10 v12
ExtentHelper. MapUtil.
AreaStyles. AreaStyle.
LineStyles. LineStyle.
PointStyles. PointStyle.
TextStyles. TextStyle.
GeoColor.StandardColors. GeoColors.
GeoColor.GeographicColors. GeoColors.
GeoColor.SimpleColors. GeoColors.
.BestPlacement = true .TextPlacement = TextPlacement.AutoPlacement
.BestPlacement = false .TextPlacement = TextPlacement.Default
TextStyle.PointPlacement = PointPlacement.      TextStyle.TextPlacement = TextPlacement.
DrawingQuality.CanvasSettings DrawingQuality.Default
GeoFileReadWriteMode. FileAccess.
FillSolidBrush.Color = GeoColor.FromArgb( FillBrush = new GeoSolidBrush(GeoColor.FromArgb(
TextStyle.TextSolidBrush TextStyle.TextBrush
InteractiveOverlayDrawType.Draw InteractiveOverlayUpdateMode.Update
InteractiveOverlayDrawType.DoNotDraw InteractiveOverlayUpdateMode.DoNotUpdate
InteractiveOverlayDrawType.Default InteractiveOverlayUpdateMode.Default
WinformsMap MapView
.RestrictedExtent .RestrictExtent
AdornmentLayersDrawingEventArgs DrawingAdornmentLayersEventArgs
AdornmentLayerDrawingEventArgs DrawingAdornmentLayerEventArgs
AdornmentLayersDrawnEventArgs DrawnAdornmentLayersEventArgs
AdornmentLayerDrawnEventArgs DrawnAdornmentLayerEventArgs
GeoCanvas.CreatePlatformGeoCanvas GeoCanvas.CreateDefaultGeoCanvas
MapUtil.SnapToZoomLevel MapUtil.GetSnappedExtent
GetAccurateLength GetLength
.DrawThisOverlay .InteractiveOverlayUpdateMode
Proj4Projection ProjectionConverter
FeatureSource.Projection FeatureSource.ProjectionConverter
InternalProjectionParametersString InternalProjection.ProjString
ExternalProjectionParametersString ExternalProjection.ProjString

Note that there were a number of changes in the EventArgs of many of the ThinkGeo classes where we switched the position of the verb from the middle to the front. For example the AdornmanetLayerDrawingEventArgs changed to DrawingAdornmanetLayerEventArgs. We do not list all of these changes it will vary by project how many of these might have been used. As long as you know the pattern it should be easy to change them. Be sure to notice small difference in the names such as in the previous example there is a AdornmanetLayerDrawingEventArgs and a AdornmanetLayersDrawingEventArgs which look very similar.

Getting Help

If you need additional help just let us know by opening a support ticket and we can help with some of the trickier conversion items not covered by this guide.

Not Supported

What we can do for the below is publish the code for these classes with the conversion documentation. WorldStreetsAreaStyle WorldStreetsLineStyle WorldStreetsPointStyle

We do not support non snapping maps. We need to think about how to make a nice path toward this and users who want to set the scale precisely. We could offer a zoom level set that included 100 zoom levels or more but we would need to test this out. WinformsMap.ZoomLevelSnapping

Previous
Previous

ThinkGeo UI 13.0 Released

Next
Next

Display SQLite Data in WPF