Repeated data in legend layer
I am creating a detailed map with many detailed PNG point symbols. I want to include a tooltip similar to the flags tooltip for the geography class mbtiles that shows a large version of the symbol in the tooltip.
I understand that to do this and embed the data in the mbtiles file I can include the base64 data in the shape file.
However, since each symbol is repeated dozens or hundred of times across the map will this not result in huge UTFGrid files being sent to the browser with repeated base64 PNG data? Or is TileMill / Tilestream able to recognize these duplicates and remove them?
I was thinking another option would be to store the base64 data in a separate JSON file and programmatically join that to the legend. Or as that seemed a little complicated for me to simply put the PNGs on an external server and link to them but that is not ideal.
Gregor
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by AJ on 12 Sep, 2011 06:58 PM
There would be no duplicate images for points of the same type within a single tile, but they will be included for each tile and there will be many duplicates for the whole map.
If you're not trying to build this for an offline use case the best option for performance is likely hosting the images externally and referencing their URLs in the tooltip - this way they should be cached by the browser and only requested once. (You could even try a css sprite method to reduce it to a single external image request.)
3 Posted by gregor on 12 Sep, 2011 07:54 PM
Thanks AJ, that's good to know. I have it working now with external images.
gregor closed this discussion on 12 Sep, 2011 07:54 PM.