ArcGIS Wpf MarkerSymbol 图形符号无法序列化为 JSON
【问题贴,尚不知如何解决】
在GraphicsLayer中添加一个点,使用自定义模板渲染该点,在Vs2012设计界面可以看到,但运行时出现异常
代码如下:
<esri:Graphic x:Name="MyGrapic" >
<esri:Graphic.Geometry>
<esri:MapPoint X="120.198704" Y="35.957860" >
<esri:MapPoint.SpatialReference>
<esri:SpatialReference WKID=""/>
</esri:MapPoint.SpatialReference>
</esri:MapPoint>
</esri:Graphic.Geometry>
<esri:Graphic.Symbol>
<esri:MarkerSymbol>
<esri:MarkerSymbol.ControlTemplate>
<ControlTemplate>
<Image Source="Images\addvector.png"></Image>
</ControlTemplate>
</esri:MarkerSymbol.ControlTemplate>
</esri:MarkerSymbol>
</esri:Graphic.Symbol>
</esri:Graphic>
异常信息:
未处理System.ArgumentException
HResult=-
Message=图形符号无法序列化为 JSON
Source=ESRI.ArcGIS.Client
StackTrace:
在 ESRI.ArcGIS.Client.Runtime.NativeGraphicsLayer.GetSymbolJson(Graphic graphic)
在 ESRI.ArcGIS.Client.Runtime.NativeGraphicsLayer.SerializeGraphic(Graphic graphic, Geometry displayGeometry, BinaryWriter output)
在 ESRI.ArcGIS.Client.Runtime.NativeGraphicsLayer.<>c__DisplayClass6.<AddGraphics>b__5(BinaryWriter w)
在 ESRI.ArcGIS.Client.Utils.BinaryWriterExtensions.Write(Action` writeAction)
在 ESRI.ArcGIS.Client.Runtime.NativeGraphicsLayer.AddGraphics(IEnumerable` graphicGeometryPairs)
在 ESRI.ArcGIS.Client.Runtime.NativeGraphicsLayer.AddGraphics()
在 ESRI.ArcGIS.Client.Runtime.NativeGraphicsLayer.Initialize()
在 ESRI.ArcGIS.Client.NativeMap.AddLayer(Int32 index, Layer layer)
在 ESRI.ArcGIS.Client.DrawingSurface.AddLayer(Int32 index, Layer layer)
在 ESRI.ArcGIS.Client.DrawingSurface.FindIndexAndAddLayer(Layer layer, IList` collection)
在 ESRI.ArcGIS.Client.Map.TryAddLayerToDrawSurface(Layer layer)
在 ESRI.ArcGIS.Client.Map.layer_Initialized(Object sender, EventArgs e)
在 System.EventHandler`.Invoke(Object sender, TEventArgs e)
在 ESRI.ArcGIS.Client.Layer.OnInitialized(EventArgs e)
在 ESRI.ArcGIS.Client.Layer.Initialize()
在 ESRI.ArcGIS.Client.Map.OnApplyTemplate()
在 System.Windows.FrameworkElement.ApplyTemplate()
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Controls.Grid.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Controls.Grid.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
在 System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Controls.Border.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Window.MeasureOverrideHelper(Size constraint)
在 System.Windows.Window.MeasureOverride(Size availableSize)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Interop.HwndSource.SetLayoutSize()
在 System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
在 System.Windows.Window.SetRootVisualAndUpdateSTC()
在 System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)
在 System.Windows.Window.CreateSourceWindow(Boolean duringShow)
在 System.Windows.Window.ShowHelper(Object booleanBox)
在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
在 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
在 System.Windows.Threading.DispatcherOperation.InvokeImpl()
在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Windows.Threading.DispatcherOperation.Invoke()
在 System.Windows.Threading.Dispatcher.ProcessQueue()
在 System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
在 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
在 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
在 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
在 System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
在 System.Windows.Application.RunInternal(Window window)
在 System.Windows.Application.Run()
在 ArcGISWpfApplication1.App.Main() 位置 e:\-LituGaoke\ProjectCode\2015Projects\IOS\IOS\obj\Debug\Application.g.cs:行号
在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
在 System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
InnerException:
官方Api也是这么写的:
http://resources.arcgis.com/en/help/runtime-wpf/apiref/index.html - ESRI.ArcGIS.Client.Symbols Namespace : Symbol Class
<esriSymbols:MarkerSymbol OffsetX="" OffsetY="">
<esriSymbols:MarkerSymbol.ControlTemplate>
<ControlTemplate>
<Border Width="" Height="" CornerRadius=""
BorderBrush="Black" BorderThickness=""
Background="Blue">
<Image Source="myImage.png" />
</Border>
</ControlTemplate>
</esriSymbols:MarkerSymbol.ControlTemplate>
</esriSymbols:MarkerSymbol>
有遇到了另一个问题,使用<esri:PictureMarkerSymbol.ControlTemplate>自定义PictureMarkerSymbol,报出“不支持所指定方法”,异常信息如下:
未处理System.NotSupportedException
HResult=-
Message=不支持所指定的方法。
Source=ESRI.ArcGIS.Client
StackTrace:
在 ESRI.ArcGIS.Client.Symbols.PictureMarkerSymbol.ToJsonInternal(Boolean nativeMapSerialization)
在 ESRI.ArcGIS.Client.Symbols.PictureMarkerSymbol.ESRI.ArcGIS.Client.IJsonSerializableNativeDisplay.ToNativeDisplayJson()
在 ESRI.ArcGIS.Client.JsonSerializableExtensions.SerializeToJson(Object o, Boolean nativeDisplay)
在 ESRI.ArcGIS.Client.SimpleRenderer.ToJsonInternal(Boolean nativeDisplay)
在 ESRI.ArcGIS.Client.SimpleRenderer.ESRI.ArcGIS.Client.IJsonSerializableNativeDisplay.ToNativeDisplayJson()
在 ESRI.ArcGIS.Client.JsonSerializableExtensions.SerializeToJson(Object o, Boolean nativeDisplay)
在 ESRI.ArcGIS.Client.Runtime.NativeGraphicsLayer.UpdateRenderer()
在 ESRI.ArcGIS.Client.Runtime.NativeGraphicsLayer.OnPropertyChanged(String propertyName)
在 ESRI.ArcGIS.Client.Runtime.NativeLayer.layer_PropertyChanged(Object sender, PropertyChangedEventArgs e)
在 System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
在 ESRI.ArcGIS.Client.Layer.OnPropertyChanged(String propertyName)
在 ESRI.ArcGIS.Client.GraphicsLayer.set_Renderer(IRenderer value)
在 IOS.MainWindow.LbxFuntion_OnSelectionChanged(Object sender, SelectionChangedEventArgs e) 位置 e:\-LituGaoke\ProjectCode\2015Projects\IOS\IOS\MainWindow.xaml.cs:行号
在 System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
在 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
在 System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
在 System.Windows.Controls.ListBox.OnSelectionChanged(SelectionChangedEventArgs e)
在 System.Windows.Controls.Primitives.Selector.SelectionChanger.End()
在 System.Windows.Controls.Primitives.Selector.SetSelectedHelper(Object item, FrameworkElement UI, Boolean selected)
在 System.Windows.Controls.Primitives.Selector.NotifyIsSelectedChanged(FrameworkElement container, Boolean selected, RoutedEventArgs e)
在 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
在 System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
在 System.Windows.Controls.ListBoxItem.OnSelected(RoutedEventArgs e)
在 System.Windows.Controls.ListBoxItem.OnIsSelectedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
在 System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
在 System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
在 System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
在 System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
在 System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
在 System.Windows.DependencyObject.SetCurrentValueInternal(DependencyProperty dp, Object value)
在 System.Windows.Controls.ListBox.NotifyListItemClicked(ListBoxItem item, MouseButton mouseButton)
在 System.Windows.Controls.ListBoxItem.OnMouseLeftButtonDown(MouseButtonEventArgs e)
在 System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
在 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
在 System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
在 System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
在 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
在 System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
在 System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
在 System.Windows.Input.InputManager.ProcessStagingArea()
在 System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
在 System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
在 System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
在 System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
在 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
在 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
在 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
在 System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
在 System.Windows.Application.RunInternal(Window window)
在 System.Windows.Application.Run()
在 ArcGISWpfApplication1.App.Main() 位置 e:\-LituGaoke\ProjectCode\2015Projects\IOS\IOS\obj\Debug\Application.g.cs:行号
在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
在 System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
InnerException:
ArcGIS Wpf MarkerSymbol 图形符号无法序列化为 JSON的更多相关文章
- ArcGIS 添加 MarkerSymbol 弹出“图形符号无法序列化为 JSON”错误
今天在做一个demo,向自定义图层中添加MarkerSymbol的时候,弹出“图形符号无法序列化为 JSON”错误,之前都没有出现过这个问题,我们首先来看一看我是怎样去添加图层,然后向图层中添加Gra ...
- ArcGIS Runtime SDK for WPF之SimpleRenderer无法添加、报错“图形符号无法序列化为 JSON”
ArcGIS Runtime SDK for WPF之SimpleRenderer无法添加.报错“图形符号无法序列化为 JSON” 在上一篇博文中如果在 esri:Map 里面是否设置了的UseAcc ...
- Jquery 将表单序列化为Json对象
大家知道Jquery中有serialize方法,可以将表单序列化为一个“&”连接的字符串,但却没有提供序列化为Json的方法.不过,我们可以写一个插件实现. 我在网上看到有人用替换的方法,先用 ...
- 使用DataContractJsonSerializer类将类型实例序列化为JSON字符串和反序列化为实例对象 分类: JSON 前端 2014-11-10 10:20 97人阅读 评论(1) 收藏
一.JSON简介 JSON(JavaScript Object Notation,JavaScript对象表示法)是一种轻量级的数据交换格式. JSON是"名值对"的集合.结构由大 ...
- jQuery表单验证以及将表单序列化为json对象小练习
jquery表单验证(非实时验证),同时,将表单序列化为json对象提交表单. <!DOCTYPE html> <html lang="en"> <h ...
- JavaScriptSerializer类 对象序列化为JSON,JSON反序列化为对象
JavaScriptSerializer 类由异步通信层内部使用,用于序列化和反序列化在浏览器和 Web 服务器之间传递的数据.说白了就是能够直接将一个C#对象传送到前台页面成为javascript对 ...
- 将Dictionary序列化为json数据 、json数据反序列化为Dictionary
需要引用System.Web.Extensions dll类库 /// <summary> /// 将json数据反序列化为Dictionary /// </summary> ...
- 类对象序列化为json串,json串反序列化为类对象
1.类对象序列化为json串: 方法一: class P(object): def __init__(self,name,age,sex): self.name=name self.age=age s ...
- 将表单序列化为JSON对象
将表单序列化为JSON对象的工具方法: $(function() { //工具方法,可以将指定的表单中的输入项目序列化为JSON数据 $.fn.serializeJson = function() { ...
随机推荐
- MPI运行程序(接触)
网友遇到的问题并解决问题:mpich2在多个节点上运行并行程序时出错 我使用mpich2时遇到一下问题: 当我运行一个计算圆周率的并行程序cpi.c时,我想在指定的若干个节点上运行这个程序,比如hos ...
- numpy.distutils.system_info.NotFoundError: no lapack/blas resources found
python35用pip安装scipy的时候报错 numpy.distutils.system_info.NotFoundError: no lapack/blas resources found 原 ...
- VC运行库合集2005/2008/2010/2012/2013/2015
VC运行库合集2005/2008/2010/2012/2013/2015,批处理一键安装(需管理员权限) 链接:http://pan.baidu.com/s/1bpLZoFt 密码:bnk8
- Perl删除数组中元素的多种方法
Perl中的数组元素起始引用序号为0,@array的第一个元素为$array[0],依次递增,最后一个元素为$array[-1]或者$#array.如果要删除一个数组中已有的元素,可以用以下几个函数来 ...
- java为什么要设置环境变量
1. PATH环境变量.作用是指定命令搜索路径,在shell下面执行命令时,它会到PATH变量所指定的路径中查找看是否能找到相 应的命令程序.我们需要把 jdk安装目录下的bin目录增加到现有的PAT ...
- smarty3与2的差异导致的小问题
又是一天看视频~ 今天在PHP100上学习smartY教程,视频中讲到了在模板文件中直接写带有“{}”JAVASCRIPT脚本会报错,我照视频上的代码写了下来,如下: <script> f ...
- sql查询当前月内的所有日期
),),)) as dt from master..spt_values where type='P' ),),),,)')
- Codeforces Round #228 (Div. 1) B
B. Fox and Minimal path time limit per test 1 second memory limit per test 256 megabytes input stand ...
- POS管理系统之供应商新增
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"% ...
- CSS基础篇
写的不错,收藏 http://www.cnblogs.com/suoning/p/5625582.html