Multiple interaction layers problem
I see an earlier thread about using multiple layers for interaction and I was wondering if there was any change or development planned?
I have a complex point layer with around 40 different types/symbols. I 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 layer.
One solution I have come across is creating a duplicate layer with all the types combined, and rendering it with transparent markers. This works to an extent but Tilemill/mapnik does not always choose the same symbol to show on the "invisible" interaction layer as it does on the map.
One solution may be to export a UTFGrid for each layer, and then combine the grids together programmatically. I'm worried that may be beyond my programming skill however...
A complex question I know for busy people, but would love thoughts/ideas from anyone.
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Tom MacWright on 14 Sep, 2011 03:42 PM
Hey gregor,
Could you elaborate on
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
3 Posted by chris on 14 Sep, 2011 06:29 PM
Clarifying question: Tom, are you saying that Tilestream hosting is limited to supporting 10 interactive layers (by which I mean a map user can add and delete layers)?
Related question: Is the hosted version the only one that supports such interactivity?
Thanks.
Support Staff 4 Posted by Will White on 14 Sep, 2011 06:40 PM
Hi Chris,
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 allows.
Will
5 Posted by Sturm, Chris on 14 Sep, 2011 07:48 PM
-----Original Message-----
From: Will White [***@***]
Sent: Wednesday, September 14, 2011 2:40 PM
To: Sturm, Chris
Subject: Re: Multiple interaction layers problem [TileMill]
Thanks Will.
The free version doesn't support any composite grid interaction, correct?
// Add your reply above here
==================================================
From: Will White
Subject: Multiple interaction layers problem
Hi Chris,
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.
Will
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.
Support Staff 6 Posted by Will White on 14 Sep, 2011 08:05 PM
That's correct, because the grid compositing is implemented as a feature of the map builder, which is only available in hosted TileStream.
7 Posted by Sturm, Chris on 14 Sep, 2011 09:28 PM
This comment was split into a new private discussion: Testing TileStream before purchase
Is there a way for us to test the hosted version before purchase?
8 Posted by gregor on 21 Sep, 2011 05:33 PM
Hi Tom,
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.
Gregor
Support Staff 9 Posted by Tom MacWright on 28 Sep, 2011 09:59 PM
Hey Gregor,
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.
10 Posted by gregor on 29 Sep, 2011 04:52 PM
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 Staff 11 Posted by Will White on 02 Oct, 2011 05:44 PM
Hi Gregor,
Have you tried setting
marker-allow-overlaptotrueto tell Mapnik that is ok for markers to overlap? It's set tofalseby 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.Will
Support Staff 12 Posted by Dane on 03 Oct, 2011 10:46 PM
Gregor,
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 byin 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.
13 Posted by gregor on 03 Oct, 2011 10:53 PM
Hi Dane,
This is very good to hear, and your suggestion about using sqlite or postgis with
order byis 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-overlapset totruefor 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.
Will White closed this discussion on 24 Oct, 2011 03:47 PM.