资源简介

自己做的小例子,完整的ArcGIS Mobile 应用,地图的缩放、平移、要素的查询等。

资源截图

代码片段和文件信息

using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace SmartDeviceProject1
{
    public partial class Form1 : Form
    {
        private ESRI.ArcGIS.Mobile.MobileServices.Featurelayer pFeaturelayer;
        private ESRI.ArcGIS.Mobile.MobileServices.FeatureDataTable pFeaturetable;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender EventArgs e)
        {
            this.mobileService.CacheStoragePath = Environment.GetFolderPath(Environment.SpecialFolder.Personal).Replace(“My Documents“ ““) + @“Storage Card\My Documents\ArcGIS Mobile\well\MobileServiceCache“; 
            if (!this.mobileService.IsValid) return; 
            if (this.mobileService != null && this.mobileService.IsOpen) 
                this.mobileService.Close(); 
            try 
            { 
                //打开缓存
                this.mobileService.Open(ESRI.ArcGIS.Mobile.MobileServices.CacheOpenMode.Open); 
                this.mobileService.GetFeatureDataAsync(map false “GetFeatures“);
                //打开底图
                ESRI.ArcGIS.Mobile.SdcData.SdcMaplayer sdcMaplayer = new ESRI.ArcGIS.Mobile.SdcData.SdcMaplayer(@“\Storage Card\china\china.navmap“); 
                this.map.Maplayers.Add(sdcMaplayer);
            } 
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }

        private void toolBar1_Buttonclick(object sender ToolBarButtonclickEventArgs e)
        {
            switch (e.Button.Tag.ToString())
            {
                case “0“:
                    this.map.CurrentMapAction =new ESRI.ArcGIS.Mobile.MapActions.ZoomInMapAction();
                    break;
                case “1“:
                    this.map.CurrentMapAction = new ESRI.ArcGIS.Mobile.MapActions.ZoomOutMapAction();
                    break;
                case “2“:
                    this.map.CurrentMapAction = new ESRI.ArcGIS.Mobile.MapActions.PanMapAction();
                    break;
                      
            }
        }

        private void Query_Click(object sender EventArgs e)
        {
            if (QueryText.Text == ““)
            {
                MessageBox.Show(“请输入查询井名!“);
            }
            else
            {
                string wellname = QueryText.Text;
                //获得查询图层
                pFeaturelayer =(ESRI.ArcGIS.Mobile.MobileServices.Featurelayer)this.mobileService.layers[0];
                //设置查询语句
                ESRI.ArcGIS.Mobile.QueryFilter filter = new ESRI.ArcGIS.Mobile.QueryFilter();
                filter.WhereClause = “WELL_NAME LIKE ‘“+wellname+“%‘“;
                //获得查询结果
                pFeaturetable = pFeaturelayer.GetDataTable(filternull);
                //获得查询字段的索引
       

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        195  2009-09-10 17:06  SmartDeviceProject1\mssccprj.scc

     文件     462336  2008-10-09 10:09  SmartDeviceProject1\SmartDeviceProject1\bin\Debug\ESRI.ArcGIS.Mobile.dll

     文件     919977  2008-10-09 10:09  SmartDeviceProject1\SmartDeviceProject1\bin\Debug\ESRI.ArcGIS.Mobile.xml

     文件      16896  2009-08-19 15:09  SmartDeviceProject1\SmartDeviceProject1\bin\Debug\SmartDeviceProject1.exe

     文件      30208  2009-08-19 15:09  SmartDeviceProject1\SmartDeviceProject1\bin\Debug\SmartDeviceProject1.pdb

    ..A.SHR       259  2009-09-10 17:06  SmartDeviceProject1\SmartDeviceProject1\bin\Debug\vssver2.scc

     文件       4877  2009-11-30 13:34  SmartDeviceProject1\SmartDeviceProject1\Form1.cs

     文件       9521  2009-08-14 17:08  SmartDeviceProject1\SmartDeviceProject1\Form1.Designer.cs

     文件      12174  2009-08-14 17:08  SmartDeviceProject1\SmartDeviceProject1\Form1.resx

     文件        218  2009-09-10 17:06  SmartDeviceProject1\SmartDeviceProject1\mssccprj.scc

     文件      19361  2009-08-19 15:09  SmartDeviceProject1\SmartDeviceProject1\obj\Debug\ResolveAssemblyReference.cache

     文件       1936  2009-08-19 15:09  SmartDeviceProject1\SmartDeviceProject1\obj\Debug\SmartDeviceProject1.csproj.FileListAbsolute.txt

     文件        847  2009-08-19 15:09  SmartDeviceProject1\SmartDeviceProject1\obj\Debug\SmartDeviceProject1.csproj.GenerateResource.Cache

     文件      16896  2009-08-19 15:09  SmartDeviceProject1\SmartDeviceProject1\obj\Debug\SmartDeviceProject1.exe

     文件       3796  2009-08-14 17:08  SmartDeviceProject1\SmartDeviceProject1\obj\Debug\SmartDeviceProject1.Form1.resources

     文件      30208  2009-08-19 15:09  SmartDeviceProject1\SmartDeviceProject1\obj\Debug\SmartDeviceProject1.pdb

     文件        180  2009-08-14 10:12  SmartDeviceProject1\SmartDeviceProject1\obj\Debug\SmartDeviceProject1.Properties.Resources.resources

    ..A.SHR       477  2009-09-10 17:06  SmartDeviceProject1\SmartDeviceProject1\obj\Debug\vssver2.scc

     文件        366  2009-08-11 15:57  SmartDeviceProject1\SmartDeviceProject1\Program.cs

     文件       1459  2009-08-11 15:57  SmartDeviceProject1\SmartDeviceProject1\Properties\AssemblyInfo.cs

     文件       2375  2009-08-11 15:57  SmartDeviceProject1\SmartDeviceProject1\Properties\Resources.Designer.cs

     文件       5618  2009-08-11 15:57  SmartDeviceProject1\SmartDeviceProject1\Properties\Resources.resx

    ..A.SHR       203  2009-09-10 17:06  SmartDeviceProject1\SmartDeviceProject1\Properties\vssver2.scc

     文件       4235  2009-08-14 10:12  SmartDeviceProject1\SmartDeviceProject1\SmartDeviceProject1.csproj

     文件        198  2009-08-11 16:01  SmartDeviceProject1\SmartDeviceProject1\SmartDeviceProject1.csproj.user

    ..A.SHR       295  2009-09-10 17:06  SmartDeviceProject1\SmartDeviceProject1\vssver2.scc

     文件       1113  2009-08-11 15:58  SmartDeviceProject1\SmartDeviceProject1.sln

    ..A..H.     18944  2009-12-07 12:24  SmartDeviceProject1\SmartDeviceProject1.suo

    ..A.SHR       111  2009-09-10 17:07  SmartDeviceProject1\vssver2.scc

     目录          0  2009-09-27 16:54  SmartDeviceProject1\SmartDeviceProject1\obj\Debug\Refactor

............此处省略11个文件信息

评论

共有 条评论