Have questions? Call us toll-free at 1-866-847-7510 (outside North America, call 1-785-727-4133)

Map Suite Wpf Desktop Edition Vehicle Tracking Samples

From ThinkGeo Wiki

Jump to: navigation, search

Contents

Bread Crumb Trail

Screenshot Sample Product Description
Map Suite Wpf Desktop Edition Sample Bread Crumb Trail.jpg C# Download

Need it in another language?
Desktop

Applies To: Desktop
Web
Silverlight
Services
Wpf
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

Screenshot Sample Product Description
Map Suite Wpf Desktop Edition Sample Centering and Rotating.jpg C# Download

Need it in another language?
Services

Applies To: Desktop
Web
Silverlight
Services
Wpf
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 And Rotating WPF

Screenshot Sample Product Description
Map Suite Wpf Desktop Edition Sample CenteringAndRotatingWPF.jpg C# Download

Need it in another language?
Wpf

Applies To: Desktop
Web
Silverlight
Wpf
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

Screenshot Sample Product Description
Map Suite Wpf Desktop Edition Sample Centering Map with Tolerance.jpg C# Download

Need it in another language?
Desktop

Applies To: Desktop
Web
Silverlight
Services
Wpf
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.

Centering On Moving Vehicle

Screenshot Sample Product Description
Map Suite Wpf Desktop Edition Sample Centering On Moving Vehicle.jpg C# Download

Need it in another language?
Services

Applies To: Desktop
Web
Silverlight
Services
Wpf
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

Screenshot Sample Product Description
Map Suite Wpf Desktop Edition Sample Chemical Plume.jpg C# Download

Need it in another language?
Services

Applies To: Desktop
Web
Silverlight
Services
Wpf
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.

Detect GPS

Screenshot Sample Product Description
Map Suite Wpf Desktop Edition Sample Detect GPS.jpg C# Download

Need it in another language?
Desktop

Applies To: Desktop
Web
Silverlight
Services
Wpf
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.

Filter Radar Image

Screenshot Sample Product Description
Map Suite Wpf Desktop Edition Sample Filter Radar Image.JPG C# Download

Need it in another language?
Services

Applies To: Desktop
Web
Silverlight
Services
Wpf
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.

Moving Vehicle with Label

Screenshot Sample Product Description
Map Suite Wpf Desktop Edition Sample Moving Vehicle with Label.png C# Download

Need it in another language?
Desktop

Applies To: Desktop
Web
Silverlight
Services
Wpf
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.

Rotated Image Style

Screenshot Sample Product Description
Map Suite Wpf Desktop Edition Sample Rotated Image Style.JPG C# Download

Need it in another language?
Services

Applies To: Desktop
Web
Silverlight
Services
Wpf
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

Screenshot Sample Product Description
Map Suite Wpf Desktop Edition Sample Snap GPS to Street.jpg C# Download

Need it in another language?
Services

Applies To: Desktop
Web
Silverlight
Services
Wpf
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.

Traveling Salesman Problem

Screenshot Sample Product Description
Map Suite Wpf Desktop Edition Sample Traveling Salesman Problem.jpg C# Download

Need it in another language?
Desktop

Applies To: Desktop
Web
Silverlight
Services
Wpf
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

Screenshot Sample Product Description
Map Suite Wpf Desktop Edition Sample Vehicle Direction.JPG C# Download

Need it in another language?
Desktop

Applies To: Desktop
Web
Silverlight
Services
Wpf
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.
Personal tools
Namespaces
Variants
Actions
Products
Data
Add Ons
Navigation
Toolbox
Learn More About Map Suite, Download a Free Trial, or Buy Now

GIS Developer Components for .NET
Map Suite Extensions & Add-Ons
Map Data Sets & Icons

Try Map Suite Free

Map Suite Online Store
sales@thinkgeo.com
1-866-847-7510 (Toll-Free)
1-785-727-4133 (Outside North America)

ThinkGeo LLC
2801 Network Blvd. Suite 215
Frisco, TX 75034
Map Suite Support Center