好久没更新我的空间了,最近在忙这个升级的事件,写好的代码要升级是相当痛苦的事情,所以在这我

也想跟大家分享一下,自己一些问题,以后会陆续更新这方面的资料。
1.9.3自带一个升级工具可以完成部分功能升级,具体可以在9.3开发文档里可以找到
2.当然有些自己写的功能还是需要手动完成这部分的工作

  首先 先用VS编译一遍看看是否有过时的方法,有的话就可以参考文档改正
  这里在升级中遇到MapTip类中的

警告 17 “ESRI.ArcGIS.ADF.Web.UI.WebControls.MapTips.BodyFormatString”已过时:“Use

the LayerFormat property” D:\psc1\Default.aspx 1 1 

http://localhost/psc1/
   这里我们的MapTip用BodyFormatString属性定制自己的样式,现在需要参考LayerFormat的Contents

属性生成自己的样式。Tip刷新也用到新的方法 RefreshMapTips();


下面是文档带的参考,大家也看看
// Initialize the MapTips control.  At a minimum, the Layer, Map, and LayerFormat properties
// must be set.  As shown here, the layer must be specified by MapResourceManager ID,

resource
// name, and layer name, in the format <MapResourceManager ID>::<resource name>::<layer

name>.
MapTips1.Layer = string.Format("{0}::{1}::{2}", MapResourceManager1.ID, resourceName,

layerName);

// Pass in the ID of the map on which map tips will be shown.
MapTips1.Map = Map1.ID;

// Get the LayerDefinition object for the layer on which map tips will be shown.
// LayerFormat, which stores the renderer (symbology), visible fields, aliases,
// display field, and attribute display format, can be accessed via this object.
ESRI.ArcGIS.ADF.Web.UI.WebControls.LayerFormat layerFormat =
    ESRI.ArcGIS.ADF.Web.UI.WebControls.LayerFormat.FromMapResourceManager(
    MapResourceManager1, resourceName, layerID);

// Use the LayerFormat from the LayerDefinition object initialized above to specify the
// format of the map tips.
MapTips1.LayerFormat = layerFormat;

// Define if a default (true) or explicit layer format (false) will be used. 
MapTips1.LayerFormat.UseDefaultTitleAndContents = false;

// Remove the GRAPHICS_ID and IS_SELECTED fields from the map tips.  These are system
// fields that are present by default in the LayerFormats of feature graphics layers.

// Declare and initialize variables to store the number of fields in the layer format
// and the current field index.
int fieldCount = MapTips1.LayerFormat.Fields.Count;
int index = 0;

// Iterate through the fields of the MapTips control's LayerFormat
for (int i = 0; i < fieldCount; i++)
{
    // Check whether the field at the current index is the GRAPHICS_ID or
    // IS_SELECTED field and remove it from the LayerFormat if so.  Note that,
    // in this case, we do not increment index.  This is because we have just
    // removed the field stored at index, therefore the same index will actually
    // refer to a different field on the next loop iteration.
    if ((MapTips1.LayerFormat.Fields[index].Name == "GRAPHICS_ID") ||
 (MapTips1.LayerFormat.Fields[index].Name == "IS_SELECTED"))
    {
   MapTips1.LayerFormat.Fields.Remove(MapTips1.LayerFormat.Fields[index]);
    } else {
   // The field at the current index is not one of those being sought, so
   // increment index to move on to the next field.
   index++;
    }
}

// Refresh the MapTips control to commit the changes made to its properties
MapTips1.RefreshMapTips();

// Set the map tips to be visible in the map.
MapTips1.Visible = true;

// Refresh the resource on which the map tips will be shown so that the map tips
// are displayed or hidden.
Map1.RefreshResource(resourceName); 

posted on 2008-10-14 18:01  zhupeng  阅读(1252)  评论(0编辑  收藏  举报