11-11-2009 19:31
I wrote up a fairly simple prototype for displaying SL maps in OpenLayers. The project is on github if anyone wants to torment, contribute or [hopefully] provide your own insights. I need to go through and clean up some stuff still (tabs mixed with spaces, etc).

github.com/sakkaku/OpenLayers.SecondLife

OpenLayers has a grid layer that implements most of the math, so making the layer was amazingly easy (basically extending OpenLayers.Layer.Grid and reimplementing tilecache with the s3 URLs). I also extended OpenLayers.Map for zoomToRegion and some defaults that should make things easier to use.

It uses Meters instead of "Map Units" or whatever the official API calls it, as it made slightly more sense to me. So you don't need to convert between the global coordinates and the map. I think region name -> coordinates and coordinates -> region name are the only oddballs in the underlying API that didn't work with Google's Map API. I still need to implement a control for launching the SL protocol (left click on the Map API by default now). Then it should be relatively usable.

Maybe this will help out some folks, as a lot of people seem to loath the SL Map API. Feel free to provide an ideas, suggestions, criticisms, etc.