4、 发布地图服务,
5、 利用ArcToolbox\\Mobile Tools\\Generate Mobile Service Cache工具发布的服务
转换为bin文件,作为mobileservice读取的数据
6、 后台建立数据库,建立表,设置如图字段
7、 GPS数据的准备,建立文本文件,自定义数据格式,点名、X坐标、Y坐标、……
嵌入式汽车导航终端软件系统 (1)窗口界面设计
向窗口拖入7个button控件,修改它们的text属性,分别为加载、放大、缩小、漫游、停止、单步显示、自动显示;向窗体拖入1个Lable控件,将它的text属性改为位置列表;向窗体拖入一个Listbox控件、一个Timer控件和一个map控件。窗口设计如下:
(2)代码设计
1)双击加载button控件,写入代码,读取存放在txt文档中的GPS数据,代码如下: string strLine = \;
string filename = \数据.txt\; try {
FileStream aFile = new FileStream(filename, FileMode.Open); StreamReader sr = new StreamReader(aFile); strLine = sr.ReadLine(); while (strLine != null) {
if (strLine != null) {
string[] strArr = strLine.Split(','); MyClass PointsCollection = new MyClass(); //PointsCollection.name=strArr[0]; name[i++] = strArr[0];
PointsCollection.Coordinate.X = Convert.ToDouble(strArr[1]);
PointsCollection.Coordinate.Y = Convert.ToDouble(strArr[2]);
Pointkindscc.Add(PointsCollection.Coordinate); }
strLine = sr.ReadLine(); }
sr.Close(); }
catch (IOException ex) {
MessageBox.Show(ex.ToString()); }
2)双击放大butto控件,写入代码,实现电子地图的放大功能,代码如下: this.map1.CurrentMapAction = this.zoomInMapAction1;
3)双击缩小button控件,写入代码,实现电子地图的缩小功能,代码如下: this.map1.CurrentMapAction = this.zoomOutMapAction1;
4)双击漫游button控件,写入代码,实现电子地图的漫游功能,代码如下: this.map1.CurrentMapAction = this.panMapAction1;
5)双击单步显示button控件,写入代码,实现单击一次按钮显示一次汽车当前位置的功能,代码如下: DeleteAll();
ShowCar(t); if (t < 29) {
t = t + 1; } else t = 0; private void DeleteAll() {