From 65583a8b774071aef2edb020267a3691db947d34 Mon Sep 17 00:00:00 2001 From: Petr Sloup Date: Fri, 12 Dec 2014 12:19:20 +0100 Subject: [PATCH] preemptive is now true by default + improved documentation --- examples/tileutfgrid.js | 3 +-- externs/olx.js | 9 ++++++--- src/ol/source/tileutfgridsource.js | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/tileutfgrid.js b/examples/tileutfgrid.js index d95a2a92db..b6462e37dd 100644 --- a/examples/tileutfgrid.js +++ b/examples/tileutfgrid.js @@ -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}); diff --git a/externs/olx.js b/externs/olx.js index 9d240642b5..d2ce77c48a 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -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 */ diff --git a/src/ol/source/tileutfgridsource.js b/src/ol/source/tileutfgridsource.js index 40dbbf055e..4a58b2bdfa 100644 --- a/src/ol/source/tileutfgridsource.js +++ b/src/ol/source/tileutfgridsource.js @@ -38,7 +38,7 @@ ol.source.TileUTFGrid = function(options) { * @type {boolean} */ this.preemptive_ = goog.isDef(options.preemptive) ? - options.preemptive : false; + options.preemptive : true; /** * @private