2016-07-29 12 views
2

Google静的マップURLを生成しています。地図のスタイルのため、非常に長く出てきます。 google docs sayの最大URLの長さは2048です。スタイリングが非常に冗長で、URLに含める必要がある場合、Googleがこの制限を課すことは私には奇妙に思えます。 URLをマーカー画像に渡す方法と同じようにURLをスタイルシートに渡すことができればうれしいでしょう。Google静的マップ最大URLの長さが強制されていません

とにかく、私のURLは2295文字ですが、googleは苦情なしに地図を私に返しています。 URLをデコードした後にGoogleが文字数をカウントしている可能性がありますが、デコードされたURLの長さを2048文字を超えて拡張するためにマーカーを追加すると、それでも機能します。私の心配は、将来彼らがこの問題を修正し、URLの受け入れを中止する可能性があることです。長さが制限されていない理由があるのか​​誰にも分かりますか?

例(有効な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

答えて

3

私たちは、URLの長さに新しい8192文字の制限を反映するために、開発者向けのドキュメントを更新しました。ありがとう!

+0

非常に感謝しています! – xr280xr

0

URLの長さがブラウザの制限ではなく、Googleの制限です。

関連質問:What is the maximum length of a URL in different browsers?

+0

どうすれば確認できますか? [担当者](https://developers.google.com/maps/documentation/static-maps/intro#url-size-restriction)には、「Google Static Maps APIのURLは2048文字に制限されています」と記載されています。それはブラウザの制限として言われていません。具体的にはGoogle Static Mapsを参照しています。彼らは、サポートするブラウザ(ブラウザ)が開発者の決定であるため、一般的なブラウザの互換性ガイドラインを、このようなドキュメントの厳しいルールとして提示する必要はありません。あなたは正しいかもしれませんが、言葉によって、長いURLを拒否する権利は少なくとも予約されていると思います。 – xr280xr

+1

あなたは[問題トラッカーの問題]を開くことができます(https://code.google.com/p/gmaps-apiあなたがバグだと思っていたり、ドキュメンテーションがはっきりしていない場合は、-issues /と入力してください。 – geocodezip

関連する問題