Create and click ( Identify ), Select ( Select . In ArcGIS Server. Net ADF SP3 Previously, the following statement was used for conversion:
Rectangle rect = (ARGs As Rectangleeventargs). screenextent;
ESRI. ArcGIS. ADF. Web. Geometry. Point minadfpoint = ESRI. arcGIS. ADF. web. geometry. point. tomappoint (rect. left, rect. bottom, mapctrl. extent, mapfunc. displaysettings. imagedescriptor. width, mapfunc. displaysettings. imagedescriptor. height );
ESRI. ArcGIS. ADF. Web. Geometry. Point maxadfpoint = ESRI. arcGIS. ADF. web. geometry. point. tomappoint (rect. right, rect. top, mapctrl. extent, mapfunc. displaysettings. imagedescriptor. width, mapfunc. displaysettings. imagedescriptor. height );
ESRI. ArcGIS. ADF. Web. Geometry. Envelope adfenvelope = New ESRI. ArcGIS. ADF. Web. Geometry. Envelope (minadfpoint, maxadfpoint );
In SP3 In the future, the above statement will receive a warning during compilation:" ESRI. ArcGIS. ADF. Web. Geometry. Point. tomappoint (INT, Int, ESRI. ArcGIS. ADF. Web. Geometry. envelope, Int, INT) "Expired. RunProgramIt seems that there is no deviation. To Map ServiceMake a cache and run it again. There is a significant deviation. See the following two figures:
Figure-1
Figure 2
Further test, as long Mapresourcemanager Any Map Service If the cache is used, the deviation will occur, but the cache is normal without it. This is exactly where people are fooled. Which of the following statements is best? ESRI The help documentation is simple and horrible, ArcGIS Server. Net ADF Of API The document looks bare and tells you that the method is outdated, but does not prompt you to use any alternative method. As my manager said, GIS The software giant is just a three-stream software company in the United States.
Fortunately Google Finally, the correct method is found. Use the following statement:
Rectangle rect = (ARGs As Rectangleeventargs). screenextent;
ESRI. ArcGIS. ADF. Web. Geometry. Point minadfpoint = ESRI. arcGIS. ADF. web. geometry. point. tomappoint (rect. left, rect. bottom, mapctrl. gettransformationparams (ESRI. arcGIS. ADF. web. geometry. transformationdirection. tomap ));
ESRI. ArcGIS. ADF. Web. Geometry. Point maxadfpoint = ESRI. arcGIS. ADF. web. geometry. point. tomappoint (rect. right, rect. top, mapctrl. gettransformationparams (ESRI. arcGIS. ADF. web. geometry. transformationdirection. tomap ));
ESRI. ArcGIS. ADF. Web. Geometry. Envelope adfenvelope = New ESRI. ArcGIS. ADF. Web. Geometry. Envelope (minadfpoint, maxadfpoint );
Note gettransformationparams and transformationdirection. My development environment is Visual Studio 2005 + ArcGIS Server. Net ADF SP4 + ArcGIS Desktop 9.2 SP4 + ArcSDE 9.1.