ui.Map.DrawingTools.toFeatureCollection
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Zwraca zbiór obiektów, w którym każdy kształt w narzędziach do rysowania jest obiektem.
Wykorzystanie | Zwroty |
---|
DrawingTools.toFeatureCollection(indexProperty) | FeatureCollection |
Argument | Typ | Szczegóły |
---|
to: ui.map.drawingtools | ui.Map.DrawingTools | Instancja ui.Map.DrawingTools. |
indexProperty | Ciąg znaków | Właściwość o tej nazwie zostanie przypisana do każdego obiektu w zwróconej kolekcji. Wartością właściwości będzie liczba odpowiadająca indeksowi warstwy geometrii, do której należy geometria. |
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-26 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-26 UTC."],[[["\u003cp\u003eReturns a FeatureCollection where each drawn geometry is represented as a separate feature.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003etoFeatureCollection()\u003c/code\u003e method takes an optional \u003ccode\u003eindexProperty\u003c/code\u003e argument, allowing you to assign a unique index to each feature based on its layer.\u003c/p\u003e\n"],["\u003cp\u003eAccess this functionality through the \u003ccode\u003eui.Map.DrawingTools\u003c/code\u003e instance, specifically using the DrawingTools object.\u003c/p\u003e\n"]]],["The `DrawingTools.toFeatureCollection` method converts drawn geometries into a FeatureCollection. It operates on a `ui.Map.DrawingTools` instance. The method accepts an `indexProperty` argument (a string). This property is added to each feature in the collection, and its value will reflect the index of the geometry layer where it was drawn. It returns a FeatureCollection object.\n"],null,["# ui.Map.DrawingTools.toFeatureCollection\n\n\u003cbr /\u003e\n\nReturns a feature collection in which each geometry in the drawing tools is a feature.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------------------------------------|-------------------|\n| DrawingTools.toFeatureCollection`(indexProperty)` | FeatureCollection |\n\n| Argument | Type | Details |\n|-----------------------------|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `ui.map.drawingtools` | ui.Map.DrawingTools | The ui.Map.DrawingTools instance. |\n| `indexProperty` | String | A property with this name will be assigned to every feature in the returned collection. The value of the property will be a number that corresponds to the index of the geometry layer to which the geometry belongs. |"]]