I've built a local tile server to serve to a local javascript application, and I'm receiving the map tiles through openlayers as a Layer.XYZ.
I've acquired raw data for massachusetts from thinkgeo. It registers at the right coordinates, because it lines up with tilemill's built-in country map.
I export the map from tilemill through mapnik (have also done this through mbtiles at an extreme size reduction), and configure tilestache to use the relevant output file. It seems to be serving correctly, because when I load up my javascript, the country maps are being successfully pulled, and when I find massachusetts, the roads are highlighted as I want.
So, here's the issue:
When I set the zoom and set the center to the lon/lat of Boston, which worked correctly on a Layer.OSM in the online version I drafted previously, it gives me the ocean just northwest of Greenland. In fact, I have to set the latitude to -lat to even get within range of massachusetts, but it's still not putting me in boston.
I've set the TileStache config to use WGS84 and the OpenLayers import to use EPSG:4326, which all documentation indicates are the same. Thus, I'm wondering if there's something about OL's XYZ layers that makes this more difficult?
If anyone has any other suggestions, related to the other software I'm using, I'm all ears.
I just used sphericalMercator and converted all of my calculations to meters (which... actually simplified things, but I had already finished writing the code for those things). I still have no idea why lon/lat were broken, but hey, if meters work....