Skip to content
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

Interactivity doesn't work without a token #662

Open
dhcole opened this issue Aug 24, 2011 · 6 comments
Open

Interactivity doesn't work without a token #662

dhcole opened this issue Aug 24, 2011 · 6 comments

Comments

@dhcole
Copy link
Contributor

dhcole commented Aug 24, 2011

I tried making a map with a static teaser formatter (no tokens) but interactivity would not show up. Adding an arbitrary token to the formatter resolved it.

@springmeyer
Copy link
Member

this may be a bug in node-mapnik, whereby if no data fields are supplied no hitgrid is output. I feel like I've seen this behavior but didn't think it would be an issue, so I'll need to look into it more.

@springmeyer
Copy link
Member

node-mapnik appears to produce grids without a problem when the fields argument is a left off or an empty [], so my hunch was wrong - hitgrid is output just fine and the data is simply an empty {}.

But I notice that if a bogus field name is passed then node-mapnik does output an empty grid - however I've confirmed that tilemill is correctly passing an empty fields array, so grids are valid just have a data that looks like data: {} which is intended.

@tmcw
Copy link
Contributor

tmcw commented Aug 24, 2011

So... the problem is a few problems.

Wax first finds data for a hover-spot, and if it has data, sends that data off to a formatter. With no tokens for a formatter, there's no data that comes back when Wax tries to find it.

One could, then, say that Wax should just accept null or no data and keep running the formatter. This would mean two things: all formatters that have come to expect data would break. Also, there would be no hovering out; the tooltip would be always on, like a legend.

So, there needs to be 'something' that signifies that a user is over a thing. Note that the 'grid' portion of a UTFGrid does not specify data or no data; land or no land, etc: the meaning of a grid pixel is entirely placed on its data entry. So, we could have __rowid__ always be output, but AFAIK, this is not universally supported and it would be a usually-unused bit of data that degrades performance a bit.

@dhcole
Copy link
Contributor Author

dhcole commented Aug 24, 2011

@tmcw, could you have __rowid__ be included only when there is no data?

@dmitrig01
Copy link
Contributor

Do shapefiles even have rowids?

@springmeyer
Copy link
Member

yes, shapefiles do. geojson through ogr is the oddball: http://trac.mapnik.org/ticket/753

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants