Popups for State Shapes in US map
Hopefully a trivial question -- I'm Working on a state-by-state map that will show tooltips when a user hovers over an individual state (ex. this map on Energy.gov: http://energy.gov/maps/2009-energy-expenditure-person) but having trouble figuring out how to connect the data points to the tooltip.
I've got a spreadsheet of data loaded with the state-by-state data and the state layers -- is there an easy way to connect these to the tooltips?
Comments are currently closed for this discussion. You can start a new one.
2 Posted by gschnippel on 29 Sep, 2011 04:38 PM
Clarifying a little the approach I am trying to take. With my current state data file, I'm trying to setup the geojson row template (in Google Refine) like this:
... etc.
I am assuming that what I need to define is a new column in my spreadsheet with the correct geometry parameter for each state polygon and then add that to the row template specification above.
Another approach (though less than ideal) would be to add a 'state capital' dot with the correct longitude / latitude defined in the spreadsheet and then add this in as a geometry type of 'point', ex:
"geometry": { "type": "Point", "coordinates": [{{cells["longitude"].value}}, {{cells["latitude"].value}}] },Support Staff 3 Posted by Tom MacWright on 29 Sep, 2011 07:01 PM
Hey gschnippel,
Have you seen any of our posts about UTFGrid (and this one)? We do polygon interaction by rasterizing data. In your case, you'd, yes, join your data with GeoJSON, a shapefile, or Postgres, and render a tileset with TileMill, which provides an interface for displaying data from your datasource in tooltips on a map.
This is how the Dept. Energy maps are currently working - they brought a shapefile into TileMill, and rendered a tileset with interactivity.
Tom
4 Posted by gschnippel on 30 Sep, 2011 07:17 PM
Thanks Tom - that helped. I ended up grabbing shape layer from TIGER and binding the data layer to it using QGIS then importing it back into tilemill. I've kept decent notes on the process and post the writeup soon in case its useful for anyone else.
gschnippel closed this discussion on 30 Sep, 2011 07:17 PM.