ابزار تعاملی Polyline Encoder
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
Google Maps می تواند یک چند خط ساده از دو یا چند مختصات طول و عرض جغرافیایی ایجاد کند. درباره رمزگذاری چند خطی ، چند خطی ساده و چند خطی پیچیده بیشتر بیاموزید.
با استفاده از این ابزار، می توانید کدهای چند خطی را به صورت تعاملی روی نقشه یا با وارد کردن مختصات ایجاد کنید. همچنین با استفاده از این ابزار به صورت معکوس می توانید چند خطوط را به مختصات رمزگشایی کنید.
با این حال، اگر یک چند خط کدگذاری شده یا فهرستی از مختصات به عنوان رشته خط GeoJSON دارید و میخواهید چند خط را روی نقشه مشاهده کنید، از ابزار رمزگشای چند خطی تعاملی استفاده کنید.
یک چند خط به صورت تعاملی روی نقشه ایجاد کنید
- آدرس، کد پستی، مکان یا علامت مشخصه را وارد کنید تا نقشه را در مرکز قرار دهید و روی جستجو کلیک کنید.
- برای قرار دادن نشانگری که محل شروع چند خط شما را نشان می دهد، روی نقشه کلیک کنید.
- مختصات نشانگر شما در کادرهای Latitude و Langitude نشان داده می شود.
- روی دکمه Add Location کلیک کنید. این مختصات را به لیست مکان اضافه می کند و یک رمزگذاری در کادر Encoded Polyline ایجاد می کند.
- به قرار دادن نشانگرها روی نقشه ادامه دهید تا همه مکانهای روی چند خط خود را به فهرست مکان و چند خط رمزگذاری شده اضافه کنید.
ویرایش مختصات
- برای حذف یک مکان، آن را در لیست مکان انتخاب کنید و Delete Selected Location را فشار دهید.
- برای حذف همه مکانها و شروع دوباره، روی حذف همه مکانها کلیک کنید.
- شما نمی توانید مکان ها را ویرایش کنید. برای ویرایش یک مکان، آن را حذف و دوباره اضافه کنید. اگر مکان در انتهای لیست شما نیست، مکان و همه موارد زیر را حذف کنید.
با وارد کردن مختصات یک چند خط ایجاد کنید
- اگر یک لیست موجود از مختصات دارید، به جای قرار دادن نشانگرها، می توانید به صورت دستی طول و عرض جغرافیایی را در کادر مربوطه وارد کنید.
یک چند خط را به مختصات رمزگشایی کنید
- چند خط خود را در کادر Encoded Polyline وارد کنید.
- اگر چند خط شما حاوی نویسههای فراری است، روی کادر انتخاب کلیک کنید تا از حالت فرار خارج شود.
- روی Decode Polyline کلیک کنید. مختصات در لیست موقعیت مکانی نشان داده می شود و خط روی نقشه ترسیم می شود.
این ابزار از Maps JavaScript API استفاده می کند. به طور خاص، رمزگذاری و رمزگشایی مسیرها توسط روشهای ایستا encodePath()
و decodePath()
در فضای نام google.maps.geometry.encoding
انجام میشود. برای اطلاعات در مورد طرح رمزگذاری به قالب الگوریتم چند خط رمزگذاری شده مراجعه کنید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[],[],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."]]