【问题标题】:How to add InfoWindow Object by using google static image map ?如何使用谷歌静态图像地图添加 InfoWindow 对象?
【发布时间】:2014-05-16 04:24:30
【问题描述】:

我想将文本标签添加到我从静态谷歌图像 api 获取的图像中。就像简单的谷歌地图中所有标记的标签和信息窗口一样。

我看过文档,没有清楚地记录。是否可以在google Static Image API 中显示信息窗口。

【问题讨论】:

    标签: google-static-maps


    【解决方案1】:

    目前,标记标签或 InfoWindows 尚不可用于 Google Maps Platform - Maps Static API。

    但是,我们在 Google 问题跟踪器中确实有一个现有的功能请求。为了表达您的兴趣并订阅它的最新更新,我建议您为这篇文章加注星标:https://issuetracker.google.com/35818346

    同时,请注意,您可以通过使用已经有标签的Custom Icons 来实现类似的效果。但是,此解决方案可能需要很长时间,因为您首先必须编辑将用于包含标签的图标图像,然后将其托管在某处。

    请查看此示例请求: http://maps.googleapis.com/maps/api/staticmap?size=600x400&markers=icon:https://raw.githubusercontent.com/annkylah/TestRepo/master/icon2.png|anchor:26,68|scale:2|-35.281454,149.128545&markers=icon:https://raw.githubusercontent.com/annkylah/TestRepo/master/icon1.png|anchor:26,68|scale:2|-37.936915,145.169723&markers=icon:https://raw.githubusercontent.com/annkylah/TestRepo/master/icon3.png?raw=true|anchor:26,68|scale:2|-33.842312,150.983470&key=YOUR_API_KEY

    以前也可以使用Google Charts - Image Charts,但是,该服务已于 2019 年 3 月 18 日被拒绝。

    您还应注意自定义图标的限制 解决方法是you could only specify up to five unique custom icons per Maps Static API request。 在 Google 问题跟踪器上向allow more than 5 custom icons 提交了功能请求 但是,它被标记为与另一个 feature request to support KML layers in Static Maps API 重复。

    我希望这会有所帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多