Monday, January 28, 2008 2:29 PM -
Code-Challenge-Team
A Set of Redlining Tools used for Drawing Temporary Graphics
By Sasa Ivetic, GIS Software Developer, Winnipeg, Manitoba, Canada
Download the script.
Code Summary
This tool will allow the user to draw polylines, polygons, circles, ellipses, and text on the temporary graphics layer. The tool is bundled with an ArcGIS Server Application for quick deployment.
To use the control, simply set the Outline/Fill color and Fill style, then select the tool to set the draw method (i.e. line/polygon/etc). For lines/polygons click on the map to start drawing, then click for each vertex you want to add, and finally double click to end drawing. For circles/ellipses click to start drawing, then move the mouse to set the size/shape of the circle/ellipse, and finally click to end draw the shape. For text, click on the map where the text will be positioned, then type the text in the box that opens.
Testing the control with the provided application:
1. Extract the downloaded file into the wwwroot directory (i.e. c:\inetpub\wwwroot\Redlining)
2. Open IIS Administration Console (Control Panel/Administrative Tools/Internet Information Services)
3. Expand the tree until all of the web folders are listed under the Default Web Site node
4. Right click on the folder that was created earlier (i.e. Redlining) and click properties
5. Under the Application Settings click on the Create button if it is enabled, then click Ok, and close the IIS window
6. Open the web project in Visual Studio 2005 (File/Open Website) and navigate to the Redlining website
7. Right click on the project in the Solution Explorer, click Add ArcGIS Identity, then enter the correct username/password/domain
7. Open the Default.aspx file in Design view
8. Add a Map Resource to the MapResourceManager control (see ESRI help for more information)
9. Save the Default.aspx file, and open it in a web browser of choice to test it.
If you want to add the control to your own application, simply copy the MIO_Redlining.ascx and MIO_Redlining.ascx.cs files into your solution, along with the MIO_*.gif images into the images directory. Then register the MIO_Redlining.ascx file at the top of your aspx file that contains the map (i.e. Default.aspx) with the following line:
Finally, add the following line where you want the control to appear (the control is tailored to be docked in the side bar with the rest of the panels, but with a few small changes can be made to appear anywhere):
< MIO:Redlining runat="server" ID="rl" MapBuddyId="Map1" />
There is also a javascript function called MIORL_ShowRedliningPanel() in the MIO_Redlining.ascx file which can be used to show (and with a little change hide) the redlining panel, so that it can be assigned to a tool in the toolbar, or a button/link found elsewhere on the page.