בדף הזה מוסבר איך לעבד נתונים גיאוגרפיים בקובץ ה-KML
פורמט, נעשה שימוש ב-GMUKMLParser ב
יחד עם GMUGeometryRenderer. KML הוא פופולרי
לעיבוד נתונים גיאוגרפיים כמו נקודות, קווים ופוליגונים.
בצילום המסך הבא מוצגים נתוני KML לדוגמה שמופיעים במפה:
כדי לראות את דוגמת הקוד המלאה, יש לעיין באפליקציות לדוגמה
מופעל
GitHub.
רינדור נתוני KML
כדי לעבד נתוני KML במפה, צריך ליצור GMUKMLParser עם
נתיב למשאב KML (KML_Sample.kml בדוגמה זו). לאחר מכן:
יוצרים GMUGeometryRenderer שרוצים להעביר את GMUKMLParser
מכונה. לסיום, להתקשר אל GMUGeometryRenderer.render().
הקוד הבא מציג עיבוד של נתוני KML במפה:
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-07-26 (שעון UTC)."],[[["\u003cp\u003eThis documentation explains how to render geographic data in KML format using the \u003ccode\u003eGMUKMLParser\u003c/code\u003e and \u003ccode\u003eGMUGeometryRenderer\u003c/code\u003e within the Google Maps SDK for iOS Utility Library.\u003c/p\u003e\n"],["\u003cp\u003eKML is a popular format used for displaying geographic data, including points, lines, and polygons, on maps.\u003c/p\u003e\n"],["\u003cp\u003eTo render KML data, create a \u003ccode\u003eGMUKMLParser\u003c/code\u003e instance with the path to your KML file, then use it to initialize a \u003ccode\u003eGMUGeometryRenderer\u003c/code\u003e, and finally, call \u003ccode\u003erender()\u003c/code\u003e on the renderer to display the data on your map.\u003c/p\u003e\n"],["\u003cp\u003eCode examples in both Swift and Objective-C are provided to demonstrate the process of rendering KML data on a map using the Google Maps SDK for iOS.\u003c/p\u003e\n"]]],[],null,[]]