0

I have a CartoDB map which has two layers. I want both to display, and I want both to be category maps — there are 3 categories in each which display as three different colors. But I want to distinguish between them by marker shape. Ideally, one layer will be a circle and the other will be a triangle or a square.

I see that I can choose "ellipse" or "arrow" as a marker-type in CartoCSS. Arrow is not useful for my purposes as it doesn't have enough space to show color. Apparently "rectangle" was supposed to exist, but hasn't been implemented for non-torque maps.

Chris from CartoDB suggested using an SVG icon, which DOES allow being filled in with the given marker-fill. I'm guessing this is because the fill for the square in the SVG file is "Undefined," and thus able to be inherited. Unfortunately, when I do this, the squares look terrible on my map because they're all pixelated. They also don't have sharp borders, even though I've provided a border in the image.

The only solution I've been able to think of thus far is to create PNG/SVG icons with the required colors, upload them and use them directly for each category. This is obviously not dynamic, but at least it would be aesthetically acceptable.

Is there some other solution I'm not thinking of? Does anyone know why the SVG seems to be rendered and then resized such that it becomes pixelated?

1 Answer 1

1

You could try using the SVG icons that CartoDB offers in the image selector window.

There are already some basic figures available there that don't look pixelated once used in the map.

3
  • They do still look a bit pixelated, but I may have to end up doing this. The biggest annoyance is that I can't give them a stroke like the drawn ellipses have. I guess I'll just have to take all the strokes away. :-(
    – Nick K9
    Jul 3, 2015 at 14:44
  • By the way, could you share the SVG icon you're using? Perhaps we can guess something from it
    – iriberri
    Jul 3, 2015 at 15:46
  • Sure, it's here. And here's the problem.
    – Nick K9
    Jul 5, 2015 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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