NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

During carto style definition I would like to enlarge some svg's icons depends on zoom level. I'm wondering if it's possible to override some SVG file attributes in .mss files? In example I would like to override width and height value defined already in SVG file. Or scale up svg for specific scale.
For example: [highway = 'motorway_link'] { [zoom >= 16 ] { marker-scale: 2; } marker-fill: @motorway-oneway-arrow-color; }

or

[highway = 'motorway_link'] { [zoom >= 16 ] { marker-width: 15; marker-height: 15; } marker-fill: @motorway-oneway-arrow-color; }

asked 23 Mar '21, 10:30

engopy's gravatar image

engopy
126101015
accept rate: 0%


Please look at the Mapnik documentation, there are some marker-related functions like marker-transform:

https://cartocss.readthedocs.io/en/latest/mapnik_api.html#markers

permanent link

answered 23 Mar '21, 10:47

kocio's gravatar image

kocio
2.1k12341
accept rate: 20%

3

I wasn't aware there are so many possible configurations for SVG. actually: marker-width: marker-height: does what I needed Thanks

(23 Mar '21, 14:04) engopy

Exactly what you have ordered... :-)

(23 Mar '21, 14:12) kocio

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×341
×65
×23

question asked: 23 Mar '21, 10:30

question was seen: 1,468 times

last updated: 23 Mar '21, 14:12

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum