Simplified api

This commit is contained in:
simonseyock
2016-12-07 11:14:59 +01:00
parent 8edc2be103
commit 55ec0af072
6 changed files with 18 additions and 33 deletions
+5 -5
View File
@@ -15,17 +15,17 @@ Old syntax:
New syntax:
```
map.forEachFeatureAtPixel(pixel, callback, callbackThis, {
layerFilter: layerFilterFn,
layerFilterThis: layerFilterThis
map.forEachFeatureAtPixel(pixel, callback, {
layerFilter: layerFilterFn
});
map.hasFeatureAtPixel(pixel, {
layerFilter: layerFilterFn,
layerFilterThis: layerFilterThis
layerFilter: layerFilterFn
});
```
To bind a function to a this, please use the bind method of the function (See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).
This change is due to the introduction of the `hitTolerance` parameter which can be passed in via this `ol.AtPixelOptions` object, too.
#### Use `view.animate()` instead of `map.beforeRender()` and `ol.animation` functions