POST
|
You can call the following method: http://help.arcgis.com/en/webapi/wpf/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.TaskBase~CancelAsync.html
if (queryTask.IsBusy)
queryTask.CancelAsync();
queryTask.ExecuteAsync(query);
Yes, I tried that first but it didn't help :(. I found that, while the QueryTask is still running, and I try to add another map, my code has the following code to get map json result. This execution takes longer until it is timed out. While it is being processed, my application hangs until it is timed out and done. I don't know why the QueryTask causes the line not be able to executed. If QueryTask is not running, it only takes few seconds. var client = new System.Net.WebClient(); StreamReader reader = new StreamReader(clien.openRead(<my map URL here>));
... View more
08-01-2011
02:14 PM
|
0
|
0
|
724
|
POST
|
Hi, Is there a document on how to cancel an excuting QueryTask properly? I know that there is method CancelAsync(), but I want to know more if additional steps need to be done to have this done properly. Thanks! I found the following post which is what I'm looking for. However, does that mean that the query is still running on the back end? It is not really stopped? Is there a way to really stop it? http://forums.arcgis.com/threads/20473-cancel-query-task-in-flex We have a hanging problem when the query is still running. Our application allows users to add more than 1 map. In one test case, our map query result is supposed to be big, and it takes long long time. After I try to cancel by just unregistering the events as suggested in the post, then add another map, the application just hangs. So, I think that the running queryTask causes this problem and looks like we cannot stop it?? Please help!
... View more
07-27-2011
09:07 AM
|
0
|
0
|
724
|
POST
|
Hi, Is there a document on how to cancel an excuting QueryTask properly? I know that there is method CancelAsync(), but I want to know more if additional steps need to be done to have this done properly. Thanks!
... View more
07-27-2011
05:22 AM
|
0
|
11
|
5415
|
POST
|
WE have a map service name similar to below: http://<machine name>:8399/arcgis/rest/services/????????????mapservice/MapServer When going to browser using the above URL but the name is encoded as below, I can see the map service http://<machine name>:8399/arcgis/rest/services/%E4%B8%AD%E6%96%87MapServices/MapServer This encoded URL was given to me and I don't know how it was done. In code, to read json for the map service, I do the following: var client = new System.Net.WebClient(); StreamReader reader = null; try { reader = new StreamReader(client.OpenRead(this.MapURL + "?f=json")); }... if(reader != null) mapJsonResult = reader.ReadToEnd(); this.MapURL is encoded using: System.Web.HttpUtility.UrlPathEncode(mapURLSb.ToString()); mapURLsb is the map service URL. However, the line reader.ReadToEnd(); has problem, the message is "\r\n\r\n\r\n\r\n{\r\n\"error\" : {\r\n\t\"code\" : 404,\r\n\t\"message\" : \"Service '????????????mapservice' of type 'MapServer' does not exist or is inaccessible.\",\r\n\t\"details\":[\r\n\t\r\n\t]\r\n}\r\n}" As I checked, my encoded mapURL is not the same as the one given. My encoded url: "http://<machine name>:8399/arcgis/rest/services/%e5%9c%b0%e5%9b%be%e6%9c%8d%e5%8a%a1mapservice/MapServer" If I paste the given encoded URL as mentioned on top to my mapURL, it works. I don't know what I should do or what is wrong with my code. Please help!!! Thanks!
... View more
06-09-2011
06:28 AM
|
0
|
1
|
731
|
POST
|
If I had expression, I would be able to copy the xaml for the basic navigation and modify it from Visual Studio. However, I don't have expression. If you have expresion and have the xaml code for the basic navigation, would you please attach the code to this post? Thanks! Found the xaml code for navigation at esri source code: http://esrisilverlight.codeplex.com/SourceControl/changeset/view/60541#722559
... View more
04-27-2011
05:27 AM
|
0
|
0
|
351
|
POST
|
Sure you can customize the template: http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2010/05/20/Use-control-templates-to-customize-the-look-and-feel-of-ArcGIS-controls.aspx If I had expression, I would be able to copy the xaml for the basic navigation and modify it from Visual Studio. However, I don't have expression. If you have expresion and have the xaml code for the basic navigation, would you please attach the code to this post? Thanks!
... View more
04-27-2011
05:24 AM
|
0
|
0
|
351
|
POST
|
Sure you can customize the template: http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2010/05/20/Use-control-templates-to-customize-the-look-and-feel-of-ArcGIS-controls.aspx I read that page before posting the question, but I don't have Expression Blend. I guess I will have to figure it out in WPF. Thanks!
... View more
04-27-2011
05:03 AM
|
0
|
0
|
351
|
POST
|
I think this is related thread: http://forums.arcgis.com/threads/19079-Disabling-Map-Mouse-Events I handled this by setting e.Handled = true in PreviewMouseWheel handler method. That works but I have to give up in making my scroll viewer worked when the cursor is inside the map.
... View more
04-26-2011
10:38 AM
|
0
|
0
|
823
|
POST
|
From ArcGis samples, I can add navigation by doing the following: <esri:Navigation Margin="5" HorizontalAlignment="Left" VerticalAlignment="Bottom" Map="{Binding ElementName=MyMap}" > </esri:Navigation> I want to add 2 buttons (in red border in the attached image) to the navigation. Is there a way I can do this?
... View more
04-26-2011
10:31 AM
|
0
|
5
|
752
|
POST
|
If you want to stop any interaction with your map when the tab view is not active, you can set to false the IsHitTestVisible property of your map. Just my 2cts, there is probably more subtil solutions:o This does not work well 😞 because my app has a scrollviewer, when setting isHitTestVisible to false, scrolling the mouse wheel while the cursor is on the map does not scroll the window vertical bar and I want it worked as before, only the map zooming function is disabled. In addition, I think the map was still set focused or something. That is why I ask if there is a way to disable this. Thanks!
... View more
04-15-2011
04:23 AM
|
0
|
0
|
823
|
POST
|
When I scroll mouse wheel, map is zoomed in or out. This is a nice feature. In our application, there are cases that I want this behavior to be active or inactive. For instance, I add a map into a "tab view". If the tab view is NOT active, and I scroll the mouse wheel, I do not want the map to be zoomed in or out. If the tab view is active, I want the map to be zoomed in/out when I scroll the mouse wheel. How can I do this? Thanks! To be clear, how can I disable or enable the Arcgis built-in mouse wheel function? Please let me know if it is doable or not. Thanks!
... View more
04-14-2011
05:35 AM
|
0
|
0
|
823
|
POST
|
I've never got MaintainExtentBehavior worked for my WPF application. I wonder if this function only works for Silverlight? Am I right? I no longer get compiled errors as mentioned in this original post, but got an error at runtime as below: A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll This was because I added <i:Interaction.Behaviors> <esriBehaviors:MaintainExtentBehavior x:Uid="meb" /> </i:Interaction.Behaviors> I removed the xaml code and tried to add the code below to the behind code as suggested, I didn't get runtime error but the map extent just didn't change when I resized my window. It didn't work. System.Windows.Interactivity.Behavior behavior = new ESRI.ArcGIS.Client.Behaviors.MaintainExtentBehavior(); System.Windows.Interactivity.Interaction.GetBehaviors(MyMap).Add(behavior); I tried a simple map application, it worked fine! Don't know what may cause the problem I have.
... View more
04-13-2011
11:38 AM
|
0
|
0
|
80
|
POST
|
I've never got MaintainExtentBehavior worked for my WPF application. I wonder if this function only works for Silverlight? Am I right? I no longer get compiled errors as mentioned in this original post, but got an error at runtime as below: A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll This was because I added <i:Interaction.Behaviors> <esriBehaviors:MaintainExtentBehavior x:Uid="meb" /> </i:Interaction.Behaviors> I removed the xaml code and tried to add the code below to the behind code as suggested, I didn't get runtime error but the map extent just didn't change when I resized my window. It didn't work. System.Windows.Interactivity.Behavior behavior = new ESRI.ArcGIS.Client.Behaviors.MaintainExtentBehavior(); System.Windows.Interactivity.Interaction.GetBehaviors(MyMap).Add(behavior);
... View more
04-13-2011
10:49 AM
|
0
|
0
|
363
|
POST
|
When I scroll mouse wheel, map is zoomed in or out. This is a nice feature. In our application, there are cases that I want this behavior to be active or inactive. For instance, I add a map into a "tab view". If the tab view is NOT active, and I scroll the mouse wheel, I do not want the map to be zoomed in or out. If the tab view is active, I want the map to be zoomed in/out when I scroll the mouse wheel. How can I do this? Thanks!
... View more
04-11-2011
07:15 AM
|
0
|
5
|
2344
|
POST
|
I actually showed this to our Dev Lead yesterday and he thinks it's a bug. While you seem to be able to navigate through the graphics through tabbing or CTRL + Arrow keys, you are only getting the graphic element which is a control that is associated to the graphic. To demonstrate that this tab property is inherited from Control. You can try the following sample in your WPF application. Notice that you can tab through control items unless you set their IsTabStop to false.
<StackPanel>
<StackPanel.Resources>
<ControlTemplate x:Key="MyEllipse" TargetType="{x:Type Control}">
<Ellipse Height="50" Width="50" Fill="Red"/>
</ControlTemplate>
<ControlTemplate x:Key="MyRectangle" TargetType="{x:Type Control}">
<Rectangle Height="50" Width="50" Fill="Blue"/>
</ControlTemplate>
</StackPanel.Resources>
<Button Content="My Button"/>
<ListBox>
<ListBox.Items>
<sys:String>item 1</sys:String>
<sys:String>item 2</sys:String>
<sys:String>item 3</sys:String>
</ListBox.Items>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Control Template="{StaticResource MyEllipse}"/>
<Control Template="{StaticResource MyRectangle}"/>
</StackPanel>
Thank you! So, Graphic class has IsTabStop=true by default and it should be set to false? I think it is a nice feature to have though. If Arcgis can provide a function to grab graphic of the focused area, it would be helpful to consumers like us.
... View more
04-07-2011
12:09 PM
|
0
|
0
|
471
|
Title | Kudos | Posted |
---|---|---|
1 | 11-15-2010 10:50 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|