Utilitas Encoder Polyline Interaktif
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Google Maps dapat membuat polyline sederhana dari dua atau lebih koordinat lintang/bujur.
Pelajari lebih lanjut
encoding polyline,
polyline sederhana,
dan
polyline kompleks.
Dengan utilitas ini, Anda dapat membuat encoding polyline
secara interaktif di peta atau dengan memasukkan koordinat.
Anda juga dapat mendekode polyline menjadi koordinat
dengan menggunakan alat ini secara terbalik.
Namun, jika Anda memiliki polyline yang dienkode atau daftar koordinat sebagai
GeoJSON linestring
dan ingin melihat polyline di peta, gunakan
Utilitas decoder polyline interaktif.
Membuat polyline secara interaktif di peta
- Masukkan alamat, kode pos, lokasi, atau bangunan terkenal untuk memusatkan peta
dan klik Telusuri.
- Klik peta untuk menempatkan penanda yang merepresentasikan lokasi awal
polyline Anda.
- Koordinat penanda Anda akan ditampilkan di kotak Lintang
dan Bujur.
- Klik tombol Tambahkan Lokasi.
Tindakan ini akan menambahkan koordinat ke Daftar lokasi
dan membuat encoding di kotak Encoded Polyline.
- Lanjutkan menempatkan penanda di peta untuk menambahkan semua lokasi di polyline Anda
ke Daftar lokasi dan Polyline yang dienkode.
Mengedit koordinat
- Untuk menghapus lokasi, pilih lokasi tersebut di Daftar lokasi, lalu tekan
Hapus Lokasi yang Dipilih.
- Untuk menghapus semua lokasi dan memulai lagi, klik Hapus Semua Lokasi.
- Anda tidak dapat mengedit lokasi. Untuk mengedit lokasi, hapus dan tambahkan kembali lokasi tersebut.
Jika lokasi tidak berada di akhir daftar Anda,
hapus lokasi dan semua lokasi berikutnya.
Membuat polyline dengan memasukkan koordinat
- Jika sudah memiliki daftar koordinat, Anda dapat memasukkan lintang dan bujur secara manual di kotak masing-masing, alih-alih menempatkan penanda.
Mendekode polyline menjadi koordinat
- Masukkan polyline Anda ke dalam kotak Encoded Polyline.
- Jika polyline Anda berisi karakter yang di-escape,
klik kotak centang untuk membatalkan escape karakter tersebut.
- Klik Decode Polyline.
Koordinat akan ditampilkan di Daftar lokasi,
dan garis akan digambar di peta.
Utilitas ini menggunakan Maps JavaScript API. Secara khusus,
encoding dan decoding jalur ditangani oleh metode statis encodePath()
dan decodePath()
di namespace google.maps.geometry.encoding
.
Lihat Format Algoritma Polyline yang Dienkodekan untuk mengetahui informasi tentang skema encoding.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-08-29 UTC.
[null,null,["Terakhir diperbarui pada 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."]]