问题描述:
在一个GIS系统中,用SuperMap IS .Net控件中的MapControl开发.要实现路径量测功能.需要使用该控件的DistanceMeasuring,DistanceMeased两个事件,然后编写这两个事件处理函数,MapControl1_DistanceMeasuring,MapControl1_DistanceMeased,函数写好后,运行测试,怎么也不出来效果.
想看一下事件处理函数的绑定代码,即看InitializeComponent()函数.由于.net 2.0中使用部分类,所以怎么也找不到这个函数.
问题的解决:
查了半天资料,才找出来原因.原来vs2005中,事件处理函数,不在放入InitializeComponent()中,而是直接写在控件标记中.如<SMIS:MapControl ID="MapControl1" runat="server" BorderColor="Gray" BorderStyle="None"
BorderWidth="5px" Height="531px" MapUrl="" Width="651px" OnAreaMeasured="MapControl1_AreaMeasured" OnAreaMeasuring="MapControl1_AreaMeasuring" OnDistanceMeasured="MapControl1_DistanceMeasured" OnDistanceMeasuring="MapControl1_DistanceMeasuring" OnQueryCompleted="MapControl1_QueryCompleted" OnQuerying="MapControl1_Querying" OnClosestFacilityFinding="MapControl1_ClosestFacilityFinding" OnClosestFacilityFound="MapControl1_ClosestFacilityFound" OnPathFinding="MapControl1_PathFinding" OnPathFound="MapControl1_PathFound" />
在一个GIS系统中,用SuperMap IS .Net控件中的MapControl开发.要实现路径量测功能.需要使用该控件的DistanceMeasuring,DistanceMeased两个事件,然后编写这两个事件处理函数,MapControl1_DistanceMeasuring,MapControl1_DistanceMeased,函数写好后,运行测试,怎么也不出来效果.
想看一下事件处理函数的绑定代码,即看InitializeComponent()函数.由于.net 2.0中使用部分类,所以怎么也找不到这个函数.
问题的解决:
查了半天资料,才找出来原因.原来vs2005中,事件处理函数,不在放入InitializeComponent()中,而是直接写在控件标记中.如<SMIS:MapControl ID="MapControl1" runat="server" BorderColor="Gray" BorderStyle="None"
BorderWidth="5px" Height="531px" MapUrl="" Width="651px" OnAreaMeasured="MapControl1_AreaMeasured" OnAreaMeasuring="MapControl1_AreaMeasuring" OnDistanceMeasured="MapControl1_DistanceMeasured" OnDistanceMeasuring="MapControl1_DistanceMeasuring" OnQueryCompleted="MapControl1_QueryCompleted" OnQuerying="MapControl1_Querying" OnClosestFacilityFinding="MapControl1_ClosestFacilityFinding" OnClosestFacilityFound="MapControl1_ClosestFacilityFound" OnPathFinding="MapControl1_PathFinding" OnPathFound="MapControl1_PathFound" />