Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpolated styles not supported #10

Open
Gyroscope07 opened this issue May 28, 2019 · 1 comment
Open

Interpolated styles not supported #10

Gyroscope07 opened this issue May 28, 2019 · 1 comment

Comments

@Gyroscope07
Copy link

MapBox styles include interpolation definitions for things line-width, fill-opacity etc in the following form:

...
{
    ...
    "line-opacity": [
        "interpolate",
        ["linear"],
        ["zoom"],
        5,
        0,
        6,
        0.5
    ],
    ...
},
...

It looks as though the styles parser in this library can only handle distinct step definitions in this form:

...
{
    ...
    "line-opacity": {
        "base": 1.5,
        "stops": [
            [
                2,
                0.3
            ],
            [
                7,
                0
            ]
        ]
    },
    ...
}
....

which causes an invalid cast exception when trying to parse the style.json

if (paintData.ContainsKey("line-opacity")){
    paint.LineOpacity = Convert.ToDouble(getValue(paintData["line-opacity"], attributes));
}
System.InvalidCastException: 'Unable to cast object of type 'System.Object[]' to type 'System.IConvertible'.'
@Gyroscope07 Gyroscope07 changed the title Exponential styles not supported Interpolated styles not supported May 28, 2019
@charlenni
Copy link

As you can see, in this library only „stops“ are implemented. I assume, that you have to implement by your own. But be careful, this library creates tiles with integer zoom values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants