כלי אינטראקטיבי למקודד מצולע
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
מפות Google יכולה ליצור קו פוליגוני פשוט משתי קואורדינטות של קו רוחב/אורך או יותר.
מידע נוסף על
קידוד של קווים פוליגוניים,
קווים פוליגוניים פשוטים,
וקווים פוליגוניים מורכבים.
בעזרת כלי השירות הזה, אפשר ליצור קידודים של קווים מצולעים באופן אינטראקטיבי במפה או על ידי הזנת קואורדינטות.
אפשר גם להשתמש בכלי הזה כדי לפענח קווי פוליגון לקואורדינטות.
עם זאת, אם יש לכם קו פוליגוני מקודד או רשימה של קואורדינטות בתור GeoJSON linestring ואתם רוצים לראות את הקו הפוליגוני במפה, אתם יכולים להשתמש בכלי האינטראקטיבי לפענוח קו פוליגוני.
יצירת קו פוליגוני אינטראקטיבי במפה
- מזינים כתובת, מיקוד, מיקום או ציון דרך כדי למרכז את המפה ולוחצים על חיפוש.
- לוחצים על המפה כדי להציב סמן שמייצג את מיקום ההתחלה של הקו המקוקו.
- הקואורדינטות של הסמן מוצגות בתיבות קו רוחב
וקו אורך.
- לוחצים על הלחצן הוספת מיקום.
הקואורדינטות יתווספו לרשימת המיקומים
ויווצר קידוד בתיבה Encoded Polyline.
- ממשיכים להציב סמנים במפה כדי להוסיף את כל המיקומים בקו הפוליגוני לרשימת המיקומים ולקו הפוליגוני המקודד.
עריכת קואורדינטות
- כדי למחוק מיקום, בוחרים אותו ברשימת המיקומים ולוחצים על מחיקת המיקום שנבחר.
- כדי למחוק את כל המיקומים ולהתחיל מחדש, לוחצים על מחיקת כל המיקומים.
- אי אפשר לערוך מיקומים. כדי לערוך מיקום, צריך למחוק אותו ולהוסיף אותו מחדש.
אם המיקום לא מופיע בסוף הרשימה,
מוחקים את המיקום ואת כל המיקומים שמופיעים אחריו.
יצירת קו שבור על ידי הזנת קואורדינטות
- אם יש לכם רשימה קיימת של קואורדינטות, במקום להציב סמנים, תוכלו להזין ידנית את קווי הרוחב והאורך בתיבות המתאימות.
פענוח של קו פוליגוני לקואורדינטות
- מזינים את הקו המרובה בתיבה Encoded Polyline (קו מרובה מקודד).
- אם הקו המקומקע מכיל תווים עם תו בריחה,
לוחצים על תיבת הסימון כדי לבטל את תו הבריחה שלהם.
- לוחצים על Decode Polyline (פענוח של קו פוליגוני).
הקואורדינטות מוצגות ברשימת המיקומים, והקו מצויר במפה.
כלי השירות הזה משתמש ב-Maps JavaScript API. ספציפית, קידוד ופענוח של נתיבים מטופלים על ידי השיטות הסטטיות encodePath()
ו-decodePath()
במרחב השמות google.maps.geometry.encoding
.
מידע על סכימת הקידוד מופיע במאמר פורמט של אלגוריתם קידוד קו פוליגוני.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 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."]]