Build the legacy pyramid URLs (one tile per level)
@function
@param {object} options - infoJson
@throws {Error}
775452
function constructLevels(options) {
        var levels = [];
        for(var i = 0; i < options.sizes.length; i++) {
            levels.push({
                url: options['@id'] + '/full/' + options.sizes[i].width + ',/0/default.' + options.tileFormat,
                width: options.sizes[i].width,
                height: options.sizes[i].height
            });
        }
        return levels.sort(function(a, b) {
            return a.width - b.width;
        });
    }
975152
private void buildExternalLink(MeshData tile, Poly node, MeshData neighbourTile) {
		if (neighbourTile.header.bmin[0] > tile.header.bmin[0]) {
			node.neis[PolyUtils.findEdge(node, tile, neighbourTile.header.bmin[0], 0)] = NavMesh.DT_EXT_LINK;
		} else if (neighbourTile.header.bmin[0] < tile.header.bmin[0]) {
			node.neis[PolyUtils.findEdge(node, tile, tile.header.bmin[0], 0)] = NavMesh.DT_EXT_LINK | 4;
		} else if (neighbourTile.header.bmin[2] > tile.header.bmin[2]) {
			node.neis[PolyUtils.findEdge(node, tile, neighbourTile.header.bmin[2], 2)] = NavMesh.DT_EXT_LINK | 2;
		} else {
			node.neis[PolyUtils.findEdge(node, tile, tile.header.bmin[2], 2)] = NavMesh.DT_EXT_LINK | 6;
		}
	}
685474
protected function httpBuildQuery($url, array $options)
    {
        if (stripos($url, 'http://') === false && stripos($url, 'https://') === false) {
            $url = self::WECHAT_BASE_URL . $url;
        }
        return parent::httpBuildQuery($url, $options);
    }
1374841
function template (options) {

    var variables = [], url = expand(options.url, options.params, variables);

    variables.forEach(function (key) {
        delete options.params[key];
    });

    return url;
}
47187
function UrlTree(root, queryParams, fragment) {
        this.root = root;
        this.queryParams = queryParams;
        this.fragment = fragment;
    }
1082233
function urlmon(options) {
    
    this.url = options.url;
    this.interval = options.interval || 5000;
    this.timeout = options.timeout || 3000;
    this.handle = null;
        
}
537030
function LayerDefinition(layerDefinition, options) {
  MapBase.call(this, options);
  this.endPoint = MapBase.BASE_URL;
  this.setLayerDefinition(layerDefinition, { silent: true });
}
546535
function failTile(e) {
        ++tileFailures;

        if (
          tileFailures > 5 &&
          defined(layer) &&
          globeOrMap.isImageryLayerShown({ layer })
        ) {
          // Too many failures, display an error message and hide the layer.
          if (
            catalogItem === catalogItem.terria.baseMap ||
            (catalogItem.terria.baseMap instanceof CompositeCatalogItem &&
              catalogItem.terria.baseMap.items.indexOf(catalogItem) >= 0)
          ) {
            globeOrMap.terria.error.raiseEvent(
              new TerriaError({
                sender: catalogItem,
                title: "Error accessing base map",
                message:
                  "An error occurred while attempting to download tiles for base map:<p><center>" +
                  catalogItem.terria.baseMap.name +
                  "</center></p> This may indicate that there is a " +
                  "problem with your internet connection, that the base map is temporarily unavailable, or that the base map " +
                  "is invalid.  Please select a different base map using the Map button in the top-right corner.  Further technical details may be found below.<br/><br/>" +
                  "<pre>" +
                  formatError(e) +
                  "</pre>"
              })
            );

            globeOrMap.hideImageryLayer({
              layer: layer
            });
            catalogItem.terria.baseMap = undefined;

            // Don't use this base map again on startup.
            catalogItem.terria.setLocalProperty("basemap", undefined);
          } else {
            globeOrMap.terria.error.raiseEvent(
              new TerriaError({
                sender: catalogItem,
                title: "Error accessing catalogue item",
                message:
                  "An error occurred while attempting to download tiles for catalogue item:<p><center>" +
                  catalogItem.name +
                  "</center></p> This may indicate that there is a " +
                  "problem with your internet connection, that the catalogue item is temporarily unavailable, or that the catalogue item " +
                  "is invalid.  The catalogue item has been hidden from the map.  You may re-show it in the Now Viewing panel to try again.  Further technical details may be found below.<br/><br/>" +
                  "<pre>" +
                  formatError(e) +
                  "</pre>"
              })
            );

            if (globeOrMap === catalogItem.terria.currentViewer) {
              catalogItem.isShown = false;
            } else {
              globeOrMap.hideImageryLayer({
                layer: layer
              });
            }
          }
        }

        tellMapToSilentlyGiveUp();
      }
469412
function(url, options, replaceWindow) {

            if (!this.runsInBrowser()) {
                throw new Error("Cannot open popups.");
            }

            options = options || {};

            var window = this.$stage.$window,
                features = [];

            options = _.defaults(options, {
                name: null,
                menubar: false,
                toolbar: false,
                location: false,
                personalbar: false,
                status: false,
                resizeable: true,
                scrollbars: true,
                dependend: false,
                dialog: false,
                minimizable: true,

                top: null,
                left: null,
                height: null,
                width: null
            });

            for (var key in options) {
                if (options.hasOwnProperty(key) && key !== "name") {
                    if (options[key] === true) {
                        features.push(key + "=yes")
                    } else if (options[key]) {
                        features.push(key + "=" + options[key]);
                    }
                }
            }

            return window.open(url, options.name, features.join(","), replaceWindow);

        }
983829
function build(options) {
  var args = [require.resolve(path.join('node-gyp', 'bin', 'node-gyp.js')), 'rebuild', '--verbose'].concat(
    ['libsass_ext', 'libsass_cflags', 'libsass_ldflags', 'libsass_library'].map(function(subject) {
      return ['--', subject, '=', process.env[subject.toUpperCase()] || ''].join('');
    })).concat(options.args);

  console.log('Building:', [process.execPath].concat(args).join(' '));

  var proc = spawn(process.execPath, args, {
    stdio: [0, 1, 2]
  });

  proc.on('exit', function(errorCode) {
    if (!errorCode) {
      afterBuild(options);
      return;
    }

    if (errorCode === 127 ) {
      console.error('node-gyp not found!');
    } else {
      console.error('Build failed with error code:', errorCode);
    }

    process.exit(1);
  });
}
111133
function(options) {
  this._uriTemplate = new URITemplate(options.url);

  if (typeof options.layerName !== "string") {
    throw new DeveloperError(
      "MapboxVectorTileImageryProvider requires a layer name passed as options.layerName"
    );
  }
  this._layerName = options.layerName;

  this._subdomains = defaultValue(options.subdomains, []);

  if (!(options.styleFunc instanceof Function)) {
    throw new DeveloperError(
      "MapboxVectorTileImageryProvider requires a styling function passed as options.styleFunc"
    );
  }
  this._styleFunc = options.styleFunc;

  this._tilingScheme = new WebMercatorTilingScheme();

  this._tileWidth = 256;
  this._tileHeight = 256;

  this._minimumLevel = defaultValue(options.minimumZoom, 0);
  this._maximumLevel = defaultValue(options.maximumZoom, Infinity);
  this._maximumNativeLevel = defaultValue(
    options.maximumNativeZoom,
    this._maximumLevel
  );

  this._rectangle = defined(options.rectangle)
    ? Rectangle.intersection(options.rectangle, this._tilingScheme.rectangle)
    : this._tilingScheme.rectangle;
  this._uniqueIdProp = options.uniqueIdProp;
  this._featureInfoFunc = options.featureInfoFunc;
  //this._featurePicking = options.featurePicking;

  // Check the number of tiles at the minimum level.  If it's more than four,
  // throw an exception, because starting at the higher minimum
  // level will cause too many tiles to be downloaded and rendered.
  var swTile = this._tilingScheme.positionToTileXY(
    Rectangle.southwest(this._rectangle),
    this._minimumLevel
  );
  var neTile = this._tilingScheme.positionToTileXY(
    Rectangle.northeast(this._rectangle),
    this._minimumLevel
  );
  var tileCount =
    (Math.abs(neTile.x - swTile.x) + 1) * (Math.abs(neTile.y - swTile.y) + 1);
  if (tileCount > 4) {
    throw new DeveloperError(
      "The imagery provider's rectangle and minimumLevel indicate that there are " +
        tileCount +
        " tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported."
    );
  }

  this._errorEvent = new CesiumEvent();

  this._ready = true;
}
116456
function(model, col, options) {
    if (this.size() > 0) {

      // Assign an order of 0 to the first layer
      this.at(0).set({ order: 0 });

      if (this.size() > 1) {
        var layersByType = {};
        for (var i = 1; i < this.size(); ++i) {
          var layer = this.at(i);
          var layerType = layer.get('type');
          layersByType[layerType] = layersByType[layerType] || [];
          layersByType[layerType].push(layer);
        }

        var lastOrder = 0;
        var sortedTypes = [CARTODB_LAYER_TYPE, TORQUE_LAYER_TYPE, TILED_LAYER_TYPE];
        for (var i = 0; i < sortedTypes.length; ++i) {
          var type = sortedTypes[i];
          var layers = layersByType[type] || [];
          for (var j = 0; j < layers.length; ++j) {
            var layer = layers[j];
            layer.set({
              order: ++lastOrder
            });
          }
        }
      }
    }
  }
677061
function createResource(url, params, methods) {
      var resource;

      params = _.defaults({}, params, defaultParams);
      methods = _.defaults({}, methods, defaultMethods);
      resource = $resource(url, params, methods);

      // overwrite $save to automatically call $create or $update
      resource.prototype.$save = function save() {
        if (!this._id) {
          return this.$create();
        }

        return this.$update();
      };

      return resource;
    }
560160
function( url ) {
        var _this = this,
            callbackName,
            callback,
            readySource,
            options,
            urlParts,
            filename,
            lastDot;


        if( url ) {
            urlParts = url.split( '/' );
            filename = urlParts[ urlParts.length - 1 ];
            lastDot  = filename.lastIndexOf( '.' );
            if ( lastDot > -1 ) {
                urlParts[ urlParts.length - 1 ] = filename.slice( 0, lastDot );
            }
        }

        callback = function( data ){
            if( typeof (data) === "string" ) {
                data = $.parseXml( data );
            }
            var $TileSource = $.TileSource.determineType( _this, data, url );
            if ( !$TileSource ) {
                /**
                 * Raised when an error occurs loading a TileSource.
                 *
                 * @event open-failed
                 * @memberof OpenSeadragon.TileSource
                 * @type {object}
                 * @property {OpenSeadragon.TileSource} eventSource - A reference to the TileSource which raised the event.
                 * @property {String} message
                 * @property {String} source
                 * @property {?Object} userData - Arbitrary subscriber-defined object.
                 */
                _this.raiseEvent( 'open-failed', { message: "Unable to load TileSource", source: url } );
                return;
            }

            options = $TileSource.prototype.configure.apply( _this, [ data, url ]);
            if (options.ajaxWithCredentials === undefined) {
                options.ajaxWithCredentials = _this.ajaxWithCredentials;
            }

            readySource = new $TileSource( options );
            _this.ready = true;
            /**
             * Raised when a TileSource is opened and initialized.
             *
             * @event ready
             * @memberof OpenSeadragon.TileSource
             * @type {object}
             * @property {OpenSeadragon.TileSource} eventSource - A reference to the TileSource which raised the event.
             * @property {Object} tileSource
             * @property {?Object} userData - Arbitrary subscriber-defined object.
             */
            _this.raiseEvent( 'ready', { tileSource: readySource } );
        };

        if( url.match(/\.js$/) ){
            //TODO: Its not very flexible to require tile sources to end jsonp
            //      request for info  with a url that ends with '.js' but for
            //      now it's the only way I see to distinguish uniformly.
            callbackName = url.split('/').pop().replace('.js', '');
            $.jsonp({
                url: url,
                async: false,
                callbackName: callbackName,
                callback: callback
            });
        } else {
            // request info via xhr asynchronously.
            $.makeAjaxRequest( {
                url: url,
                withCredentials: this.ajaxWithCredentials,
                headers: this.ajaxHeaders,
                success: function( xhr ) {
                    var data = processResponse( xhr );
                    callback( data );
                },
                error: function ( xhr, exc ) {
                    var msg;

                    /*
                        IE < 10 will block XHR requests to different origins. Any property access on the request
                        object will raise an exception which we'll attempt to handle by formatting the original
                        exception rather than the second one raised when we try to access xhr.status
                     */
                    try {
                        msg = "HTTP " + xhr.status + " attempting to load TileSource";
                    } catch ( e ) {
                        var formattedExc;
                        if ( typeof ( exc ) == "undefined" || !exc.toString ) {
                            formattedExc = "Unknown error";
                        } else {
                            formattedExc = exc.toString();
                        }

                        msg = formattedExc + " attempting to load TileSource";
                    }

                    /***
                     * Raised when an error occurs loading a TileSource.
                     *
                     * @event open-failed
                     * @memberof OpenSeadragon.TileSource
                     * @type {object}
                     * @property {OpenSeadragon.TileSource} eventSource - A reference to the TileSource which raised the event.
                     * @property {String} message
                     * @property {String} source
                     * @property {?Object} userData - Arbitrary subscriber-defined object.
                     */
                    _this.raiseEvent( 'open-failed', {
                        message: msg,
                        source: url
                    });
                }
            });
        }

    }
374072
function generateResourceListingForVersion(options) {
  var clone = JSON.parse(JSON.stringify(options.rootDocument));
  clone.info.version =  options.version;
  clone.basePath = options.basePath;
  clone.paths = clone.paths || {};
  clone.definitions = clone.definitions || {};
  mergeIn(clone.paths, buildPaths(options.controllers));
  mergeIn(clone.definitions, buildDefinitions(options.controllers));

  return clone;
}
246336
function buildModelUrl (protocol, host, apiRoot, modelName, id) {
  var result

  try {
    result = url.format({
      protocol: protocol,
      host: host,
      pathname: url.resolve('/', [apiRoot, modelName, id].join('/'))
    })
  } catch (e) {
    return ''
  }

  return result
}
1077706
function( options ){
      var array = $$.util.getMap(options);

      if( array == null ){ // if empty, put initial array
        $$.util.setMap( $.extend({}, options, {
          value: [ options.value ]
        }) );
      } else {
        array.push( options.value );
      }
    }