GeoStream: Custom Traffic Layer Styles
1 to 3 of 3
-
- CommentAuthorDavid K
- CommentTimeFeb 19th 2012
I am currently attempting to render traffic information using a custom traffic source and a custom traffic .cam file where the traffic layer links are rendered with different stylings. What I want to accomplish is to be able to draw hash marks or dots or some other form of styling for the traffic layer within each link. It appears that the pen object has some styles that can be attached to the width of the pen, such as 2:dash, but when attempting to use these stylings in the custom traffic layer .cam file the dash styling doesn't appear to have any effect. Does GeoStream traffic layer support the styling on the pen or is there some other way to accomplish this same effect? -
- CommentAuthorAlex H
- CommentTimeFeb 19th 2012
Hi David,
This works OK in my testing. I've taken the style defined in our Adding A Traffic Layer tutorial and modified each render statement to add a dash to the second pen in the pen block, as follows:
[pen,pen<$(cat.color),2:dash>]
This results in the lines being rendered with dashes. However, it can be hard to see this when zoomed out, as the dash-frequency and width of the render-pen means that each section of the dash is merging together - zoom in to see that the dash is working correctly.
To obtain a more visible dash for higher zoom levels, I would recommend varying the pen width and dash frequency by zoom level. The example in the tutorial already does this to a certain extent with Pen Width; to define your own dash frequency, use the "custom" pen style, which you can find further details of in our API documentation.
Adding a Traffic Layer: http://docs.geobase.info/html/dd01ee79-8c26-469b-a24f-c1e5a842b56d.htm
Pen Object: http://docs.geobase.info/html/ed1974d1-3f38-4e93-8555-4fc282cad1a3.htm
Thanks,
Alex -
- CommentAuthorDavid K
- CommentTimeFeb 21st 2012
Thanks Alex. The .cam file I was using had semi-colon after the pen width instead of colon. It's working now. I'll also take a look at the custom pen style to see if this might help further.
1 to 3 of 3
