📄 arcgis server development blog zooming to task results automatically.htm
字号:
<span>re: Zooming to task results automatically<a name="524"></a></span>
</h4>
<div class="commentsbody">
Nevermind, I got it.
</div>
<div class="commentssubhead">
<span class="commentspan"></span>Wednesday, October 10, 2007 10:56 AM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl29_NameLink" title="Andy" target="_blank">Andy</a>
</div>
</div>
<div class="comment">
<h4>
<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl30_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#525">#</a>
<span>re: Zooming to task results automatically<a name="525"></a></span>
</h4>
<div class="commentsbody">
I have found another small problem. When you select something you will get three levels in the results tree view, the last of which is the actual feature. If you right click on the tree node for the feature you get a context menu with Zoom To, Pan To, and Remove choices. When I click the Remove choice on that feature node I get a callback error that says "An unhandled exception has occurred. Deleted row information cannot be accessed through the row". This then renders all query tasks that use this control useless. That error keeps reappearing everytime you try to do a query. Any ideas why that is happening or how we can get around it?
</div>
<div class="commentssubhead">
<span class="commentspan"></span>Wednesday, October 10, 2007 12:48 PM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl30_NameLink" title="Andy" target="_blank">Andy</a>
</div>
</div>
<div class="altcomment">
<h4>
<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl31_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#526">#</a>
<span>re: Zooming to task results automatically<a name="526"></a></span>
</h4>
<div class="commentsbody">
Andy,
It appears the call to dt.AcceptChanges() in the ZoomToResults.processDataTable() method is the causing the problem. Calling AcceptChanges causes the RowState to be updated everytime something happens to a DataRow. In this case, clicking on the Remove context menu item triggers the out of the box TaskResults control to delete a DataRow and change the RowState to ‘Deleted’. Then the Web ADF graphics map resource which contains the feature graphics layer generated by task execution (selected features) is refreshed. At this point, the full extent of the feature graphics layer is recalcuated by iterating through the data rows. Since AcceptChanges was called, the DataRow which was deleted is waiting for another call to AcceptChanges to actually delete the row. Since our source code doesn't do this, an exception is thrown because the row remains in the Rows collection. In essence, the Web ADF wasn't designed to work with RowState. If AcceptChanges is not called on a DataTable, the RowState will remain ‘Added’ and actions on rows (e.g. Delete) will occur immediately.
So, to resolve this issue remove or comment out the line dt.AcceptChanges().
Hope this helps,
-Rex
</div>
<div class="commentssubhead">
<span class="commentspan"></span>Wednesday, October 10, 2007 5:34 PM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl31_NameLink" title="Rex Hansen" target="_blank">Rex Hansen</a>
</div>
</div>
<div class="comment">
<h4>
<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl32_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#531">#</a>
<span>re: Zooming to task results automatically<a name="531"></a></span>
</h4>
<div class="commentsbody">
That did the trick. Thanks a lot Rex ...
</div>
<div class="commentssubhead">
<span class="commentspan"></span>Monday, October 15, 2007 7:52 AM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl32_NameLink" title="Andy" target="_blank">Andy</a>
</div>
</div>
<div class="altcomment">
<h4>
<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl33_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#540">#</a>
<span>re: Zooming to task results automatically<a name="540"></a></span>
</h4>
<div class="commentsbody">
Nice job guys.
Of course I do have a question. I haven't seen anyone else mention this problem so I am sure that it is probably something I have broutght on myself. In most cases, especially if zooming in to larger scales, my map conrol draws all the selected results, but it also draws a solid gray fill over the entire map.
I am having the same problem when I use Bryan Baker's customized QueryAttributesTask. I thought maybe it had something to do with my particular map service, but I don't have the problem when performing any other map navigation including using the zoom on the resutls context menus.
Any ideas?
Thanks
rb
</div>
<div class="commentssubhead">
<span class="commentspan"></span>Wednesday, October 24, 2007 2:57 PM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl33_NameLink" title="Randy" target="_blank">Randy</a>
</div>
</div>
<div class="comment">
<h4>
<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl34_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#548">#</a>
<span>re: Zooming to task results automatically - Gray fill with graphics layer<a name="548"></a></span>
</h4>
<div class="commentsbody">
Randy - re. the problem with the gray-filled areas with graphics layers see this blog post:
http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2007/08/13/Transparency-in-graphics-layers-with-callbacks.aspx
You'll probably have to find the extra callbacks and remove them as discussed in the post.
</div>
<div class="commentssubhead">
<span class="commentspan"></span>Thursday, October 25, 2007 9:43 AM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl34_NameLink" title="Bryan Baker" target="_blank">Bryan Baker</a>
</div>
</div>
<div class="altcomment">
<h4>
<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl35_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#557">#</a>
<span>re: Zooming to task results automatically<a name="557"></a></span>
</h4>
<div class="commentsbody">
Two other questions for you guys as far as differences between the way your control behaves and the way the default task results control behaves. I miss my Clear All link at the top, and it seems like your control expands the size of the floating panel to fill whatever is displayed in there whereas the default control displays scroll bars and keeps the floating panel size consistent. I think the scroll bars are much more user friendly. How do I get them back? Thanks for your help ...
</div>
<div class="commentssubhead">
<span class="commentspan"></span>Tuesday, October 30, 2007 9:42 AM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl35_NameLink" title="Andy" target="_blank">Andy</a>
</div>
</div>
<div class="comment">
<h4>
<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl36_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#558">#</a>
<span>re: Zooming to task results automatically<a name="558"></a></span>
</h4>
<div class="commentsbody">
I figured out the Clear All thing. There is a ShowClearAllButton property on the ZoomToResults control. Brilliant. So if you could answer my scroll bar question that would be great. Thanks ...
</div>
<div class="commentssubhead">
<span class="commentspan"></span>Tuesday, October 30, 2007 1:21 PM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl36_NameLink" title="Andy" target="_blank">Andy</a>
</div>
</div>
<div class="altcomment">
<h4>
<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl37_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#561">#</a>
<span>re: Zooming to task results automatically<a name="561"></a></span>
</h4>
<div class="commentsbody">
Just add this style attribute to the ZoomToResults control.
Style="left: 0px; width: 100%; position: absolute; top: 0px; height: 100%; overflow:auto;"
This is the same style attribute that is used for the standard task results in the template.
</div>
<div class="commentssubhead">
<span class="commentspan"></span>Wednesday, October 31, 2007 9:47 AM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl37_NameLink" title="Tom Brenneman" target="_blank">Tom Brenneman</a>
</div>
</div>
<div class="comment">
<h4>
<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl38_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#562">#</a>
<span>re: Zooming to task results automatically<a name="562"></a></span>
</h4>
<div class="commentsbody">
Worked like a charm. Thanks Tom ...
</div>
<div class="commentssubhead">
<span class="commentspan"></span>Wednesday, October 31, 2007 2:14 PM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl38_NameLink" title="Andy" target="_blank">Andy</a>
</div>
</div>
<div class="altcomment">
<h4>
<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl39_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#566">#</a>
<span>re: Zooming to task results automatically<a name="566"></a></span>
</h4>
<div class="commentsbody">
<p>Thanks for the post and the control. Will this zoom to a feature returned by a geoprocessing task or is that beyond its intentions? I have a simple geoprocessing task that returns a buffer feature and would like apply this zoom control so that the viewer is zoomed to the feature that is returned in the results area and displayed on the map. It was set up in ArcMap and published as suggested in the samples with the only modification happening to the model itself...I have tried the suggested implementation above with no luck (it works great for my geocoding service though!). Thanks for any suggestions.</p>
</div>
<div class="commentssubhead">
<span class="commentspan"></span>Thursday, November 01, 2007 11:14 AM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl39_NameLink" title="japete02" href="/Dev/user/Profile.aspx?UserID=2949" target="_blank">japete02</a>
</div>
</div>
<div class="comment">
<h4>
<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl40_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#619">#</a>
<span>re: Zooming to task results automatically<a name="619"></a></span>
</h4>
<div class="commentsbody">
<p>Thanks for the control. It's been working great, but now I have users wanting to see a different marker symbol used for the selection graphic. They don't like the pushpin. I assume that can be done by extending the control similar to the zooming, but I'm at a loss as to where that would be. I hope it isn't something trivial that I've just overlooked. Thanks</p>
</div>
<div class="commentssubhead">
<span class="commentspan"></span>Thursday, November 15, 2007 1:48 PM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl40_NameLink" title="ksgizmo" href="/Dev/user/Profile.aspx?UserID=5832" target="_blank">ksgizmo</a>
</div>
</div>
<div class="altcomment">
<h4>
<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl41_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#630">#</a>
<span>re: Zooming to task results automatically<a name="630"></a></span>
</h4>
<div class="commentsbody">
We have used both "automatically display query results" and "automatically zoom to query results" both with success. Now the trick is to find a way to alter the query itself. We would like to have all the query drop down come up - but only select based on drop downs the user has altered...i.e. we have a demographics query box with pull downs for each variable, and we only want the system to query gender if that's all that the user changes, not race, gender, age. We use a value of "99" in some other places on our website that use OLAP data. Any hints?
</div>
<div class="commentssubhead">
<span class="commentspan"></span>Tuesday, November 20, 2007 7:08 AM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl41_NameLink" title="Jason" rel="nofollow" href="/Dev/utility/Redirect.aspx?U=http%3a%2f%2fwww.floridacharts.com" target="_blank">Jason</a>
</div>
</div>
<div class="comment">
<h4>
<a id="ctl00___ctl00___ctl01___Comments___Comments_ctl42_PermaLink" Title="permalink" href="/Dev/blogs/arcgisserver/archive/2007/08/28/Automatically-zooming-to-task-results.aspx#663">#</a>
<span>re: Zooming to task results automatically<a name="663"></a></span>
</h4>
<div class="commentsbody">
I have added the custom control but when I try to search in the web application i get the following Pop-Up and then nothing happens. "An unhandles exception has occured: There was an error in callback." Does anyone know why I am getting this.
</div>
<div class="commentssubhead">
<span class="commentspan"></span>Wednesday, November 28, 2007 9:48 AM by <a id="ctl00___ctl00___ctl01___Comments___Comments_ctl42_NameLink" title="Noran Badawi" target="_blank">Noran Badawi</a>
</div>
</div>
</asp:Repeater>
</div>
<div id="commentform">
<h3>Leave a Comment</h3>
<dl>
<dt><label for="ctl00___ctl00___ctl01___form___tbTitle">Title</label> <em>(required)</em><span id="ctl00___ctl00___ctl01___form___Requiredfieldvalidator1" style="color:Red;visibility:hidden;">*</span></dt>
<dd><input name="ctl00$_$ctl00$_$ctl01$_$form$_$tbTitle" type="text" value="re: Zooming to task results automatically" id="ctl00___ctl00___ctl01___form___tbTitle" class="smallbox" /></dd>
<dt id="ctl00___ctl00___ctl01___form___NameTitle"><label for="ctl00___ctl00___ctl01___form___tbName">Name</label> <em>required</em><span id="ctl00___ctl00___ctl01___form___Requiredfieldvalidator2" style="color:Red;visibility:hidden;">*</span></dt><dd id="ctl00___ctl00___ctl01___form___Name
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -