change path color with time tag - CZML

500 views
Skip to first unread message

bhawna daryani

unread,
Apr 3, 2013, 7:44:32 AM4/3/13
to cesiu...@googlegroups.com
I need to change path color with time tag. Below is my CZML which does not change color with time tag. What am I doing wrong. Any help is appreciated. 

{
    "availability": "2013-03-25T17:41:00Z/2013-03-25T17:57:10Z",
    "id": "0fe2de84-c447-4788-91b5-8839831a61ae",
    "label": {
        "text": "EXAMPLE",
        "fillColor": {
            "rgbaf": [0,
            0.5019607843137255,
            0,
            1]
        },
        "font": "10pt Lucida Console",
        "horizontalOrigin": "LEFT",
        "outlineColor": {
            "rgbaf": [0,
            0,
            0,
            1]
        },
        "pixelOffset": [12,
        0,
        0],
        "scale": 1,
        "show": true,
        "style": "FILL",
        "verticalOrigin": "CENTER"
    },
    "billboard": {
        "horizontalOrigin": "CENTER",
        "scale": 1,
        "show": true,
        "verticalOrigin": "BOTTOM",
        "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAB3RJTUUH3QMPFAgjDCY/AQAAADFJREFUGNNjYCACMMIYGqc1/qNL3jC9wQhXhE0BskImYqxjwmcKXBHMXryKqOY7ogAAgkUQDFNBvnMAAAAASUVORK5CYII="
    },
    "path": {
        "color": {
            "epoch": "2013-03-25T17:41:00Z",
            "rgbaf": [
            2,1,0,0,1,
            4,0,1,1,1,
            6,1,1,0,1
            ]
        },
        "width": 5,
        "show": true
    },
    "position": {
        "epoch": "2013-03-25T17:41:00Z",
        "cartographicDegrees": [0,
        -103.0715,
        44.14116666666666,
        20000,
        960,
        -93.65152777777779,
        42.01859722222222,
        0],
        "interpolationAlgorithm": "LAGRANGE",
        "interpolationDegree": 1
    }
}

Matthew Amato

unread,
Apr 3, 2013, 9:55:42 AM4/3/13
to cesiu...@googlegroups.com
Actually, this looks like a bug on the Cesium side.  It should be an easy fix.  If you would like a temporary fix, you can go into Polyline.js and change

    Polyline.prototype.setColor = function(value) {
        if (typeof value === 'undefined') {
            throw new DeveloperError('value is required.');
        }

        var color = this._color;
        if (!Color.equals(color, value)) {
            Color.clone(value, color);
            makeDirty(this, COLOR_INDEX);
        }
    };

to

    Polyline.prototype.setColor = function(value) {
        if (typeof value === 'undefined') {
            throw new DeveloperError('value is required.');
        }

        Color.clone(value, this._color);
        makeDirty(this, COLOR_INDEX);
    };

Also, I would recommend you specify a color at time 0, since you start at 2, that means your color is undefined for the first 2 seconds.


--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Matthew Amato

unread,
Apr 3, 2013, 10:00:56 AM4/3/13
to cesiu...@googlegroups.com
Actually, this is already fixed in the polylineMaterials branch, and will be in master as soon as that branch is ready.

bhawna daryani

unread,
Apr 3, 2013, 11:17:23 AM4/3/13
to cesiu...@googlegroups.com
Thanks you , do appreciate!
Reply all
Reply to author
Forward
0 new messages