Merge pull request #2633 from elemoine/signature

Fix ol.style.defaultStyleFunction signature
This commit is contained in:
Éric Lemoine
2014-08-26 17:24:45 +02:00
+14 -7
View File
@@ -169,13 +169,20 @@ ol.style.defaultStyleFunction = function(feature, resolution) {
}) })
]; ];
// now that we've run it the first time, // Now that we've run it the first time, replace the function with
// replace the function with a constant version // a constant version. We don't use an immediately-invoked function
ol.style.defaultStyleFunction = // and a closure not to get an error at script evaluation time in
/** @type {function(this:ol.Feature):Array.<ol.style.Style>} */( // browsers that do not support Canvas. ol.style.Circle indeed
function(resolution) { // does canvas.getContext('2d') at construction time.
return styles;
}); /**
* @param {ol.Feature} feature Feature.
* @param {number} resolution Resolution.
* @return {Array.<ol.style.Style>} Style.
*/
ol.style.defaultStyleFunction = function(feature, resolution) {
return styles;
};
return styles; return styles;
}; };