Does anyone know how i can display the UTF Character overlays by themselves?
Something like this is done by glower - it'd be possible to just display all grids all the time.
i want to understand more about how this technology works. I assume the utfgrid overlays are drawing as vector tiles beneath the image tiles but firebug isn't showing me much.
No, UTFGrid is not a vector format, and its being a raster hit-grid is the reason why it's more efficient than vectors for most use cases. The hitgrids are stored in javascript and accessed via offsets from each tile bound, so there's no default visual representation, or representation in the DOM, for the grid.
It seems that the utfgrid will exactly match the the geometry it is created from in the mapnik xml file -- meaning a direct overlay. If i render custom marker .png(s) for points is there anyway to make the utfgrids overlay for the whole marker instead of just the point? Is there a way to use utfgrids with points or is it meaningless ( pointless even ;-) )?
The Mapnik UTFGrid renderer supports any sort of feature representation (except for Raster), including points, and it will cover all semi-opaque parts of any symbolizer.
You may need to look at the second step. The tutorial started you out with just creating the tiles. Then tutorial added support for the "hit grid" created by the "Teaser" tab in TileMill. The teaser step created another part of the .mbtile spec.
The mbutil utility is used to extract either the grid or tiles. In the second run, it extracts both. In the change to the second code, he shows where he added both references to the .png files and the .grid.json files. The other thing that his path shows me is the 1.0.0 reference. This means that you are using the TMS directory path to display the data.
The other part of the code that you are missing is the formatter section that formats how the .json file will be displayed.
The glue that you are missing from his explanation is that TMS is used to display information without a web server. At least that's how I have used the TMS format before. You say that you have an IIS web server. The .mbtiles format is just a sqlite3 database if you did not know this. Look up some of the existing tile servers. Hook up a version of a mbtiles server that works for you in your web server environment. Then just use the .mbtiles database. That way you do not have to haul around a bizzlion files.
var tilejson = {
tilejson: '1.0.0',
tiles: ['http://localhost/tiles/freguesias/1.0.0/Freguesias/{z}/{x}/{y}.png'],
grids: ['http://localhost/tiles/freguesias/1.0.0/Freguesias/{z}/{x}/{y}.grid.json'],
formatter: function (options, data) { return "CODE: " + data.DICOFRE }
};
map = new L.Map('map');
map.addLayer(new wax.leaf.connector(tilejson));
map.setView(new L.LatLng(39.5,-5.0), 6);
wax.leaf.interaction(map, tilejson);
Best Answer
This blog post is about exactly that. Looks like TileStache will handle it for you.