Skip to content

Commit

Permalink
removed buggy image filter declaration
Browse files Browse the repository at this point in the history
As pointed out by Dane Springmeyer ( springmeyer ) blur couldnt be reset by zoom-level.

»image-filters actually operate at the style level (like the bar opacity parameter - see mapbox/carto#249) and are applied to the rendering canvas once all features are rendered. «

Signed-off-by: mge <[email protected]>
  • Loading branch information
g12n committed Aug 9, 2013
1 parent a7d37bc commit b1f5144
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 88 deletions.
Binary file modified CardboardMap.tm2/.thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
103 changes: 26 additions & 77 deletions CardboardMap.tm2/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Parameters>
<Parameter name="attribution"><![CDATA[Map data © OpenStreetMap contributors]]></Parameter>
<Parameter name="bounds">-180,-85.0511,180,85.0511</Parameter>
<Parameter name="center">-4.5263671875,53.91081008725409,6</Parameter>
<Parameter name="center">-4.866943359375,54.23955053156177,6</Parameter>
<Parameter name="description"><![CDATA[Tilemill 2 Map Style based on a Carboard look]]></Parameter>
<Parameter name="format">png8:m=h</Parameter>
<Parameter name="maxzoom">22</Parameter>
Expand Down Expand Up @@ -51,46 +51,46 @@
</Rule>
<Rule>
<MaxScaleDenominator>12500</MaxScaleDenominator>
<Filter>([type] = 'canal')</Filter>
<Filter>([type] = 'river')</Filter>
<LineSymbolizer stroke-width="3" stroke="#c3e6ff" />
</Rule>
<Rule>
<MaxScaleDenominator>50000</MaxScaleDenominator>
<MinScaleDenominator>12500</MinScaleDenominator>
<Filter>([type] = 'canal')</Filter>
<Filter>([type] = 'river')</Filter>
<LineSymbolizer stroke-width="2" stroke="#c3e6ff" />
</Rule>
<Rule>
<MaxScaleDenominator>200000</MaxScaleDenominator>
<MinScaleDenominator>50000</MinScaleDenominator>
<Filter>([type] = 'canal')</Filter>
<Filter>([type] = 'river')</Filter>
<LineSymbolizer stroke-width="1" stroke="#c3e6ff" />
</Rule>
<Rule>
<MinScaleDenominator>200000</MinScaleDenominator>
<Filter>([type] = 'canal')</Filter>
<Filter>([type] = 'river')</Filter>
<LineSymbolizer stroke="#c3e6ff" stroke-width="0.5" />
</Rule>
<Rule>
<MaxScaleDenominator>12500</MaxScaleDenominator>
<Filter>([type] = 'river')</Filter>
<Filter>([type] = 'canal')</Filter>
<LineSymbolizer stroke-width="3" stroke="#c3e6ff" />
</Rule>
<Rule>
<MaxScaleDenominator>50000</MaxScaleDenominator>
<MinScaleDenominator>12500</MinScaleDenominator>
<Filter>([type] = 'river')</Filter>
<Filter>([type] = 'canal')</Filter>
<LineSymbolizer stroke-width="2" stroke="#c3e6ff" />
</Rule>
<Rule>
<MaxScaleDenominator>200000</MaxScaleDenominator>
<MinScaleDenominator>50000</MinScaleDenominator>
<Filter>([type] = 'river')</Filter>
<Filter>([type] = 'canal')</Filter>
<LineSymbolizer stroke-width="1" stroke="#c3e6ff" />
</Rule>
<Rule>
<MinScaleDenominator>200000</MinScaleDenominator>
<Filter>([type] = 'river')</Filter>
<Filter>([type] = 'canal')</Filter>
<LineSymbolizer stroke="#c3e6ff" stroke-width="0.5" />
</Rule>
</Style>
Expand Down Expand Up @@ -137,19 +137,14 @@
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
</Layer>

<Style name="tunnel-inset" filter-mode="first" image-filters="agg-stack-blur(0,0),agg-stack-blur(1,1)">
<Style name="tunnel-inset" filter-mode="first" image-filters="agg-stack-blur(1,1)">
<Rule>
<MinScaleDenominator>12500000</MinScaleDenominator>
<LineSymbolizer stroke-width="0.4" stroke="#ffffff" offset="0" geometry-transform="translate(2, 1)" />
<LineSymbolizer stroke-width="0" stroke="#ffffff" offset="0" simplify="1" smooth="1" geometry-transform="translate(2, 0)" />
</Rule>
<Rule>
<MaxScaleDenominator>12500000</MaxScaleDenominator>
<MinScaleDenominator>25000</MinScaleDenominator>
<LineSymbolizer stroke-width="0.6" stroke="#ffffff" offset="0" geometry-transform="translate(2, 1)" />
</Rule>
<Rule>
<MaxScaleDenominator>25000</MaxScaleDenominator>
<LineSymbolizer stroke="#ffffff" stroke-width="1" offset="0" geometry-transform="translate(2, 1)" />
<LineSymbolizer stroke="#ffffff" stroke-width="1" offset="0" simplify="1" smooth="1" geometry-transform="translate(2, 0)" />
</Rule>
</Style>
<Style name="tunnel" filter-mode="first" comp-op="multiply" opacity="0.2">
Expand Down Expand Up @@ -203,14 +198,8 @@
<LineSymbolizer stroke-width="2" stroke="#000000" simplify="1" smooth="1" />
</Rule>
<Rule>
<MaxScaleDenominator>750000</MaxScaleDenominator>
<MinScaleDenominator>200000</MinScaleDenominator>
<Filter>([class] = 'main')</Filter>
<LineSymbolizer stroke-width="1" stroke="#000000" simplify="1" smooth="1" />
</Rule>
<Rule>
<MinScaleDenominator>750000</MinScaleDenominator>
<Filter>([class] = 'main')</Filter>
<LineSymbolizer stroke="#000000" stroke-width="1" simplify="1" smooth="1" />
</Rule>
<Rule>
Expand All @@ -231,14 +220,8 @@
<LineSymbolizer stroke-width="2" stroke="#000000" simplify="1" smooth="1" />
</Rule>
<Rule>
<MaxScaleDenominator>750000</MaxScaleDenominator>
<MinScaleDenominator>200000</MinScaleDenominator>
<Filter>([class] = 'motorway')</Filter>
<LineSymbolizer stroke-width="1" stroke="#000000" simplify="1" smooth="1" />
</Rule>
<Rule>
<MinScaleDenominator>750000</MinScaleDenominator>
<Filter>([class] = 'motorway')</Filter>
<LineSymbolizer stroke="#000000" stroke-width="1" simplify="1" smooth="1" />
</Rule>
<Rule>
Expand All @@ -250,19 +233,14 @@
<StyleName>tunnel</StyleName>
<StyleName>tunnel-inset</StyleName> </Layer>

<Style name="road-inset" filter-mode="first" image-filters="agg-stack-blur(0,0),agg-stack-blur(1,1)">
<Style name="road-inset" filter-mode="first" image-filters="agg-stack-blur(1,1)">
<Rule>
<MinScaleDenominator>12500000</MinScaleDenominator>
<LineSymbolizer stroke-width="0.4" stroke="#ffffff" offset="0" geometry-transform="translate(2, 1)" />
<LineSymbolizer stroke-width="0" stroke="#ffffff" offset="0" simplify="1" smooth="1" geometry-transform="translate(2, 0)" />
</Rule>
<Rule>
<MaxScaleDenominator>12500000</MaxScaleDenominator>
<MinScaleDenominator>25000</MinScaleDenominator>
<LineSymbolizer stroke-width="0.6" stroke="#ffffff" offset="0" geometry-transform="translate(2, 1)" />
</Rule>
<Rule>
<MaxScaleDenominator>25000</MaxScaleDenominator>
<LineSymbolizer stroke="#ffffff" stroke-width="1" offset="0" geometry-transform="translate(2, 1)" />
<LineSymbolizer stroke="#ffffff" stroke-width="1" offset="0" simplify="1" smooth="1" geometry-transform="translate(2, 0)" />
</Rule>
</Style>
<Style name="road" filter-mode="first" comp-op="multiply" opacity="0.2">
Expand Down Expand Up @@ -316,14 +294,8 @@
<LineSymbolizer stroke-width="2" stroke="#000000" simplify="1" smooth="1" />
</Rule>
<Rule>
<MaxScaleDenominator>750000</MaxScaleDenominator>
<MinScaleDenominator>200000</MinScaleDenominator>
<Filter>([class] = 'main')</Filter>
<LineSymbolizer stroke-width="1" stroke="#000000" simplify="1" smooth="1" />
</Rule>
<Rule>
<MinScaleDenominator>750000</MinScaleDenominator>
<Filter>([class] = 'main')</Filter>
<LineSymbolizer stroke="#000000" stroke-width="1" simplify="1" smooth="1" />
</Rule>
<Rule>
Expand All @@ -344,14 +316,8 @@
<LineSymbolizer stroke-width="2" stroke="#000000" simplify="1" smooth="1" />
</Rule>
<Rule>
<MaxScaleDenominator>750000</MaxScaleDenominator>
<MinScaleDenominator>200000</MinScaleDenominator>
<Filter>([class] = 'motorway')</Filter>
<LineSymbolizer stroke-width="1" stroke="#000000" simplify="1" smooth="1" />
</Rule>
<Rule>
<MinScaleDenominator>750000</MinScaleDenominator>
<Filter>([class] = 'motorway')</Filter>
<LineSymbolizer stroke="#000000" stroke-width="1" simplify="1" smooth="1" />
</Rule>
<Rule>
Expand All @@ -363,19 +329,14 @@
<StyleName>road</StyleName>
<StyleName>road-inset</StyleName> </Layer>

<Style name="bridge-inset" filter-mode="first" image-filters="agg-stack-blur(0,0),agg-stack-blur(1,1)">
<Style name="bridge-inset" filter-mode="first" image-filters="agg-stack-blur(1,1)">
<Rule>
<MinScaleDenominator>12500000</MinScaleDenominator>
<LineSymbolizer stroke-width="0.4" stroke="#ffffff" offset="0" geometry-transform="translate(2, 1)" />
<LineSymbolizer stroke-width="0" stroke="#ffffff" offset="0" simplify="1" smooth="1" geometry-transform="translate(2, 0)" />
</Rule>
<Rule>
<MaxScaleDenominator>12500000</MaxScaleDenominator>
<MinScaleDenominator>25000</MinScaleDenominator>
<LineSymbolizer stroke-width="0.6" stroke="#ffffff" offset="0" geometry-transform="translate(2, 1)" />
</Rule>
<Rule>
<MaxScaleDenominator>25000</MaxScaleDenominator>
<LineSymbolizer stroke="#ffffff" stroke-width="1" offset="0" geometry-transform="translate(2, 1)" />
<LineSymbolizer stroke="#ffffff" stroke-width="1" offset="0" simplify="1" smooth="1" geometry-transform="translate(2, 0)" />
</Rule>
</Style>
<Style name="bridge" filter-mode="first" comp-op="multiply" opacity="0.2">
Expand Down Expand Up @@ -413,58 +374,46 @@
</Rule>
<Rule>
<MaxScaleDenominator>12500</MaxScaleDenominator>
<Filter>([class] = 'motorway')</Filter>
<Filter>([class] = 'main')</Filter>
<LineSymbolizer stroke-width="5" stroke="#000000" simplify="1" smooth="1" />
</Rule>
<Rule>
<MaxScaleDenominator>50000</MaxScaleDenominator>
<MinScaleDenominator>12500</MinScaleDenominator>
<Filter>([class] = 'motorway')</Filter>
<Filter>([class] = 'main')</Filter>
<LineSymbolizer stroke-width="3" stroke="#000000" simplify="1" smooth="1" />
</Rule>
<Rule>
<MaxScaleDenominator>200000</MaxScaleDenominator>
<MinScaleDenominator>50000</MinScaleDenominator>
<Filter>([class] = 'motorway')</Filter>
<Filter>([class] = 'main')</Filter>
<LineSymbolizer stroke-width="2" stroke="#000000" simplify="1" smooth="1" />
</Rule>
<Rule>
<MaxScaleDenominator>750000</MaxScaleDenominator>
<MinScaleDenominator>200000</MinScaleDenominator>
<Filter>([class] = 'motorway')</Filter>
<LineSymbolizer stroke-width="1" stroke="#000000" simplify="1" smooth="1" />
</Rule>
<Rule>
<MinScaleDenominator>750000</MinScaleDenominator>
<Filter>([class] = 'motorway')</Filter>
<Filter>([class] = 'main')</Filter>
<LineSymbolizer stroke="#000000" stroke-width="1" simplify="1" smooth="1" />
</Rule>
<Rule>
<MaxScaleDenominator>12500</MaxScaleDenominator>
<Filter>([class] = 'main')</Filter>
<Filter>([class] = 'motorway')</Filter>
<LineSymbolizer stroke-width="5" stroke="#000000" simplify="1" smooth="1" />
</Rule>
<Rule>
<MaxScaleDenominator>50000</MaxScaleDenominator>
<MinScaleDenominator>12500</MinScaleDenominator>
<Filter>([class] = 'main')</Filter>
<Filter>([class] = 'motorway')</Filter>
<LineSymbolizer stroke-width="3" stroke="#000000" simplify="1" smooth="1" />
</Rule>
<Rule>
<MaxScaleDenominator>200000</MaxScaleDenominator>
<MinScaleDenominator>50000</MinScaleDenominator>
<Filter>([class] = 'main')</Filter>
<Filter>([class] = 'motorway')</Filter>
<LineSymbolizer stroke-width="2" stroke="#000000" simplify="1" smooth="1" />
</Rule>
<Rule>
<MaxScaleDenominator>750000</MaxScaleDenominator>
<MinScaleDenominator>200000</MinScaleDenominator>
<Filter>([class] = 'main')</Filter>
<LineSymbolizer stroke-width="1" stroke="#000000" simplify="1" smooth="1" />
</Rule>
<Rule>
<MinScaleDenominator>750000</MinScaleDenominator>
<Filter>([class] = 'main')</Filter>
<Filter>([class] = 'motorway')</Filter>
<LineSymbolizer stroke="#000000" stroke-width="1" simplify="1" smooth="1" />
</Rule>
<Rule>
Expand Down
6 changes: 3 additions & 3 deletions CardboardMap.tm2/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ bounds:
- 180
- 85.0511
center:
- -4.5263671875
- 53.91081008725409
- -4.866943359375
- 54.23955053156177
- 6
description: Tilemill 2 Map Style based on a Carboard look
format: "png8:m=h"
interactivity_layer: ''
maxzoom: 22
minzoom: 0
mtime: 1375998649857
mtime: 1376034295471
name: Cardboard Map
scale: 1
source: "mapbox:///mapbox.mapbox-streets-v3"
Expand Down
14 changes: 6 additions & 8 deletions CardboardMap.tm2/style.mss
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ Map {
line-smooth: 1;
[class='motorway'],
[class='main'] {
[zoom>=10] {line-width:1}
[zoom>=12] {line-width:2}
[zoom>=14] {line-width:3}
[zoom>=16] {line-width:5}
Expand All @@ -93,13 +92,12 @@ Map {
line-color:#fff;
line-width:1;
line-offset:0;
line-geometry-transform: "translate(2, 1)";
image-filters: agg-stack-blur(1,1);
[zoom<=14]{line-width:0.6}
[zoom<=5]{
line-width:0.4;
image-filters: agg-stack-blur(0,0);
}
line-simplify:1;
line-smooth: 1;
line-geometry-transform: "translate(2, 0)";
image-filters: agg-stack-blur(1,1);
[zoom<=5] {line-width:0}

}
}
/* Buildings */
Expand Down

0 comments on commit b1f5144

Please sign in to comment.