You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过Python requests移除Bing Maps API中的定位图钉?

彻底移除Bing Maps航拍地图图钉的解决方案

要彻底移除Bing Maps航拍地图中的图钉,你可以在请求参数中添加pp=0参数——该参数用于控制是否显示地图上的兴趣点(POI)标记,设置为0即可完全隐藏所有图钉类标记,效果比dcl=1的"去杂乱"更彻底,能满足实时计算机视觉应用的无干扰需求。

修改后的代码示例

imagerySet = "Aerial"
address = session['address']
zoomLevel = ZOOM

url = f"https://dev.virtualearth.net/REST/v1/Imagery/Map/{imagerySet}/{address}/{zoomLevel}"

params = {
    'mapSize': "512,512",
    'format': "png",
    'mapMetadata': "false",
    'key': os.environ.get('BING_MAPS_API'),
    'zoomLevel': zoomLevel,
    'dcl': "1",
    'pp': "0"  # 添加该参数彻底隐藏图钉
}

response = requests.get(url, params=params)
image = open_image(response)

内容的提问来源于stack exchange,提问作者jobu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.15 09:27:03