systemapic / systemapic.js

Systemapic Javascript API
https://systemapic.com
0 stars 3 forks source link

Remove points/polygons/lines styler when not relevant #143

Open knutole opened 8 years ago

knutole commented 8 years ago

When styling a layer, we should check more precisely what type of data it contains (points, polygons, lines), and if points, simply remove the other two options in the styler (since they will never be used).

This will make the styler look cleaner and easier to grasp.

knutole commented 8 years ago

@jorgenevil Btw, type of geometry is available on metadata. Try file._getGeometryType() (see https://github.com/systemapic/systemapic.js/blob/master/js/src/models/model.files.js#L409)

{
    "extent": ["14.2863754116819", "66.1992943757374", "14.3084318480191", "66.2096430586868"],
    "columns": {
        "20130611": {
            "max": 20130611,
            "min": 20130611,
            "avg": 20130611
        },
        // (...)
        "d3mnd": {
            "max": 3.925,
            "min": -1.959,
            "avg": 0.8206863654699476
        },
        "d1mnd": {
            "max": 2.844,
            "min": -1.865,
            "avg": 0.2791610864595939
        },
        "_columns": ["20130611", "20130622", "20130703", "20130714", "20130725", "20130805", "20130816", "20130827", "20130907", "20130918", "20130929", "20131010", "20131021", "20131101", "20140620", "20140701", "20140712", "20140723", "20140803", "20140814", "20140825", "20140905", "20141008", "20141019", "gid", "code", "lon", "lat", "height", "demerror", "r", "g", "b", "coherence", "mvel", "adisp", "dtotal", "d12mnd", "d3mnd", "d1mnd"]
    },
    "extent_geojson": {
        "type": "Polygon",
        "coordinates": [
            [
                [14.2863754116819, 66.1992943757374],
                [14.2863754116819, 66.2096430586868],
                [14.3084318480191, 66.2096430586868],
                [14.3084318480191, 66.1992943757374],
                [14.2863754116819, 66.1992943757374]
            ]
        ]
    },
    "total_area": 1141243.5362438215,
    "row_count": "14874",
    "size_bytes": "5384 kB",
    "geometry_type": "ST_Point"
}
jorgenevil commented 8 years ago

Cool, nice :)