====== Map Suite Silverlight Edition Vehicle Tracking Samples ======
==== Bread Crumb Trail ====
{{silverlightedition:codesamples:Map Suite Silverlight Edition Sample Bread Crumb Trail.jpg?300x180}}
[[Source_Code_DesktopEditionSample_BreadCrumbTrail_CS_100428.zip|View Source]] {{filehistory:DesktopEditionSample_BreadCrumbTrail_CS_100428.zip|C# Download}}
[[Map Suite Samples Applies To|Applies To: Desktop \ Web \ Silverlight \ Services \ Wpf ]] \\ [[Map Suite Samples Alternate Languages | Need it in another language?]]
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.
----
==== Callback for Fleet Tracker ====
{{silverlightedition:codesamples:Map Suite Silverlight Edition Sample Callback for Fleet Tracker.png?300x180}}
[[Source_Code_WebEditionSample_CallbackForFleetTracker_CS.zip|View Source]] {{filehistory:WebEditionSample_CallbackForFleetTracker_CS_141211.zip|C# Download}}
[[Map Suite Samples Applies To|Applies To: Web \ Silverlight ]] \\ [[Map Suite Samples Alternate Languages | Need it in another language?]]
In this web-based project, we use Callback technology to create a simple vehicle tracking application and show how to interact between the client side and server side. Almost all of the functionality is implemented by using client-side JavaScript. Therefore we don't need to post back to the server side every time, and the server side doesn't need to send the entire page to the client side. You can see how Callback technology minimizes the need to transfer data over the Internet, which enhances the user experience.
----
==== Centering And Rotating WPF ====
{{silverlightedition:codesamples:Map Suite Wpf Desktop Edition Sample CenteringAndRotatingWPF.jpg?300x180}}
[[Source_Code_WpfDesktopEditionSample CenteringAndRotatingWPF CS 110504.zip|View Source]] {{filehistory:WpfDesktopEditionSample CenteringAndRotatingWPF CS 110504.zip|C# Download}}
[[Map Suite Samples Applies To|Applies To: Desktop \ Web \ Silverlight \ Wpf ]] \\ [[Map Suite Samples Alternate Languages | Need it in another language?]]
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 ====
{{silverlightedition:codesamples:Map Suite Silverlight Edition Sample Centering Map with Tolerance.jpg?300x180}}
[[Source_Code_DesktopEditionSample_CenteringMapWithTolerance_CS_100114.zip|View Source]] {{filehistory:DesktopEditionSample_CenteringMapWithTolerance_CS_100114.zip|C# Download}}
[[Map Suite Samples Applies To|Applies To: Desktop \ Web \ Silverlight \ Services \ Wpf ]] \\ [[Map Suite Samples Alternate Languages | Need it in another language?]]
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 ====
{{silverlightedition:codesamples:Map Suite Silverlight Edition Sample Detect GPS.jpg?300x180}}
[[Source_Code_DesktopEditionSample_DetectGPS_CS_100630.zip|View Source]] {{filehistory:DesktopEditionSample_DetectGPS_CS_100630.zip|C# Download}}
[[Map Suite Samples Applies To|Applies To: Desktop \ Web \ Silverlight \ Services \ Wpf ]] \\ [[Map Suite Samples Alternate Languages | Need it in another language?]]
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.
----
==== Detect GPS location ====
{{:No_screenshot.jpg?300x180}}
[[Source_Code_WebEditionSample_DetectGPSLocation_CS_100616.zip|View Source]] {{filehistory:WebEditionSample_DetectGPSLocation_CS_100616.zip|C# Download}}
[[Map Suite Samples Applies To|Applies To: Web \ Silverlight ]] \\ [[Map Suite Samples Alternate Languages | Need it in another language?]]
The purpose of this project is to complete “AutoRefreshOverlay” of the “How Do I“ sample apps. In this project, you can see the icon of a moving vehicle changing if it is within a certain distance of a reference point. For doing that you can see how to take advantage of SimpleMarkerOverlay and how to do some spatial queries such as GetFeaturesWithinDistanceOf function.
----
==== Moving Vehicle with Label ====
{{silverlightedition:codesamples:Map Suite Silverlight Edition Sample Moving Vehicle with Label.png?300x180}}
[[Source_Code_DesktopEditionSample_MovingVehicleWithLabel_CS_100126.zip|View Source]] {{filehistory:DesktopEditionSample_MovingVehicleWithLabel_CS_100126.zip|C# Download}}
[[Map Suite Samples Applies To|Applies To: Desktop \ Web \ Silverlight \ Services \ Wpf ]] \\ [[Map Suite Samples Alternate Languages | Need it in another language?]]
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 ====
{{silverlightedition:codesamples:Map Suite Silverlight Edition Sample Traveling Salesman Problem.jpg?300x180}}
[[Source_Code_DesktopEditionSample_TravelingSalesmanProblem_CS_100325.zip|View Source]] {{filehistory:DesktopEditionSample_TravelingSalesmanProblem_CS_100325.zip|C# Download}}
[[Map Suite Samples Applies To|Applies To: Desktop \ Web \ Silverlight \ Services \ Wpf ]] \\ [[Map Suite Samples Alternate Languages | Need it in another language?]]
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 ====
{{silverlightedition:codesamples:Map Suite Silverlight Edition Sample Vehicle Direction.JPG?300x180}}
[[Source_Code_DesktopEditionSample_VehicleDirection_CS_090728.zip|View Source]] {{filehistory:DesktopEditionSample_VehicleDirection_CS_090728.zip|C# Download}}
[[Map Suite Samples Applies To|Applies To: Desktop \ Web \ Silverlight \ Services \ Wpf ]] \\ [[Map Suite Samples Alternate Languages | Need it in another language?]]
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.
---- {{page>Map Suite Services Edition Vehicle Tracking Samples}}