使用Google静态地图API网址呈现多边形 [英] Rendering polygon with Google Static Maps API URL
问题描述
我创建了一个脚本来存储动态地图输入,方法是将属性附加到静态地图URL(所以我们可以在用户提交后引用它)。
由于我还不能确定的原因,Polygon并没有使用基本的静态地图URL进行渲染,但它可以与第三方网站的静态地图功能一起使用。根据静态地图API示例应该没有问题,但我似乎无法重新创建多边形。
工作版本(在URL中具有相同的属性,尽管它忽略了Satellite和zoom分辨率)来自第三方网站。
所需版本缺少多边形。
问题是:我是否缺少一些参数?我确实有一个我从网址中删除的API密钥,所以一定不能是这个问题。
原文 em>期望的版本使用Google不支持的参数。删除 opacity:0 |
并且它可以正常工作:
Google地图上的不透明度设置在颜色作为32位十六进制值,因此
所以我认为这就是你要找的(或者真的很接近):
I created a script to store dynamic map inputs by appending attributes to a Static Maps URL (so we can refer back to it after a user submits).
For reasons I can't yet determine, the Polygon is not rendering at all with the basic static maps URL, but it works with a 3rd party site's static maps function. According to Static Maps API examples there should be no issue, but I can't seem to recreate the Polygon.
Working version (with same attributes in URL, though it ignores Satellite and zoom resolution) from 3rd Party site.
Desired version missing the polygon.
The question is: Am I missing some parameter? I do have an API key which I removed from the URL, so that must not be the issue..
Your original Desired Version uses a parameter that Google does not support. Removing just opacity:0|
and it works:
Opacity on google maps is set in the color as a 32-bit hexadecimal value, so
- Thin blue line, 0% opacity: path=color:0x0000ff00
- Solid red line with 100% opacity: path=color:0xff0000ff
- The default is 50% if you pass a 24-bit color: 0x0000ff (50% opacity, blue)
So I think this is what you are looking for (or really close):
这篇关于使用Google静态地图API网址呈现多边形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!