ui.Map.DrawingTools.setDrawModes
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Đặt các hình dạng có thể vẽ trên công cụ vẽ. Các hình dạng có trong chế độ vẽ là: điểm, đường kẻ, đa giác và hình chữ nhật.
Cách sử dụng | Giá trị trả về |
---|
DrawingTools.setDrawModes(drawModes) | |
Đối số | Loại | Thông tin chi tiết |
---|
this: ui.map.drawingtools | ui.Map.DrawingTools | Thực thể ui.Map.DrawingTools. |
drawModes | List<String>, không bắt buộc | Danh sách các chế độ vẽ cần bật. Mặc định là tất cả các ngôn ngữ được hỗ trợ. |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eSets available drawing shapes (point, line, polygon, rectangle) for the drawing tool.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eDrawingTools.setDrawModes()\u003c/code\u003e method allows customization of available drawing modes on a map.\u003c/p\u003e\n"],["\u003cp\u003eBy default, all supported drawing shapes are enabled, but this can be modified using the \u003ccode\u003edrawModes\u003c/code\u003e argument.\u003c/p\u003e\n"]]],["The `DrawingTools.setDrawModes` function configures the drawing tool's available shapes. It accepts an optional list of `drawModes` to enable, which defaults to all supported shapes (point, line, polygon, and rectangle). This function modifies the `ui.Map.DrawingTools` instance, setting the shapes that can be used. It does not return any value.\n"],null,["# ui.Map.DrawingTools.setDrawModes\n\n\u003cbr /\u003e\n\nSets the available draw mode shapes on the drawing tool. The available draw mode shapes are: point, line, polygon, and rectangle.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------------------------------|---------|\n| DrawingTools.setDrawModes`(`*drawModes*`)` | |\n\n| Argument | Type | Details |\n|-----------------------------|--------------------------|-------------------------------------------------------------------|\n| this: `ui.map.drawingtools` | ui.Map.DrawingTools | The ui.Map.DrawingTools instance. |\n| `drawModes` | List\\\u003cString\\\u003e, optional | The list of draw modes to enable. Defaults to all supported ones. |"]]