查询缓冲接收错误:错误代码0? (适用于Google地图的ArcGis服务器链接)

时间:2012-09-12 03:04:35

标签: javascript gis arcgis arcgis-server

我一直在尝试将缓冲区功能添加到正在进行的项目中,该项目使用arcgis服务器链接进行谷歌地图here

我能够在地图上绘制缓冲区,但是,当我尝试实现缓冲区的查询(使用proxy.ashx)时,根据firebug,代理加载正常,但它们返回错误, “错误:错误代码0”,没有别的。我因此而陷入困境。

我不确定代理配置文件是否错误或是代码。我目前正在使用上面链接中的图层查询作为如何通过缓冲区查询的参考,通过指示空间过滤器本身就是缓冲区。

以下是代码:

var layer = overlayObjects['ls'].getMapService().getLayer(0);

var params = {
    geometry: buffers,
    geometryType: "esriGeometryPolygon",
    where:" ",
    spatialRelationship: "CONTAINS",
    returnGeometry: true        
};  

layer.query(params, function(resultSet){...}

错误发生在layer.query()方法。

我的代理配置文件:

<ProxyConfig mustMatch="true">
<serverUrls>
<!-- serverUrl options:
        url = location of the ArcGIS Server, either specific URL or stem
        matchAll = true to forward any request beginning with the url
        token = (optional) token to include for secured service
        dynamicToken = if true, gets token dynamically with username and
          password stored in web.config file's appSettings section.
-->

<serverUrl url="http://*mapserverlink*/ArcGIS/rest/services/"
           matchAll="true"></serverUrl>
</serverUrls>

</ProxyConfig>    

由于某些安全原因,我不确定是否应将服务器URL放在此处。无论如何,serverUrl不是安全的,所以我认为不需要令牌。

另外..是因为我使用的缓冲区对象不是overlayView对象吗?正如queryOptions类引用中所述。我的缓冲与上面链接中的示例中的缓冲大致相同。我已经使用从缓冲区获得的Geometry进行了测试,并将其放入mapserver的查询服务中,并收回了一系列记录,但不是javascript。

对此有任何帮助将不胜感激..

1 个答案:

答案 0 :(得分:0)

很抱歉将google maps api v3放入其中,因为我认为它包含在我正在查看的api参考中。我已经设法找出错误代码0的错误。我已经阅读了项目中的arcgislink.js,并看到代码0来自XMLHTTPRequest的状态代码。经过服务器的一些配置后,它现在正在工作..