This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
map_suite_vehicle_tracking_starter_kit_quick_start_guide [2015/09/16 10:02] admin |
map_suite_vehicle_tracking_starter_kit_quick_start_guide [2015/09/16 10:16] (current) admin |
||
---|---|---|---|
Line 20: | Line 20: | ||
**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. | **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. | ||
- | {{Figure|QSG_VehicleTracking_Img01.png}} | + | {{vehicletrackingstarterkit:QSG_VehicleTracking_Img01.png}} |
===== Overview of Vehicle Tracking ===== | ===== Overview of Vehicle Tracking ===== | ||
- | {{Figure|QSG_VehicleTracking_Img02.jpg}} | + | {{vehicletrackingstarterkit:QSG_VehicleTracking_Img02.jpg}} |
==== (1) Vehicle Information ==== | ==== (1) Vehicle Information ==== | ||
- | {{Figure|QSG_VehicleTracking_Img03.png}} | + | {{vehicletrackingstarterkit:QSG_VehicleTracking_Img03.png}} |
Line 33: | Line 33: | ||
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. | 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. | ||
- | {{wiki:QSG_VehicleTracking_Img05.png}} | + | {{vehicletrackingstarterkit:QSG_VehicleTracking_Img05.png}} |
==== (3) Pan Button ==== | ==== (3) Pan Button ==== | ||
- | {{wiki:QSG_VehicleTracking_Img06.png}} | + | {{vehicletrackingstarterkit:QSG_VehicleTracking_Img06.png}} |
Click this button to navigate the map by using tools such as panning, mouse wheel zooming and track zoom in. | Click this button to navigate the map by using tools such as panning, mouse wheel zooming and track zoom in. | ||
Line 43: | Line 43: | ||
Click the "Draw Fence" button to open the following dialog. | Click the "Draw Fence" button to open the following dialog. | ||
- | {{wiki:QSG_VehicleTracking_Img07.png}} | + | {{vehicletrackingstarterkit:QSG_VehicleTracking_Img07.png}} |
==== (5) Measure Tool ==== | ==== (5) Measure Tool ==== | ||
- | {{wiki:QSG_VehicleTracking_Img12.png}} | + | {{vehicletrackingstarterkit:QSG_VehicleTracking_Img12.png}} |
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. | 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. | ||
- | {{wiki:QSG_VehicleTracking_Img13.png}} | + | {{vehicletrackingstarterkit:QSG_VehicleTracking_Img13.png}} |
===== Using SQL Server Instead of Access ===== | ===== 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. | 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. | ||
- | {{Figure|QSG_VehicleTracking_Img14.png}} | + | {{vehicletrackingstarterkit:QSG_VehicleTracking_Img14.png}} |
Attach this data file to your SQL Server; three tables will be generated automatically. | Attach this data file to your SQL Server; three tables will be generated automatically. | ||
- | {{Figure|QSG_VehicleTracking_Img15.png}} | + | {{vehicletrackingstarterkit:QSG_VehicleTracking_Img15.png}} |
Next, modify the connection string for SQL Server in the web.config file. Here is an example: | Next, modify the connection string for SQL Server in the web.config file. Here is an example: | ||
- | <source lang="xml"> | + | <code xml> |
<connectionStrings> | <connectionStrings> | ||
<add name="VehicleTrackingDbConnectionString" connectionString="Data Source=[[ServerName]];Initial Catalog=[[DatabaseName]];Persist Security Info=True;User ID=[[UserName]];Password=[[Password]]" /> | <add name="VehicleTrackingDbConnectionString" connectionString="Data Source=[[ServerName]];Initial Catalog=[[DatabaseName]];Persist Security Info=True;User ID=[[UserName]];Password=[[Password]]" /> | ||
</connectionStrings> | </connectionStrings> | ||
- | </source> | + | </code> |
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: | 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: | ||
- | <source lang="csharp"> | + | <code csharp> |
- | <nowiki>//</nowiki> using (TrackingSqlProvider dataProvider = new TrackingSqlProvider(ConfigurationManager.ConnectionStrings[["VehicleTrackingDbConnectionString"]].ConnectionString)) | + | // using (TrackingSqlProvider dataProvider = new TrackingSqlProvider(ConfigurationManager.ConnectionStrings[["VehicleTrackingDbConnectionString"]].ConnectionString)) |
- | <nowiki>//</nowiki> | + | // |
using (TrackingAccessProvider dataProvider = new TrackingAccessProvider(MapPath(ConfigurationManager.AppSettings[["AccessDataBase"]]))) | using (TrackingAccessProvider dataProvider = new TrackingAccessProvider(MapPath(ConfigurationManager.AppSettings[["AccessDataBase"]]))) | ||
- | </source> | + | </code> |
- | 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 <code>using (TrackingSqlProvider</code>, then comment-out the line that begins <code>using (TrackingAccessProvider</code>. 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. | + | 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 ===== | ===== 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. | 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. | ||