Questions tagged [cartocss]

CartoCSS is a CSS-like language used in TileMill and Mapbox Studio Classic to style features.

Filter by
Sorted by
Tagged with
34
votes
3answers
14k views

Is there a Carto CSS Gallery which also contains code?

I am currently exploring the usage of CartoCSS and TileMill in one of our projects. I have seen the impressive gallery available at http://www.mapbox.com/tilemill/gallery/ The gallery looks ...
17
votes
0answers
1k views

Converting from SLD to Carto CSS? [closed]

I have a bunch of layers and corresponding SLD's running a WMS service. I was exploring the possibility of shifting to a TileMill's tile based TMS service. For this, I would like if it were possible ...
11
votes
1answer
525 views

What is the future of CartoCSS (i.e. does it have one)? [closed]

MapBox recently announced that they would be moving away from CartoCSS towards a completely visual interface. Apparently the new style sheets that underlay that UI will be JSON based, so despite the ...
5
votes
2answers
464 views

How to use external CartoCSS/mss within JavaScript?

I am using CartoCSS to style features in a run-time CartoDB layer (as opposed to a pre-made visualization) but it gets messy doing this within JavaScript: sublayers: [{ cartocss: '#initvisitedfws {...
5
votes
1answer
1k views

Refer to zoom level in TileMill expressions

Is it possible to do something like this: #ways[highway="trunk"] { line-color:#c99; line-width:@zoom/10; } Obviously that example doesn't work. Is there another way to do arithmetic expressions ...
4
votes
1answer
487 views

How to render overlapping bus trips as one route from OSM?

I would like to create bus map for my city from OSM data. I imported data into Postgresql with osm2psql and I can render routes with Mapnik. But the problem is that same route ref is shown multiple ...
4
votes
1answer
185 views

Difficult style for the map

There is a task before me of generating images as shown below. The main problem is the signs which must be placed outside the polygon (if they do not fit in it), and the lines should connect the sign ...
4
votes
1answer
984 views

Rendering tm2 projects? [closed]

What are the options for rendering tm2 projects? As far as I know the open source Mapbox tm2 projects have proprietary data sources (like OSM Bright 2), thus they are of little use, but some other ...
3
votes
1answer
1k views

osm2pgsql vs imposm rendering performance

Is there any difference in rendering performance between using a osm2pgsql vs imposm imported PostGIS DB in Mapnik? Or asking it differently, is there any downside of using imposm if I only want to ...
3
votes
1answer
363 views

CartoCSS: labels along inside of polygon boundary

I'm using CartoCSS to render maps that include large polygons (like national parks). At higher zoom levels I want labels along the inside of the polygon boundaries, like in OpenStreetMap: I reviewed ...
3
votes
1answer
575 views

Double transformation of marker in Carto CSS

I need to show on the map the direction of the road traffic with arrows. For this purpose I use markers for Carto CSS in TileMill. If the road has in OSM tag oneway="yes" or oneway="1", all is ok, ...
3
votes
1answer
1k views

Where is the reference for functions available in CartoCSS

I'm playing with Tilemill and i see that for some properties, like marker-transform, i can use functions. I want to use rotate() which takes 3 arguments (i learned this by inputing just one so it ...
3
votes
1answer
73 views

TileMill Issue with Null values

I have this original image But when i open it in TileMill, it converts image like this. White areas are transparent in the image This is more like, it removes all no data values i.e. 255 in my ...
3
votes
1answer
76 views

How to avoid multiple label in zoomin in tilemill

Now i am working on tilemill ,and i am facing a problem in a tilemill when i am styling zoomin a road layer that time display road layer label multiple times. How can avoid disply multiple road layer ...
3
votes
2answers
3k views

How to generate 512x512 map tiles (2x resolution for retina displays)

I'm looking for a method to produce 512x512 pixels map tiles using CartoCSS and Mapnik, for example exactly as CardoDB does for its base maps (here below a 256x256 map tile vs its correspondent ...
3
votes
1answer
118 views

Min distance for markers in CartoCSS

I used shields in CartoCss to show the subway stations on my map. When I started to develop the map for mobile devices, I noticed that svg images in shields were destorted hugely and I decided to use ...
3
votes
2answers
556 views

Carto-CSS/ Mapnik XML Text background color

I want to add a background color to my labels. How do I do that with Carto-CSS in Tilemill or with Mapnik? Carto-CSS #marker_labels { text-name: "[name]"; text-face-name:@sans; text-size: 20; ...
3
votes
0answers
119 views

CartoCSS : Style a road using a road_label rule

The parisian ring road (and probably others) usually looks a bit off (especially at low zoom levels), because in OSM it has been created as two independant 'main' roads, instead of one 'highway'. ...
3
votes
0answers
200 views

CartoCSS: Don't show border between adjacent polygons

In OSM, riverbeds are created as multiple adjacent or even overlapping polygons. When styling these polygons in CartoCSS with a border, the overlapping can be seen: I'd like to hide that line ...
2
votes
3answers
118 views

How do you create buffers around points based on individual point values in CARTO?

I am very new to CARTO and have very limited coding skills. I have a data set of points representing the centroid of zip codes. Each point has an associated average commute time. It is relatively ...
2
votes
1answer
6k views

How to add CSS styling in Mapbox GL Popup?

I am aware this is similar to many other questions, but I have been unable to determine how to add the correct code to style my popups in mapbox-gl. I'm very new to CSS, Mapbox-gl, and coding in ...
2
votes
1answer
2k views

Including chart based on fields in CartoDB infowindow?

I would like to make graphs, pie charts, etc based on fields in my table within my infowindows. Is there a way to accomplish this?
2
votes
2answers
847 views

How can I create a hexbin layer using the SQL and CartoCSS parameters in cartodb.js?

CartoDB has a great hexbin visualization wizard baked into the client dashboard: However, I like using cartodb.js to customize events and interactions; in particular, I'd like to make styles ...
2
votes
2answers
189 views

Change Carto basemap font size?

I'm using the CartoDB static Maps API. I need to change the font size of the street names. E.g. in the image below the street name "Stanhope Road" needs to be bigger. Here's what my Json config ...
2
votes
1answer
86 views

What is the :: notation in CartoCSS?

I've been designing some tilesets in Mapbox Studio Classic and I keep seeing the :: notation in styles that Mapbox has created. What does that mean? Are there only specific values that can be put ...
2
votes
2answers
374 views

Mapbox Natural earth map disappears on zooms 0 & 1

As the title says, I'm currently using mapbox to create a little atlas app the issue is whenever I zoom out to anything lower than zoom level 2, the map dissappears with the map background being the ...
2
votes
2answers
919 views

Rotating labels in cartocss with controlling the rotation basepoint

I am trying to rotate multiple text labels in cartodb/cartocss. I am offseting each label so that they appear to be stacked using text-dx and text-dy. Using text-horizontal-alignment: left; and text-...
2
votes
2answers
429 views

CartoCSS different background colors of Map element

I tried to change the background color of a map in zoomlevels greater than 11, but Map{ background-color:@water; [zoom>11]{background-color:@water*1.05;} } had no effect. Is there an other ...
2
votes
1answer
62 views

Priority of street labels over amenity icons

OK, so I have a CartoCSS project. These are all of the stylesheets used (as described in my project.mml): "Stylesheet": [ "palette.mss", "base.mss", "roads.mss", "labels.mss", ...
2
votes
1answer
83 views

Why are point-files cut at tiles-borders?

I'm placing a SVG in Tilemill via a point with lat and long. So far that works great but when the tile the point is located in ends, the image is not rendered. Is this a bug? Can I do something ...
2
votes
1answer
128 views

Sunlight layer into CartoDB

I have a list of tweets on a torque map made with CartoDB. I want to add an additional layer that shows the sunlight around the world at certain times, similar to the Twitter #sunrise map found here. ...
2
votes
1answer
625 views

Leaflet.js and CartoDB.js giving event conflict

I have a layer from a CartoDB viz that I’m listening to the featureclick event. When a feature is clicked I highlight it by applying cartoCss. However, I want to unhighlight it when I click on an area ...
2
votes
1answer
302 views

Drawing 2 points at the beginning and the end of the LineString

I have LineStrings in a GeoJSON files, in example: {"type":"Feature","geometry":{"type":"LineString","coordinates":[[8.5918904,46.6325099,0],[8.5984267,46.6184961,0]]},"properties":{"name":"...
2
votes
1answer
1k views

Is it possible to convert QGIS QLM to SLD (w/ New Symbology)?

I have a QGIS project where I have created some nice styles using New Symbology. I would like to convert this to either SLD for use in GeoServer or CartoCSS for use in TileMill. I have tried saving ...
2
votes
1answer
55 views

Prerendering OSM tiles with CartoCSS?

I've set up a PostGIS database and imported my map data. Then I ran render_list to render my tiles. Serving them through mod-tile works just fine. However, the files on my HDD are *.meta files and ...
2
votes
1answer
258 views

Creating custom legend to map to custom css torque heatmap

I'm hoping someone can help me with html to create a legend that maps to a custom heatmap I made using the style CSS. When I try using the default legend, it neither maps to the right custom colors, ...
2
votes
1answer
598 views

Add PostGIS database information to XML generated by CartoDB

I have installed the latest Mapnik renderer following the information on their website and exported a .pbf file to a local PostGIS DB using this command: osm2pgsql --style ../openstreetmap-carto/...
2
votes
1answer
308 views

Mapnik/CartoCSS: make text labels overlap other layers (but not each other)

I'm using Mapnik 3.0.7 to render a basemap and a Shapefile layer that contains points. The labels for these points should overlap all the layers underneath, but not each other. Unfortunately, road ...
2
votes
1answer
189 views

TileMill : set minzoom to layers?

i found in this post: CartoCSS layer visibility a solution to set a layer not visible for some zoom levels. But in https://github.com/gravitystorm/openstreetmap-carto it seems that a minzoom ...
2
votes
1answer
62 views

Is it possible to create browser-specific CartoCSS?

I can't think of many practical uses for this, so it probably isn't implemented, but I have an edge-case desire for it so I thought I'd ask. Basically I'm creating a Torque animation in CartoDB of ...
2
votes
1answer
538 views

Trying to Offset Overlapping Transit Lines/Routes - Is There a Way?

I am trying to create a bus route map in Los Angeles. I realize that it is shooting for the moon (perhaps it is impossible to do well) since there are so many overlapping routes, but I think I've gone ...
2
votes
1answer
122 views

What do cartocss attachments along filters mean?

I'm exploring openstreetmap-carto style and I wonder what does such syntax mean: [natural = 'water']::natural, [landuse = 'reservoir']::landuse, [waterway = 'riverbank']::waterway Is this ...
2
votes
1answer
229 views

TileMill: How to mask layer without losing background

I have a large geotiff with elevation gradient which I want to use to colour my map. However, the coastal line of the geotiff doesn't exactly match my shapefile so I want to mask it. The problem is ...
2
votes
2answers
322 views

Conditional styling and expressions using modulus

I'm trying to style a contour shapefile in TileMill with all contour lines divisible by 100 bolder than others. Can I use expressions in defining a condition? The following example of course does not ...
2
votes
2answers
507 views

How to style ways with CartoCSS depending on a relation property (OSM)

I'm using CartoCSS together with an OSM Postgres DB (hstore on). I want to set the line color depending on the operator tag of relations (routes). How can I do that? Update Thanks to Paul Norman for ...
2
votes
1answer
720 views

Can you use nested properties to style features in CartoCSS

I've imported a GeoJSON layer into TileMill and am having trouble styling based on the properties in the features. The features' properties objects have objects nested within them, and I haven't found ...
2
votes
1answer
537 views

How do I make my Cartodb info windows wider?

According to my read of andrewxhill (more readable version) I should be able to change the info window size by adding CSS, like so: <div class="cartodb-popup header with-image" data-cover="true"&...
2
votes
0answers
41 views

Adjusting the admin_level of countries in osm-bright style?

I'm using OSM Bright style Unfortunately, this style favours more admin_level=3 countries than admin_level=2, for instance, on the map below, Transnistria is labelled instead of Moldavia. How to ...
2
votes
0answers
245 views

CartoCSS to MapboxGL

I have some old styles in CartoCSS and some I have found online. However obviously with the update of mapbox studio it uses Mapbox GL styling and the two are different. I can't see a way of ...
2
votes
0answers
941 views

How to style markers so they dynamically offset if overlapping at different zoom levels? [closed]

I have created a map using Carto. The map has bespoke images as icon markers. I would like to style the map so that, if the icons overlap, they both render in an offset position so that the full ...