Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.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
我可以将请求作为imageArcgisRest | OPENLAYERS 6.5的post请求发送吗_Openlayers_Openlayers 6 - Fatal编程技术网

我可以将请求作为imageArcgisRest | OPENLAYERS 6.5的post请求发送吗

我可以将请求作为imageArcgisRest | OPENLAYERS 6.5的post请求发送吗,openlayers,openlayers-6,Openlayers,Openlayers 6,我正在使用imageArcgisRest源代码,我需要在导出层API中按ID过滤数据,ID可以是数千。因此,获取请求是不可能做到这一点的。是否有任何方法可以使用OpenLayers imageArcGisRest源作为post方法请求数据 以下是我创建源代码的代码: const source = new ImageArcGISRest({ url: l.url, crossOrigin: 'anonymous', params: { dpi: 96,

我正在使用imageArcgisRest源代码,我需要在导出层API中按ID过滤数据,ID可以是数千。因此,获取请求是不可能做到这一点的。是否有任何方法可以使用OpenLayers imageArcGisRest源作为post方法请求数据

以下是我创建源代码的代码:

const source = new ImageArcGISRest({
    url: l.url,
    crossOrigin: 'anonymous',
    params: {
      dpi: 96,
      FORMAT: 'PNG8',
      layers: `show: 1`,
      token: 'api-token-here'
    },
  });

此设置在一个简单的测试中工作(使用测试浏览器,因为示例服务器不支持CORS),以过滤OpenLayers示例中的高速公路

可以使用动态更新过滤器

source.updateparams({layerDefs: JSON.stringify(filter)});

您需要使用设置
imageLoadFunction
选项。然后,您可以通过xhr加载图像,加载方式与tileLoadFunction中的加载方式相同。这将与地图放大和缩小功能一起工作,或者我们需要手动处理它。它应该使用您提供的参数和OpenLayers动态生成的参数来处理任何图像请求。好的,非常感谢您的帮助。它对我有用:)
source.updateparams({layerDefs: JSON.stringify(filter)});