User Tools

Site Tools


map_suite_wpf_desktop_edition_all_samples

Table of Contents

Map Suite Wpf Desktop Edition All 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.

Map Suite Wpf Desktop Edition How Do I Samples

The “How Do I?” samples collection is a comprehensive set containing dozens of interactive samples. Available in both C# and VB.NET, these samples are designed to hit all the highlights of Map Suite, from simply adding a layer to a map to performing spatial queries and applying a thematic style. Consider this collection your “encyclopedia” of all the Map Suite basics and a great starting place for new users.


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.

GPS to Google Map(Desktop)

map_suite_wpf_desktop_edition_sample_gps_to_googlemap_desktop.jpg

Today we have the Desktop version of the Web project “GPS to Google”. In this project, we show how to display on Google Map point data coming from some GPS reading in Geodetic (Longitude/Latitude). It also shows how to set the extent of the map so that it is centered on the GPS point.


Great Circle with Google Map

map_suite_wpf_desktop_edition_sample_great_circle_with_googlemap.jpg

The purpose of this Web project is to complete an earlier project “Great Circle on Pacific Rim” which showed how to create the Great Circle between two points over the Pacific with the geodetic projection (decimal degrees). In this project, we apply Great Circle to Google Map showing on the Pacific Rim going from America to Asia.


Mini map with Google Map

map_suite_wpf_desktop_edition_sample_mini_map_with_google_map.jpg

The purpose of this Web project is to complete an earlier project “Great Circle on Pacific Rim” which showed how to create the Great Circle between two points over the Pacific with the geodetic projection (decimal degrees). In this project, we apply Great Circle to Google Map showing on the Pacific Rim going from America to Asia.


Mini map with Google Map

map_suite_wpf_desktop_edition_sample_mini_map_with_google_map.jpg

At the request of a Discussion Forum user who wants to know how to use a map locator with Google Map, today we publish a Desktop project that shows how to extent the AdornmentLayer for creating a locator mini map that can use Google Map.


OpenStreetMap

map_suite_wpf_desktop_edition_sample_openstreetmap.jpg

OpenStreetMap (OSM) is a collaborative project to create free geographic data for the entire world. It can be thought of the “Free Wiki World Map”. Now, the latest version of MapSuite desktop can support that. In order to run this project, you will need the Development Build 4.0.72.0 or later.


ArcGISServerRestLayer

In this wpf-based project, we'll demonstrate the new ArcGISServerRestLayer released with Map Suite 9.0. This layer gives developers a simple and powerful tool to access their maps that reside on ArcGIS Server. This new layer utilizes the ArcGIS Server REST API. Now, the latest version of Map Suite Core can support that. In order to run this project, you will need the Development Build 9.0.443.0 or later.


Shapefile to Google Map

map_suite_wpf_desktop_edition_sample_shapefile_to_googlemap.jpg

In the project “GPS to Google Map”, we learned how to project a single point in Longitude/Latitude so that it displays correctly on Google Map. In today’s project, we apply the same principle of projection to a shapefile to have it showing on Google Map. Notice how we also set the extent of the map based on the projected shapefile.


Get Features From ArcGISServer

In this wpf-based project, it illustrates how to get the features from the ArcGIS Restful Server. On the left side of the screenshot shows the raster data from ArcGIS Server and on the other side shows the features from ArcGIS Restful Server. In order to run this project, you will need the Development Build 9.0.482.0 or later.


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.

Canceling TrackOverlay

no_screenshot.jpg

This project shows how to implement aborting a trackshape with Esc key as you could do it in MapSuite 2.x.
As with Dynamic Info on TrackShape project, it shows how TrackOverlay can be extended to add some custom functionalities.
You will see how to handle some events of the map such as KeyDown and how to manipulate TrackOverlay.


Custom Track Line

map_suite_wpf_desktop_edition_sample_custom_track_line.jpg

In today’s project, we are going to see how to extend the TrackInteractiveOverlay in the Desktop edition to have the desired behavior when tracking a line. In this case, we show how to override the MouseDownCore function to have the line being tracked at left mouse click and have the last vertex added deleted at right mouse click.


Custom Track Polygon

map_suite_wpf_desktop_edition_sample_custom_track_polygon.jpg

In the project “Custom Track Line”, we saw how to extend the TrackInteractiveOverlay to have the behavior of deleting the last added vertex when right click on a track line. In today’s project, we show how to implement this same behavior for tracking polygon.


Drag Select Vertices As Group

map_suite_desktop_edition_sample_drag_select_vertices_as_group.jpg

With EditInteractiveOverlay, we know how to drag a feature such as polygon as a whole. We also know how to drag an individual vertex by setting the appropriate properties. Here we go a little further and we show how to create an inherited class from EditInteractiveOverlay to implement the logic for selecting vertices and dragging them as a group. See how the protected methods MouseDownCore, MouseUpCore, MouseClickCore and MouseMoveCore were overridden for that purpose. This is a Desktop app that also applies to Wpf.


Dragged Point Style

map_suite_wpf_desktop_edition_sample_dragged_point_style.jpg

In the Discussion Forum Post “Snapping help needed”, we show the solution to have a dragged vertex snapping to a vertex of another layer. You can see that by default the control point being dragged turns yellow. In this project, we focus our attention on how to have control on the style of the control points. You will see how to override the DrawCore function of EditInteractiveOverlay. This is a project for the Desktop edition.


Dragged Point Style Advanced

map_suite_desktop_edition_sample_dragged_point_style_advanced.jpg

This project is another example of how extendible EditInteractiveOverlay is for the editing needs of the user. You can see how to change the styles of the vertex being dragged based on the Shift key and have the vertex snap to any feature. Thanks to the protected override functions such as KeyDownCore, KeyUpCore, MouseUpCore and DrawCore, these functionalities can be easily implemented by inheriting from EditInteractiveOverlay.


Dragged PointStyle with Label

map_suite_wpf_desktop_edition_sample_dragged_point_style_with_label.jpg

In our series of projects dedicated to EditInteractiveOverlay, today you will see how easy it is to add some labeling to your dragged control point showing dynamic information. Here we show how to display the distance from the dragged control point to the closest point of a reference shape. Also, to augment the experience of the user, the closest point of the reference shape is also shown varying as the control point is dragged around.

In the GIS field, enterprises have different needs on how they edit there data and on how smooth the editing should be allowing the maximum control and precision to the technician editing the data. This example on how to use the EditInteractiveOverlay demonstrates how powerful and flexible editing is with Map Suite map control.


Dragging Icon

map_suite_wpf_desktop_edition_sample_dragging_icon.jpg

In today’s sample, we show how to drag icons representing vehicle on the map. This is a handy feature if you want to give your users the ability to drag and drop some non stationary features such as vehicles. You can see that to accomplish this functionality, you can use EditInteractiveOverlay as it already has all the necessary logic for dragging purposes. Look at the code to see how to set up that overlay to have the expected behavior.


Dragging Icon Advanced

map_suite_wpf_desktop_edition_sample_dragging_icon_advanced.jpg

This project is a more complete version of a previous project “Dragging Icon”. In addition to showing how to use EditInteractiveOverlay for dragging and dropping features represented by an icon, we also show how to add new features on the map by left double clicking on the map. You will also see how to remove a feature by right double clicking on its icon.


Dragging Vertex

map_suite_wpf_desktop_edition_sample_dragging_vertex.jpg

The purpose of today’s project is not so much as show a new technology as to show an improvement in an existing one. We are already familiar with EditInteractiveOverlay with projects such as “Dragged PointStyle with Label”, “Snap To Layer” and “Snapping to Vertex”. But those projects showed EditInteractiveOverlay on small shapes. Using EditIntercticeOverlay on complex shapes became not very responsive. We improved that and now you can drag, resize, rotate and drag individual vertex of a complex polygon made of thousand of vertices with good responsiveness as you can see in this example.

To run this Desktop project, you will need the version 4.0.66.0 or later of the development daily build for MapSuiteCore and DesktopEdition dlls. And do not forget to add a reference to WindowsBase.dll.

This improvement is currently only in the development branch, it will be added to the production branch at the next major release in November.


Dynamic Info On TrackShapes

map_suite_wpf_desktop_edition_sample_dynamic_info_on_trackshapes.jpg

This project is for the Desktop version and it shows how to handle TrackOverlay to obtain dynamic information about the shape being tracked.

In this example, you will see displayed in a groupbox, properties such as perimeter and area as the shape is being tracked.

In this project, you will learn how to handle events such as TrackStarted, MouseMoved and TrackEnded of TrackOverlay for that purpose.

Getting dynamic info of a shape being tracked can be handy in situation where before committing to get the completed shape, you want to know more about the shape. For example, if you are tracking a search zone, you get dynamically info about its area.

This project will be followed by other related projects. One will show how to create one’s own inherited TrackOverlay for having the possibility to abort tracking by pressing a key. Another project will show how to display dynamic info inside the shape itself instead of using a separate control.


Editing Rectangles

This sample shows how to extend the EditInteractiveOverlay rectangles as shapes rather than polygon shapes by setting special column values. For features (Well Known Text and Binary), the concept of a rectangle is not supported and typically rectangles are handled as polygons. This feature allows users to modify the rectangle but requires that the modification keep a rectangular form. The rectangle doesn't need to be straight as long as all of the corner angles are at 90 degrees relative to each other.
To activate the feature, you need to assign the value of the column called “Edit” to “rectangle”. The resize function will keep the ratio of width and height of the rectangle, otherwise it will use the original method.
For more information you can see the discussion forum post below:
http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/5822/afv/topic/Default.aspx


EditOverlay Styles

map_suite_wpf_desktop_edition_sample_editoverlay_styles.jpg

In today’s Web project, we learn how to control the styles of the EditOverlay for both the default style and the editing style. In order to accomplish this, we write some javascript code. Look at the code in the “script” tag to see how we can control the fill color, the opacity, the border width etc of the features in the EditOverlay.


Connecting Two Shapes With Arraw Line Samples

map_suite_wpf_desktop_edition_sample_connecting_two_shapes.jpg

In this sample, two polygons are connected by a arrowline, and if the polygons are moved the connecting arrowline will be moved automatically as well.


Preset Vertex To Tracked Polygon

map_suite_desktop_edition_sample_preset_vertex_to_tracked_polygon.jpg

This Desktop sample shows how to extend TrackInteractiveOverlay to give the ability to add a preset vertex to a track polygon while tracking. This can be handy in the situations where you need to add a vertex outside the current extent of the map or when you need to add a vertex with precise X and Y values. In the custom PresetVertexTrackInteractiveOverlay, you can see how the protected function GetTrackingShapeCore was overridden to implement this tracking behavior of the polygon.


Select and Drag(wpf)

map_suite_wpf_desktop_edition_sample_select_and_drag.jpg

In this Wpf project, we show how to select a feature from a shapefile based on a column value using the GetFeaturesByColumnValue. We also show to setup the EditOverlay to give the user the ability to drag the selected feature. In this project, you can also see how to get the world coordinates at the mouse move event. Notice that the code for doing this is quite different in Wpf compared to the winforms edition.


Select Vertices

map_suite_desktop_edition_sample_select_vertices.jpg

The purpose of this sample is to help you, the developer understand some intricacies of inheriting from EditInteractiveOverlay when implementing your own editing logic. Here we show how to keep control points drawing as selected even after the dragging operation is finished. For this purpose, we need to override three protected functions, OnControlPointSelected, MouseUpCore and DrawCore. Please, read carefully the comments to understand the inner workings of EditInteractiveOverlay.


Select with Track Shape

map_suite_wpf_desktop_edition_sample_select_with_trackshape.jpg

In today’s Desktop project, we combine the skills we learned in the samples “Spatial Query A Feature Layer” and “Track And Edit Shapes”. You can see how we use the event TrackEnded to get the RectangleShape from the tracked shape of TrackOverlay to do the spatial query. In this example, we use a Rectangle but you could also very easily use another shape such as Polygon, Circle, etc.


Snap To Layer

map_suite_wpf_desktop_edition_sample_snap_to_layer.jpg

This project shows how you can apply snapping to an EditInteractiveOverlay. There are many aspects to snapping. Previously, we showed a project with the mouse pointer snapping to the closest vertex of an editable polygon. Today, we show the technique to drag a control point and have it snap to the closest vertex of a layer if within tolerance. The tolerance can be set in world (meter, feet etc) or screen (pixels) coordinates. Notice that we are also using the technique showed in the previous project “Dragged Point Style”.


Snapping to Layer2

map_suite_wpf_desktop_edition_sample_snaptolayer2.jpg

The purpose of this Wpf project is to address some limitations of the class SnapToLayerEditInteractiveOverlay found in a previous sample Snap To Layer.
This class allowed the snapping of the mouse pointer to the closest vertex of a polygon if it is within a set tolerance. While this worked great for simple polygons, there was a performance limitation with complex polygons made of many vertices. This Wpf sample addresses this limitation and allows responsive dragging and snapping of vertex regardless of the size of polygon to snap to.


Snapping to Vertex

map_suite_wpf_desktop_edition_sample_snapping_to_vertex.jpg

This project is the first one of a series that will be dedicated to snapping using InteractiveOverlay. In this project, we show how to snap the mouse pointer to the closest vertex of an editable polygon if it is within a set tolerance. The tolerance is shown as a circle around the vertices. This technique can also be applied to snapping vertices within the same shape, between different shapes or even based on a layer. Those different types of snapping will be the subject of future projects related to snapping using InteractiveOverlay.


Track Zoom In Without Shift

no_screenshot.jpg

This project is for DesktopEdition users. In Map Suite 2.x, different modes of the map are offered to the developer to choose what kind of behavior the map has at a mouse action. In Map Suite 3.x, we went away from modes to have a more flexible model using InteracticeOverlay. By default, track zoom in is done by clicking and dragging the mouse on the map while holding the Shift key. This is very convenient but what if you want to offer the users the same experience as with 2.x, where the same mouse action has different behavior such as TrackZoomIn and Pan through the use of modes.

In this project, we show how to build your own InteractiveOverlay to emulate in Map Suite 3.x the mode behavior 2.x has.


Tracked Shapes to File

map_suite_wpf_desktop_edtion_sample_tracked_shapes_to_file.jpg

In this Wpf sample, we show how to persist the tracked shapes by saving the WKT (Well Known Text) to a file using the TrackEnded event. Also, you can see how to retrieve the WKT from files to create the features for the TrackShapeLayer of the TrackOverlay when loading the map. You will need the MapSuiteCore.dll and WpfDesktopEdition.dll references for this sample.


Tracked Shapes to WKT

map_suite_wpf_desktop_edition_sample_tracked_shapes_to_wkt.jpg

In today’s project, we show how to save a tracked shape to WKT (Well Known Text). You will notice that we make the distinction between the shape being tracked and the finished tracked shape thanks to two different events of TrackOverlay, TrackEnding and TrackEnded.


TrackOverlay with ESC(New)

no_screenshot.jpg

This project is meant to respond to a limitation with aborting tracking a shape in the project TrackOverlay with Esc. Now we can abort the tracked shape from the first vertex being added. Notice how we used a new class CustomTrackInteractiveOverlay inheriting from TrackInteractiveOverlay for this purpose.


Vertex Tolerance

map_suite_wpf_desktop_edition_sample_vertex_tolerance.jpg

Basically, this project shows the opposite of yesterday’s project “Snap To Layer”. Instead of having the dragged control point snapping to a vertex if within a tolerance, we show how to not allow a control point get within a set tolerance. This technique can be handy to implement if you have a requirement to have vertices of a shape being no less than a certain distance between each others. To implement that technique, again we use the power and flexibility of the EditInteractiveOverlay of the Desktop edition.


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.

Draggable Labels

map_suite_wpf_desktop_edition_sample_draggable_labels.jpg

In this wpf project, we are going to show how to place labels from a shapefile into a SimpleMarkerOverlay. Using the DragMode property of the SimpleMarkerOverlay, the user can then drag the labels to place them at the desired location for the most pleasing labeling effect. This project will be later completed to show how to save the state of the dragged labels from the SimpleMarkerOverlay and reload them.


Labeling based on size

map_suite_wpf_desktop_edition_sample_labeling_based_on_size.jpg

In the sample app “Draw thematic features” of the “How Do I” samples, we show how to use the ClassBreakStyle to display countries based of what population range they belong to. In today’s project, we show some more advanced uses of ClassBreakStyle to show how to label countries based on the area. You will notice that we also take advantage of the various zoom level sets for labeling purposes. The result is an eyed pleasing labeling of the countries with the size proportional to the countries’ area with more labels of smaller countries appearing as you zoom in.


MultiLine Labeling

map_suite_wpf_desktop_sample_multiline_labeling.jpg

For labeling purpose, TextStyle has a property called LabelAllPolygonParts that will label all the parts making up a polygon based feature. Unfortunately, we don’t have an equivalent API for labeling all the parts of a line based feature. But thanks to the flexible framework of Map Suite, we show in this Wpf sample how easily you can expand the TextStyle class to allow this labeling capability. Look at the custom class MultiLinetextStyle and how DrawCore function is overridden to have the expected labeling behavior.


Multiple Labels

This sample shows how you can display multiple labels for a given point or feature. You can do this by setting a single TextStyle or multiple TextStyles. If you use a single TextStyle, you can simply use a pattern like “[ColumnName1][ColumnName2]…“ and when Map Suite displays the text it will combine the values of the columns in your pattern. If you use a different styling method, you will need to manually control the offset of each piece of text to avoid overlapping.

For more information you can see the discussion forum post below:
http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/6955/afv/topic/Default.aspx


Decimal Degrees Formatting

LEAD Technologies Inc. V1.01

The purpose of this project is to complete the static class DecimalDegreesHelper. This class offers functions to go to and from Decimal Degrees but it lacks the functions handling various formats such as Degrees Decimal Minutes and Degrees Minutes Decimal Seconds. Those formats can be output by different GPS devices and it is handy to know how to manipulate them and convert them to Decimal Degrees, the only format that can be input into a GIS or Mapping application.


Label to Show Location

map_suite_services_edition_sample_label_to_show_location.jpg

This project shows how to use layers not for displaying but for getting location information on the current extent of the map. Getting information of the administrative divisions of the current extent of the map is convenient because it gives a spatial clue when the map is zoomed in too close to have any major features recognizable. In this project, we use the WorldMapKit as a background and the shapefiles state and counties are used for displaying the spatial clue.


Labeling Based On Columns

map_suite_services_edition_sample_labeling_based_on_columns.jpg

As a developer developing a mapping application, you may encounter point based shapefile for labeling. All the characteristics for labeling such as font, size, angle, color can be found in the attribute information of the shapefile itself. This project will show how to create a custom TextStyle that will get the value for those different columns and display each feature accordingly.


Multi Column Labeling

LEAD Technologies Inc. V1.01

In this project, we show some techniques to label features based on various columns. With the CustomStyles property and CustomColumnFetch event, you will see the flexibility you have to label the way you desire in a few lines of code. In this example, we label volcanoes based on four columns on two lines and using two different font styles.


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.

Raster Image Color Replacement

In today’s WPF project, we show you how to replace a specific color in a raster image, with the advantage of new added API Color Mapping. For the example, in this project, the lake in Green can be replaced with blue.

To make sure this sample work, you will need to use the latest Development daily build of “MapSuiteCore.dll” and “WpfDesktopEdition.dll”, version 9.0.477.0 or higher.


DynamicMarkerOverlay

In today’s WPF project, we show you how to retrieve data from a REST service and display them as markers with different styles based on its attributes. You can click on any marker to call a WCF service which returns data from the server. A popup displays a chart with information. All the markers and related information are updated dynamically after a specific time interval.


Native KML(Keyhole Markup Language) Support

map_suite_wpf_desktop_edition_kmlfile.jpg

In today's WPF project, we show you how to take advantage of Map Suite to load the Keyhole Markup Language (KML) file, which is an XML notation for expressing geographic annotation and visualization within Internet-based brwosers. With the latest KML support in Map Suite, you can eaisily display such files on a Map Suite control, including adorment pictures, placemarks etc. Also you can do the conversion between KML and any other vector formats supported by Map Suite componenets.


Apply Quick Filter to FeatureSource

map_suite_wpf_desktop_edition_quickfilter_linksource.jpg

In today's WPF project, we show you how to apply the quick filters to a FeatureSource with the help of LinkSource and LinkExpressions. With the LinkExpreesion, we can specify the query string to determine which features will be displayed. This feature can be applied in all Map Suite products.


NOAA Global Weather Station

map_suite_wpf_desktop_edition_sample_noaa_global_weather_station.jpg

In today's WPF project, we show you how to query and display real time NOAA wather station data directly as a Layer, which allows you to display up-to-date weather station data from around the world on top of your maps. The weather station data is sourced from NOAA and is refreshed every 15 minutes in the background. As these classes are inherited from the FeatureSource and FeatureLayer, many properties are querable and can be used to create a variety of maps or analysis of current weather patterns. This feature can be applied in all Map Suite products.


Magnetic Declination

map_suite_wpf_desktop_edition_sample_magnetic_declination.jpg

In today's WPF project, we show you how to add the Magnetic Declination or Magnetic variation to the map, it's designed as an AdormentLayer, which is used for showing the angle on the horizontal plane between magnetic north (the direction in which the north end of a compass needle, corresponding to the direction of the Earth's magnetic field lines) and true north (the direction along a meridian towards the geographic North Pole). This angle varies depending on one's position on the Earth's surface, and over time. See http://en.wikipedia.org/wiki/Magnetic_declination for more details. This feature can be applied in all Map Suite products.


Delay Map Drawing Feature

map_suite_wpf_desktop_edition_sample_delay_drawing.jpg

In this WPF project, we show you how to use the Delay Map Drawing feature to control whether or not redraw the layer after a specified delay. This option is very helpful for anyone wanting to do something before actually refresh the map, such as editing the elements, adding an animation etc. This effect can be avaible in all Map Suite products.


Combining Overlays

map_suite_wpf_desktop_edition_sample_combining_overlays.jpg

In today’s Wpf project, we show a technique of using a common FeatureSource for two different Overlays. From a physical shapefile representing cities, a regular LayerOverlay is used for the higher zoom levels while a FeatureSourceMarkerOverlay is used for the lower zoom levels. FeatureSourceMarkerOverlay is a Wpf specific overlay offering features for a better user experience such a Tooltips and ImageSource.


Create GRID

map_suite_desktop_edition_sample_create_grid.jpg

Today’s sample shows the new feature available in this may release Map Suite 5 for creating GRID files. A GRID is a raster format that defines a geographic space as an array of equally sized squares (cells) arranged in rows and columns. Each cell stores a numeric value that represents an attribute (such as elevation, surface slope, soil pH etc.) for that unit of space. Each GRID cell is referenced by its x, y coordinate location. Typically a GRID file is created based on some sample points with known values. In today’s sample, we take the example of creating a GRID file based on a point based shapefile representing soil pH values of some sample locations in a field. Using the Inverse Weighted Distance algorithm for interpolation, we create the GRID with the pH value for the entire extent of the field. Look at the code and comments for more details on how GRID files get generated and displayed on the map. This sample is a Desktop application but GRID can be used in all the editions of Map Suite.


Edit Attribute Of Shapefile

map_suite_wpf_desktop_edition_sample_edit_attribute_of_shapefile.jpg

The purpose of this Wpf sample is to show how to edit the attribute of a feature of a shapefile. This sample is useful for anyone wanting to actualize the attribute part of its data by simply clicking on the desired feature on the map and updating its attribute in a textbox. You will find the editing part of the code in the KeyDown event of the textbox.


Edit Geometry Of Shapefile

map_suite_desktop_edition_sample_edit_geometry_of_shapefile.jpg

The purpose of this sample is to show how to update the geometry of a feature of a shapefile in one step. This sample is useful for anyone wanting to actualize the geometry part of its data. You can see how only a few lines of code are necessary for this process and that the spatial index gets automatically updated after calling the committing the change. Notice that this sample does not show all the fanciness for manipulating at user interaction the geometry to be updated. For this purpose, you can see all the samples related to TrackInteractiveOverlay and EditInteractiveOverlay.


Get Data From Server With WCF

In this Silverlight-based project, we are going to take a look at how to get geometry data from the server side using the WCF service with Map Suite Silverlight Edition, while keeping all map data on the server side. You can click any of the countries on the map to call a WCF service, which will require data from the server, and then a popup will appear with information about that country.


Graphic Logo Adornment Layer

This sample shows how you can display your logo on the map using an AdornmentLayer. The advantage of using an Adornment is that the graphic stays in place and doesn't move as you pan your map. The sample should work for various kinds of logos and allow you to change the position using the AdornmentLayer's properties.


Heat Map

map_suite_wpf_desktop_edition_sample_heat_map.jpg

Heat maps is a technique increasingly used in various fields such in biology and other fields. See http://en.wikipedia.org/wiki/Heat_map. They are also used for displaying areas of webs page most frequently scanned by users. http://csscreme.com/heat-maps/.

At ThinkGeo, we are taking this concept to GIS and applying it to geographic maps. Heat maps are a great way to give the users a visually compelling representation of the distribution and intensity of geographic phenomenon.

Today, we are posting two Desktop projects on that subject. The first one is using the swine flu data we used in an earlier project. You can see how powerful the visualization of that data is to show the spatial distribution flu swine cases. In the next project, you will see how to take into account column values to produce various degrees of intensity using some earthquake data. In those two projects, you will need references to MapSuiteCore.dll and DesktopEdition.dll.


Highlight at Mouse Hover

map_suite_wpf_desktop_edition_sample_highlight_at_mouse_hover.jpg

In this WPF project, we show you how to highlight a feature when the user hovers the mouse pointer over it. This effect can be realized in Map Suite by using a timer and doing some spatial querying based on the location of the mouse pointer. This sample works with area-based features but the same could be accomplished with point- or line-based features simply by using different spatial queries.


Heat Map with earthquakes

map_suite_wpf_desktop_edition_sample_heat_map_with_earthquakes.jpg

After the project on displaying swine flu data using the heat map technique, here you learn how to apply parameters other than strictly spatial distribution to affect the coloring of the map.

In this example, the magnitude of each earthquake (from 0 to 12) is taken into account to influence the displaying of the heat map. The result is California appearing even more intense than if only the spatial distribution were taken into account.

As for the previous project, you will need references to MapSuiteCore.dll, DesktopEdition.dll. As a caveat on heat map in GIS, it is worth mentioning that while this is great tool for displaying data in a very appealing and communicative way, it cannot be used as an analysis tool for studying spatial behaviors. For spatial analysis, GRID is the appropriate tool. Although a heat map looks like a GRID, it is not one and it cannot substitute GRID for spatial analysis.


Image Stream Loading

map_suite_wpf_desktop_edition_sample_image_stream_loading.jpg

As an alternative to loading an Image with the image file from the file system, you can choose to pass your own stream. This project shows you how to use the event StreamLoading of GdiPlusRasterSource for this purpose. In this project, we show how to do this using a Tiff image but you can also use that event for ShapeFileFeatureSource as we show in a previous project “Shapefile Encryption”. Keep in mind that this technique only works with images besides MrSid, ECW and Jpeg2000. These types of images do not work because the providers do not support streams in their decoding SDKs.


KML Extension

map_suite_wpf_desktop_edition_sample_kml_extension.jpg

KML is the file format for displaying geographic data in a Google Earth browser such as Google Earth. Now, you can also display such a file on a Map Suite control. Thanks to its flexible architecture to extent to new file formats, in today’s project we wrote the logic for supporting KML. Look at the class KmlfeatureSource inheriting from FeatureSource to see how the logic for reading FML files was implemented. As well, you can see the class KmlStyle inheriting from Style for the drawing logic. And feel free to modify and improve those classes with your own implementations.


Latitude Longitude Graticule

map_suite_wpf_desktop_edition_sample_latitude_longitude_graticule.jpg

After the projects on North Arrow and Compass, we created another project related to Adornment Layer to have a more stylish map and give more information to the user navigating the map.

In this project, we create a Graticule Adorment Layer that shows Meridians and Parallels displaying through the map. Meridians are lines of longitude and they have a North South orientation. Parallels are lines of latitude and they have an East West orientation.
Showing graticule for latitude and longitude is a standard way in cartography to give spatial references to the users.

You will find two zip files. One is for the Desktop Edition “LatLongGraticule” and it shows nicely the effect of the meridians and parallels as you pan and zoom in and out. You will also see, as additional spatial references to the users, the latitude and longitude location at the mouse pointer in labels at the mouse move event. You will see that information in the decimal degrees format and in the Degrees Minutes Seconds format.

For those that don’t have the Desktop Edition, you will find the zip file “LatLongGraticuleServices” for the Service edition. It is using exactly the same GraticuleAdormentLayer class.

In the future, we will offer another class for graticule with more options for formatting and displaying the graticule. It will also offer projection support for map that are not in Decimal Degrees map unit.


Native TAB File Suppport

tabfilesupport.jpg

One of the most exciting new features in MapSuite 5.0 is native TAB file support. In the past, the FDO extension was used for displaying TAB files in MapSuite. Now with the new TabFeatureLayer, we have a simpler and more stable method of working with TAB files.

This Code Community project demonstrates how to load and display a TAB file using the new TabFeatureLayer. The example also allows you to add, edit and delete features from the TAB file.


Numbered Grid

map_suite_wpf_desktop_edition_sample_numbered_grid.jpg

In many atlases, you can see maps with a numbered grid to give the page reference for a more detailed map. In today’s project, we show how to construct such a grid. Based on the extent of the feature, the number of columns and rows, a grid can be created with the page number in each cell.


PopupOverlay

map_suite_wpf_desktop_edition_sample_popupoverlay.jpg

In this Wpf project, we explore more capabilities of the PopupOverlay and its collection of Popups. With the Content property, we can add a TextBox or any other control to a Popup. For example, here we show how to have the column value of a selected feature appear in a Popup on the user MapClick event. Notice how that column value can be easily changed by typing in the TextBox of the Popup and committing the edit.


Save & Load State

map_suite_wpf_desktop_edition_save_load_state.jpg

The purpose of this Wpf project is to show how to use the new SaveState and LoadState of the SimpleMarkerOverlay. We show how you can simply drag the icons to change their location, save their state to a file and then reload the state from that file. For this sample to work, you will need to use the latest production daily build of “MapSuiteCore.dll” and “WpfDesktopEdition.dll”, version 4.0.40.87 or higher. This project applies to Map Suite Wpf Desktop Edition only.


Shapefile Encryption

no_screenshot.jpg

In today’s project, we are looking at a way to encrypt shapefiles to prevent them from being used outside the application. We show how to encrypt and decrypt shapefiles using streams. You will see that a very simple encryption algorithm is used but by looking at the example, you will be able to implement your own.

Disclaimer: This encryption system can be used only on small shapefiles due to the amount of memory used. A typical use would be to encrypt some valuable small shapefiles you don't want your users to access. In the future, Map Suite will provide a full encryption system as an API.


WMTS Overlay

This project shows how to consume data from a WMTS Server using WmtsOverlay. You would find the code pretty straightforward, while behind the scenes we request tiles from the server asynchronously and efficiently, and stitch them into a proper map.
This class is introduced from version 6.0.187.0, besides this WmtsOverlay, we also have WmtsLayer available. Here is the WMTSLayer Sample.


ENC Viewer for displaying S-57 (*.000) File

map_suite_wpf_desktop_edition_s57viewer.jpg

Today’s project is a tool of ENC Viewer for displaying unencrypted Electronic Navigational Charts (ENCs) available in the S-57 exchange format (*.000).
This tool takes use of Map Suite HydrographyExtension to display ENC data in compliance with the latest version of ECDIS Presentation Library Edition 4.0, which is defined by the International Hydrographic Organization (IHO) in the special publication S-52.

NOTE: the styling file “NauticalCharts.xml” for drawing S-57 (*.000) file is included in the source code package.


GPS EXchange Format FeatureLayer

This sample demonstrates how to read GPS EXchange Format file(*.gpx) with Map Suite. GPX (GPS Exchange Format) is a light-weight XML data format for the interchange of GPS data (waypoints, routes, and tracks) between applications and Web services on the Internet, which you can find more information:here. Now Map Suite supports the GPX 1.0 and 1.1 schema. This sample works with Map Suite development branch daily build 7.0.275.0 or later.


Maritime S57 FeatureLayer

This sample demonstrates how to display unencrypted Electronic Navigational Charts (ENCs) available in the S-57 exchange format (*.000). It follows the style schema defined in the latest version of ECDIS Presentation Library Edition 4.0 (S-52), which is published by International Hydrographic Organization (IHO).

NOTE: This sample works with Map Suite development branch daily build 9.0.31.0 or later, Map Suite Unmanaged Dependencies 9.0.31.0.msi or later needs to be installed.


Build Custom Shapefile Indexes

map_suite_services_edition_sample_build_custom_shapefile_indexs.jpg

This sample shows how you can display a subset of a shapefile without splitting the physical shapefile. For example, you may have a single shapefile that contains both highways and local roads. To improve display speed, you may be temped to split it into two separate shapefiles so you can quickly display local roads with one style and highways with another style (and avoid using a value style, which can be slow). But at this project demonstrates, rather than split your shapefile you can simply build two custom indexes, one for each road type. Then, when you create your ShapeFileFeatureLayer, you'll simply use your original shapefile and specify a custom index. Each custom index will limit the records that can be seen by the Layer, making it very fast and efficient.


CAD FeatureLayer

map_suite_services_edition_sample_display_cad_file.jpg

This sample demonstrates how you can read data from an CAD file(*.dwg, *.dxf) in your Map Suite GIS applications, and how to render it with CAD embedded style as well as a customized style. It works with Map Suite daily development build version 7.0.46.0 or later, and Setup Unmanaged Dependencies 7.0.46.0 or later needs to be installed to make the sample work. This Cad File support would work in all of the Map Suite controls such as WPF Desktop Edition, Silverlight Edition, Web Edition, MVC Edition. The CAD dependencies assemblies can be downloaded from http://wiki.thinkgeo.com/wiki/File:MapSuiteCADDependencies8.0.109.0.zip


TAB FeatureLayer With Embed Style

map_suite_services_edition_sample_display_tab_file.jpg

This sample demonstrates how you can read data from an Tab file(*.tab) in your Map Suite GIS applications, and how to render it with Tab embedded style as well as a customized style. It works with Map Suite daily development build version 8.0.208.0 or later. This Tab File support would work in all of the Map Suite controls such as WPF Desktop Edition, Silverlight Edition, Web Edition, MVC Edition.



Compass

map_suite_services_edition_sample_compas.jpg

In the project “North Arrow”, you saw how to extend AdornmentLayer to create a North Arrow AdormentLayer. In this project, we expand on that idea and create a more sophisticated class. You will see how you can combine two images to create a compass. Compare to “North Arrow” project, we also added some other handy properties such as a Position property. Also, the compass can be of varied sizes thanks to the SizePercentage property. Finally, if you pass just one image, the compass can behave just like a regular north arrow.
We also added new designs of compass in smaller version. See the attached file: Rotating Compass New Smaller Designs.zip


File Geodatabase

map_suite_services_edition_sample_filegeodatabase.jpg

This sample demonstrates how you can read data from an ESRI FileGeodatabase in your Map Suite GIS applications. The sample will read data from 3 tables of one FileGeodatabase, and you will find the code as straightforward as consuming any other data source in Map Suite. It works with Map Suite daily development build version 6.0.115.0 or later, and you will need to run the “Setup Unmanaged Dependencies” installer from your daily build package in order for the sample to work The FileGeodatabase sample works in all of the Map Suite controls such as WPF Desktop Edition, Silverlight Edition, Web Edition, MVC Edition and so on.

Video Overview


Hook Up External Data to Shapefile

map_suite_services_edition_sample_hook_up_external_data_to_shapefile.jpg

This sample shows how to hook up external data to shapefile. The US states shapes are from a shapefile while the population values for Washington and New York come from an external database. From this sample, we can see how to use the event FeatureSource.CustomColumnFetch to introduce an external data source and utilize Dictionary objects to cache the external data.



Isolines

map_suite_services_edition_sample_isolines.jpg

In this sample we show how you can use Map Suite to add isolines (commonly known as contour lines) to your .NET application. Isolines are a way to visualize breaks between different groups of data such as elevation levels, soil properties, or just about anything else you can imagine. This sample also shows the various steps in creating isolines, including the gathering of point data, creating a grid using interpolation, and finally, picking your isoline break levels. We also quickly dive into some more advanced options such as generating isolines on the fly.

To bring this all together, check out our instructional video that will walk you through the process of setting up and working with isolines in Map Suite.

Please note that you will need version 5.0.87.0 or newer of Map Suite in order to use isolines. For more information on how to upgrade, see the Map Suite Daily Builds Guide.

From 6.0.187.0, the sample has been updated that polygons can also be returned as IsoLines results. You need version 6.0.187.0 or newer of Map Suite in order to use this sample.


Isolines with Kriging

map_suite_services_edition_sample_isolines_with_kriging.jpg

In this sample we show how you can generate isolines (commonly known as contour lines) using Kriging Interpolation Models. We integrated 5 Kriging interpolation models (Circular, Exponential, Gaussian, Linear, Spherical) in Map Suite which you can see from the sample are powerful and very straightforward to use. It works with Map Suite 6.0.126.0 or later.



MapShapes

map_suite_services_edition_sample_map_shapes.jpg

One of the most requested features left out of Map Suite 3.0 is MapShapes. For those who are not familiar with MapShapes, in Map Suite 2.0 they were a group of self-contained features that had their own styles, projection and column data. This meant that each one could be unique; however, this also meant you had to specify all of the attributes about each single MapShape.

In working with customers using MapShapes for a number of years, we found a common pattern. First, users tried MapShapes by adding one to the screen. This was very simple and got them up and running fast. They next added a few more as they started to build more of their application. After a short amount of time they realized that it was cumbersome to set the projection, styles, zoom levels, etc. on so many MapShapes, especially since the MapShapes often represented the same kind of underlying feature, like a fire hydrant or road block. The problem was that there was no good solution with Map Suite 2.0 to handle lots of very similar dynamic features.

In designing Map Suite 3.0, we took this into account and created the InMemoryFeatureLayer and InMemoryFeatureSource. These allowed you to treat all of the same kinds of similar features as if they were one group, which solved many problems. What we later found was that it made it more difficult for the cases where you truly had dozens or hundreds of features that were each unique and you needed to represent them as such. Having not implemented MapShapes, we were caught with a hole in our offering.

To fill this gap, we are presenting a project for a simple MapShapeLayer. This is a simple version of a more powerful one that we will include as part of the core framework in the near future. What really struck us when we were creating this new Layer was just how easy it was to do! It is a testament to our 3.0 framework and we decided to include the section below on how we implemented it.
Notes from the developer:

Success! This was about as easy as I thought it would be. All of the heavy lifting was done by existing classes and all I needed was a little glue code. In retrospect, I would had liked to do this by inheriting from the FeatureLayer and FeatureSource, because then it would have made the layer accessible by spatial queries. In the interests of time, and so I could post this on our forums as fast as possible, I inherited from Layer, which is really simple. You can see that the comments and my notes here take up more room than the code itself!

I think you will find this works nearly exactly as the 2.0 MapShapes did. It doesn't support projection; however, I think this could be easily added. We will be creating a production version of this class to include with the framework in the near future, and if projection is indeed easy to add, it will support projection and spatial querying.

In a nutshell, what I did was to create a MapShape class that housed a ZoomLevelSet and a single Feature. The ZoomLevelSet has all of the zoom levels, styles, etc. on it, so that part was nice to reuse. I matched this up with a new kind of Layer. I created the MapShapeLayer by inheriting from Layer. The only required overload was Draw, which was nice. I added to the class a MapShape's GeoCollection to store all of your MapShapes. In the Draw I simply looped through the MapShapes, and for each of them I found the zoom level that would be drawing and called its Draw method. In just a few lines of code, it all came together.


Mini Map Adornment Layer

map_suite_services_edition_sample_mini_map_with_adornment_layer.jpg

This project shows how to create a simple mini map to give a reference of where you are when you zoomed in. As for WaterMarkAdornmentLayer, the MiniMapAdormentLayer inherits from AdornmentLayer.




Multi Geo Raster Layer

no_screenshot.jpg

MapSuite API has RasterLayer from which inherits MrSIDRasterLayer and ECWRasterLayer etc. If we have many raster files, we would need to add all the raster files as separate layer. However this has a performance issue. In this project, we show how to create a class MultiGeoRasterLayer that treats all the raster file as one layer.

This class show how to do that using JPEG images with its associating JGW world file. It speeds up the loading of a large number of Raster layers by loading and drawing on demand only the files in the current extent. It loads a reference file that contains the bounding box, path and file information for all of the Raster files. We load this information into an in-memory spatial index. When the map requests to draw the layer, we find the Rasters that are in the current extent, create a layer on-the-fly, call their Draw method and then close them. In this way, we load on demand only the files that are in the current extent.


Multi Index

map_suite_services_edition_sample_multi_index.jpg

Today our purpose is to gather into one concise project all the different knowledge we learned about multi index in various Discussion Forum posts such as:
http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/5921/afv/topic/Default.aspx
http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/5958/afv/topic/Default.aspx
Consolidating various physical shapefiles into one layer is a flexible and clean way to handle your data. Thanks to multi index, you can treat your layers as one. Depending on your needs you can choose to use all the shapefiles in one folder or only a few. In this project you will see the different ways to use the powerful static function MultipleShapeFileFeatureLayer.BuildIndex()


North Arrow

map_suite_services_edition_sample_north_arrow.jpg

This project demonstrates basically two techniques; How to rotate a map and how to have a North Arrow keeping the right north orientation.

Rotating the map:

To rotate the map, you have to be aware that you have to use RotationProjection class provided by MapSuite API. All the layers need to have their projection property set to RotationProjection. Beware that if a Layer does not have that property set, it will not rotate along with the rest of the map.

Displaying the North Arrow:

As the map rotate, it is important to keep track of the orientation of the map and to know what the direction to the North is. Inheriting from Adornment Layer, RotatingAdornmentLayer class takes an Image representing a North Arrow and with its RotateAngle property set according to the angle property of RotationProjection, it always shows the North correctly.


Oledb Point FeatureSource

map_suite_services_edition_sample_oledb_point_featuresource.jpg

This project shows the power of MapSuite by giving to the developer the possibility to create its own layer based on an existing format containing spatial information. If the developer is familiar with a certain format like oledb, he can create its own FeatureSource reading the database and its own FeatureLayer wrapping the FeatureSource and providing the drawing logic.

In this project, we create the class OledbPointFeatureSource inheriting from FeatureSource and OledbPointFeatureLayer inheriting from FeatureLayer.


Oledb FeatureSource

map_suite_services_edition_sample_oledb_featuresource.jpg

This project shows how you can store your geometry data in any OLEDB compatible database. The sample provides a custom FeatureSource and FeatureLayer that allows you to query, insert and edit a full range of spatial. The spatial data is stored in binary using Well Known Binary and its index is a series of four columns describing the bounding box. This solution does not require your database to support any sort of special spatial indexing as it is all build into table structure and uses plain SQL statements to query back the data. This sample is also a great way to see how it is easy and efficient to extend Map Suite to meet your specific requirements.

NOTE: For portability and allowing the sample to be self-contained with minimal setup we have used a Microsoft Access database. Due to this there is a limitation there the “Microsoft.Jet.OLEDB” engine can only run in X86 mode. This is reflected in the target for this project. If you use another OLDB source then is limitation is no longer applicable.


Scale Bar

map_suite_services_edition_sample_scale_bar.jpg

Map Suite already offers classes such as ScaleBarAdornmentLayer for displaying scale bars on the map but they are limited to certain common units like meters, kilometers, feet and miles. In this project, you are going to learn the basics for creating a scale bar using the unit of your choice. The class CustomUnitScaleBar displays a very simple scale bar but you will find the logic for basics of creating a scale bar. Looking at the code, you will be able to create more sophisticated stylish scale bars for your own needs.


SQLInMemoryLayer

The purpose of this sample is to show you a quick and easy way to read data from a SQL data source and display it on the map using an InMemoryFeatureLayer. Since geometric feature data can be stored in a number of different formats such as X and Y coordinates, WKT (Well Known Text), and Geometry data types, this sample shows you how to load, edit and save data to a SQL data source for each different type of format. The sample includes a SQL script you need to run first, in order to create and populate a SQL Server table with sample data. You will also need to change the connection information in the code on lines 71 and 204 so that it points to your SQL Server.

Note: The approach in this sample works best for small amounts of data (less than 10,000 features) since it loads all of the data into memory. For larger datasets, we recommend using the SQL2008FeatureLayer or the ''OledbFeatureSource'', which only reads the data for the given extent you are working in (much more efficient for larger datasets).


Styles with InMemoryFeatureLayer

In this WPF project, we show how to build an InMemoryFeatureLayer from a text file. You'll notice how the columns are set up so that styles can be used as if the InMemoryFeatureLayer were a static layer such as a Shapefile. Here, we apply a Class Breask Style and a Text Style to our InMemoryFeatureLayer. What we learn in this sample can be applied to all the different editions of Map Suite.


Swine Flu

map_suite_services_edition_sample_swine_flu.jpg

In today’s project is going to apply some of the techniques we learned in the previous projects to some swine flu data available on the web.
On the web site
http://www.mapcruzin.com/free-download-h1n1-swine-flu-arcgis-shapefile.htm, it is possible to download point based shapefiles of swine flu occurrences in the world. While this information is valuable, it is a little difficult to display it at world level. At high zoom levels, all the points are on top of each other making the map very difficult to read and get overall information of the swine flu situation at the world level as you can see in the image with the map of the upper left.

Using some the techniques we used before such as Spatial Join with some modification, we can create a new polygon based layer from the country layer adding info from the swine flu layer. That resulting layer can be displayed with the info being a lot more readable as you can see in the map of the lower right corner of the image.

We basically use the techniques we saw in the “Spatial Join” project with getting the info from the swine flu layer into the country layer based on spatial relationship. We also use the techniques from “Dissolve with statistics” for doing some statistics on the swine flu records according to what country they belong to. See the comments in the project for more details.

Keep in mind that the project is for shapefile data format, if there are people expressing interest for doing the same thing with other data format, we will create a new more generic project.


Watermark Adornment Layer

map_suite_services_edition_sample_watermark_adornment_layer.jpg

This project shows how to create a WaterMarkAdornmentLayer class inheriting from AdormentLayer. Notice that in the overridden method DrawCore, the drawing is done using screen coordinates. This is a characteristic of Adornment Layer and any layer inheriting from it. In this example, the code in the DrawCore method places the water mark text at regular interval but you could easily modify the code to have the water mark text placed randomly on the map. Notice that WaterMarkAdornmentLayer is added to the StaticLayers collection of the MapEngine meaning that you can place this adornment layer on top of all the other layers or between any other layers. This class is useful for providing demos to clients.


WMTS Layer

This project shows how to consume data from a WMTS Server using WmtsLayer. You would find the code pretty straightforward, just like displaying a shapefile, while behind the scenes we request tiles from the server asynchronously and efficiently, and stitch them into a proper map.
This class is introduced from version 6.0.187.0, besides this WmtsLayer, we also have WmtsOverlays in different products. For example, this is the WPF WmtsOverlay Sample.


Zedgraph

LEAD Technologies Inc. V1.01

In our “How Do I” apps, there is sample app that shows how to add graphs to the map using the ZedGraph library. In this project, using the same data, the US cities, we elaborate a little bit on the pie chart. You will see how to add some gradient colors to the chart, how to label the different pie slices, how to add a title etc. Zedgraph is a truly massive library for graphics and Pie chart is only one type of chart among many others. As you can add pie charts to your map, you can also add bar charts, trend charts etc. I suggest you check out this site for more info on ZedGraph http://zedgraph.org/wiki/index.php?title=Main_Page With Map Suite, you have the whole ZedGraph API available with an easy interface to add the graphs to the map. For this project, in addition to the MapSuiteCore.dll, you will also need the ZedGraph.dll and ZedGraphStyleExtension.dll references. We will have several projects showing how to integrate other types of charts to your map.


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

map_suite_wpf_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.


MDI Form

map_suite_wpf_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.


ShapeFile to SQLite Convertion Tool

convert_shapefile_to_sqlite.jpg



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 9.0.0.1/9.0.1.0 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> [


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.

Large Scale Map Printing

map_suite_wpf_desktop_edition_sample_large_scale_map_printing.jpg

This WPF project is the second in our series of samples on printing. The first introductory sample served as a presentation of the different printing concepts such as page layout, the map element, legends, titles, data grids, logos and the user's interaction with them. Using all of the printing tools we introduced in the first sample, here we will demonstrate a real-world print scenario at a large scale with data for parcels at a county level. By reading the descriptive comments within the sample code itself, you will better understand how to handle your printing needs and follow cartographic standards for map presentation.

Note: Users of Map Suite Web, Silverlight and Services Editions will not have access to the interactive drag-and-drop page layout interface pictured here. However, these editions can still be used to programmatically design page layouts in code and then export them to a printer.


Map Printing With High Quality

This WPF project is the 3rd sample on the printing series. It demonstrates how to print your maps in high quality. This new feature for Map Suite is available in version 9.0.483.0 or later. From the sample you will better understand how to use DPI for handling print quality. The sample is based on raster images, but could also be used with vector data.


screenshot

In this sample we show you how to add robust printing support to your Map Suite applications for the desktop, WPF, web or services environments. Using the code in this sample, you'll be able to build a Print Preview interface that lets your users interactively arrange items (such as a map, scale line, labels, data grid or image) on a virtual page before printing the result to a printer, exporting to a PDF or to a bitmap image. Maps are printed using vector graphics so you can be sure the output will look great on anything from a PDF to a large plotter. The printing system also includes low-level report building classes that make it easy to generate reports in the web or services environment.

To help you understand the sample, as well as Map Suite's new printing system upon which it is based, check out our instructional video that will introduce you to all of these concepts and walk you through the sample solution.

Please note that you will need version 5.0.102.0 or newer of Map Suite in order to use the new printing features. For more information on how to upgrade, see the Map Suite Daily Builds Guide.

Note: Users of Map Suite Web, Silverlight and Services Editions will not have access to the interactive drag-and-drop page layout interface pictured here. However, these editions can still be used to programmatically design page layouts in code and then export them to a printer.


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 Parameters Projection

map_suite_wpf_desktop_edition_sample_custom_paramters_projection.jpg

In today’s Wpf project, we learn more about projection and how to handle a special case where the projection information in the PRJ file of a shapefile is not found as an EPSG or ESRI code in the spatial reference web site (www.spatial-reference.org). The strategy in this case is to build a proj4 string based on the parameters found in the PRJ file. Note that you must pay special attention to the false easting or northing parameters as they are always expressed in meters even if the projection is in another unit such as feet. For this example, we show how to convert from the local projection in Lambert Conformal Conic with regional specific parameters to Geodetic (WGS84) to match the World Map Kit.


Custom Rotation Projection

map_suite_wpf_desktop_edition_sample_custom_rotation_projection.jpg

In today’s project, we show how to create your own projection class that allows projecting a layer from any internal projection to any external while doing a rotation at the same time. Having the capability to apply those two operations in one step may come handy if the original layer was created in a different projection with the north at an angle and you want to align it on the base map. This is a Wpf project and you will need references to MapSuiteCore.dll and WpfDesktopEdition.dll to run it.


Distance Query on WrapDatelineMode

map_suite_wpf_desktop_edition_sample_distance_query_on_wrap_dateline_mode.jpg

In this Wpf sample is on the same theme as the previous sample WrapDatelineMode. Here we show how to take advantage of the projection class WrapDatelineProjection for doing spatial query when on a “virtual map”. From this spatial query example, the developer should understand how the same principle using the same projection class can be applied for other operations such as Spatial Queries, Identify etc. In order to run this sample, you will need the latest Dev Daily Build for Wpf with references to MapSuiteCore.dll and WpfDesktopEdition.dll.


Google Map to Geodetic

map_suite_wpf_desktop_edition_sample_googlemaptogeodetic.jpg

In today’s Wpf project, we are showing a trick for getting the current extent of the map with Google Map as an image and displaying it on a map in decimal degrees unit. You may be in a situation where you want the details and accuracy of Google Map, especially the satellite view but want to have it displayed on your map in decimal degrees. In this sample, you will see how to get the Google Map image and create the accompanying world file for decimal degrees. Notice that we are realizing an affine transformation on the image to go to Geodetic as illustrated in the case 3
http://en.wikipedia.org/wiki/World_file#Definition. You can also use this technique for any other background maps such as Bing Map, Open Street Map using Spherical Mercator.
Warning: It is possible to use a world file with parameters for a Geodetic system from an image originally in Spherical Mercator due to some similar projection characteristics. Applying the same operation for other projections such as Lambert or UTM will not work.


Local Datum UTM

map_suite_wpf_desktop_edition_sample_local_datum_utm.jpg

The purpose of this Wpf sample is to get familiar with the concept of datum and datum shift in UTM and Geographic coordinates. Using local data, you might be required to apply datum transformation to your data to go from an old datum to a more recent datum. Here we are taking the example of Australia which went to change its datum (from AGD84 to GDA94) for its mapping purposes. We show how to apply the datum transformation in both the longitude/latitude coordinate system and in the local UTM systems (AMG based on AGD84 and MGA based on GD94). See the code and read with attention the comments in the MouseMove event where all the projection logic is taken place. Notice that the correction is about 200 meters. Once you understand for the case of Australia, you will be able to apply the same principles for your own datums in UTM. For further reading:
http://www.cage.curtin.edu.au/~will/datum.html
http://www.usq.edu.au/course/material/SVY3107/lectures/Breeze/SVY2106amgmgafund/index.html


Projection by Analyzing Prj File

projectionreadingprjfile.jpg

This project demonstrates how to use the new ConvertPrjToProj4 function to dynamically project shapefiles based on the contents of their .prj file. This is one of the most requested new features of MapSuite 5.0. In the past, you were required to know the EPSG number or proj4 string in order to use the Proj4Projection class. The new ConvertPrjToProj4 method used in this sample will determine a shapefile's projection at runtime by analyzing the contents of the .prj file. This will enable the developer to build applications that allow users to dynamically add shapefiles with various projections and reproject them dynamically at runtime.


Note: There is also a ConvertProj4ToPrj function that can be used to build a .prj file from a proj4 string. This is not covered in this sample, but could be useful in the future.


Projection Distance LineStyle

map_suite_wpf_desktop_edition_sample_projection_distance_linestyle.jpg

This Web project is similar to the project “Distance Line Style”. Here we show how to use a projection of choice different from the projection used on the map. For example, you may have your map using Google map as a background. Google map uses Spherical Mercator projection which is not ideal for distance measurements, that is why using a more appropriate projection for distance measurement such as State Plane will give more accurate results. The CustomDistanceLineStyle inheriting from LIneStyle has the logic built in to have the distance calculated based on a projection of choice instead of the projection of the map.

As for the previous project “Distance Line Style”, you can see how the DrawCore function is overridden for the a specific need of style: displaying the distance label on each line segment making up a LineShape. In addition to the overriding of the DrawCore function, you will find useful some geometry functions such as GetPointOnLine to find the midpoint of a line segment and GetAngleFromTwoVertices to incline correctly the labels according to the orientation of each line segment. You will notice that the CustomDistanceLineStyle works for features made of LineShape and you will have to slightly modify to have it working with MultilineShape.


Wrap Dateline Mode

map_suite_wpf_desktop_edition_sample_wrap_dateline_mode.jpg

In this Wpf project, we show a new property of Overlay, WrapDatelineMode. When you set this property to WrapDatelineMode.WrapDateline, the overlay will display to the right or left as you continuously pan west or east. This is very useful when dealing with world maps and you want to display the pacific rim as one extent. You have to be aware that this feature comes with some limitations. For example, on the “virtual” maps, the world coordinates are no longer valid and you need a special projection that we created (WrapDatelineProjection) to have the world coordinates displaying correctly. In order to run this sample, you will need the latest Dev Daily Build for Wpf with references to MapSuiteCore.dll and WpfDesktopEdition.dll.


Distance Query on Projected Layers

In this sample, we learned how to use the method GetFeaturesWithDistanceOf when the data is projected. We just input the unit which is projected to, do not need to mind what the real unit is for the internal data before projection. It works fine with Map Suite Assemblies 4.5.54.0 or later.


Graticule with Projection

map_suite_wpf_desktop_edition_sample_graticule_with_google_projection.jpg

In today’s Wpf project, we explore more features of GraticuleAdornmentLayer which shows meridians and parallels at various intervals based on the zoom level. Being natively in Geodetic, GraticuleAdornmentLayer can be set to any projection. In this project’s example, you have the graticule showing with World Map Kit in Spherical Mercator (Google Map projection). Also, not how easily you can change the appearance with properties such as GraticuleLineStyle and GraticuletextFont.


Wrap Dateline Mode With Projection

map_suite_wpf_desktop_edition_sample_wrap_date_line_mode_with_projection.jpg

In this Wpf project, we show a new property of Overlay, WrapDatelineMode. This property that allows to continuously pan west or east with world map was already available in the dev branch. This concept was shown in the previous sample “WrapDatelineMode”. Now it is fully supported in Map Suite 5 and you can see in this sample how the behavior for the map in both Decimal Degrees (Lat/Long) and Spherical Mercator (Google Map/Bing map projection). In order to run this sample, you will need the latest release for Wpf with references to MapSuiteCore.dll and WpfDesktopEdition.dll.


Datum Transformation

map_suite_services_edition_sample_datum_transformation.jpg

The purpose of today’s project is show how to handle the scenario where you have to apply a datum transformation to your data while keeping the same projection. This project addresses some confusion that might exist about the difference between datum and projection. We take a concrete example of a point in degrees using the ED50 datum and we apply a datum transformation so that it is in degrees using the WGS84 datum. Please, read carefully the comments to better grasp some key concepts.


Geodetic to State Plane

map_suite_services_edition_sample_geodetic_to_state_plane.jpg

Having to project a layer from geodetic (decimal degrees) to State Plane is a common task in GIS. One of the challenges is to know what State Plane zone a layer belongs to. This project is basically a little utility for State Plane projection needs. With the help of the State Plane zones layer provided, any layer in geodetic can be projected automatically to State Plane without having to do research to know the specific zone a layer belongs to. The opposite task (that comes even more frequently) of going from State Plane to Geodetic is unfortunately impossible to accomplish the same automatic way.


Geodetic to UTM on the fly

map_suite_services_edition_sample_geodetic_to_utm_on_the_fly.jpg

A common situation with dealing with geographic data from different sources is to have to “match” data in decimal degrees (Geodetic) with data in the local system of UTM. For example, you may have vector data in decimal degrees and an image in UTM. Projecting vector data is always more straightforward than projecting image data, that is why it is preferable to project the vector data to the image, rather than the opposite. In this project, we show the example of projecting a vector layer in decimal degrees (Geodetic) to UTM to “match” a tiff in that projection.


GeoRaster Projection

map_suite_services_edition_sample_raster_projection.jpg

This sample demonstrates how you can project raster layers in real-time for your .NET GIS application. In the sample it will show you show we switch a small sample image to and from a variety of projections. This sample was developer using the Map Suite Services Edition just to show how these feature are in the core of the framework. Projection can easily be applied to all of products such as the Wpf Desktop Edition, Silverlight Edition, MVC Edition and so on. It is important to note that this implementation is unmanaged and at the moment we do not have a managed version however we are working on it.


Great Circle on Pacific Rim

map_suite_services_edition_sample_great_circle_on_pacific_rim.jpg

This project extends what we learned in Pacific Rim. We show how to apply the Offset projection to Great Circle to have it displaying correctly over the pacific as opposed to Google Map where the same Great Circle is shown broken down.


Measurements Decimal Degrees

LEAD Technologies Inc. V1.01

This project is in response to a Discussion Forum post that has generated plenty of debate on the meaning of measuring area for shapes in decimal degrees.
In this project, you will see how to get area and length measurements according to the projection used from a shape in decimal degrees. For more information on why different measurements can be obtained from the same shapes, please read the Discussion Forum “GetArea on Buffered shape not working as expected”


Pacific Rim

picture_map_suite_samples_pacific_rim.jpg

This project shows how to display the Pacific Rim and Asia if you pan to the west, so that the world “wraps around,” as it does with Google Maps.\\Many of our Map Suite sample applications include an example of the world being displayed using a world ShapeFile. The ShapeFile is in Decimal Degrees and it displays the world according to longitude and latitude value ranges. These ranges are from -180 to 180 for longitude and 90 to -90 for latitude. In our various examples that use this ShapeFile, you see the Western Hemisphere on the left and the Eastern Hemisphere on the right. Now, a common request that we receive is to display the Pacific Rim and Asia if you pan to the west, so that the world “wraps around,” as it does with Google Maps. This can be accomplished in Map Suite 3.x by using a custom projection that offsets all of the points by 360 for the x (longitude) values. (180 + 180 360). …


Polygon across Meridian

map_suite_services_edition_sample_polygon_across_meridian.jpg

Following a request from the Discussion Forum on how to handle cases where the shape straddles the 180 degree meridian on a Decimal Degree map, we created this project. The solution is to split the shape into two main parts to be displayed on the two ends of the map.In this case, we use the case of a Polygon but this could easily be adapted for any other shapes such as lines.


Projection Distortion

map_suite_services_edition_sample_projection_distortion.jpg

Today’s project is more about learning and raising awareness about map projections than about a specific programming technique. By monitoring the Discussion Forum, we have encountered a large number of questions related to projections and distances. Many Map Suite users are unsettled by getting different distances from the same locations on various projections. To try to demystify this a little bit, we show how a regular grid on lat/long points get distorted in various ways depending on the projection applied. By visually seeing the distortion happening, it helps understand why distances can vary so wildly. You will also find some link to study this topic a little further if you wish.


Projection in Feet

no_screenshot.jpg

You may be in the situation where you have data in a projection that is in feet. For example, you may have the data for the USA in the standard Lambert projection in feet. Unfortunately, many of the projections offered in the PROJ4 library (the default projection library in Map Suite), handles the different projections in meters. It is the case for USA Contiguous Lambert Conformal Conic projection (ESPG code 102004). It is only available in meters.This project will show you the trick to easily have the projection of your choice being in feet using the original projection in meters.


Routing with Projections

map_suite_services_edition_sample_routing_with_projection.jpg

From a Discussion Forum request, in today’s project we show how to perform routing in one projection and display the result in another. You may be in the situation where you have your routable street data in State Plane meters and you have your base map in Geodetic (decimal degrees). This project shows you how to handle this case.


Save To Projection

LEAD Technologies Inc. V1.01

In the Projection section of the “How Do I” sample apps, there is a sample app that shows how to project on the fly a layer in one projection to another. While this is useful, you may be in the need to actually create a new layer in the desired projection. This project shows how to use the API SaveToProjection of ShapeFileFeatureLayer. In this project we use the example where you need your data in a regional projection saved to WGS84 (decimal degrees) to match other data such as GPS readings or the WorldMapKit.


Spherical Mercator Projection Adjustment

map_suite_desktop_edition_sample_spherical_mercator_projection_adjustment.jpg

The purpose of this sample is to address a projection issue that you may encounter when converting your data from your local projection to Google Map. It has been reported by Map Suite users that in some cases reprojecting their data to Google Map or other base maps using Spherical Mercator (Bing Map, Open Street Map etc) is inaccurate with the data being shifted a few hundreds of meters. This problem has been identified as being caused by an unnecessary grid shift when going from ellipsoid datum to spherical datum. Among other projections, the British National Grid (BNG) and the German Gauss-Kruger system have that problem when going to Spherical Mercator.
This sample uses the example of BNG to demonstrate the problem and how to fix it. The Map Suite development team will offer a permanent solution to this projection issue but in the meantime, as a rule of thumb, if your data shows some inaccuracies when going to Spherical Mercator, use the method you find this sample. This is a Desktop app but the concept shown applies to all editions of Map Suite.


Street Intersection

map_suite_services_edition_sample_street_intersection.jpg

From a request in the Discussion Forum, we decided to post a project today related to street intersection. In this project, we show how to get the intersection point of two streets. Basically, we get all the street features according to the street name and based on the shapes from those features, we do use some geometric function to determine what the intersection point of those two streets is. Keep in mind that the code provided in this sample app might not be the fastest or more optimized but it basically shows the algorithm for that purpose. This algorithm will be used to complement the Map Suite Geocoder product for Intersection geocoding.


World Coordinate with Rotation

In the “How Do I” sample apps, in the section “Projection”, you can find the sample “Use RotationProjection for a feature layer”. It allows to basically rotating the map to any angle. You can see how useful this can be by having the map rotated according to a vehicle direction, for example. Now, what is missing in this sample are the world coordinates in the status bar at the mouse move event. Today we show how to do that and what technique to use.


World Coordinates

LEAD Technologies Inc. V1.01

The purpose of this project is to complete the section “Screen & World Coordinates” of the “How Do I?” sample apps. You will learn how to display world coordinates at the mouse event. Notice that the Layer is in Mercator projection and we use a projection conversion to display Longitude and Latitude in addition to the world coordinates values in meters from the Mercator projection.
Also, we are reusing the DecimalDegrees static class we used in a previous project for formatting decimal degrees.


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.

This WPF project shows how to get a route between 2 adjacent roads even if they don't intersect within an allowable tolerance. It’s based on Map Suite Geometry Topology module and does not require the Map Suite Routing Extension.

Note: This sample requires MapSuiteCore.dll newer than Daily development build version 9.0.178.0 or Daily Production Build version 9.0.0.178.


Clipping On Line Layer

map_suite_wpf_desktop_edition_sample_clipping_on_line_layer.jpg

This Wpf project completes the series of projects dedicated to the clipping geoprocessing. We already saw how to perform clipping on a polygon based layer in “Clipping” and on a point layer in “Clipping On Point Layer”. Here we show how to perform the clipping geopressing on a line based layer. As for the same operation on a polygon based layer, the key geometric function is GetIntersection. We will also appreciate the operation of creating a layer from scratch as in addition to the geometric operation itself, geoprocessing also involves creating a result layer from the original layers, the clipping layer and the clipped layer. You will need to get in the Dev Daily Build the latest MapSuiteCore.dll and WpfDesktopEdition.dll as references as the GetIntersection API for line based shapes was added only recentely.


Create Inner Ring

map_suite_wpf_desktop_edition_sample_create_innerring.jpg

In today’s Desktop project, we learn how to create inner rings to a polygon based on another polygon using the GetDifference function. We also learn how to perform Union on a collection of polygon and how to set up the event TrackEnded. To use this app, you need to track a polygon, double click to end it and it will create an inner ring from the unioned result of the polygons completely within the tracked polygon. You can look at the TrackEnded event handler to see all the different operations taking place for that task.


Distance Query on Projected Layers

In this sample, we learned how to use the method GetFeaturesWithDistanceOf when the data is projected. We just input the unit which is projected to, do not need to mind what the real unit is for the internal data before projection. It works fine with Map Suite Assemblies 4.5.54.0 or later.


Distance Query on WrapDatelineMode

map_suite_wpf_desktop_edition_sample_distance_query_on_wrap_dateline_mode.jpg

In this Wpf sample is on the same theme as the previous sample WrapDatelineMode. Here we show how to take advantage of the projection class WrapDatelineProjection for doing spatial query when on a “virtual map”. From this spatial query example, the developer should understand how the same principle using the same projection class can be applied for other operations such as Spatial Queries, Identify etc. In order to run this sample, you will need the latest Dev Daily Build for Wpf with references to MapSuiteCore.dll and WpfDesktopEdition.dll.


FeatureIdsToExclude

map_suite_wpf_desktop_edition_sample_featureidstoexclude.jpg

The purpose of this project is to show how to use the FeatureIdsToExclude collection of FeatureLayer. In the project, you will see how you can exclude some features from being part of the GetFeaturesNearestTo function. Using that collection is a handy method for not taking into account some features in doing spatial queries, searching and even drawing without having to change the structure of the layer or create another layer.


Get Feature Clicked On(Desktop)

map_suite_wpf_desktop_edition_sample_get_feature_clicked_on_desktop.jpg

The purpose of this project is to show the technique for finding the feature the user clicked on. To give the user the expected behavior, a buffer in screen coordinate needs to be set so that the feature get selected within a constant distance in screen coordinate to where the user clicked on regardless on the zoom level. This project will show how to accomplish that task regardless of the layer type (polygon, line or point based) and the zoom level of the current extent of the map. This is a Desktop project.


Intersect Line

map_suite_wpf_desktop_edition_sample_intersect_line.jpg

In today’s project, we show how to split a line based on an intersecting line. To accomplish this task, basically two steps are needed. First, you need to find the crossing point using the GetCrossing function and then you split the line based on the crossing point using the GetLineOnLine function. If you are in the utilities industry working with electric network, gas pipes etc, you will find this project useful.


Polygon Shapes To Multipolygon Shapes

map_suite_wpf_desktop_edtion_sample_polygon_shapes_to_multipolygon_shapes.jpg

In this Wpf project, we show how to create a MultipolygonShape from various PolygonShapes. Since a collection of PolygonShapes cannot be directly cast to a MultipolygonShape, we show the technique to build a MultipolygonShape passing an IEnumerable of PolygonShape. This is a Wpf sample and you will need the references for MapSuiteCore.dll and WpfDesktopEdition.dll.


Shortest Line Between Two Features with Split

map_suite_wpf_desktop_edition_sample_shortest_line_splitting_lines.jpg

This sample will show you how to find the closest line between two features by using the GetShortestLineTo API and how to split a line at a given point using the GetLineOnALine API. These APIs can be very useful when doing spatial analysis and editing of features. This sample also allows you to dynamically alter the test features using the EditOverlay so you can try out different scenarios and see the results quickly. A MapShapes layer is used to display and style the individual results.

Note: This sample requires that you reference DLLs from the Map Suite WPF Desktop Edition daily development build version 7.0.318.0 or later.


Sweep Angle Desktop

map_suite_wpf_desktop_edition_sample_sweep_angle_desktop.jpg

The purpose of today’s project is to show how to make a desktop project from a Servicess one. Many of the projects published in the Code Community are in the Servicess edition because the only reference for Map Suite required for running them is MapSuiteCore.dll. That dll comes in any of the Map Suite products. We are taking the example of the “Sweep Angle” Servicess project to show how to adapt it to a Desktop project. With the understanding of some basic concepts such as Overlay, you will be able to easily convert a Servicess project to a Desktop one. So, for this project, you will need the references for both MapSuiteCore.dll and DesktopEdition.dll. Next, we will see how to convert a Servicess project to a Web one.


Clipping

map_suite_services_edition_sample_clipping.jpg

This project along with “Spatial Join”, “Dissolve” and “Dissolve with Statistics” show another type of geoprocessing technique that can be applied to a layer. Clipping a layer can be handy in situation where the layer has a geographic extent larger than necessary and you just need a portion of it based on some defined area. For example, you might have the world layer of evergreen but you are working at the national level for Brazil and you don’t need the rest of the world. Clipping the layer will reduce it to the geographic area you are only interested in.
With “Clipping”, you will see how to combine the GetIntersection geometric function with other functions for creating and editing a layer into a coherent one step operation. Notice that this project only deals with clipping polygon based layer. It is also possible to clip line and point based layers. That will be the subject of future projects.


Clipping On Point Layer

map_suite_services_edition_sample_clipping_on_point_layer.jpg

After the project “Clipping” where we saw how to clip a polygon layer based on a polygon, in this project we see how to clip a point based layer. Clipping a point based layer is quite a simpler task than clipping a polygon based layer as no geometric functions are necessary such as GetIntersection (overlap) besides the spatial query. It is also a much faster task to run.
After the projects on clipping polygon and point based layers, we will show a project on clipping line based layers.


Convex Hull

ConvexHull is a geometric function that returns the smallest ring containing all the points of a shape. Another way to think about it is to imagine a set of points on a plane as nails pounded into a board. If you wrap the entire set with a rubber band snapping it into place, it will form a convex hull, which is the minimum-energy wrapper that encloses all the points.
This is the theory, now you may be wondering what the practical use of this is in GIS. In today’s project, we show how to contruct a convex hull polygon from a set of point in a concrete situation of oil rigs offshore. Creating a convex hull could be used to determine the perimeter for constructing a barrier around the oil rigs to help protect from hurricanes. It could also be used for a barrier to keep spilled oil contained within.


Correcting Nodes

map_suite_services_edition_sample_correcting_nodes.jpg

As for the projects “Spatial Join” and “Dissolve”, in this project we see how to edit FeatureLayers. In this case, we show some techniques to clean up a line based layer. You may be in a situation where you have to do that on a layer representing a network. Due to a poor digitizing, the end nodes of the lines don’t touch each other showing disconnected when in fact they should be connected. In this project, we show the technique to correct the location of the end vertices (nodes) so that they connect to each other. Keep in mind that the logic for correcting nodes shown here, is very simple and does not take into account various parameters such as tolerance, line order, multi line intersection etc. This logic works in the case of having an ordered sequential network as it is often digitized. The full logic taking into account all the different scenarios is vastly more complicated. We plan to offer this full logic in the future as an API within our core product.
Also, notice that we create a custom LineStyle, NodeLineStyle for the purpose of showing the start and end nodes of each line as different color than the body of the line.


Create Polygon Programatically

map_suite_services_edition_sample_create_polygon_programatically.jpg

Having a list of vertices with X and Y representing a polygon is a common scenario in GIS. For example, you might have a list of vertices (in Longitude and Latitude) representing plumes from a chemical dispersion. How do I create the polygons from that and how to I display that on the map? In this project, we show how to accomplish this from text files.


Dissolve on Shapefile

map_suite_services_edition_sample_dissolve_on_shapefile.jpg

This project shows how to perform some geoprocessing on a shapefile, in this case dissolving a shapefile based on a common attribute. Dissolving shapefiles can be handy in situation where the shapefiles are too broken down for what they are intended to be used for. For example, you may have a shapefile of all the states of the US and they all have attributes for what sales region each belong to. If what really matters to you are the sales regions and not the individual states, it makes sense to dissolve the shapefile.

In this small project, you will see the technique to dissolve a shapefile based on a common attribute using some key methods such as Union static method to efficiently union together a large number of shapes. You will also find useful the code for creating a shapefile from scratch.

This project will soon be followed by another project on how to apply statistics when dissolving a shapefile.
Also, there will be another related project on how to do Dissolve on a generic FeatureSource.


Dissolve with Statistics

map_suite_services_edition_sample_dissolve_with_statistics.jpg

In the project “Dissolve”, we saw the geometric aspect of the Dissolve operation with the Union function etc. In this project, we going a little further and we apply statistics on the layer while dissolving. For each column of the layer being dissolved, we can apply various statistics such as sum, average, count etc. For example if you are dissolving the states of the US based on what region they belong to, you may want to get the sum of the population of each state within the same region and save that to the output dissolved layer.


Draw a Pie shape

This sample shows you how to draw a pie shape defined by an Ellipse prototype. The pie shape is not a standard shape provided by the Map Suite component, though it could be considered part of the ellipse or circle if special enough. In essence, you can create a pie shape by adding additional points to a given ellipse shape.

For more information, please see the discussion forum post below:
http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/6963/afv/topic/Default.aspx


Dynamic Segmentation

map_suite_services_edition_sample_dynamic_segmentation.jpg

The purpose of this project is to give a very quick introduction to Dynamic Segmentation, the area of GIS that has to do with network analysis. This project should interest professionals working in road management, accident analysis and pavement management.

The key method used here is GetLineOnLine that offers many parameters to get a segment of an existing line. In our example, we get a line segment based on a distance from the start and the length. You can see how this could be applied for application such closing a segment of a highway after an accident for example.

This project will be followed by other more advanced projects related to Dynamic Segmentation.


Get Feature Clicked On With Projection

map_suite_services_edition_sample_get_feature_clicked_on_with_projection.jpg

This WPF project shows a technique for finding the feature of a point, line or polygon-based layer that the user clicked on. As with the earlier sample entitled “Get Feature Clicked On”, in order to give the user the expected behavior, a buffer in screen coordinates needs to be set so that the selected feature is chosen within a constant distance in screen coordinates from where the user clicked on, regardless of the zoom level. In addition, this sample also addresses a limitation of the earlier sample by showing the contrast between using the functions GetFeaturesNearestTo and GetFeaturesWithinDistanceOf.

While the function GetFeaturesNearestTo as used in “Get Feature Clicked On” works quickly and is adequate in most cases, it is not guaranteed to get the closest feature. In contrast, with the new function GetFeaturesWithinDistanceOf, you can loop through the features within a specified tolerance and get their exact distance. While this approach requires some more code, it is guaranteed to get the closest feature in every case.

This sample also demonstrates another aspect of distance queries. We have the layers projected to the Google Map projection from WGS84, and you'll notice that the aforementioned distance functions (GetFeaturesWithinDistanceOf and GetFeaturesWithinDistanceOf) work seamlessly without requiring the developer to worry about whether the layers are projected or not.


Identify Point with Icon

map_suite_services_edition_sample_identify_point_with_icon.jpg

This project shows what technique to use when identifying at mouse click a feature represented with an icon. From the user’s perspective, the expected behavior when is to get the information of the feature when the user clicks on the icon, any part of the icon. The icon is the feature for him.

Today, we show how to implement that mode of getting info from a feature with icons of any size.


Inner Ring Containment

map_suite_services_edition_sample_inner_ring_containment.jpg

The Contains function of PolygonShape when passing a PointShape is a convenient way to find out if a point is inside a polygon or not. But you have to be aware that the function is going to return false whether the point is completely outside the polygon or is inside one of the inner rings (holes of the polygon). While this is technically accurate, you might be in the position where you need to be able to make the distinction between those different types of containment for a polygon possessing inner rings. In today’s project, we create a function gives you the information whether a point is completely outside or inside one of the inner rings.


Intersecting Multi Polygon

map_suite_services_edition_sample_intersecting_multipolygon.jpg

In today’s project, we learn how to handle graciously the case of an invalid MultipolygonShape. Having a MultipolygonShape (The MutiPolygon according to OGC) with intersecting (overlapping) PolygonShapes is not a valid geometric shape. Although it draws (with some quirks) without throwing errors, such a shape cannot be used for doing spatial queries or other geometric functions. There are two options to solve the problem. One is to create a collection of individual PolygonShapes. The other one is to correct the MultipolygonShape by unioning the overlapping parts. In this project, you will see the code for both approaches. Keep in mind that the two different approaches are not just different methods, they also give different resulting shapes. You have to choose what solution fits the best your case.


Intersecting Two Layers

map_suite_services_edition_sample_intersecting_two_layers.jpg

In the project “Clipping”, we saw how to clip a layer with another to have a resulting layer of the desired geographical extent. In the project “Intersecting two layers”, we see the technique of intersecting two layers which goes a few steps further compared to simply clipping a layer.

Let say you have a layer of stratigraphy and a layer of counties and you need to do some analysis based on info from the county layer and info from the stratigraphy layer. You can combine the two layers by intersecting them and get only the common data of the two layers while adding the attributes of both original layers. The resulting layer has geographical extent that is common to both layers (as for clipping) while adding the information from both original layers.

As for other geoprocessing techniques, writing the code for Intersecting requires combining layer editing with geometric functions.


Merge Line Layers

map_suite_services_edition_sample_merge_line_layers.jpg

From the previous project, on the geoprocessing technique of merging point layers, here we show the same technique applied to line layers.
Remember that an alternative approach to merging is to use a multi index and treating all the various files as one layer. You can see this Discussion Forum post for more info on that: http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/5921/afv/topic/Default.aspx


Merge Point Layers

map_suite_services_edition_sample_merge_point_layers.jpg

This project is similar to a previous project related to geoprocessing for merging polygon layers “Merging Layers”, but applied to point layers.
An alternative approach to merging is to use a multi index and treating all the various files as one layer. You can see this Discussion Forum post for more info on that: http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/5921/afv/topic/Default.aspx
Next we will show how to do the same thing for line layers.


Merging Layers

map_suite_services_edition_sample_merging_layers.jpg

If you have many files of the same type and representing the same type of features, Map Suite offers an API for building a multi index and treating all the various files as one layer. You can see this Discussion Forum post for more info at here
While this is very convenient, you may still want to combine all your files into one for maintenance purpose. This project shows the geoprocessing technique of accomplishing that task with merging. The logic for writing the merging algorithm is simpler than other geoprocessing tasks since no geometric functions are involved.

Keep in mind that this project shows how to merge polygon based shapefiles into one. In the future, we will post a more generic project for layer of various format and type.


Multi Ring Buffering

LEAD Technologies Inc. V1.01

This project shows how to create a multi ring buffer on shapes, in this case MultilineShapes from a line based layer, a road. From buffering the road at various distances, we create concentric rings. Then, we can determine how many features from the point based layer (schools) are in each ring.

In this project, you learn how to handle geometry functions such as Buffer, Union and Difference for the goal of doing some spatial analysis with the resulting rings.


Negative Buffering

LEAD Technologies Inc. V1.01

This project is meant for addressing a current limitation of Map Suite API concerning the geometric operation of buffering. Currently, the Buffer function can only be done for buffering to the outside of a shape but not to the inside of the shape. This project shows the different steps to follow using various geometric functions to accomplish the result of negative buffering. In the future public release of Map Suite, negative buffering will be fully supported. This project is still useful in understand how to manipulate various geometric functions to get the desired result.


Offset Point at Right Angle

map_suite_services_edition_sample_offset_point_at_right_angle.jpg

This project shows some geometry for moving a point parallel to a line segment. The GetLineOnLine method allows you to do some dynamic segmentation on a road. After doing that you may need to offset the start and end points at a right angle by a certain distance. This project will show you how to accomplish that.


Register Shape

map_suite_services_edition_sample_register_shape.jpg

In this sample, we show a geometric function that allows tying to the ground or registering shapes from some non geographic coordinate to the map (in world coordinates). To better understand how useful this can be for your mapping needs, imagine the following scenario:

You have some geometric shapes in a CAD for chemical plume. In a CAD or specialized program generating chemical models, you can do all your scientific manipulation, transformation etc. Once you are finished generating the chemical models with your specialized program, you are ready to put it on the map. Using anchor points, one of origin and one of destination, you can tie to the ground the shapes with the help of the Register function.

This operation cannot be confused with Projection. Projecting a shape means going from one geographic projection to another one, for example from Geodetic to Spherical Mercator and some deformation of the shape can occur. Registering is simply placing a shape from a non geographic coordinate to a specific location on the map.


Remove LineShape

map_suite_services_edition_sample_remove_lineshape.jpg

MultilineShape is a line based shape type consisting of a collection of LineShapes. In today’s project, we will show some editing on how to remove a LineShape of the MultilineShape. In this process, you have to be aware of various issues such as removing the LineShape using the correct index and recreating a new feature with the edited MultilineShape with the correct ColumnValues if necessary.


Spatial Join

map_suite_services_edition_sample_spatial_join1.jpg

This project shows how to perform a Spatial Join on a point Layer based on a Polygon layer. It adds the relevant info to the point layer based on the spatial characteristics of the features of the point layer in comparison to the polygon layer.

For example, we have two layers. One is polygon layer of the countries; the other is point layer of the cities. We don’t have any attribute information about what country each city belongs to. We can perform a Spatial Join to add that info to the point layer. A Spatial Join looks at what country of the polygon layer, each city belongs to using a spatial query. Spatial Join requires handling various techniques such as creating, updating layer and spatial queries in one coherent function.

In this project, you will also see the technique of displaying a label based on more then one columns.

In this example, we show a Spatial Join based on containing rule. Other types of Spatial Joins can be performed based on proximity, or some other topological rules. Later, we will show other projects of Spatial Joins.


Split Polygon

LEAD Technologies Inc. V1.01

Map Suite offers functions such as GetLineOnLine or GetPointOnLine to work to get portion of a line for dynamic segmentation. While this is very useful, many organizations dealing with road networks may have there roads represented as polygons as opposed to lines. This project shows the technique of splitting a polygon based on lines for situation where you have the roads represented as polygons with a center line for the road.


Split Polygon Based On Grid

This utility was designed to grid high point-count polygons to aid in faster rendering. It is one of the utilities used in the Performance Guide section of the wiki and is also featured in a performance learning video.

From the Performance Guide:

One way to dramatically increase performance is to grid your polygons, thus getting them into an optimized state for rendering. What we want to do is get the average tile render time to be as low as possible. Typically, the features that take the longest time to draw are high point-count polygon layers. Imagine you are rendering a low-level tile that is essentially blank. Most places are empty space at the lowest level, containing perhaps only a small road segment or something similar. To render this, you typically use the country / region polygon to render the earth tone that is the background of your map. There may also be large polygons as well which, while not in view, will be loaded as the tile being rendered is within their spatial bounding box. In order for that simple tile to draw, it needs to read the large region polygon, which may have hundreds of thousands of points, and draw it. While most or all of the points are clipped at run-time, it still takes time to load the bytes from disk, transform to well-known binary, clip them, etc. In many examples, a simple tile can take 500 milliseconds to draw even though it is essentially blank. This makes every area on the map very heavy and inefficient.

To solve this issue, we suggest that you grid and split your polygon Shapefiles specifically for improved drawing speed. In this process we take your original high point-count polygon and split it with a grid, with a size depending on the target scale, so that much of the old polygon's area is made of very simple squares with each being composed of just the square's edges. When your simple tile goes to draw, it finds the simple square, draws that and the whole process avoids loading and drawing the tens of thousands of points. We regularly see rendering times for the layer decrease from 500ms to less than 5ms.


Split Polygon Dynamically into Grids based on the Area

This utility was designed to create a “Dynamic Grid” based on the area of the shape, for example, grids in Russia should be bigger than the grids in France. Compared with the fixed size grid in sample http://wiki.thinkgeo.com/wiki/map_suite_services_edition_all_samples#split_polygon_based_on_grid , it’s more efficient and has better drawing performance.



From the Performance Guide:

One way to dramatically increase performance is to grid your polygons, thus getting them into an optimized state for rendering. What we want to do is get the average tile render time to be as low as possible. Typically, the features that take the longest time to draw are high point-count polygon layers. Imagine you are rendering a low-level tile that is essentially blank. Most places are empty space at the lowest level, containing perhaps only a small road segment or something similar. To render this, you typically use the country / region polygon to render the earth tone that is the background of your map. There may also be large polygons as well which, while not in view, will be loaded as the tile being rendered is within their spatial bounding box. In order for that simple tile to draw, it needs to read the large region polygon, which may have hundreds of thousands of points, and draw it. While most or all of the points are clipped at run-time, it still takes time to load the bytes from disk, transform to well-known binary, clip them, etc. In many examples, a simple tile can take 500 milliseconds to draw even though it is essentially blank. This makes every area on the map very heavy and inefficient.

To solve this issue, we suggest that you grid and split your polygon Shapefiles specifically for improved drawing speed. In this process we take your original high point-count polygon and split it with a grid, with a size depending on the target scale, so that much of the old polygon's area is made of very simple squares with each being composed of just the square's edges. When your simple tile goes to draw, it finds the simple square, draws that and the whole process avoids loading and drawing the tens of thousands of points. We regularly see rendering times for the layer decrease from 500ms to less than 5ms.


Sweep Angle

map_suite_services_edition_sample_sweep_angle.jpg

For your GIS needs, you might have the need to construct a shape as a pie with a sweep angle for doing spatial analysis similar to radar. In this project, we show how to build a polygon based on a sweep angle and have it dynamically widens the angle while checking the containment of a collection of points. The key function in this project is CreatePie that has all the geometry necessary for creating such a shape.


Splitting Polygons with a Line

split.jpg

This projects demonstrates how you can split a polygon with a line. This can be useful for users in land management allowing them to split fields and parcels or any other type of polygon.


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.

ClusterPointStyle is integrated into Map Suite's core. In this project you will see how to use the ClusterPointStyle for clustering various features into one. Sometimes, the map may have too many features which are stacked on top of each other making the map illegible at higher zoom levels. Clustering is a useful technique as it allows you to group together various features into one labeled symbol with the count of all the features. This latest sample also includes recent performance enhancements to the clustering API.


Map Suite Wpf Desktop Edition Styles Samples

Filter Style

map_suite_wpf_desktop_edition_filter_style.jpg

In today's Wpf project, we show you how to apply the FilterStyle to a layer's display. By using this style, the map will filter the features queried from the source file by checking if a specified column value fits the input condition. This effect can be applied to all the Map Suite products.


Animated Gif

map_suite_wpf_desktop_edition_sample_animated_gif.jpg

In today’s project, we learn how to extend InMemoryFeatureLayer to have the ability to display animated gif for each layer in the Desktop edition. You will notice that for now, we are limited to have one animated gif per InMemoryFeatureLayer but in the future, we will show the technique to have a different animated gif for each feature of the InMemoryFeatureLayer.


Default ValueStyle

map_suite_wpf_edition_sample_default_valuestyle.jpg

In today’s Wpf project, we demonstrate the extensibility of ThinkGeo API by creating a custom Style. Inheriting from ValueStyle, we create a Default Value Style that handles the drawing of features that don’t have a value defined in the ValueStyle. Here we are using a point based layer with PointStyle. Note that the Default ValueStyle would also work with line and polygon based layers.


Distance Line Style

map_suite_wpf_desktop_edition_sample_distance_line_style.jpg

This Web project shows how to create a new style class CustomDistanceLineStyle inheriting from LineStyle class. You can pay attention to how the DrawCore function is override for a very specific need of style: displaying the distance label on each line segment making up a LineShape. In addition to the overriding of the DrawCore function, you will find useful some geometry functions such as GetPointOnLine to find the midpoint of a line segment and GetAngleFromTwoVertices to incline correctly the labels according to the orientation of each line segment. You will notice that the CustomDistanceLineStyle works for features made of LineShape and you will have to slightly modify to have it working with MultilineShape.


EditOverlay Styles

map_suite_wpf_desktop_edition_sample_editoverlay_styles.jpg

In today’s Web project, we learn how to control the styles of the EditOverlay for both the default style and the editing style. In order to accomplish this, we write some javascript code. Look at the code in the “script” tag to see how we can control the fill color, the opacity, the border width etc of the features in the EditOverlay.


Line Style With Increment

map_suite_desktop_edition_sample_line_style_with_increment.jpg

In today’s winforms desktop project, we expend on the functions of DistanceLineStyle shown on a previous sample, “Distance Line Style”. Here we show how to create a custom LineStyle for showing distance increment at a regular interval (every tenth kilometers). Having this LineStyle can be very handy when dealing with line network such as roads or railways.


Multiple Dot Density Styles

map_suite_wpf_desktop_edition_sample_multiple_dot_density_styles.jpg

In this sample, we are looking in a little more detail at the DotDensityStyle. You can combine different DotDensityStyles on one FeatureLayer using different columns. Demographic data are usually well fit to be used with that type of style. Here each dot of a certain color represents 100,000 persons of the same age group by state. Using multiple DotDensityStyles, the dimension of age group demographics is added to the representation of population density. Note that the PointToValueRatio is used to set how many people a dot is going to represent. For example, if you want a dot to represent 100,000 persons, you set it to 0.00001 (1 / 100000). If you want it to be 500,000 persons, you set it to 0.000002 (1 / 500000).


MultiLine Labeling

map_suite_wpf_desktop_sample_multiline_labeling.jpg

For labeling purpose, TextStyle has a property called LabelAllPolygonParts that will label all the parts making up a polygon based feature. Unfortunately, we don’t have an equivalent API for labeling all the parts of a line based feature. But thanks to the flexible framework of Map Suite, we show in this Wpf sample how easily you can expand the TextStyle class to allow this labeling capability. Look at the custom class MultiLinetextStyle and how DrawCore function is overridden to have the expected labeling behavior.


Projection Distance LineStyle

map_suite_wpf_desktop_edition_sample_projection_distance_linestyle.jpg

This Web project is similar to the project “Distance Line Style”. Here we show how to use a projection of choice different from the projection used on the map. For example, you may have your map using Google map as a background. Google map uses Spherical Mercator projection which is not ideal for distance measurements, that is why using a more appropriate projection for distance measurement such as State Plane will give more accurate results. The CustomDistanceLineStyle inheriting from LIneStyle has the logic built in to have the distance calculated based on a projection of choice instead of the projection of the map.

As for the previous project “Distance Line Style”, you can see how the DrawCore function is overridden for the a specific need of style: displaying the distance label on each line segment making up a LineShape. In addition to the overriding of the DrawCore function, you will find useful some geometry functions such as GetPointOnLine to find the midpoint of a line segment and GetAngleFromTwoVertices to incline correctly the labels according to the orientation of each line segment. You will notice that the CustomDistanceLineStyle works for features made of LineShape and you will have to slightly modify to have it working with MultilineShape.


Side View Icon

map_suite_wpf_desktop_edition_sample_side_view_icon.jpg

This project is a little bit similar to the previous one Rotate Icon. It shows how to display correctly side view icons of moving vehicles. With top down view icons of vehicle, you simply rotate the icon according to the direction of the vehicle. But with side view icons of vehicle, it is a little bit trickier and you have to use a pair of icons. This project shows how to handle that and also how to calculate the direction of a vehicle based on the current GPS reading and the last one.


Smooth Transparent Route

map_suite_wpf_desktop_edition_sample_smooth_transparent_route.jpg

In the Routing extension, the API GetRoute of the RoutingEngine returns a MultilineShape made of a collection of LineShape. By default, the MultilineShape has LineShapes for each two vertex line segment. The result in the displaying of the route using some transparency is a route that looks dotted and irregular. In this project, we show the trick to get one continuous LineShape which will show as smooth and regular. We recognized that the default result is not the most adequate in most cases and we will correct that for the next major release of the Routing extension. In the meantime, you can use that project to get the result that you want to display your routes.


Weather Line Style

map_suite_wpf_desktop_edition_sample_weather_line_style.jpg

In this Wpf sample, we learn how to extend LineStyle class to create a style for representing weather fronts such as cold front, warm front and occluded front for your weather maps. To achieve that styling a regular LineStyle is used for the front line itself. For symbolizing the type of front an icon is used. Notice the two handy properties to give you more control: Spacing property to adjust the distance in screen coordinate between each symbol on the line and Side property to control on what side of the line front the symbols should appear. Of course, as you zoom in and out on the map the spacing between each symbol remain the same as it is set in screen coordinate.


Weather Line Style

map_suite_wpf_desktop_edition_sample_weather_line_style.jpg

In this Wpf sample, we learn how to extend LineStyle class to create a style for representing weather fronts such as cold front, warm front and occluded front for your weather maps. To achieve that styling a regular LineStyle is used for the front line itself. For symbolizing the type of front an icon is used. Notice the two handy properties to give you more control: Spacing property to adjust the distance in screen coordinate between each symbol on the line and Side property to control on what side of the line front the symbols should appear. Of course, as you zoom in and out on the map the spacing between each symbol remain the same as it is set in screen coordinate.


Adjusted Scaling Image Style

map_suite_services_edition_sample_adjusted_scaling_image_style.jpg

The purpose of this project is to address some of the limitations of the ScalingImageStyle that we saw in the project of the same name. As with ScalingImageStyle, with AdjustedScalingImageStyle, you have the icon scaling up and down according to the zoom level; but you can also have the icon pointing correctly to the point feature it represents if for example you are using a pin as an icon. Also, the problem of the height of the image not sizing proportionally to its width has been corrected.


Cached Value Style

no_screenshot.jpg

The MapSuite API provides a Value Style as you can see in the sample app “Draw features based on value”. This is a great way to display feature features based on some value of a column. With this style and any other styles offered by the MapSuite API, each time the map has to redraw the value for each feature within the current extent has to be fetched. This can affect the performance especially if a large number of features are used. With CachedValueStyle, the value for each feature is cached into memory to reduce the overhead of having to go and fetch the value for each feature each time the map has to draw. Using this CachedValueStyle has a benefit on performance but you need to pay attention on memory usage.


ClusterPointStyle

map_suite_services_edition_sample_cluster_point_style.jpg

In this project, you will see how to use a custom style, ClusterPointStyle for clustering various features into one. Sometimes, the map may have many features stacked on top of each other at high zoom levels making the map too busy and difficult to read. Clustering is a usefull technique in those situation making the map more readable. It groups together various features into one symbol with the count of all the features being labeled.

There are many ways for finding the location of the cluster point. One of the simplest is to use the center of gravity of all the clustered features as used in this project.

In this project, we are using volcanoes because natural phenomenon are usually good candidates for being clustered.


Decimal Degrees Formatting

LEAD Technologies Inc. V1.01

The purpose of this project is to complete the static class DecimalDegreesHelper. This class offers functions to go to and from Decimal Degrees but it lacks the functions handling various formats such as Degrees Decimal Minutes and Degrees Minutes Decimal Seconds. Those formats can be output by different GPS devices and it is handy to know how to manipulate them and convert them to Decimal Degrees, the only format that can be input into a GIS or Mapping application.


Displaying One-Way Streets

LEAD Technologies Inc. V1.01

In the Discussion Forum Post “Drawing one-way streets in the map”, we have a question on how to display an arrow on a street that is one way as Google Map does. In this project, we show the solution by creating a LineStyle specifically for that purpose. We take the shapefile “AustinWithOneWayRoad.shp” from the sample app “Route On One-Way Roads” of Map Suite Routing Extension to display the arrow according to the traffic direction on the one-way streets


Doughnut Point Style

map_suite_services_edition_sample_doughnut_point_style.jpg

This project shows how to create a doughnut point style as this style is not offered by the MapSuite API. DonutPointStyle inherits from PointStyle and you will notice that in the overridden method DrawCore, no reference to any GDI + API is used. That means that this style is drawing system independent.


Feature Centric Style

map_suite_services_edition_sample_feature_centric_style.jpg

This project got inspired for looking at the sample “ClassBreakStyle” of How Do I demo apps. Using a ClassBreakStyle, the data is displayed based on what class each feature belongs to. Using a custom FeatureCentricStyle, each feature is displayed in relation to a central feature. In this example, it shows all the countries that have a comparable population to a reference country.

To do that, we use a custom style FeatureCentricAreaStyle inheriting from AreaStyle and we override DrawCore and GetRequiredColumnNamesCore methods. The code in DrawCore loops thru all the features and checks if the value for a specified column is within a certain range of the central feature.

You can see how you could apply and extent the logic of this custom style to be used in Real Estate for example, where you could see all the properties that are comparable according to some criteria to a selected property.


Flashing Point Style

map_suite_services_edition_sample_flashing_point_style.jpg

In this project, we explore how to create a point style that flashes. Here we take the example of a vehicle moving around based on GPS location and flashes when entering prohibited zones. I think that this project will inspire people working on building a vehicle tracking application. This project is a general solution for a Servicess edition. Notice that we are using two MapEngines with one only for drawing the flashing vehicle to avoid redrawing the other layers at each flashing.

Later, we will publish projects specifically adapted for the Desktop and Web editions.


Hybrid TextStyle

map_suite_services_edition_sample_hybrid_textstyle.jpg

This project is a follow up to the Discussion Forum post here
Rotating the feature text (similar to wordwrap).

In this project, we create a new Text Style combining word wrapping that we saw in the project http://code.thinkgeo.com/projects/show/wordwrapped and text rotation. You can see the labels word wrapping and rotating in harmony with the resizing and rotating of the shapes.


Image Style

As you probably already know, using the Map Suite API, you can easily display a point-based feature as an image. But how do you do the same thing for a line or a polygon-based feature? In this WPF project, we show you how to create custom Image Styles for both line and polygon features. With the new ImageAreaStyle, you can display a polygon feature that uses an image as its fill. You can see how an image for forest and water is used in the sample project. And with the new ImageLineStyle, you can do the same thing with line features. You'll see how an image of a pavement texture is used to represent streets.


Isolines

map_suite_services_edition_sample_isolines.jpg

In this sample we show how you can use Map Suite to add isolines (commonly known as contour lines) to your .NET application. Isolines are a way to visualize breaks between different groups of data such as elevation levels, soil properties, or just about anything else you can imagine. This sample also shows the various steps in creating isolines, including the gathering of point data, creating a grid using interpolation, and finally, picking your isoline break levels. We also quickly dive into some more advanced options such as generating isolines on the fly.

To bring this all together, check out our instructional video that will walk you through the process of setting up and working with isolines in Map Suite.

Please note that you will need version 5.0.87.0 or newer of Map Suite in order to use isolines. For more information on how to upgrade, see the Map Suite Daily Builds Guide.


Rotate Icon

map_suite_services_edition_sample_rotate_icon.jpg

In the “How Do I” windows apps, there is sample “Efficiently Move A Plane Image” that shows a plane moving across the map from west to east along the Great Circle path. A flaw in this sample is that the plane is always shown flying in one direction regardless of the curve of the path.

In today’s project, we learn to correct that by setting an angle to the image. The key function is GetAngleFromTwoVertices. You can take this function is apply it to your vehicle tracking needs. It can be used to display any moving vehicle with the orientation according to the heading direction.


Routing Styles

map_suite_services_edition_sample_routing_styles.jpg

The API for the Routing extension product provides a class RoutingLayer. RoutingLayer is basically a convenient layer to have the features for routing being displayed in a default way. You can add the start, end point, the routes and it is going to display that nicely for you without much work on your side. While this is convenient, you may be in the situation when you want more control on the styles and have the whole flexibility that an InMemoryFeatureLayer gives you. In this project, we show how to display in InMemoryFeaturesLayers the start and end points, as well as the resulting route using the full power of InMemoryFeatureLayer such as zoom levels and custom styles.


Scaling Image Style

map_suite_services_edition_sample_scaling_image_style.jpg

This project presents a useful case where you want to have the icon representing a feature to be sized in proportion to the current scale. It is little bit similar to what we show in the project SizedPointStyle exept that the size of the symbol is based on the scale, not on some values specific to each feature. That explains why in the class ScalingImageStyle, the method GetRequiredColumnNames is not overriden. The whole drawing logic can be contained in DrawCore.


Scaling TextStyle

map_suite_services_edition_sample_scaling_textstyle.jpg

This project shows how to create a Style inheriting from TextStyle to have the label sizing according to the scale. You will see that the logic of scaling is basically the same as the on in the previous project “ScalingImageStyle” but applied to TextStyle.


Scaling TextStyle for Polygon

map_suite_services_edition_sample_scaling_textstyle_for_polygon.jpg

In the project “Scaling TextStyle”, we learned how to create a custom TextStyle to have the font size proportional to the scale while zooming in and out the map when labeling point based features. In the project “Scaling Image Style”, we learned basically the same thing but applied to an icon or an image. In today's project, we also learn how to create a scaling textStyle but for polygon features. Notice in the overridden DrawCore function how we calculate the font size based on the current and how we make sure no label overlapping exists by using the function CheckOverlapping of the base class before drawing the label for each part of the polygon.


Sized Point Style

map_suite_services_edition_sample_sized_point_style.jpg

Creating a Custom Style is a great way to encapsulate custom logic draw symbol based on some values. This project shows that using the concrete example world capitals. In this example, we draw capitals as circles with the size proportional to the population. We create the class SizedBasedPointStyle inheriting from PointStyle. We override the method DrawCore for the drawing logic. We also override the method GetRequiredColumnNamesCore to make sure we have the column for Population that will be used in DrawCore method to calculate the correct size of the circle for each feature.


Start End LineStyle

map_suite_services_edition_sample_start_end_line_style.jpg

Today, we are looking at how to extent LineStyle to have a style for lines that shows the start and end points. This is useful to display line features with that custom LineStyle if you are mindful of the order it was digitized and you want to know the direction of the lines. This project is similar to previous ones where LineStyle is extended such as “One Way Streets” and “Distance Line Style”.


TextStyle for Multi Line

map_suite_services_edition_sample_textstyle_for_multiline.jpg

If you are labeling features based on MulilineShapes, using the default TextStyle, only one line of the collection of lines making up the MultilineShape is going to be label. In today’s project, we show how to create a new class inheriting from TextStyle that will label all the lines of the MultilineShapes. That behavior is similar to the property LabelAllPolygonParts of DefaultTextStyle for polygons.


Time Based Point Style

map_suite_services_edition_sample_time_based_pointstyle.jpg

This project shows how to create a custom style to display info based on some live data. Here we display world capital with a symbol for day or for night according to the local time. The method GetRequiredColumnNamesCore is overridden to make sure the column for the time zone is used. The method DrawCore is also overridden. It contains the logic to determine if a feature is within day time or night time according to the time zone column and the system time on the machine.


Time Line

map_suite_services_edition_sample_time_line.jpg

In this project, we learn another way to inherit from Style creating the class DateBasedStyle to display features according to some time values. Using a Time Line based on a track bar, the user can scroll back and forth on the time line to see what states were parts of the Union at any year.

Also, notice that this project used three instances of the MapEngine to have the states of Alaska and Hawaii displayed on a different PictureBox.


ValueStyle with Countries

map_suite_services_edition_sample_valuestyle_with_countries.jpg

In today’s project, we revisit the ValueStyle class that is introduced in the “How Do I” sample app “Draw Features Based on Values”. In that sample app we show how to use the ValueStyle on a point based layer to display cities according to their population rank. In today’s Code Community project, we apply the ValueStyle to the polygon based countries layer (supplied with the sample apps). The countries layer has a column named “Color_map” with values from 1 to 8. Each number is assigned a color; that way the countries are displayed with 8 various colors on the map helping to distinguish them easily.

Also, in this project, we pay attention to some advisable cosmetic practices for using light or pastel colors. As a general rule, it is recommendable to use lighter colors for displaying general background features such as countries rather than brighter ones to have a more pleasing visual experience for the map users.


WordWrapped TextStyle

map_suite_services_edition_sample_wordwrapped_textstyle.jpg

In the Discussion Forum post “Display word-wrapped text”, there is a discussion on how to implement a TextStyle doing word wrapping. In this project, you will actually find a working implementation. Notice that by using the class WordWrappingTextStyle, word-wrapping is applied according the proportion of the size of the text to the size of the bounding box of the feature to label. This means that the label can be word-wrapped or not depending on the zoom level.

You can find the discussion forum post on that topic at:
http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/6421/afv/topic/Default.aspx


World Sized Image Style

map_suite_services_edition_sample_world_sized_image_style.jpg

At the request of a client, today we have a project showing how to have an ImageStyle of real world dimension. A good example to show that is to use an image representing a cruise ship. Knowing that the ship is of 300 meters of length and 90 meters of width, we can use an image representing a ship and set those dimension to it. It will be drawn on the map always at those dimensions regardless of the zoom level. The logic used for this is very similar to what we saw in the project World Sized TextStyle but applied to images.


World Sized Text Style

map_suite_services_edition_sample_world_sized_textstyle.jpg

In our Discussion Forum, we have a user asking for how to label text at world coordinates. For example, how to display a label at a size of 50 kilometers? Now, you can find in this project a custom TextStyle called WorldSizedTextStyle that does that. Whether your map is in Meters, Feet or Decimal Degrees, you can have the labels displayed at the desired size in any real world distance unit such as kilometers, meters, miles, feet etc.


Label Point with Circle Symbol and Mask Description

In this WPF project we show how you can create a friends network using a point with a circle symbol. It’s a combination of PointStyle and TextStyle, including a description with a mask that keeps the labels in the same layer. It was originally required by a customer at http://community.thinkgeo.com/t/label-on-a-circle-with-lot-of-points/8193/6, it’s a solution with many applications.


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.

map_suite_wpf_desktop_edition_sample_bread_crumb_trail.jpg

An early project of the Code Community, “Vehicle Direction”, showed how to rotate the icon of a moving vehicle based on the direction. In today’s project, we are going one step further and we are showing how to display dynamically a bread crumb trail as a trailing tail behind the moving vehicle. For this purpose, we are creating a new LineShape with the latest points at every new position.


Centering And Rotating WPF

map_suite_wpf_desktop_edition_sample_centeringandrotatingwpf.jpg

This project is the Wpf version of the services edition sample “Centering and Rotating On Moving Feature”, where we learn how to have the map always centered and rotated based on the location and direction of a moving vehicle. This issues addresses some issues you have to be aware of regarding both ShapeFileFeatureLayer and InMemoryFeatureLayer when applying rotation to the map.


Centering Map with Tolerance

map_suite_wpf_desktop_edition_sample_centering_map_with_tolerance.jpg

In the previous project, we showed how to center the map on a moving vehicle. While this is great, it has the disadvantage of having to refresh the map each time the vehicle changes position. In this project, we respond to this inconvenience by using a set tolerance used for determining if the map needs to be refreshed or not. If the vehicle moves within a rectangle of a certain size located in the center of the current extent of the map, the map will not refresh and only the moving vehicle will. If it moves outside the tolerance area, the entire map will be refreshed and the tolerance recalculated.


Detect GPS

map_suite_wpf_desktop_edition_sample_detect_gps.jpg

Upon request of our users, today we publish a project that is the Desktop version of “Detect GPS” for Web. Notice how we use ValueStyle and change the column value of the feature based on the Spatial Query feature at each new position. We chose this structure so that you can have more flexibility for adding more than one moving vehicle features to the InMemoryFeatureLayer. For that, you can pretty much keep the same code and just add an outer loop for looping thru all the moving features.


Moving Vehicle with Label

As many of the Map Suite developers build applications with the common task of tracking vehicles, in today’s project we show how to update the label of a moving vehicle. The InMemoryFeatureLayer has all the tools necessary to display and label dynamically with editing a moving feature. In today’s project we show in a label the changing Longitude and Latitude each time the vehicle position is updated.


Traveling Salesman Problem

map_suite_wpf_desktop_edition_sample_traveling_salesman_problem.jpg

In today’s project, we are seeing a variant of the sample “Traveling Salesman Problem” of the “How Do I” samples of the Routing product. At the request of a Discussion Forum user, we added a new API to the GetRouteViaVisitStops function where now you can have distinct start and end points. For being able to run this app, you will need the version 3.1.427.0 or later.


Vehicle Direction

map_suite_wpf_desktop_edition_sample_vehicle_direction.jpg

This project is similar to RotatedImageStyle project, but shows in more detail how to use RotatedImageStyle with the Desktop edition. You will see the technique on how to use the Desktop specific OverLays collection to update each Layer. This project forms a good foundation for displaying moving vehicles on a Desktop application.


Centering and Rotating

map_suite_services_edition_sample_centering_and_rotating.jpg

In the project “Centering On Moving Vehicle”, we learned how to have the map always centered on a moving vehicle. In this project, we go one step further and show how to have the map also rotating according to the direction of the moving vehicle. In this project, you will also see how to use the CompassAdornmentLayer that always indicates the north as the map rotates.


Centering On Moving Vehicle

map_suite_services_edition_sample_centering_on_moving_vehicle.jpg

A commonly requested feature when tracking a vehicle for GPS application is to have the map centered on a vehicle as it moves. Implementing this is fairly easy with Map suite using the CenterAt API. In this project, you will see this feature in action with a vehicle represented by a vehicle icon being always the center of the extent of the map. You can also take advantage of this project to learn some other techniques related to GPS such as reading GPS data from a text file and applying a rotation angle to show the direction.


Chemical Plume

map_suite_services_edition_sample_chemical_plume.jpg

In this project, we show how simple it is to display and do spatial analysis with chemical plumes.
The US department of transportation sets standards for protection and isolation zones according to the type of chemical involved. You can find all that publicly available information at http://www.phmsa.dot.gov/

With Map Suite, you can easily build those zones, display them and do spatial analysis.
You will notice an interesting feature of this project is that it combines WorldMapKit wms for street map background display and the actual vector street data for analysis.
For this project, you will need the very latest evaluation or full edition of MapSuiteCore.dll and WorldMapKit Wms.dll for displaying the background street map.


Filter Radar Image

map_suite_services_edition_sample_filter_radar_image.jpg

NOAA (National Oceanic and Atmospheric Administration) makes available for the public Radar images http://radar.weather.gov/ridge/Conus/RadarImg/
Those images show the precipitation activities based on the whole range of dBz scale. (see http://en.wikipedia.org/wiki/DBZ_%28meteorology%29)

You might want to keep only dBz scales superior to 20 which correspond to actual rain. You might also want to add some transparency to better show the layers below the radar image.

This project shows how to filter the image for that purpose. You will see how to create a new filtered image better fit to be displayed on the map. You will find particularly interesting the power of using directly the GDI+ API which is very handy with dealing with a Map Suite GDIPlusRasterLayer.


Rotated Image Style

map_suite_services_edition_sample_rotated_image_style.jpg

This project shows how to use an icon to rotate it according to the direction of some GPS readings. An InMemoryFeatureLayer is used with various Features representing vehicles. For representing the symbol a Custom Style is created inheriting from Style. Notice that the Custom Style overrides the methods DrawCore and GetColumnNamesCore. You will also see how to update the X and Y value of the PointShape making up each feature. This project is based on the Servicess edition, I recommend also to look at the project Vehicle Direction which is a Desktop App. The difference is in the use of the Layers and the drawing techniques to update the position and symbol of the features.


Snap GPS to Street

map_suite_services_edition_sample_snap_gps_to_street.jpg

In this sample we are going to handle the common case of snapping a point to a set of features in a layer. The common case for this is snapping real-time GPS points to road layers. GPS has an error factor and it's nice to display vehicles on a map snapped to the roads they are on. It can also be used for a number of other different cases as well, such as finding not just the road position but the road name. You may display or store the road name for the trip in your database.

In the sample we have set up a road layer; when you click on the map it will find the closest road segment within a tolerance and snap the point to that road. You can click repeatedly around a road and simulate GPS points coming in. Inside of the sample, we have encapsulated the functionality into a method that can easily support multiple layers, varying tolerances, and different data units.


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.

Center Map Based On Lat/Long

map_suite_wpf_desktop_edition_sample_center_map_based_on_latlong.jpg

In today’s web project, we show how to have the map centered and zoomed in according to some maximum and minimum longitude and latitude values. Doing this on a map using decimal degrees is a pretty straightforward operation but if you want to do this on a map displaying Google Map or other providers such as Virtual Earth, it requires some handling of projection. In this project, we show a concrete case, where Google Map is set to an extent corresponding to Florida according to the maximum and minimum longitude and latitude values.


Centering Map with Tolerance

map_suite_wpf_desktop_edition_sample_centering_map_with_tolerance.jpg

In the previous project, we showed how to center the map on a moving vehicle. While this is great, it has the disadvantage of having to refresh the map each time the vehicle changes position. In this project, we respond to this inconvenience by using a set tolerance used for determining if the map needs to be refreshed or not. If the vehicle moves within a rectangle of a certain size located in the center of the current extent of the map, the map will not refresh and only the moving vehicle will. If it moves outside the tolerance area, the entire map will be refreshed and the tolerance recalculated.


GetZoomLevel

map_suite_wpf_desktop_edition_sample_get_zoomlevel.jpg

In today’s project, we are going to show how to get the zoom level of the map each time we change its extent. Using custom zoom levels, you will see how to get the zoom level with its characteristics such as the upper and lower scale defining it. You can read the comments inside the project to better understand the relationship of scales with zoom levels.


Map Scales

map_suite_wpf_desktop_edition_sample_map_scales.jpg

With Map Suite, you can both set and get the scale of your map. In this project, we show some tricks on how to manipulate a scroll bar that allows setting the map at a scale from 1:1,000 to 1:40,000,000. We also show how to use a text box to set the map to the exact desired scale.

This project is also an opportunity to review the very basic concept of scale in GIS. The easiest way to think about scale is to think about a ratio between what you see on the screen and the real world. So, if the scale is 1: 10,000 it basically means that one centimeter (you can use any unit) on the screen represents 10,000 centimeters (or 100 meters) in the real world. Of course, there are some intricacies related to calculating the scale for a map according to the projection etc. But, if you think in that very simple way, you will have at least an idea what the scale represents for your maps.


Raster Layer with extent

picture_map_suite_samples_raster_layer_with_extent.jpg

The purpose of this project is to show the alternate way to load a regular image layer such as tiff if you don’t have a world file but know the extent of the image in world coordinate. To accomplish that, you can use a RectangleShape. In this project, you will also find more info on the world file and what the different parameters mean.


Multiple Jpeg2000 Raster Layer

This sample shows how to create a customized raster layer for loading multiple files. In this project, we create the MultipleJpeg2000RasterLayer to inherit from Layer to load multiple .jp2 files. You can use the world files or a RectangleShape which is the extent of the image in world coordinate.


Restricting Extent

map_suite_desktop_edtion_sample_restricting_extent.jpg

In this sample, we show some technique for restricting the users from navigating the map beyond a certain area of the map. For this type of behavior of the map, two types of restricted extents are combined, one for panning and another larger one for zooming out. You want to handle two restricted extents to allow the users to pan and still zoom out within the restricted area. Notice that all the logic for restricting zooming out or panning is handled in the CurrentExtentChanging event.


Map Rotation and Multi Touch(WPF)

This sample shows how to take the advantage of a touchable screen, to play with the map using fingers. You would see we can pan the map with one finger, zoom in/out or rotate a map using 2 fingers. Not only that, we can add a marker, and track/edit a shape (point, line or polygons) by tapping on the screen. And marker/popup/label won't rotate with the map. It is straightforward to use and checking out the code, you would see it is very simple to implement with Map Suite! It is available in 8.0.48.0 or later.


Zoom In To Feature

map_suite_wpf_desktop_edition_sample_zoom_in_to_feature.jpg

This sample is similar to the sample “Find The Feature The User Clicked On” of the How Do I apps of the Web Edition. Here instead of showing information of the selected feature, we have the feature highlighted and the extent of the map set to the bounding box of that feature. Just click on a country and the map will zoom in to it.


Zoom In To Point

map_suite_wpf_desktop_edition_sample_zoom_in_to_point.jpg

This project is for DesktopEdition users. As for the project TrackZoomInWithoutShiftKey, we show how to create a new class from InteractiveOverlay. InteractiveOverlay is a powerful way to interact with the map but it currently lacks documentation. While this project does not substitute a good documentation, it shows some techniques for using that class. You can take a look at the overriding method MouseDownCore to see how in a few lines of code, you can allow the users to have the map zoomed in and centered to the location the map was clicked on.

In the next major public release of Desktop Map Suite, we will present a more complete documentation on InteractiveOverlay.


Zoom Levels Partitioning

no_screenshot.jpg

Map Suite API conveniently offers 20 predefined zoom levels to set the different styles. With those 20 predefined zoom levels, at any change of extent, the map will snap to the nearest zoom level. While this is appropriate in most cases, you may want a more granular control on the zoom levels. This project shows how to set intermediate zoom levels between the existing predefined ones for more granularity. Since the zoom levels are based on scales, you can still use the predefined zoom levels to set the styles and have the additional custom zoom levels for more refined control on zoom level snapping. In this project, we have the WorldMapKit WMS as a layer and a regular point based shapefile. You can see how the intermediate custom zoom levels have the effect of stretching the WMS image to better fit.

This is a Desktop project and you will need the full or evaluation references to MapSuiteCore.dll, DesktopEdition.dll and WorldMapKitWms.dll.


Zoom to Full Extent (WPF)

map_suite_wpf_desktop_edtion_sample_zoom_to_fullextent_wpf.jpg

Today we have the first project in the Map Suite WPF Desktop version. This is a simple project that shows how to set the current extent based on a collection of layers. You can use this technique for the common task of having the map set to the full extent. Instead of having to manually set the full extent, you can pass all the layers you want the full extent to be based on.

This project will be followed by many other WPF projects due to the increasing popularity of that Map Suite version.


Centering and Rotating

map_suite_services_edition_sample_centering_and_rotating.jpg

In the project “Centering On Moving Vehicle”, we learned how to have the map always centered on a moving vehicle. In this project, we go one step further and show how to have the map also rotating according to the direction of the moving vehicle. In this project, you will also see how to use the CompassAdornmentLayer that always indicates the north as the map rotates.


Custom Zoom Levels

no_screenshot.jpg

In the project, “Zoom Levels Partitioning”, we showed how to partition the existing predefined zoom levels to have a finer level of control on how to display layers based on scale. In today’s project, we show how to set your own ten zoom levels based on a reference scale, each zoom level being half in scale of the previous one. So, in this case, we limit the number of zoom levels to ten instead of the twenty predefined ones.


Zoom to Full extent

map_suite_services_edition_sample_zoom_to_fullextent_service.jpg

This project shows you how to set the current extent based on a collection of layers. You can use this technique for the common task of having the map set to the full extent. Instead of having to manually set the full extent, now you can pass all the layers you want the full extent to be based on.

Map Suite License File Generator

The Map Suite License File Generator shows how to take the advantage of MapSuiteLicense.dll to create the Map Suite Production Server license in your application on the fly. When you activate a Map Suite Production Server license that you have purchased, that license is verified with ThinkGeo’s online servers as part of the activation process. The simple process ensures that you are activating a license that you are entitled to. ThinkGeo takes care of all the particulars, and the process is seamless if you have an internet connection.

NOTE: please ask support@thinkgeo.com for MapSuiteLicense.dll

map_suite_wpf_desktop_edition_all_samples.txt · Last modified: 2017/03/17 02:13 by tgwikiupdate