tests/Leaflet/sl-application.js
/**
 * Opens a map window (info window) for the given SL location, giving its name
 * and a "Teleport Here" button, as when clicked.
 *
 * @param {number} x the horizontal (west-east) SL Maps region coordinate to open the map window at
 * @param {number} y the vertical (south-north) SL Maps region coordinate to open the map window at
 * @param {SLMap} slMap the map in which to open the map window
 */
Opens a map window (info window) for the given SL location, giving its name
and a "Teleport Here" button, as when clicked.

@param {number} x the horizontal (west-east) SL Maps region coordinate to open the map window at
@param {number} y the vertical (south-north) SL Maps region coordinate to open the map window at
@param {SLMap} slMap the map in which to open the map window
Opens a map window ( info window ) for the given SL location giving its name and a " Teleport Here " button as when clicked . @param { number } x the horizontal ( west - east ) SL Maps region coordinate to open the map window at @param { number } y the vertical ( south - north ) SL Maps region coordinate to open the map window at @param { SLMap } slMap the map in which to open the map window
function gotoSLURL(x, y, lmap)
{
    var int_x = Math.floor(x);
    var int_y = Math.floor(y);
    var local_x = Math.round((x - int_x) * 256);
    var local_y = Math.round((y - int_y) * 256);
    var scriptURL = "https://cap.secondlife.com/cap/0/b713fe80-283b-4585-af4d-a3b7d9a32492"
                    + "?var=slRegionName&grid_x=" + int_x + "&grid_y="+ int_y;
    var onLoadHandler = function () {
        if (slRegionName == null || slRegionName.error)
            return;
        var url = "secondlife://" + encodeURIComponent(slRegionName)
                  + "/" + local_x + "/" + local_y;
        var debugInfo = '';
        if (slDebugMap) {
            debugInfo = ' x: ' + int_x + ' y: ' + int_y;
        }
        var content = '<div class="balloon-content balloon-content-narrow"><h3><a href="' + url + '">'+ slRegionName + '</a></h3>'
            + debugInfo
            + '<div class="buttons"><a href="'+ url +'" class="HIGHLANDER_button_hot btn_large primary">Visit this location</a></div></div>';
        var popup = L.popup().setLatLng([y, x]).setContent(content).openOn(lmap);
    };
    slAddDynamicScript(scriptURL, onLoadHandler);
}
function gotoSLURL ( x , y , lmap ) { var int_x = Math . floor ( x ) ; var int_y = Math . floor ( y ) ; var local_x = Math . round ( ( x - int_x ) * 256 ) ; var local_y = Math . round ( ( y - int_y ) * 256 ) ; var scriptURL = "https://cap.secondlife.com/cap/0/b713fe80-283b-4585-af4d-a3b7d9a32492" + "?var=slRegionName&grid_x=" + int_x + "&grid_y=" + int_y ; var onLoadHandler = function ( ) { if ( slRegionName == null || slRegionName . error ) return ; var url = "secondlife://" + encodeURIComponent ( slRegionName ) + "/" + local_x + "/" + local_y ; var debugInfo = '' ; if ( slDebugMap ) { debugInfo = ' x: ' + int_x + ' y: ' + int_y ; } var content = '<div class="balloon-content balloon-content-narrow"><h3><a href="' + url + '">' + slRegionName + '</a></h3>' + debugInfo + '<div class="buttons"><a href="' + url + '" class="HIGHLANDER_button_hot btn_large primary">Visit this location</a></div></div>' ; var popup = L . popup ( ) . setLatLng ( [ y , x ] ) . setContent ( content ) . openOn ( lmap ) ; } ; slAddDynamicScript ( scriptURL , onLoadHandler ) ; }
Opens a map window (info window) for the given SL location, giving its name
 and a "Teleport Here" button, as when clicked.
Opens a map window ( info window ) for the given SL location giving its name and a " Teleport Here " button as when clicked .
// Work out region co-ords, and local co-ords within region // Add a dynamic script to get this region name, and then trigger a URL change // based on the results // Once the script has loaded, we use the result to teleport the user into SL