User Tools

Site Tools


Map Suite Wpf Desktop Edition Miscellaneous Samples

Note: The page was created before Map Suite 10. Map Suite 10.0 organized many classes into new namespaces and assemblies as well as had a few minor breaks in compatibility. The majority of previously built code should work without modification assuming the new namespaces are added. For guidance on upgrading your existing code, please check out MapSuite 10 Upgrade Guide.

Custom Scale Bar


In today’s Web project, we learn how to extend ScaleBarAdornmentLayer to create a custom scale bar that is based on a projection of choice instead of the projection of the map. This can be useful when the displayed projection of the map has highly distortable distances especially at high latitudes such as Spherical Mercator (used by Google Map, Virtual Earth, Yahoo maps etc). Using a scale bar based on distance geometry of the Geodetic (WGS84) projection will give a more accurate result. Note that the CustomScaleBar class is based on MapSuiteCore and can be used in any other versions of MapSuite such as Desktop.

Draw Custom Exception

This sample shows how you can suppress and draw exceptions in desktop overlays instead of throwing them. There is a little-known feature in the Map Suite Desktop Edition Overlay class that allows you to draw an exception in the event an exception is thrown during the drawing process. We have a default image we draw in this case; however, you can override this using the DrawExceptionCore method and draw whatever you want. By default we always throw expections, but to start drawing them you can use the Overlay.DrawExceptionMode property.

MDI Form


In today’s project, we show how to have the WinformsMap control in a MDI form. Using an MDI form with a map background can represent a challenge. You will see in this project the technique to display properly a child form on top of the map. You can also notice how the map is accessed from the child form by plotting points on it from the child form.

Topology Validation


Starting with version, Map Suite includes topology validation capabilities. This Topology Validator sample application makes it simple to visualize and test topology rules. You simply select the case you want to test, use our drawing tools to create the shapes necessary, and then hit the play button to run the test. The error cases are highlighted on the screen and saved to the test, and their Well-Known Text (WKT) is copied to your clipboard. At any time, you can view or edit the WKT which makes up the case. We save our test cases as XML files that contain not only the test case features but also the errors. This makes it a snap for you to share your cases with us or other colleagues.

For more details including a list of topology cases that you can test, see this article or watch the video overview

Use Map with MVC Framework

This project demonstrates how to create a web-based map using Microsoft ASP.NET MVC 1.0 and Map Suite Web Edition. To meet the requirements of MVC, we inherit the interface IMapInitializer in the controller, which has a function InitializeMap that is overridden in the controller. We then implement the class “MapInitializerHelper” to initialize the map instance.

ShapeFile to SQLite Convertion Tool


This sample demonstrates how to save the features in a shape file (.shp) into a Sqlite file (.sqlite) for a higher query performance. This takes the built-in functionalities of recent daily builds after or later, which you can download from the ThinkGeo Customer Portal or Map Suite Product Center.

Indexed Raster Layer

This sample shows how to create indexed raster layer. The sample supports rTree index file and create it if not exist. It is high performance for multiple raster layers.

Finding Nearest Cross Streets

This sample demonstrates how to geocode an address using Map Suite Geocoder. It then returns and highlights the low and high cross streets.

Labeling Flight Lines

This sample shows how to offset arc shaped flight lines so multiple from point to point are visible and then show popup labels providing information on the flights the lines represent.

Map Suite Explorer (ServiceEdition)

This week, we decided to publish in the Code Community the project for Map Suite Explorer. You are already familiar with that free Desktop tool that comes with any edition of Map Suite. It is a basic GIS tool that allows you to view your geographic data and its tabular information. It also allows doing some basic manipulation on your date such as building the spatial index. With the source code at your disposition, you can cut time developing your own application by having at your disposal the code for doing common tasks such as loading, unloading layers, building spatial index, changing styles etc. You will also find interesting the legend and see how you can add, remove, move up and down the different layers. It is by far the most comprehensive project in the Code Community to that date. You will need the reference for MapSuiteDesktop.dll and MapSuiteCore.dll (full or evaluation) to run it.

Tile Cache Generator

<div sample_otherlinks> [

map_suite_wpf_desktop_edition_miscellaneous_samples.txt · Last modified: 2017/03/17 02:12 by tgwikiupdate