google-maps-markers - 在静态谷歌地图 URL 中使用 "@2x"

标签 google-maps-markers google-maps-static-api retina

我正在尝试使用自定义标记使用谷歌静态 map API 创建自定义静态 map 。标记以“@2x.png”结尾。看来google的api不喜欢这个?如果我使用以“.png”结尾的常规版本,它确实有效。

有人遇到过这个问题吗?

编辑: 看来这里的问题可能是存在图标尺寸限制。

来自:https://developers.google.com/maps/documentation/staticmaps/#CustomIcons

Icons are limited to sizes of 4096 pixels (64x64 for square images)

我尝试用于 2 倍比例的图像是 78x98。

最佳答案

事实上,当您激活scale:2模式时它就会起作用。在您的网址中,您必须检查是否存在:

http://..../staticmap?&scale=2&markers=scale:2|icon:http://...../<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="93bdbdbdd3a1ebbde3fdf4" rel="noreferrer noopener nofollow">[email protected]</a>|lat,lon

它在高清屏幕上运行得很好。 使用这些参数,您的图像文件最大可为 128x128。

关于google-maps-markers - 在静态谷歌地图 URL 中使用 "@2x",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29018808/

相关文章:

javascript - 我怎样才能在标记下显示文本

javascript - 谷歌地图标记事件 'dragend' 问题

python - 谷歌静态 map API : representing a route as an encoded polyline

css - 如何使用 CSS 使其在视网膜屏幕上运行?

xcode - 如何以正确的方式从NSImage保存PNG文件(视网膜问题)?

javascript - 如何访问由 DirectionsRenderer 在 Google Maps V3 中创建的对象

android - 如何保持道路上的标记?谷歌地图安卓

c# - 带有交通和公共(public)交通叠加层的谷歌静态 map

google-maps - 如何处理Google静态 map 中的 "Imagery not available"错误?

css - SVG 图像 Sprite 在 IE9 和 10 中不起作用