ui.Map.DrawingTools.setShape
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 hình dạng chế độ vẽ và bắt đầu chế độ 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.
Trả về bộ công cụ vẽ này.
Cách sử dụng | Giá trị trả về |
---|
DrawingTools.setShape(shape) | ui.Map.DrawingTools |
Đối số | Loại | Thông tin chi tiết |
---|
this: ui.map.drawingtools | ui.Map.DrawingTools | Thực thể ui.Map.DrawingTools. |
shape | Chuỗi | Hình dạng cần vẽ. |
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-29 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-29 UTC."],[[["\u003cp\u003eEnables users to initiate drawing mode on a map with selectable shapes like points, lines, polygons, and rectangles.\u003c/p\u003e\n"],["\u003cp\u003eProvides a method (\u003ccode\u003esetShape\u003c/code\u003e) to specify the desired shape for drawing, accepting a string argument representing the shape type.\u003c/p\u003e\n"],["\u003cp\u003eReturns the DrawingTools instance, allowing for method chaining and further customization.\u003c/p\u003e\n"]]],["The `DrawingTools.setShape(shape)` method configures the drawing tool's shape (point, line, polygon, or rectangle) and activates draw mode. It accepts a string argument specifying the desired shape and returns the `ui.Map.DrawingTools` instance, allowing for method chaining. This method is used to select the shape to draw and initiate the drawing process.\n"],null,["# ui.Map.DrawingTools.setShape\n\n\u003cbr /\u003e\n\nSets the draw mode shape and starts draw mode. The available draw mode shapes are: point, line, polygon, and rectangle.\n\n\u003cbr /\u003e\n\nReturns this set of drawing tools.\n\n| Usage | Returns |\n|--------------------------------|---------------------|\n| DrawingTools.setShape`(shape)` | ui.Map.DrawingTools |\n\n| Argument | Type | Details |\n|-----------------------------|---------------------|-----------------------------------|\n| this: `ui.map.drawingtools` | ui.Map.DrawingTools | The ui.Map.DrawingTools instance. |\n| `shape` | String | The shape to draw. |"]]