examples/ParseUrlArguments.js
function () {
            var result = {};

            var queryString = window.location.href.split("?");
            if (queryString && queryString.length > 1) {
                var args = queryString[1].split("&");

                for (var a = 0; a < args.length; a++) {
                    var arg = args[a].split("=");

                    // Obtain geographic position to redirect WorldWindow camera view.
                    if (arg[0] === "pos") {
                        // arg format is "pos=lat,lon,alt"
                        var position = arg[1].split(","),
                            lat = parseFloat(position[0]),
                            lon = parseFloat(position[1]),
                            alt = parseFloat(position[2]);
                        result.position = new WorldWind.Position(lat, lon, alt);
                    }
                }
            }

            return result;
        }
function () {
            var result = {};

            var queryString = window.location.href.split("?");
            if (queryString && queryString.length > 1) {
                var args = queryString[1].split("&");

                for (var a = 0; a < args.length; a++) {
                    var arg = args[a].split("=");

                    // Obtain geographic position to redirect WorldWindow camera view.
                    if (arg[0] === "pos") {
                        // arg format is "pos=lat,lon,alt"
                        var position = arg[1].split(","),
                            lat = parseFloat(position[0]),
                            lon = parseFloat(position[1]),
                            alt = parseFloat(position[2]);
                        result.position = new WorldWind.Position(lat, lon, alt);
                    }
                }
            }

            return result;
        }
function ( ) { var result = { } ; var queryString = window . location . href . split ( "?" ) ; if ( queryString && queryString . length > 1 ) { var args = queryString [ 1 ] . split ( "&" ) ; for ( var a = 0 ; a < args . length ; a ++ ) { var arg = args [ a ] . split ( "=" ) ; // Obtain geographic position to redirect WorldWindow camera view. if ( arg [ 0 ] === "pos" ) { // arg format is "pos=lat,lon,alt" var position = arg [ 1 ] . split ( "," ) , lat = parseFloat ( position [ 0 ] ) , lon = parseFloat ( position [ 1 ] ) , alt = parseFloat ( position [ 2 ] ) ; result . position = new WorldWind . Position ( lat , lon , alt ) ; } } } return result ; }
Function to obtain arguments from query string.
Function to obtain arguments from query string .