Merge pull request #2633 from elemoine/signature
Fix ol.style.defaultStyleFunction signature
This commit is contained in:
+14
-7
@@ -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;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user