POST
|
Aha, I found a solution on the forums once I used "elementhost" as a keyword. http://forums.arcgis.com/threads/79379-Use-UseAcceleratedDisplay-true-with-ElementHost I had to include PresentrationFramework, System.Xaml, and WindowsBase references in my forms project. I then added the following line as described in the above post. new System.Windows.Application(); Cheers and Thanks Mike! Now I can stop banging my head against the wall :confused:
... View more
11-22-2013
10:46 AM
|
1
|
0
|
356
|
POST
|
I am getting an "Object reference not set to an instance of an object." exception at StackTrace " at ESRI.ArcGIS.Client.DrawingSurface..ctor(Single dpi)\r\n at ESRI.ArcGIS.Client.AcceleratedDisplayLayers.Initialize() string as reported in the InitializationFailed handler for my AcceleratedDisplayLayers group. A sample xaml is provided below. Basically the example below works perfectly fine when I move the local feature layer outside of the AcceleratedDisplayLayers group. If I keep it in the accelerated layers I get the exception. It should also be noted that my base application is a WinForms app so I have my map in a WPF control that is hosted in my form using ElementHost. I can take the markup below and set it up in a new WPF application and it seems to work as is? Very strange... Hopefully someone else has run into this and has some insight! Edit: I have now referenced the project containing the WPF control that is giving me the exception to my WPF test project and can load up the control just fine in a WPF window with no initialization exception. Accelerated layers support doesn't seem to like being hosted in a WinForm via ElementHost. <Grid x:Name="LayoutRoot" Background="#FFE6E6E6" HorizontalAlignment="Stretch"> <Grid.Resources> <esri:LocalFeatureService x:Key="FeatureService" Path="USCitiesStates.mpk" MaxRecords="30000" /> <esri:SimpleRenderer x:Key="MySimplePolygonRenderer"> <esri:SimpleRenderer.Symbol> <esri:SimpleFillSymbol Fill="#440000FF" /> </esri:SimpleRenderer.Symbol> </esri:SimpleRenderer> </Grid.Resources> <esri:Map x:Name="arcMap" Background="#FFE3E3E3" MinimumResolution="0.1"> <esri:AcceleratedDisplayLayers InitializationFailed="AcceleratedDisplayLayers_InitializationFailed"> <esri:ArcGISLocalFeatureLayer ID="States" Service="{StaticResource FeatureService}" LayerName="States" IsHitTestVisible="False" Renderer="{StaticResource MySimplePolygonRenderer}" OutFields="*"/> </esri:AcceleratedDisplayLayers> </esri:Map> </Grid>
... View more
11-22-2013
09:33 AM
|
0
|
1
|
3016
|
POST
|
Hey Mike, just wondering, are we going to see a labeling engine added soon to any of the .NET SDKs?
... View more
08-09-2013
01:46 PM
|
0
|
0
|
738
|
POST
|
Hey Mike, Thanks for that detailed response. I am glad that we're getting an improved version of the WPF SDK so that we get that as we ease the transition to the new SDK. One of the biggest drawbacks of the current SDK is its lack of a proper labeling engine. Are we getting that any time soon?
... View more
07-17-2013
08:08 AM
|
0
|
0
|
738
|
POST
|
Hi Mike, Will there be a 10.2 release for the ArcGIS Runtime SDK for WPF prior to the transition to the new ArcGIS Runtime SDK for .NET? If so, when is that scheduled? Thanks, George
... View more
07-17-2013
05:55 AM
|
0
|
0
|
719
|
POST
|
Hello, Is it possible with WPF to display a layer with a label that comes from a certain field in the feature table. I would like to take a look at the code sample that does this. The thing that I need to do is to display a number of weather station and display the current value of the temperature at the weather station. Thanks You can use the GeometryService class to get the point where you can place a symbol (like a TextSymbol for text) for each feature you want. There isn't a really good labeling engine in the Runtime SDK yet, but I hear there are plans for one in the near future. -George
... View more
06-18-2013
10:08 AM
|
0
|
0
|
278
|
POST
|
I am having an issue with selecting a feature after zooming to it. If the feature is within the spatial extent before zooming to it then I am able to successfully select it. If the feature I am zooming to is not within the spatial extent and I zoom to it then selecting the feature fails. I noticed that the feature Layer only contains features in the spatial extent so when I loop through it to find the feature to select, it is only there if it is currently in the spatial extent. I tried to refresh the feature Layer after zooming to it but it doesn't appear to update to the new extent that I zoomed too. Is there a step that I am missing to force the feature layer to update its list of features after the zoom or is there a way to query all the features in a featureLayer. Thanks for any help Assuming that you have your feature layer set to On Demand mode, I had this exact same problem. How do you zoom to the feature? Did you get the feature from a QueryTask? If so, you can just add that feature to the Graphics collection of your feature layer and select it. Something like: myLayer.Graphics.Add(feature); feature.Selected = true; To make it better, you could first check to see if you already have that feature in the Graphics collection, and only add it if it's not there: var graphic = myLayer.Graphics.FirstOrDefault(g => g.Geometry.Extent.Equals(feature.Geometry.Extent)) if (graphic == null) { graphic = feature; myLayer.Graphics.Add(feature); } graphic.Selected = true; This worked for me, and I couldn't find any other cleaner way to do it. -George
... View more
06-18-2013
10:04 AM
|
0
|
0
|
346
|
POST
|
Hi, I would like to know if there's any way to allow the user to zoom further than what my base map allows. My other layers have more detail than the base map, so I would like the user to be able to zoom in. Thanks.
... View more
05-14-2013
02:08 PM
|
0
|
4
|
2262
|
POST
|
Capture the task/job status and retry the tool (for a limited count!) until it succeeds. I thought of doing this, but I hoped there was a better solution. Execute your code on a PC/VM that has just the default Windows build i.e. no antivirus or group policies that might restrict your app writing to the temp directory. (This seems to be a common cause for ERROR 000210 and the like.) It's gonna be difficult for me to do this since all machines here have an anti-virus installed. I'd be interested if you were able to share any GPO rules you are aware of and the flavour of antivirus you use. (I have a dev laptop running a default build of 32-bit Win7 SP1 and Symantec Endpoint Protection off the network and it runs fine, however our enterprise build of 64-bit Win7 SP1 and Microsoft Forefront Endpoint Protection has the issue you describe.) For a while, it seemed that submitJob worked better than executeAsync and that x86 Windows worked better than x64, but it seems to relate more to the user temp directory access and my current thinking is that it isn't actually a bug with the Runtime SDK. Interesting. My anti-virus is managed through the network by my workplace, and it looks like we use System Center 2012 Endpoint Protection. I can't turn it off, apparently, but I will talk to the Systems department. Thanks for your helpful answer, Matthew.
... View more
05-08-2013
06:02 AM
|
0
|
0
|
431
|
POST
|
Does anyone know why executing the geoprocessor (from a local geoprocessing service) results in intermittent exceptions being thrown? It will fail and succeed intermittently with the same parameters being passed. Is there anything I can do to prevent this from happening? ESRI.ArcGIS.Client.Tasks.ServiceException was caught Message=Unable to complete operation. Source=ESRI.ArcGIS.Client Code=400 StackTrace: at ESRI.ArcGIS.Client.Tasks.TaskBase.Request(String url, Dictionary`2 parameters, Boolean forcePost) at ESRI.ArcGIS.Client.Tasks.Geoprocessor.Execute(List`1 parameters) at TAGISViewer.GeoprocessingDialog.<DoRunSelectedTool>b__0() in C:\Source\PACS.NET\Source\Development\PACS.NET-1.0\Washington\TAGISViewer\Dialogs\GeoprocessingDialog.cs:line 410 InnerException: Details: Error executing tool.: ERROR 000210: Cannot create output C:\Users\gfaraj\AppData\Local\Temp\arcgisruntime_11992\geotools\jobs\_\j5c946bbf0d954cf19138cffb3190f140\scratch\scratch.gdb\Buffer487 Failed to execute (Buffer). Failed to execute (BufferModel). Failed to execute (BufferModel). Failed to execute (BufferModel).
... View more
05-02-2013
01:26 PM
|
0
|
4
|
2604
|
POST
|
The thing is, I don't know what shapefiles will be used in my app beforehand. The user can load any number of shapefiles/MPKs/GDBs/etc into the map, I just want to have a default basemap added at the beginning. Can I just download the topographic MXD and save it as a TPK without any extra shape files? PS: Where do I download that MXD?
... View more
04-26-2013
04:55 AM
|
0
|
0
|
417
|
POST
|
So, I should be able to add the WTM basemap in ArcMap, then share it as a TPK and when I load it in my app in the internet-less machine, it should work?
... View more
04-25-2013
05:17 AM
|
0
|
0
|
417
|
POST
|
I have map_PreviewMouseDown Event in Layers_CollectionChanged to Attach/Detach MeasureAction and perform MeasureAction multiple times. The code is working fine. But my Map Control crashes with the following exception in between. Can you tell me how to fix this exception. --------------------------------------------------------------------------- Source:mscorlib Description:Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index Call Stack: at System.ThrowHelper.ThrowArgumentOutOfRangeException() at System.Collections.Generic.List`1.get_Item(Int32 index) at ESRI.ArcGIS.Client.Behaviors.Utilities.Measure.map_MouseLeftButtonDown(Object sender, MouseButtonEventArgs e) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent) at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) -----------------------------------------------------------------------------------------------
... View more
04-18-2013
12:23 PM
|
0
|
0
|
353
|
POST
|
I finally got this working. I'll put the code here in case anyone else needs help with this. I needed to specify the correct field type, and especially I needed to correctly identify the OID field too. Thanks for everyone that helped. public static ICollection<Field> GetFields(Graphic graphic) { var fields = new List<Field>(); foreach (var attribute in graphic.Attributes) { var field = new Field() { FieldName = attribute.Key, Alias = attribute.Key }; if (attribute.Key.ToLower() == "shape") { field.Type = Field.FieldType.Geometry; } else if (attribute.Key.ToLower() == "fid") { field.Type = Field.FieldType.OID; } else if (attribute.Key.ToLower() == "objectid") { field.Type = Field.FieldType.OID; } else if (attribute.Value is int) { field.Type = Field.FieldType.Integer; } else if (attribute.Value is double) { field.Type = Field.FieldType.Double; } else if (attribute.Value is float) { field.Type = Field.FieldType.Single; } else if (attribute.Value is DateTime) { field.Type = Field.FieldType.Date; } else { field.Type = Field.FieldType.String; } fields.Add(field); } return fields; }
... View more
04-18-2013
08:25 AM
|
0
|
0
|
1084
|
Title | Kudos | Posted |
---|---|---|
1 | 11-22-2013 10:46 AM | |
1 | 11-09-2012 11:26 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|