インタラクティブ ポリライン エンコーダー ユーティリティ
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Google マップでは、2 つ以上の緯度と経度の座標から単純なポリラインを生成できます。ポリラインのエンコード、単純なポリライン、複雑なポリラインの詳細を確認する。
このユーティリティを使用すると、地図上でインタラクティブに、または座標を入力して、ポリライン エンコードを生成できます。このツールを逆に使用して、ポリラインを座標にデコードすることもできます。
ただし、既存のエンコードされたポリラインまたは座標のリストを GeoJSON linestring として使用し、地図上にポリラインを表示する場合は、インタラクティブ ポリライン デコーダ ユーティリティを使用します。
地図上でポリラインをインタラクティブに作成する
- 住所、郵便番号、場所、ランドマークを入力して地図の中心に表示し、[検索] をクリックします。
- 地図をクリックして、ポリラインの開始位置を表すマーカーを配置します。
- マーカーの座標が [緯度] ボックスと [経度] ボックスに表示されます。
- [地域を追加] ボタンをクリックします。
これにより、座標が [Location list] に追加され、[Encoded Polyline] ボックスにエンコードが生成されます。
- 地図上にマーカーを配置し続けると、ポリライン上のすべての場所が場所のリストとエンコードされたポリラインに追加されます。
座標の編集
- ロケーションを削除するには、[ロケーション リスト] でロケーションを選択し、[選択したロケーションを削除] を押します。
- すべての地域を削除して最初からやり直すには、[すべての地域を削除] をクリックします。
- ビジネス情報を編集することはできません。場所を編集するには、場所を削除して再度追加します。リストの末尾にない場合は、その場所とそれ以降のすべての場所を削除します。
座標を入力してポリラインを作成する
- 座標の既存のリストがある場合は、マーカーを配置する代わりに、それぞれのボックスに緯度と経度を手動で入力できます。
ポリラインを座標にデコードする
- Encoded Polyline ボックスにポリラインを入力します。
- ポリラインにエスケープされた文字が含まれている場合は、チェックボックスをクリックしてエスケープを解除します。
- [ポリラインをデコード] をクリックします。
座標が [位置リスト] に表示され、地図上に線が描画されます。
このユーティリティは Maps JavaScript API を使用します。具体的には、パスのエンコードとデコードは、google.maps.geometry.encoding
名前空間の静的メソッド encodePath()
と decodePath()
によって処理されます。エンコード スキームについては、エンコード ポリライン アルゴリズム形式をご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-29 UTC。
[null,null,["最終更新日 2025-08-29 UTC。"],[],[],null,["# Interactive Polyline Encoder Utility\n\nGoogle Maps can generate a simple polyline from two or more latitude/longitude coordinates.\nLearn more about\n[polyline encoding](/maps/documentation/utilities/polylinealgorithm),\n[simple polylines](/maps/documentation/javascript/examples/polyline-simple),\nand\n[complex polylines](/maps/documentation/javascript/examples/polyline-complex).\n\nWith this utility, you can generate polyline encodings\ninteractively on a map or by entering coordinates.\nYou can also decode polylines into coordinates\nby using this tool in reverse.\n\nHowever, if you have an existing encoded polyline or a list of coordinates as a\n[GeoJSON linestring](https://geojson.org/)\nand want to view the polyline on a map, use the\n[Interactive polyline decoder utility](/maps/documentation/routes/polylinedecoder).\n\n**Create a polyline interactively on the map**\n\n1. Enter an address, zip code, location, or landmark to center the map and click **Search**.\n2. Click the map to place a marker that represents the start location of your polyline.\n3. The coordinates of your marker show in the **Latitude** and **Longitude** boxes.\n4. Click the **Add Location** button. This adds the coordinates to the **Location list** and generates an encoding in the **Encoded Polyline** box.\n5. Continue to place markers on the map to add all locations on your polyline to the **Location list** and the **Encoded polyline**.\n\n**Editing coordinates**\n\n- To delete a location, select it in the **Location list** and press **Delete Selected Location**.\n- To delete all locations and start over, click **Delete All Locations**.\n- You cannot edit locations. To edit a location, delete and re-add it. If the location is not at the end of your list, delete the location and all the ones following.\n\n**Create a polyline by entering coordinates**\n\n- If you have an existing list of coordinates, instead of placing markers, you can manually enter the latitudes and longitudes in their respective boxes.\n\n**Decode a polyline into coordinates**\n\n1. Enter your polyline into the **Encoded Polyline** box.\n2. If your polyline contains escaped characters, click the checkbox to unescape them.\n3. Click **Decode Polyline** . The coordinates show in the **Location list**, and the line is drawn on the map.\n\n\u003cbr /\u003e\n\n|--------------------------------------------|----------------------------------------------------------------------------------------------------------------------|\n| Input an address to center the map: Search | |------------|---| | Latitude: | | | Longitude: | | | | | || \u003cbr /\u003e **Locations list** |\n| |-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | | **Warning**: Special characters in the encoded polylines returned in JSON responses are escaped. To use these polylines here you must unescape them. | | Encoded Polyline: | |---------------------------------------------------------------------------------| | | | Unescape special characters in the encoded polylines returned in JSON responses | | | || ||\n\nThis utility uses the Maps JavaScript API. Specifically,\nencoding and decoding of paths are handled by the static methods `encodePath()`\nand `decodePath()` in the `google.maps.geometry.encoding` namespace.\nSee the [Encoded Polyline Algorithm\nFormat](/maps/documentation/utilities/polylinealgorithm) for information about the encoding scheme."]]