tests/Leaflet/sl-application.js
/* =========================================================================
**  mapquery
** =========================================================================
** A query has been made, plot those points */
mapquery
A query has been made, plot those points
mapquery A query has been made plot those points
function mapquery()
{
    $("a.slurl-link").each(function (index) {
        var xy = $(this).attr("title").split(",");
        var rx = parseFloat(xy[0]);
        var ry = parseFloat(xy[1]);
        var linkHref = $(this).attr("href");
        var title = '';
        var msg = '';
        var img = '';
        var re_tp_url = new RegExp('^(https?://[^/]+)?/secondlife/([^?]+).*$', 'i');
        var tp_region = linkHref.replace(re_tp_url, "$2");
        var tp_url = "secondlife://" + tp_region;
        if (rx && ry && tp_region) {
            var tokens = tp_region.split('/');
            loc_x = rx + parseFloat(tokens[1]) / 256;
            loc_y = ry + parseFloat(tokens[2]) / 256;
        }
        else {
            loc_x = 128;
            loc_y = 128;
            msg = 'We\'re having difficulty plotting this location. It could be that this isn\'t a valid location, or that you are trying to locate a person.';
            tp_url = null;
        }
        var templateData = {
            'slurl': tp_url,
            'title': title || $.sl.maps.config.default_title,
            'img': img || $.sl.maps.config.default_img,
            'msg': msg || $.sl.maps.config.default_msg
        };
        Mustache.parse($.sl.maps.config.balloon_tmpl);
        var windowContent = Mustache.render($.sl.maps.config.balloon_tmpl, templateData);
        var markerLatLng = L.latLng(loc_y, loc_x);
        var $result = $(this).parents('div.result').first();
        var regionLocation = '/secondlife/' + tp_region;
        makeMarkerForSidebar(windowContent, markerLatLng, $result, regionLocation);
    });
    if (slurl_data['region']['default']) {
        $("a.slurl-link").first().click();
    }
}
function mapquery ( ) { $ ( "a.slurl-link" ) . each ( function ( index ) { var xy = $ ( this ) . attr ( "title" ) . split ( "," ) ; var rx = parseFloat ( xy [ 0 ] ) ; var ry = parseFloat ( xy [ 1 ] ) ; var linkHref = $ ( this ) . attr ( "href" ) ; var title = '' ; var msg = '' ; var img = '' ; var re_tp_url = new RegExp ( '^(https?://[^/]+)?/secondlife/([^?]+).*$' , 'i' ) ; var tp_region = linkHref . replace ( re_tp_url , "$2" ) ; var tp_url = "secondlife://" + tp_region ; if ( rx && ry && tp_region ) { var tokens = tp_region . split ( '/' ) ; loc_x = rx + parseFloat ( tokens [ 1 ] ) / 256 ; loc_y = ry + parseFloat ( tokens [ 2 ] ) / 256 ; } else { loc_x = 128 ; loc_y = 128 ; msg = 'We\'re having difficulty plotting this location. It could be that this isn\'t a valid location, or that you are trying to locate a person.' ; tp_url = null ; } var templateData = { 'slurl' : tp_url , 'title' : title || $ . sl . maps . config . default_title , 'img' : img || $ . sl . maps . config . default_img , 'msg' : msg || $ . sl . maps . config . default_msg } ; Mustache . parse ( $ . sl . maps . config . balloon_tmpl ) ; var windowContent = Mustache . render ( $ . sl . maps . config . balloon_tmpl , templateData ) ; var markerLatLng = L . latLng ( loc_y , loc_x ) ; var $result = $ ( this ) . parents ( 'div.result' ) . first ( ) ; var regionLocation = '/secondlife/' + tp_region ; makeMarkerForSidebar ( windowContent , markerLatLng , $result , regionLocation ) ; } ) ; if ( slurl_data [ 'region' ] [ 'default' ] ) { $ ( "a.slurl-link" ) . first ( ) . click ( ) ; } }
mapquery
A query has been made, plot those points
mapquery A query has been made plot those points
/*//////////////////////////////////////////////////////////////////////
        // Must string replace the base url for IE because ie passes fully qualified url to javascript
        // even though it doesn't exist in the markup
        //////////////////////////////////////////////////////////////////////*/ // linkHref is still URI encoded, so tp_url ends up with the correct URI encoded name. // Error with precise location plotting in the region - set to center // Select the first result if we didn't load with a place selected (that // is, a search or a default maps.sl.com page load).