Loading

启用 Google Maps 作为网页对象时出现“www.google.com refused to connect”或“The Google Maps Embed API must be used in an iframe”错误

发布日期: Nov 9, 2023
描述
将 Google 地图作为 Web 对象嵌入工作簿时,可能会出现以下错误:
 
The Google Maps Embed API must be used in an iframe(Google Maps Embed API 必须在 iframe 中使用)
 
访问工作簿的已发布版本时,可能会出现以下错误: 

www.google.com refused to connect(www.google.com 拒绝连接)


 
Refused to display 'https://www.google.com/maps?...' in a frame because it set 'X-Frame-Options' to 'sameorigin'(拒绝在框架中显示“https://www.google.com/maps?...”,因为它将“X-Frame-Options”设置为“sameorigin”)

Cause

Google 服务器将包含 Google 地图 URL 的仪表板托架解释为站点内的框架,因此它们会阻止呈现地图。
解决方案

对于 Google Maps URL,使用带“&output=svembed”参数的以下格式:
 
https://maps.google.com/?q=40.5509,-105.0668&output=svembed
 
(而不是 https://www.google.com/maps/?q=40.5509,-105.0668

其他资源
有关本主题的其他信息,请参见以下文档:
知识文章编号

001471883

 
正在加载
Salesforce Help | Article