preemptive is now true by default + improved documentation

This commit is contained in:
Petr Sloup
2014-12-12 12:19:20 +01:00
parent 7bcd925cdb
commit 65583a8b77
3 changed files with 8 additions and 6 deletions

View File

@@ -12,8 +12,7 @@ var mapLayer = new ol.layer.Tile({
});
var gridSource = new ol.source.TileUTFGrid({
url: 'http://api.tiles.mapbox.com/v3/mapbox.geography-class.json',
preemptive: true
url: 'http://api.tiles.mapbox.com/v3/mapbox.geography-class.json'
});
var gridLayer = new ol.layer.Tile({source: gridSource});

View File

@@ -3550,9 +3550,12 @@ olx.source.TileUTFGridOptions;
/**
* If true, the TileUTFGrid source loads the tiles based on their "visibility".
* This can be used to improve the speed of response, but increases traffic.
* Default is `false`.
* If `true` the TileUTFGrid source loads the tiles based on their "visibility".
* This improves the speed of response, but increases traffic.
* Note that if set to `false`, you need to pass `true` as `opt_request`
* to the `forDataAtCoordinateAndResolution` method otherwise no data
* will ever be loaded.
* Default is `true`.
* @type {boolean|undefined}
* @api
*/

View File

@@ -38,7 +38,7 @@ ol.source.TileUTFGrid = function(options) {
* @type {boolean}
*/
this.preemptive_ = goog.isDef(options.preemptive) ?
options.preemptive : false;
options.preemptive : true;
/**
* @private