migurski/TileStache — pull request #41 by shawnbot (2012-03-22 18:34:40+00:00)
Title: Preview template update to get touch working in iOS (again?)

Not sure when this stopped working, but Nate and I took a look on phones and pads last night and it was clearly broken for two reasons:

1. The `

` doesn't have a computed width and height when the script executes, so the map doesn't either.
2. The build of MM that we're using didn't create a `TouchHandler` by default, so touch interaction wasn't enabled.

This commit fixes both issues by putting the map into its own `

`, explicitly setting the width and height of everything on the page to 100% (and with absolute positioning) in CSS, and deferring the script execution until after the DOM is ready with a `defer` attribute. This is rock-solid on every browser that I've checked, including Firefox, which is notoriously bad about respecting `height: 100%`.