Tolerate single-stop colorizers. Fixes #251
This commit is contained in:
parent
05797dd711
commit
49c81edd3a
@ -165,6 +165,9 @@ ref.validValue = function(env, selector, value) {
|
||||
return true;
|
||||
} else if (ref.selector(selector).type == 'tags') {
|
||||
if (!value.value) return false;
|
||||
if (!value.value[0].value) {
|
||||
return value.value[0].is === 'tag';
|
||||
}
|
||||
for (i = 0; i < value.value[0].value.length; i++) {
|
||||
if (value.value[0].value[i].is !== 'tag') return false;
|
||||
}
|
||||
|
14
test/rendering/raster_colorizer_onestop.mml
Normal file
14
test/rendering/raster_colorizer_onestop.mml
Normal file
@ -0,0 +1,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",
|
||||
"Stylesheet": [
|
||||
"raster_colorizer_onestop.mss"
|
||||
],
|
||||
"Layer": [{
|
||||
"name": "world",
|
||||
"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",
|
||||
"Datasource": {
|
||||
"file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip",
|
||||
"type": "shape"
|
||||
}
|
||||
}]
|
||||
}
|
7
test/rendering/raster_colorizer_onestop.mss
Normal file
7
test/rendering/raster_colorizer_onestop.mss
Normal file
@ -0,0 +1,7 @@
|
||||
#world {
|
||||
raster-opacity:1;
|
||||
raster-scaling:bilinear;
|
||||
raster-colorizer-default-mode: linear;
|
||||
raster-colorizer-default-color: transparent;
|
||||
raster-colorizer-stops: stop(0,#000);
|
||||
}
|
21
test/rendering/raster_colorizer_onestop.result
Normal file
21
test/rendering/raster_colorizer_onestop.result
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE Map[]>
|
||||
<Map 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" maximum-extent="-20037508.34,-20037508.34,20037508.34,20037508.34">
|
||||
|
||||
|
||||
<Style name="world" filter-mode="first">
|
||||
<Rule>
|
||||
<RasterSymbolizer opacity="1" scaling="bilinear" default-mode="linear" default-color="rgba(0, 0, 0, 0)" >
|
||||
<stop value="0" color="#000000" /></RasterSymbolizer>
|
||||
</Rule>
|
||||
</Style>
|
||||
<Layer name="world"
|
||||
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">
|
||||
<StyleName>world</StyleName>
|
||||
<Datasource>
|
||||
<Parameter name="file"><![CDATA[[absolute path]]]></Parameter>
|
||||
<Parameter name="type"><![CDATA[shape]]></Parameter>
|
||||
</Datasource>
|
||||
</Layer>
|
||||
|
||||
</Map>
|
14
test/rendering/transforms_single.mml
Normal file
14
test/rendering/transforms_single.mml
Normal file
@ -0,0 +1,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",
|
||||
"Stylesheet": [
|
||||
"transforms_single.mss"
|
||||
],
|
||||
"Layer": [{
|
||||
"name": "world",
|
||||
"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",
|
||||
"Datasource": {
|
||||
"file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip",
|
||||
"type": "shape"
|
||||
}
|
||||
}]
|
||||
}
|
3
test/rendering/transforms_single.mss
Normal file
3
test/rendering/transforms_single.mss
Normal file
@ -0,0 +1,3 @@
|
||||
#world {
|
||||
point-transform: scale(2, 2);
|
||||
}
|
20
test/rendering/transforms_single.result
Normal file
20
test/rendering/transforms_single.result
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE Map[]>
|
||||
<Map 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" maximum-extent="-20037508.34,-20037508.34,20037508.34,20037508.34">
|
||||
|
||||
|
||||
<Style name="world" filter-mode="first">
|
||||
<Rule>
|
||||
<PointSymbolizer transform="scale(2,2)" />
|
||||
</Rule>
|
||||
</Style>
|
||||
<Layer name="world"
|
||||
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">
|
||||
<StyleName>world</StyleName>
|
||||
<Datasource>
|
||||
<Parameter name="file"><![CDATA[[absolute path]]]></Parameter>
|
||||
<Parameter name="type"><![CDATA[shape]]></Parameter>
|
||||
</Datasource>
|
||||
</Layer>
|
||||
|
||||
</Map>
|
Loading…
Reference in New Issue
Block a user