Google静态地图未强制执行最大网址长度

时间:2016-07-29 20:50:09

标签: google-maps

我正在生成Google静态地图网址。由于地图风格,它出现的时间很长。 google docs say最大网址长度为2048.我觉得谷歌会在样式如此冗长并且必须包含在网址中时强加此限制。如果他们允许您将URL传递给样式表,就像他们允许您将URL传递给标记图像一样,那将是很好的。

无论如何,我的网址是2295个字符,但谷歌正在将地图返回给我,没有任何投诉。我想也许谷歌在URL解码URL后计算字符,但如果我添加额外的标记来扩展我的解码URL长度超过2048个字符,它仍然有效。我担心他们将来可以解决这个问题并停止接受我的网址。有谁知道长度不受限制是否有充分的理由?

示例(需要有效的API密钥)

  

https://maps.googleapis.com/maps/api/staticmap?center=30.911406,-90.805644&zoom=13&size=640x640&maptype=roadmap&style=feature%3aadministrative%7celement%3alabels.text.fill%7ccolor%3a0x044444&style=feature%3aadministrative.neighborhood%7cvisibility%3aoff&style=feature%3alandscape%7ccolor%3a0x02f2f2&style=feature%3alandscape%7celement%3ageometry.fill%7ccolor%3a0x0fffff&style=feature%3apoi%7cvisibility%3aoff&style=feature%3aroad%7csaturation%3a-100%7clightness%3a45&style=feature%3aroad.highway%7cvisibility%3asimplified&style=feature%3aroad.highway%7celement%3ageometry.fill%7csaturation%3a100%7ccolor%3a0x05c1e8%7cvisibility%3aon%7cweight%3a2.19%7clightness%3a0%7cgamma%3a1&style=feature%3aroad.highway%7celement%3ageometry.stroke%7cweight%3a1.00%7cvisibility%3aon%7ccolor%3a0x05c1e8%7clightness%3a-12&style=feature%3aroad.arterial%7celement%3ageometry.fill%7cvisibility%3aon%7ccolor%3a0x05c1e8%7cweight%3a1.79%7cgamma%3a1%7clightness%3a0%7csaturation%3a100&style=feature%3aroad.arterial%7celement%3ageometry.stroke%7cvisibility%3aoff&style=feature%3aroad.arterial%7celement%3alabels.text.fill%7ccolor%3a0x0287d4%7cvisibility%3aon%7cweight%3a10.00%7csaturation%3a81%7clightness%3a-16%7cgamma%3a1&style=feature%3aroad.arterial%7celement%3alabels.icon%7cvisibility%3aoff%7csaturation%3a48&style=feature%3aroad.local%7celement%3ageometry.fill%7ccolor%3a0x03e5f6%7cvisibility%3aon%7cweight%3a1.51%7csaturation%3a100%7clightness%3a16&style=feature%3aroad.local%7celement%3ageometry.stroke%7cweight%3a1.35%7cvisibility%3aoff&style=feature%3aroad.local%7celement%3alabels.text.fill%7ccolor%3a0x01d7eb%7cweight%3a3.03%7clightness%3a-21&style=feature%3aroad.local%7celement%3alabels.text.stroke%7cweight%3a2.33&style=feature%3atransit%7cvisibility%3aoff&style=feature%3awater%7ccolor%3a0x06bcec%7cvisibility%3aon&style=feature%3awater%7celement%3ageometry.fill%7cvisibility%3aon%7ccolor%3a0x0ae1e1%7clightness%3a7%7csaturation%3a-5&style=feature%3awater%7celement%3ageometry.stroke%7cvisibility%3aoff&style=feature%3awater%7celement%3alabels.text%7ccolor%3a0x066666&style=feature%3awater%7celement%3alabels.text.stroke%7cvisibility%3aoff&markers=icon:http%3a%2f%2fwww.mydomain.com%2fClientResources%2fassets%2fimages%2fmap-marker.png%7C30.911406,-90.805644&key=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

2 个答案:

答案 0 :(得分:3)

我们更新了开发人员文档,以反映网址长度的新8192字符限制。谢谢!

答案 1 :(得分:0)

网址长度是浏览器限制,而非Google限制。

相关问题:What is the maximum length of a URL in different browsers?