Skip to content

Instantly share code, notes, and snippets.

@olt
Created July 27, 2015 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olt/8de050be984ea38ed718 to your computer and use it in GitHub Desktop.
Save olt/8de050be984ea38ed718 to your computer and use it in GitHub Desktop.
magnacarto -mml roads.mml -builder mapserver -ms-no-map-block > layers.map
LAYER
NAME roads-outline
MAXSCALEDENOM 200000
STATUS ON
TYPE LINE
DATA "hamburg_germany/hamburg_germany_osm_roads"
PROJECTION
"init=epsg:4326"
END
CLASS
# Zoom{>=14}
MAXSCALEDENOM 50000
EXPRESSION ('[type]' = "secondary")
STYLE
WIDTH 4
COLOR "#000000"
LINECAP BUTT
LINEJOIN MITER
END
END
CLASS
# Zoom{>=14}
MAXSCALEDENOM 50000
EXPRESSION ('[type]' = "primary")
STYLE
WIDTH 4
COLOR "#000000"
LINECAP BUTT
LINEJOIN MITER
END
END
CLASS
# Zoom{>=14}
MAXSCALEDENOM 50000
EXPRESSION ('[type]' = "trunk")
STYLE
WIDTH 4
COLOR "#000000"
LINECAP BUTT
LINEJOIN MITER
END
END
CLASS
# Zoom{>=14}
MAXSCALEDENOM 50000
EXPRESSION ('[type]' = "motorway")
STYLE
WIDTH 4
COLOR "#000000"
LINECAP BUTT
LINEJOIN MITER
END
END
CLASS
# Zoom{>=12}
MAXSCALEDENOM 200000
EXPRESSION ('[type]' = "motorway")
STYLE
WIDTH 4
COLOR "#000000"
LINECAP BUTT
LINEJOIN MITER
END
END
END
LAYER
NAME roads-inline
MAXSCALEDENOM 200000
STATUS ON
TYPE LINE
DATA "hamburg_germany/hamburg_germany_osm_roads"
PROJECTION
"init=epsg:4326"
END
CLASS
# Zoom{>=14}
MAXSCALEDENOM 50000
EXPRESSION ('[type]' = "secondary")
STYLE
WIDTH 3
COLOR "#ffffff"
LINECAP BUTT
LINEJOIN MITER
END
END
CLASS
# Zoom{>=14}
MAXSCALEDENOM 50000
EXPRESSION ('[type]' = "primary")
STYLE
WIDTH 3
COLOR "#f5f5dc"
LINECAP BUTT
LINEJOIN MITER
END
END
CLASS
# Zoom{>=14}
MAXSCALEDENOM 50000
EXPRESSION ('[type]' = "trunk")
STYLE
WIDTH 3
COLOR "#ffff00"
LINECAP BUTT
LINEJOIN MITER
END
END
CLASS
# Zoom{>=14}
MAXSCALEDENOM 50000
EXPRESSION ('[type]' = "motorway")
STYLE
WIDTH 3
COLOR "#ff0000"
LINECAP BUTT
LINEJOIN MITER
END
END
CLASS
# Zoom{>=12}
MAXSCALEDENOM 200000
EXPRESSION ('[type]' = "motorway")
STYLE
WIDTH 3
COLOR "#ff0000"
LINECAP BUTT
LINEJOIN MITER
END
END
CLASS
# Zoom{>=14}
MAXSCALEDENOM 50000
STYLE
WIDTH 0.5
COLOR "#0000007f"
LINECAP BUTT
LINEJOIN MITER
END
END
END
@motorway_width: 3;
@trunk_width: 3;
@primary_width: 3;
@outline_width: 1;
#roads::outline[zoom>=12] {
line-color: black;
}
#roads::inline[zoom>=12] {
line-color: rgba(0, 0, 0, 0.5);
[type='motorway'] { line-color: red; }
[type='trunk'] { line-color: yellow; }
[type='primary'] { line-color: beige; }
[type='secondary'] { line-color: white; }
}
#roads::outline[zoom>=12] {
[type='motorway'] { line-width: @motorway_width + @outline_width; }
}
#roads::inline[zoom>=12] {
[type='motorway'] { line-width: @motorway_width; }
}
#roads::outline[zoom>=14] {
[type='motorway'] { line-width: @motorway_width + @outline_width; }
[type='trunk'] { line-width: @trunk_width + @outline_width; }
[type='primary'],
[type='secondary'] { line-width: @primary_width + @outline_width; }
}
#roads::inline[zoom>=14] {
line-width: 0.5;
[type='motorway'] { line-width: @motorway_width; }
[type='trunk'] { line-width: @trunk_width; }
[type='primary'],
[type='secondary'] { line-width: @primary_width; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment