1

I am wanting to use a different marker-file based on a value returned via SQL in cartodb. I am wanting todo something like

marker-file:  url('[icon]');

Where the value in [icon] is a full URL to a PNG image. When I do the above there is no error displayed, but there is no marker displayed on the map. If I use the below then the marker is displayed.

marker-file: url('http://test.wildwalks.com/wildwalks_custom/icons/map/access/marker-green-seat-136.png');

The value returned by [icon] is identical to this full URL. Any suggustions on how to use SQL values to define marker-file urls?

1

According to the documentation here and here the marker-file parameter is expecting an URI, not an expression, so you would need to use the URL directly.

If you have several categories and you want to use different markers for them, you would need to filter the data in CartoCSS for the values of any of your columns (it could even be the column for the URLs themselves or any other column in which you store the categories) and then, inside the filter, apply the marker-file with the URL corresponding to each case.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.