ee.ImageCollection.style
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.
Vẽ một bộ sưu tập vectơ để trực quan hoá bằng ngôn ngữ kiểu đơn giản.
Cách sử dụng | Giá trị trả về |
---|
ImageCollection.style(color, pointSize, pointShape, width, fillColor, styleProperty, neighborhood, lineType) | Hình ảnh |
Đối số | Loại | Thông tin chi tiết |
---|
this: collection | FeatureCollection | Bộ sưu tập cần vẽ. |
color | Chuỗi, mặc định: "black" | Màu mặc định (giá trị màu CSS 3.0, ví dụ: "FF0000" hoặc "red") để dùng cho việc vẽ các đối tượng. Hỗ trợ độ mờ (ví dụ: "FF000088" cho màu đỏ trong suốt 50%). |
pointSize | Số nguyên, mặc định: 3 | Kích thước mặc định tính bằng pixel của điểm đánh dấu. |
pointShape | Chuỗi, mặc định: "circle" | Hình dạng mặc định của điểm đánh dấu cần vẽ tại mỗi vị trí điểm. Một trong các giá trị: "circle", "square", "diamond", "cross", "plus", "pentagram", "hexagram", "triangle", "triangle_up", "triangle_down", "triangle_left", "triangle_right", "pentagon", "hexagon", "star5", "star6". Đối số này cũng hỗ trợ các chữ viết tắt sau của điểm đánh dấu Matlab: "o", "s", "d", "x", "+", "p", "h", "^", "v", "<", ">". |
width | Độ chính xác đơn, mặc định: 2 | Chiều rộng đường kẻ mặc định cho các đường kẻ và đường viền của đa giác và hình dạng điểm. |
fillColor | Chuỗi, mặc định: null | Màu để tô đa giác và hình dạng điểm. Mặc định là "color" (màu) ở độ mờ 0,66. |
styleProperty | Chuỗi, mặc định: null | Một thuộc tính cho mỗi đối tượng dự kiến sẽ chứa một từ điển. Các giá trị trong từ điển sẽ ghi đè mọi giá trị mặc định cho tính năng đó. |
neighborhood | Số nguyên, mặc định: 5 | Nếu bạn sử dụng styleProperty và bất kỳ đối tượng nào có pointSize hoặc chiều rộng lớn hơn giá trị mặc định, thì có thể xảy ra hiện tượng tạo ô giả. Chỉ định vùng lân cận tối đa (pointSize + width) cần thiết cho mọi đối tượng. |
lineType | Chuỗi, mặc định: "solid" | Kiểu đường mặc định cho đường kẻ và đường viền của đa giác và hình dạng điểm. Giá trị mặc định là "solid". Một trong các lựa chọn sau: liền, chấm, nét đứt. |
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-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003eVisualize vector collections (FeatureCollections) by applying styles like color, size, and shape to their features.\u003c/p\u003e\n"],["\u003cp\u003eCustomize the appearance of points, lines, and polygons with parameters such as point size, shape, line width, and fill color.\u003c/p\u003e\n"],["\u003cp\u003eUtilize the \u003ccode\u003estyleProperty\u003c/code\u003e parameter to define individual styles for each feature within the collection.\u003c/p\u003e\n"],["\u003cp\u003eControl potential tiling artifacts by setting the \u003ccode\u003eneighborhood\u003c/code\u003e parameter, especially when using large point sizes or widths.\u003c/p\u003e\n"],["\u003cp\u003eAdjust the default line style for lines and outlines with the \u003ccode\u003elineType\u003c/code\u003e parameter, choosing between solid, dotted, and dashed options.\u003c/p\u003e\n"]]],[],null,["# ee.ImageCollection.style\n\nDraw a vector collection for visualization using a simple style language.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------|---------|\n| ImageCollection.style`(`*color* `, `*pointSize* `, `*pointShape* `, `*width* `, `*fillColor* `, `*styleProperty* `, `*neighborhood* `, `*lineType*`)` | Image |\n\n| Argument | Type | Details |\n|--------------------|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `collection` | FeatureCollection | The collection to draw. |\n| `color` | String, default: \"black\" | A default color (CSS 3.0 color value e.g., 'FF0000' or 'red') to use for drawing the features. Supports opacity (e.g., 'FF000088' for 50% transparent red). |\n| `pointSize` | Integer, default: 3 | The default size in pixels of the point markers. |\n| `pointShape` | String, default: \"circle\" | The default shape of the marker to draw at each point location. One of: \\`circle\\`, \\`square\\`, \\`diamond\\`, \\`cross\\`, \\`plus\\`, \\`pentagram\\`, \\`hexagram\\`, \\`triangle\\`, \\`triangle_up\\`, \\`triangle_down\\`, \\`triangle_left\\`, \\`triangle_right\\`, \\`pentagon\\`, \\`hexagon\\`, \\`star5\\`, \\`star6\\`. This argument also supports these Matlab marker abbreviations: \\`o\\`, \\`s\\`, \\`d\\`, \\`x\\`, \\`+\\`, \\`p\\`, \\`h\\`, \\`\\^\\`, \\`v\\`, \\`\\\u003c\\`, \\`\\\u003e\\`. |\n| `width` | Float, default: 2 | The default line width for lines and outlines for polygons and point shapes. |\n| `fillColor` | String, default: null | The color for filling polygons and point shapes. Defaults to 'color' at 0.66 opacity. |\n| `styleProperty` | String, default: null | A per-feature property expected to contain a dictionary. Values in the dictionary override any default values for that feature. |\n| `neighborhood` | Integer, default: 5 | If styleProperty is used and any feature has a pointSize or width larger than the defaults, tiling artifacts can occur. Specifies the maximum neighborhood (pointSize + width) needed for any feature. |\n| `lineType` | String, default: \"solid\" | The default line style for lines and outlines of polygons and point shapes. Defaults to 'solid'. One of: solid, dotted, dashed. |"]]