User:Kerik Rau/MapTileURL
< User:Kerik Rau
Jump to navigation
Jump to search
Revision as of 14:34, 16 January 2009 by Kerik Rau (talk | contribs) (New page: Returns the URL of the image of the current sim's tile as in SLURL. Also see Thraxis Epsilon's OpenLayers Wrapper. <lsl> string MapTileURL() { ...)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Returns the URL of the image of the current sim's tile as in SLURL. Also see Thraxis Epsilon's OpenLayers Wrapper.
<lsl> string MapTileURL() {
vector TilePos = llGetRegionCorner(); //tiles are in a grid based on the regions, so 256m = 1 tile TilePos /= 256.0; //offset provided in the javascript, really 1278 + 1 (probably 0 -> 1 index difference?) TilePos.y = 1279.0 - TilePos.y; //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0 string mapURL = "http://secondlife.com/apps/mapapi/grid/map_image/"; mapURL += (string) llFloor(TilePos.x); mapURL += "-"; mapURL += (string) llFloor(TilePos.y); //the 3rd value is something to do with zoom mapURL += "-1-0"; return mapURL;
} </lsl>