mobile-sdk
mobile-sdk copied to clipboard
vector layer can use cartocss style?
vector tile layer can use the cartocss style,but the vector layer's style is too simple.
Yes, vector layer style has less options. Can you detail your needs: what exactly do you miss from there?
@jaakla for example vector layer can render as mapnik map or mapsforge,it can also use cartocss or any other styleset to rule the map layer.
A few missing options that we would be happy to have are :
- Dotted / dashed lines (ideally we should be able to do anything we can do with the
stroke-dasharray
CSS property) - A border for Point geometries, which would allow us to create circles with a black border and transparent fill for example.
- Less critical for us, but still nice : options to define a base shape for a point. Maybe something like SLD styling allows you to do with points : you can specify shape type among
circle
,square
,triangle
,star
,cross
, orx
. Among with the point border option, they would provide a good number of ways to represent different kind of things without having to use more complex geometries like Polygons or Marks.
@mtehver can comment?
I think all this can be achieved with current styling options. For dashed line, you need to generate the dashed pattern bitmap and use the LineStyleBuilder.setBitmap method. Not sure how well it works, we have not tried this for a while and the patterning may not work as well as with vector tiles.
Regarding points/markers - simply use canvas to generate the bitmaps you need and use these.
We are thinking about adding SVG support to Bitmap loader, so this may be also helpful. Not sure we will add this into 4.1.0, though.
Of course, using dynamically generated bitmaps is the way I was planning to go for these features. But it's always nice when I can use an API to avoid spending time on that kind of common task :) . So since you asked for feedback, I jumped on the occasion.