Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/322.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 地理处理服务-调用后清空内存_C#_Asp.net_Arcgis_Esri_Arcgis Server - Fatal编程技术网

C# 地理处理服务-调用后清空内存

C# 地理处理服务-调用后清空内存,c#,asp.net,arcgis,esri,arcgis-server,C#,Asp.net,Arcgis,Esri,Arcgis Server,下面是ADF库的示例 我实际上是在用地理处理服务围绕一个点画一个圆圈。半径约为20公里 代码运行良好,但“清除”例程却不行。每次我从以前的数据中清除映射时,缓冲区服务的内存也不会被清除,我得到了这个结果 “清除”例程的代码与示例相同,但不起作用: // Clears features from all graphics layers in the resource specified by _graphicsResourceName protected void ClearGraphics(

下面是ADF库的示例

我实际上是在用地理处理服务围绕一个点画一个圆圈。半径约为20公里

代码运行良好,但“清除”例程却不行。每次我从以前的数据中清除映射时,缓冲区服务的内存也不会被清除,我得到了这个结果

“清除”例程的代码与示例相同,但不起作用:

// Clears features from all graphics layers in the resource specified by _graphicsResourceName
protected void ClearGraphics()
{
    // Retrieve the resource and clear its graphics dataset
    ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource graphicsMapResource =
        Map1.GetFunctionality(_graphicsResourceName).Resource as
        ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource;
    graphicsMapResource.Graphics.Clear();

// This won't work too
GeoprocessingResourceManager1.GetResource(0).ClearState();

// Refresh the resource and copy the map's callback results to the callback results collection so
// the graphics are removed from the map
Map1.RefreshResource(graphicsMapResource.Name);
_callbackResultCollection.CopyFrom(Map1.CallbackResults);
}
这应该很简单,但我不知道如何解决这个问题。。我找到的唯一解决方案是重新启动IIS服务器,这显然非常糟糕


有人能帮我吗?

通过清除作业队列来解决

我通常使用GraphicsLayer功能。GraphicsDataSet.Tables.Clear()

ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource myMapResource myMapResource.Graphics.Tables.Remove(图形元素)


您实际上是在处理.NET数据集

能否显示用于绘制圆圈的代码?(大致)这是代码:查找注释过的零件,以便对发生的事情有一个大致的解释。我不够清楚,我指的是将圆添加到集合中的代码。您正在使用
renderer.GetAllSymbols
方法获取项目列表。必须在某个地方创建这些符号并将其添加到集合中?我没有使用这个API,但我会在这里查找。我认为点是在这里添加的://将每个点添加到功能图形层,我们将其用作GP任务foreach的输入(pointElementGraphicsLayer.Rows中的System.Data.DataRow DataRow){ESRI.ArcGIS.ADF.Web.Geometry.Point adfPoint=pointElementGraphicsLayer.GeometryFromRow(数据行)作为ESRI.ArcGIS.ADF.Web.Geometry.Point;featureGraphicsLayer.Add(adfPoint);}