think I need to split it into separate layers in order to have
control over which types/symbols are given priority, but that would
break the interactivity, since I would need interactivity for each
So the main problem you're running against is that some symbols
are covering up others? I'll start thinking about this problem;
though we do combination of grids in TileStream hosting (and,
unfortunately not in stock tilestream), even that's limited to 10
layers, far less than your 40. I think that there might be a
solution here based on spatially joining features that overlap to
get some of the experience of getting feature-under-features
Support Staff4 Posted by Will White on 14 Sep, 2011 06:40 PM
With the map
builder in TileStream Hosting, we "composite" grid interaction
data just like we composite the image data. We currently only
support ten layers at a time for compositing, however.
So each map it is limited to 10 layers, but you're free to have
as many interactive layers on your account as your subscription
From: Will White [***@***]
Sent: Wednesday, September 14, 2011 2:40 PM
To: Sturm, Chris
Subject: Re: Multiple interaction layers problem [TileMill]
The free version doesn't support any composite grid interaction, correct?
// Add your reply above here
From: Will White
Subject: Multiple interaction layers problem
With the [map builder](http://mapbox.com/tilestream/map-builder/index.html) in TileStream Hosting, we "composite" grid interaction data just like we composite the image data. We currently only support ten layers at a time for compositing, however.
So each map it is limited to 10 layers, but you're free to have as many interactive layers on your account as your subscription allows.
View this Discussion online: http://support.mapbox.com/discussions/tilemill/145-multiple-interaction-layers-problem
Reply with #ignore to stop receiving notifications for this discussion.
To clarify the problem a little: At the moment I have all 40
"types"/symbols on one layer. Mapnik removes overlapping symbols
automatically, which is fine, but I want some control over which
symbols are given priority. The only way I see to do that is split
some of these symbols onto a separate layer that is drawn first, so
the symbols on that layer will always show and layers underneath
will hidden if they overlap. The problem with this solution is that
I can no longer get interaction across the two layers. Grid
compositing would obviously solve this, just a shame it's only
available on Tilestream hosting.
Unfortunately, even on MapBox hosting, you'd only be able to
combine 10 layers at once - far short of the 40.
I was thinking about this earlier, and would it be possible to
render a layer with all 40 markers, and then 40 layers with one
marker each? That wouldn't require compositing at all, and would
make it easier to focus on specific species/layers at a time.
Thanks for continuing to think about this Tom, the problem with
that solution is that Mapnik chooses different markers to show on
the different layers, so the interactive layer does not correspond
to what is showing on the map. I think the ideal solution would be
for Mapnik to offer more control over symbol placement priorities
within a layer.
Support Staff11 Posted by Will White on 02 Oct, 2011 05:44 PM
Have you tried setting marker-allow-overlap to
true to tell Mapnik that is ok for markers to overlap?
It's set to false by default. For overlap priority, I
believe Mapnik uses the order of the features in the datasource to
decide which one to render. Features that come first are rendered
with a higher priority.
Support Staff12 Posted by Dane on 03 Oct, 2011 10:46 PM
I'm interested in your reply to Will. Also I agree with you that
it would be great if mapnik allowed more ability to sort/order
features on the fly. Currently the way to do it is to push your
data into a format like sqlite or postgis and then apply an
order by in the table sql select query for the
datasource. But there are some good ideas brewing for better native
ordering support - see http://trac.mapnik.org/ticket/891.
Lastly, in the future mapnik should be able to be extended to
render multiple layers onto a single grid canvas in a single
rendering pass. Since the beginning of development in Mapnik on
rendering utf8grids this has been a goal, but its a tricky thing to
implement so its still on the TODO list.
This is very good to hear, and your suggestion about using
sqlite or postgis with order by is very useful.
The marker-allow-overlap is useful when symbols are in multiple
layers, applied to specific layers. The information in this thread
has helped me understand better the way mapnik makes decisions
about which symbols to show. At one point I experimented with
creating an invisible layer with marker-allow-overlap
set to true for the interaction layer, but there is
too much information in there to be useful at low zoom levels, so
the interaction data does not make sense.
The best solution for this I think is the native ordering
support, or using ordering and grouping into separate layers
together with utf8grid compositing, if I had Tilestream hosted.