gpt4 book ai didi

javascript - ArcGIS REST web_map_as_json 定义表达式

转载 作者:行者123 更新时间:2023-11-30 14:31:38 25 4
gpt4 key购买 nike

我正在使用 Javascript 对 ArcGIS 10.5 服务器上的 ExportWebMap 函数进行 REST 调用,该函数返回 map 图像。返回了 map 图像,但当我只想要一个点时它会显示所有点。我认为我的 defitinitionExpression 被忽略了。我查看了文档和论坛,但没有发现我的错误。

MAP QUERY URL:我可以通过 OBJECTID 成功查询 MapServer 以获取单个点

https://<baseUrl>/<arcserver>/rest/services/<project>/<map>/MapServer/export 

REST 网址:

https://<baseUrl>/<arcserver>/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task/execute

这是我发布到导出 Web map 时的参数

Layout_Template: MAP_ONLY,
Format: PNG32,
f: json
Web_Map_as_JSON:
{
"mapOptions":
{
"showAttribution":false,
"extent":
{
"xmin":-118.85360990096176,
"ymin":33.99062491328014,
"xmax":-118.75318799544432,
"ymax":34.04042561067984,
"spatialReference":
{
"wkid":4326
}
},
"spatialReference":
{
"wkid":4326
}
},
"operationalLayers":
[
{
"id":null,
"title":"All Wells",
"opacity":1,
"url":"https://<baseUrl>/<arcserver>/rest/services/<project>/<map>/MapServer",
"layers":
{
"id":0,
"layerDefinition":
{
"definitionExpression":"OBJECTID=27100"
}
}
}
],
"baseMap":
{
"title":"Street Basemap",
"baseMapLayers":
[
{
"url":"https://services.arcgisonline.com/arcgis/rest/services/ESRI_StreetMap_World_2D/MapServer",
"opacity":1
}
]
},
"exportOptions":
{
"dpi":96,
"outputSize":[250,210]
}
}

最佳答案

通过将业务层从 map 服务器更改为要素服务器并移动 layerDefinition 来解决。我的理解是 map 服务器能够执行我想要的操作,但可能存在我不知道的服务器配置选项。

Web_Map_as_JSON:
{
"mapOptions":
{
"showAttribution":false,
"extent":
{
"xmin":-118.85360990096176,
"ymin":33.99062491328014,
"xmax":-118.75318799544432,
"ymax":34.04042561067984,
"spatialReference":
{
"wkid":4326
}
},
"spatialReference":
{
"wkid":4326
}
},
"operationalLayers":
[
{
opacity: 1,
url: "https://<baseUrl>/<arcserver>/rest/services/<project>/<map>/FeatureServer/0",
layerDefinition: {
definitionExpression: "OBJECTID=27100"
}
},
],
"baseMap":
{
"title":"Street Basemap",
"baseMapLayers":
[
{
"url":"https://services.arcgisonline.com/arcgis/rest/services/ESRI_StreetMap_World_2D/MapServer",
"opacity":1
}
]
},
"exportOptions":
{
"dpi":96,
"outputSize":[250,210]
}
}

关于javascript - ArcGIS REST web_map_as_json 定义表达式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51083503/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com