User Tools

Site Tools


map_suite_vehicle_tracking_starter_kit_quick_start_guide

Map Suite Vehicle Tracking Starter Kit Quick Start Guide

The Map Suite Vehicle Tracking Starter Kit has been discontinued as a product. Please refer to the Vehicle Tracking Project Template in your ThinkGeo Product Center.

This QuickStart Guide will show you how you can use the Map Suite Vehicle Tracking Starter Kit to easily develop a Web-based vehicle tracking project with ThinkGeo's Map Suite Web Edition. Please note that in order to follow the examples below, you will need to have installed Map Suite Web Edition 6.0 or higher (either the free evaluation or full licensed version).

Welcome to the Map Suite Vehicle Tracking Starter Kit from ThinkGeo®. This QuickStart Guide will show you how you can use the Starter Kit to easily develop a Web-based vehicle tracking project with ThinkGeo's Map Suite Web Edition. Using the intuitive object model, even developers inexperienced in Geographic Information Systems (GIS) can have a fully functional vehicle tracking application working in minutes.

When you open the Vehicle Tracking Starter Kit solution with Visual Studio, you are presented with four projects.

Introduction of the Four Projects

We have included two main implementations of vehicle tracking. One is a Server implementation, which uses server-side events and an Update Panel, while the other implementation is an AJAX version, which uses Callback technology. Each implementation is offered in both a C# and a VB.NET project, making for a total of four projects. The functionality is exactly the same between these four projects but the implementation methodology is totally different.

Server implementation: Almost all of the functionality is implemented by using server-side events so that you can easily understand what the events are doing and so that you can easily debug with Visual Studio. However, please note that some client states are not disposed of by the Update Panel, so that when running this application for a long time there may be memory leaks on the client side.

AJAX implementation: Almost all of the functionality is implemented by using client-side JavaScript. As such, we don't need to postback to the server side every time; instead, we use Callback technology to minimize the need to transfer data over the Internet, which enhances the user experience.

Overview of Vehicle Tracking

qsg_vehicletracking_img02.jpg

(1) Vehicle Information

(2) Auto Refresh

Click this button to simulate loading data from GPS on the fly. This will make the vehicle move and update the vehicle information as well.

(3) Pan Button

Click this button to navigate the map by using tools such as panning, mouse wheel zooming and track zoom in.

(4) Draw Spatial Fence

Click the “Draw Fence” button to open the following dialog.

(5) Measure Tool

Click this button to activate the measurement function on the map. When this function is activated, you can click on the map to begin drawing a polyline (a line with one or more segments). Each additional click will begin drawing a new segment of the same line. You can double-click to finish drawing the polyline. When you do, a bubble displaying the total length of the line will appear on the map.

Using SQL Server Instead of Access

It is easy to transfer this project from using a Microsoft Access Database to using Microsoft SQL Server instead. In the Vehicle Tracking Starter Kit's installation folder, there is a subfolder called App_Data that contains a file named VehicleTrackingDb.mdf.

Attach this data file to your SQL Server; three tables will be generated automatically.

Next, modify the connection string for SQL Server in the web.config file. Here is an example:

<connectionStrings>
    <add name="VehicleTrackingDbConnectionString" connectionString="Data Source=[[ServerName]];Initial Catalog=[[DatabaseName]];Persist Security Info=True;User ID=[[UserName]];Password=[[Password]]" />
</connectionStrings>

Now you have successfully configured the environment to use SQL Server. As a next step, you need to make a few changes within the project code. Let's take the “CSWebAjaxSample” project for example; to begin, please open “VehicleTracking.aspx.cs”. You may notice that this file contains many comments that have been written to help you easily understand this application and how it works. In the code, you will find a data provider whose type is “TrackingAccessProvider”; in addition, there will be a commented-out snippet of code above it. It should look like this:

// using (TrackingSqlProvider dataProvider = new TrackingSqlProvider(ConfigurationManager.ConnectionStrings[["VehicleTrackingDbConnectionString"]].ConnectionString))
//
using (TrackingAccessProvider dataProvider = new TrackingAccessProvider(MapPath(ConfigurationManager.AppSettings[["AccessDataBase"]])))

This object is responsible for all of the communication with the database. To switch from using the Access provider to the SQL Server provider, uncomment the line that begins using (TrackingSqlProvider, then comment-out the line that begins using (TrackingAccessProvider. Do this everywhere this code occurs in the “VehicleTracking.aspx.cs” file. Once you have made these changes, press F5 to run the application and verify that its connection to your SQL Server is working properly.

Summary

Now you know the basic functionality of the Map Suite Vehicle Tracking Starter Kit. Please enjoy experimenting with this project and learning from the code and our comments therein. We hope the sample code provided in this Starter Kit will help guide you in the right direction toward implementing a higher performance vehicle tracking application with Map Suite Web Edition.

map_suite_vehicle_tracking_starter_kit_quick_start_guide.txt · Last modified: 2015/09/16 10:16 by admin