New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing marker halos with two layers #4247
Comments
|
hmm, I think I made a mistake and I'm actually only seeing the marker from the lower layer... |
|
In fact, yes, that's what I'm seeing. If I comment out the first layer, the right icon shows in the resulting image. I tried to do the same with lines and of course it works, because that's how everybody is implementing road casing. Here's the two other layers I added for that: <Style filter-mode="first" name="roads-casing-casing">
<Rule>
<Filter><![CDATA[([highway] = 'service')]]></Filter>
<LineSymbolizer stroke="#999999" stroke-dasharray="22, 11" stroke-linecap="round" stroke-linejoin="round" stroke-width="12" />
</Rule>
</Style>
<Layer name="roads-casing-casing" 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><![CDATA[roads-casing-casing]]></StyleName>
<Datasource>
<Parameter name="type"><![CDATA[csv]]></Parameter>
<Parameter name="inline"><![CDATA[
highway,wkt
service,"LINESTRING(-20037508 10, 20037508 10)"
]]></Parameter>
</Datasource>
</Layer>
<Style filter-mode="first" name="roads">
<Rule>
<Filter><![CDATA[([highway] = 'service')]]></Filter>
<!-- LineSymbolizer stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" stroke-width="6.9" /-->
<LineSymbolizer stroke="#eaeaea" stroke-dasharray="6, 8" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" />
</Rule>
</Style>
<Layer name="roads" 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><![CDATA[roads]]></StyleName>
<Datasource>
<Parameter name="type"><![CDATA[csv]]></Parameter>
<Parameter name="inline"><![CDATA[
highway,wkt
service,"LINESTRING(-20037508 10, 20037508 10)"
]]></Parameter>
</Datasource>
</Layer>Resulting image: I even tried using a PointSymbolizer. DebugSymbolizer works, though. |

I tried to fake what I asked in #4246, but I hit an issue.
The way I did it is to draw two layers. The lower one uses an SVG, set fill and stroke to white, stroke width to 2. The upper one uses the same SVG only with fill in another color (a shade of red). This should imitate a 1px halo, right?
No. The stroke style is also used in the upper layer. See for yourself:
I have a test file:
The SVG is this one.
The text was updated successfully, but these errors were encountered: