User Tools

Site Tools


backuppages:map_suite_desktop_edition_miscellaneous_samples

Map Suite Desktop Edition Miscellaneous Samples

Custom Scale Bar

map_suite_desktop_edition_sample_custom_scale_bar.jpg

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.


Managing Cache

no_screenshot.jpg

This project is an introduction on how to handle some basic principles of caching the map in the Desktop edition. Cache has the advantage of reusing existing images of the map when revising areas of the map that have already have been drawn. When in Snap Up mode for Zoom level snapping, cache is very handy. But it is a recommendable practice to not use it when the Zoom Level snapping mode is set to none because it can have the unintended consequence of generating an almost unlimited number of tiles. This project will be followed by other ones showing more advanced features of caching.


Map Suite Explorer

map_suite_desktop_edition_sample_map_suite_explorer.jpg

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.


MDI Form

map_suite_desktop_edition_sample_mdi_form.jpg

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

map_suite_desktop_edition_sample_topology_validation.jpg

Starting with version 6.0.113.0, 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.


Track Zoom In With Shift

map_suite_desktop_edition_sample_track_zoom_in_with_shift.jpg

This sample shows how you can track zoom in. this sample restrict the track zoom shape when press “Shift Key”. The restricted shape is same resolution (width/height) with map. When set the map’s snapping mode to none, the map zooms to specific zoom level without snapping Select the display area with mouse and shift.


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

This video will show you how to use the Map Suite Tile Cache Generator utility to generate tile caches based on your own layers. Pre-generating tiles based on your data allows you to display the data faster than rending it from vector graphics files. It also allows you to protect your vector data by providing just the raster tiles for display purposes only. In the past, pre-generating tiles required customers to build the process from scratch which was time consuming and often inefficient. With the Tile Cache Generator utility, we have packaged many of our best practices along with the source code, allowing you to tweak the process to your specific situation.


TinyGeo File Format Sample and Converter

map_suite_services_edition_sample_tinygeo_displayer_and_converter.jpg

This project provides a sample of how to use the new TinyGeo file format as well as provides an easy to use converter tool for shapefiles. The goal of the TinyGeo file format was to provide our customers with a highly compressed, read only, secure, and easily distributable data file that they could use to disseminate spatial data to their customers.
Note:This is a new beta feature of Map Suite 6.0 and only works with Map Suite developer build 5.5.36.0 or later.


Serialize To Xml

map_suite_services_edition_sample_serialize_to_xml_sample.jpg

This sample shows you how to serialize objects in Map Suite to XML and then deserialze them back to objects. This is usefully in many GIS mapping application to save the state of styles, layers, projections or just about anything. The XML is readable and well formatted, great for working with in you GIS application.


Code Generator

map_suite_services_edition_sample_code_generator_sample.jpg

This sample shows you how to generate source code calls from Map Suite objects. Imagine that you have a Layer that has been styled a particular way and uses a certain projection. Once the object is created you can pass it to the code generator and it will create source code to re-create the model passed in. This is very helpful especially in GIS applications where users define things through a custom UI but then want to leverage that in code.


Current Extent to Bitmap

map_suite_services_edition_sample_current_extent_to_bitmap.jpg

In today’s project we learn how to convert to bitmap the current extent of the map. In order to have the bitmap georeferenced or being tied to the ground an accompanying world file needs to be created. That way it can be used as an image layer along with the other layers of the same projection (in this case geodetic). To test the result, you can load the bitmap to Map Suite Explorer and add a vector layer in geodetic to see how the two layers align with each other.


Generate EMF using GraphicsGeoCanvas

map_suite_services_edition_sample_generate_emf_using_graphicsgeocanvas.jpg

This sample shows how you can generate an EMF file using GraphicsGeoCanvas, which is a custom GeoCanvas with the source available in the attached sample. Not just EMF in fact, we can draw on any passed Graphics object which can be a lot of formats. This sample works with 6.0.121.0/6.0.0.121 or later.


Raster Layer to Bitmap

map_suite_services_edition_sample_raster_layer_to_bitmap.jpg

Today’s project is comparable to “Current Extent to Bitmap” project where we learned how to convert the current extent of the map to bitmap with its accompanying world file. Here we learn how to get the bitmap of a raster layer (in our example a Mr Sid image) and convert it to bitmap. We learn some techniques such as how to get the image size of the raster layer using ExtentHelper static functions and how to manipulate GeoImage. This project brings a good foundation for building applications converting different image formats.


Show A Legend

showalegend.jpg

In today’s project we learn how to display a simple legend using the new and improved LegendAdornmentLayer. The improved LegendAdornmentLayer is new to the MapSuite 5.0 release and provides an easy to use api for creating legend adornments. The LegendAdornmentLayer is part of MapSuite.Core which gives all MapSuite products access to this powerful new feature.


ShapeFile to WkbFile Converter

shptowkbconverter.jpg

In this project, we built a tool to convert from Shapefile to Wkbfile. We show how to use MapSuite API for this conversion with higher performance.

backuppages/map_suite_desktop_edition_miscellaneous_samples.txt · Last modified: 2015/09/25 09:14 (external edit)