Addressing @elemoine's review comments

This commit is contained in:
ahocevar
2013-07-19 13:30:14 +02:00
parent 892088ffac
commit a9fcc5ff15
4 changed files with 18 additions and 19 deletions

View File

@@ -4,7 +4,6 @@ goog.require('ol.View2D');
goog.require('ol.layer.TileLayer');
goog.require('ol.layer.Vector');
goog.require('ol.parser.KML');
goog.require('ol.proj');
goog.require('ol.source.TiledWMS');
goog.require('ol.source.Vector');
@@ -41,7 +40,7 @@ var map = new ol.Map({
renderer: ol.RendererHint.CANVAS,
target: 'map',
view: new ol.View2D({
projection: ol.proj.get('EPSG:4326'),
projection: 'EPSG:4326',
center: [-112.169, 36.099],
zoom: 11
})

View File

@@ -508,7 +508,8 @@
* @property {ol.parser.Parser} parser Parser instance to parse data
* provided as `data` or fetched from `url`.
* @property {ol.ProjectionLike|undefined} projection Projection. EPSG:4326
* is assumed if not defined.
* is assumed if not defined. TODO: Get projection from the parser instead
* of assuming EPSG:4326.
* @property {string|undefined} url Server url providing the vector data.
*/

View File

@@ -228,8 +228,7 @@ ol.renderer.canvas.VectorLayer.prototype.getFeatureInfoForPixel =
* @param {function(Array.<ol.Feature>, ol.layer.Layer)} success Callback for
* successful queries. The passed arguments are the resulting features
* and the layer.
* @param {function(Object)=} opt_error Callback for
* unsuccessful queries.
* @param {function()=} opt_error Callback for unsuccessful queries.
*/
ol.renderer.canvas.VectorLayer.prototype.getFeaturesForPixel =
function(pixel, success, opt_error) {
@@ -255,7 +254,7 @@ ol.renderer.canvas.VectorLayer.prototype.getFeaturesForPixel =
if (goog.isNull(candidates)) {
// data is not loaded
if (goog.isDef(opt_error)) {
goog.global.setTimeout(function() { opt_error({}); }, 0);
goog.global.setTimeout(function() { opt_error(); }, 0);
}
return;
}

View File

@@ -6,6 +6,17 @@ goog.require('ol.proj');
goog.require('ol.source.Source');
/**
* @enum {number}
*/
ol.source.VectorLoadState = {
IDLE: 0,
LOADING: 1,
LOADED: 2,
ERROR: 3
};
/**
* @constructor
@@ -50,10 +61,10 @@ goog.inherits(ol.source.Vector, ol.source.Source);
/**
* @param {ol.layer.Layer} layer Layer that parses the data.
* @param {ol.layer.Vector} layer Layer that parses the data.
* @param {ol.Extent} extent Extent that needs to be fetched.
* @param {ol.Projection} projection Projection of the view.
* @param {Function=} opt_callback Callback which is called when features are
* @param {function()=} opt_callback Callback which is called when features are
* parsed after loading.
* @return {ol.source.VectorLoadState} The current load state.
*/
@@ -84,14 +95,3 @@ ol.source.Vector.prototype.prepareFeatures = function(layer, extent, projection,
}
return this.loadState_;
};
/**
* @enum {number}
*/
ol.source.VectorLoadState = {
IDLE: 0,
LOADING: 1,
LOADED: 2,
ERROR: 3
};