⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 arcgis server development blog zooming to task results automatically.htm

📁 C#开发的ArcGIS Server9.2查询地物居中高亮显示控件
💻 HTM
📖 第 1 页 / 共 5 页
字号:
            <a href="/Dev/blogs/arcgisserver/archive/2007/07.aspx">July 2007 (6)</a>
        </li>
    
        <li>
            <a href="/Dev/blogs/arcgisserver/archive/2007/06.aspx">June 2007 (9)</a>
        </li>
    
        <li>
            <a href="/Dev/blogs/arcgisserver/archive/2007/05.aspx">May 2007 (8)</a>
        </li>
    
        <li>
            <a href="/Dev/blogs/arcgisserver/archive/2007/04.aspx">April 2007 (2)</a>
        </li>
    
        <li>
            <a href="/Dev/blogs/arcgisserver/archive/2007/03.aspx">March 2007 (1)</a>
        </li>
    
        <li>
            <a href="/Dev/blogs/arcgisserver/archive/2007/02.aspx">February 2007 (2)</a>
        </li>
    
        <li>
            <a href="/Dev/blogs/arcgisserver/archive/2007/01.aspx">January 2007 (5)</a>
        </li>
    
        <li>
            <a href="/Dev/blogs/arcgisserver/archive/2006/12.aspx">December 2006 (9)</a>
        </li>
    
</ul>
	


	
			</div>
			<div id="content"><div id="content2">
				
        

<div class="post">
	<div class="postview">			
		<h2>Zooming to task results automatically</h2>
		<I>In this post, Tom Brenneman and Rex Hansen&nbsp;share a control they created that allows you to automatically zoom to the results of a .Net Web ADF task.</I> 
<P><IMG title="Magnifying glass" style="WIDTH:144px;HEIGHT:144px;" height=144 alt="Magnifying glass" src="http://blogs.esri.com/Dev/photos/2007/images/421/original.aspx" width=144 align=left><A href="http://serverx.esri.com/blogImages/AUG-28-2007/ZoomToResults.zip">This control</A>, called <EM>ZoomToResults</EM>, enables you to automatically zoom to the result set returned from a task instead of requiring you to navigate through tree-view results in a standard <EM>TaskResults</EM> control. By default, this control is not visible at runtime. It is designed to simply zoom to the result set in the map if the number of features returned is less than the <EM>MaxResultsForMapZoom</EM> property. You will need to add this control to a task’s <EM>TaskResultsContainers</EM> collection to take advantage of these features. Note that this control must be listed before any other container in the collection (e.g. an out-of-the-box <EM>TaskResults</EM> control). This control was built with version 9.2, Service Pack 3 of the .Net Web ADF.</P><BR><BR><B>Follow these steps to use the control in your application.</B> 
<OL>
<LI>In Visual Studio, right click in the Toolbox and click Choose Items.</LI>
<LI>Click Browse and navigate to ZoomToResults.dll and click OK.</LI>
<LI>Drag the ZoomToResults control onto your web page. </LI>
<LI>Set the following properties for <EM>ZoomToResults</EM> control:<BR><BR><EM>MaxResultsForAutoSelect</EM> – this is the maximum result set that will be selected. The results will only be selected if a result set contains this value or less. Set this property to 0 to disable the auto selection capability.<BR><BR><EM>MaxResultsForMapZoom</EM> – this is the maximum result set that will be zoomed to. The map will only be zoomed to the result set if it is less than or equal to this value. Set this property to 0 to disable the auto zoom capability.<BR><BR><EM>MinWidthOfZoom</EM> – this is the minimum width (or height actually) in map units of the extent rectangle that will be zoomed to. This is particularly useful if the result set is a single point or a very small feature. In this case you could set the minimum extent that the map will zoom to. If you are working with geographic data you may want to make this significantly smaller than the default of 10.<BR><BR><EM>ZoomExtentExpansionPercent </EM>– this is the expansion percentage around the extent of the result set for the map to zoom to. This is useful for defining a margin around the extent of features returned in a result set.<BR><BR><EM>DisplayTaskResult</EM> – display task results like an out-of-the-box <EM>TaskResults</EM> control. By default, this property is false.<BR><BR><EM>ShowTaskActivityIndicator</EM> – display activity indicator when a task is processing, like an out-of-the-box <EM>TaskResults</EM> control. By default, this property is false.<BR></LI>
<LI>To associate this container with a task, at design-time in design view click on the smart tag on the task and select <STRONG>Choose Task Results container</STRONG>.</LI>
<LI>Click <STRONG>Add</STRONG>. Set the <EM>Name</EM> property of the new <EM>BuddyControl</EM> to the name of the <EM>ZoomToResult</EM> control (e.g. ZoomtoResults1).</LI>
<LI>In the BuddyControl Collection Editor click the up arrow to move the ZoomToResults buddy control to the top of the list.</LI>
<LI>Click <STRONG>OK</STRONG> to dismiss&nbsp;the BuddyControl Collection Editor.</LI>
<LI>Try out the app!</LI></OL>
<P><A href="http://serverx.esri.com/blogImages/AUG-28-2007/ZoomToResults.zip">Download the control</A> (The compressed folder contains the code with extensive comments from Tom and Rex, as well as a Readme file with the above instructions.)</P>
		<div class="postfoot">
			Published Tuesday, August 28, 2007 5:02 PM
			by
			<a id="ctl00___ctl00___ctl01___Entry___AuthorLink" href="/Dev/user/Profile.aspx?UserID=2256">sterlingdq</a>
			
			
			<div><span id="ctl00___ctl00___ctl01___Entry___InlineTagEditorPanel">Filed under: <a href="/Dev/blogs/arcgisserver/archive/tags/ADF/default.aspx" rel="tag">ADF</a>, <a href="/Dev/blogs/arcgisserver/archive/tags/.NET/default.aspx" rel="tag">.NET</a>, <a href="/Dev/blogs/arcgisserver/archive/tags/Code+Snippet/default.aspx" rel="tag">Code Snippet</a>, <a href="/Dev/blogs/arcgisserver/archive/tags/Tasks/default.aspx" rel="tag">Tasks</a></span><input type="hidden" name="ctl00$_$ctl00$_$ctl01$_$Entry$_$InlineTagEditorPanel" id="ctl00___ctl00___ctl01___Entry___InlineTagEditorPanel_State" value="nochange" /></div>
										
		</div>
	</div>
</div>


<div id="postToolbar">
<h2 class="CommonSubTitle">Comment Notification</h2>
<p>
	If you would like to receive an email when updates are made to this post, please register <a id="ctl00___ctl00___ctl01___DetailedSubBar___RegisterLink" href="/Dev/user/CreateUser.aspx?ReturnUrl=/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx">here</a>
	
</p>
<p>
	Subscribe to this post's comments using
	<a id="ctl00___ctl00___ctl01___DetailedSubBar___CommentRssLink" href="/Dev/blogs/arcgisserver/commentrss.aspx?PostID=420">RSS</a>
</p>
</div>

<h3>
	Comments
</h3>	
<div id="comments">

		<div class="comment">
			<h4>
				<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl00_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#423">#</a>
				<span>Exporer 9.2 very slow<a name="423"></a></span>
			</h4>
			<div class="commentsbody">
				I install GIS explorer 9.2 when I click to open its take 8 to 10 minutes even my system(3.4Mhz 2GB RAM 256VGA)...?


			</div>
			<div class="commentssubhead">
				<span class="commentspan"></span>Thursday, August 30, 2007 7:11 AM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl00_NameLink" title="Riyazuddin Mohammed" rel="nofollow" href="/Dev/utility/Redirect.aspx?U=http%3a%2f%2friyaz_din%40yahoo.com" target="_blank">Riyazuddin Mohammed</a>
			</div>
		</div>
	
		<div class="altcomment">
			<h4>
				<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl01_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#424">#</a>
				<span>re: Zooming to task results automatically<a name="424"></a></span>
			</h4>
			<div class="commentsbody">
				<p>Riyazuddin-</p><p>Not sure what the issue is here, but you may have better luck with this question on the ArcGIS Explorer Forums <a rel="nofollow" target="_new" href="http://forums.esri.com/forums.asp?c=184">http://forums.esri.com/forums.asp?c=184</a> or the ArcGIS Explorer Blog <a rel="nofollow" target="_new" href="http://blogs.esri.com/Info/blogs/arcgisexplorerblog/">http://blogs.esri.com/Info/blogs/arcgisexplorerblog/</a></p>
			</div>
			<div class="commentssubhead">
				<span class="commentspan"></span>Thursday, August 30, 2007 12:50 PM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl01_NameLink" title="sterlingdq" href="/Dev/user/Profile.aspx?UserID=2256" target="_blank">sterlingdq</a>
			</div>
		</div>
	
		<div class="comment">
			<h4>
				<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl02_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#425">#</a>
				<span>re: Zooming to task results automatically<a name="425"></a></span>
			</h4>
			<div class="commentsbody">
				I am ecstatic that this was published as I have several QueryAttributes tasks already created that I don't want to rewrite. But after working with it for the past day or so and can't quite get it to work. When I add to my project and attempt to compile I get several validation errors. I do have Service Pack 3 installed too. I will keep poking at it.
			</div>
			<div class="commentssubhead">
				<span class="commentspan"></span>Thursday, August 30, 2007 4:33 PM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl02_NameLink" title="Matthew Lawton" rel="nofollow" href="/Dev/utility/Redirect.aspx?U=http%3a%2f%2fwww.washoecounty.us%2fgis" target="_blank">Matthew Lawton</a>
			</div>
		</div>
	
		<div class="altcomment">
			<h4>
				<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl03_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#428">#</a>
				<span>Another great ADF control: Zooming to task results<a name="428"></a></span>
			</h4>
			<div class="commentsbody">
				<p>Tom Brenneman and Rex Hansen posted this control: <a rel="nofollow" target="_new" href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive">http://blogs.esri.com/Dev/blogs/arcgisserver/archive</a></p>
			</div>
			<div class="commentssubhead">
				<span class="commentspan"></span>Thursday, August 30, 2007 8:41 PM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl03_NameLink" rel="nofollow" title="TrackBack" href="/Dev/utility/Redirect.aspx?U=http%3a%2f%2falpascual.com%2fblog%2fal%2farchive%2f2007%2f08%2f30%2fanother-great-adf-control-zooming-to-task-results.aspx" target="_blank">Community Blogs</a>
			</div>
		</div>
	
		<div class="comment">
			<h4>
				<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl04_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#429">#</a>
				<span>re: Zooming to task results automatically<a name="429"></a></span>
			</h4>
			<div class="commentsbody">
				Hi Matthew,

  We'll need some additional information to troubleshoot the problem you're encountering.  Are you able to built the ZoomToResults project successfully by itself, outside of your project?  What are some of the validation errors you're seeing?

Thanks,
-Rex
			</div>
			<div class="commentssubhead">
				<span class="commentspan"></span>Thursday, August 30, 2007 11:29 PM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl04_NameLink" title="Rex Hansen" target="_blank">Rex Hansen</a>
			</div>
		</div>
	
		<div class="altcomment">
			<h4>
				<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl05_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#430">#</a>
				<span>re: Zooming to task results automatically<a name="430"></a></span>
			</h4>
			<div class="commentsbody">
				The project seems to build okay on its own. The error that I am getting when I add it to my web site in VS is: "Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."

Any ideas?
			</div>
			<div class="commentssubhead">
				<span class="commentspan"></span>Friday, August 31, 2007 1:50 PM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl05_NameLink" title="Matthew Lawton" rel="nofollow" href="/Dev/utility/Redirect.aspx?U=http%3a%2f%2fwww.washoecounty.us%2fgis" target="_blank">Matthew Lawton</a>
			</div>
		</div>
	
		<div class="comment">
			<h4>
				<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl06_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#433">#</a>
				<span>re: Zooming to task results automatically<a name="433"></a></span>
			</h4>
			<div class="commentsbody">
				I have downloaded the control and have integrated it into my project successfully. Thanks for posting this.

Ideally, I would like to replace my taskresults control with this control. However, in order to do so, I need to make a customization and am wondering how/where to go about doing this.

I am keeping track of selections in the task results control via nodechecked and nodecleared event -- keeping a running tally of which features are selected in a session variable.

However, in using this custom control, I have the auto select feature enabled and am unable to figure out where in code the nodes are being checked so that I can modify my session variable. The nodechecked and nodecleared events are fired when I click on the nodes after the result appears on the page but not on initial display of the task result. 

Is this clear? Any thoughts?

Ted
			</div>
			<div class="commentssubhead">
				<span class="commentspan"></span>Monday, September 03, 2007 3:52 PM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl06_NameLink" title="Ted Quinby" target="_blank">Ted Quinby</a>
			</div>
		</div>
	
		<div class="altcomment">
			<h4>
				<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl07_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#434">#</a>
				<span>re: Zooming to task results automatically<a name="434"></a></span>
			</h4>
			<div class="commentsbody">
				I figured out my posted question.

I handled it at the task level before the results were displayed to the custom control.

Thanks again!

Ted
			</div>
			<div class="commentssubhead">
				<span class="commentspan"></span>Monday, September 03, 2007 4:32 PM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl07_NameLink" title="Ted Quinby" target="_blank">Ted Quinby</a>
			</div>
		</div>
	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -