Commit Graph

18 Commits

Author SHA1 Message Date
AndersVittrup aa61c47fc4 Fixed document ref in hitdetect
fixed lint
2021-05-13 20:51:40 +02:00
Maximilian Krög dde6d6559c Reduce work for hitdetection
Skip cloning of style if geometry is not in extent.
2021-02-10 21:27:25 +01:00
Maximilian Krög 99564671c1 Only create one canvas per icon 2021-02-10 21:18:59 +01:00
Maximilian Krög de3f60861d Fix hitdetection of icons with opacity < 1
Hit detection works by reading the pixel color, if the icon is not drawn
with full opacity it won't work.
2021-02-10 21:16:55 +01:00
Maximilian Krög 8645a3109d Fix zIndex handling for hitdetection
getZIndex returns number|undefined, so Number conversion is unnecessary, but
undefined was converted to NaN instead of zero.
2021-02-10 01:04:21 +01:00
Maximilian Krög 5a7e4dfaf6 Add a constant for the hit-detection resolution 2021-02-10 01:04:19 +01:00
Maximilian Krög 49c6ab716c Fix VectorLayer hitdetect inaccuracy
Due to rounding the hitdetection may have been off by one pixel.
At map edge the pixel coordinate may exceed the map's dimensions if an
decimal pixel ratio is used, this is fixed by clamping to the canvas
dimensions.
2021-02-09 19:53:08 +01:00
Tim Schaub aed4773ecb Hit lines even if they are dashed 2020-12-30 12:33:06 -07:00
Frederic Junod e932233103 Fix typo in module name 2020-08-13 10:48:00 +02:00
Tim Schaub 054af09032 Make code prettier
This updates ESLint and our shared eslint-config-openlayers to use Prettier.  Most formatting changes were automatically applied with this:

    npm run lint -- --fix

A few manual changes were required:

 * In `examples/offscreen-canvas.js`, the `//eslint-disable-line` comment needed to be moved to the appropriate line to disable the error about the `'worker-loader!./offscreen-canvas.worker.js'` import.
 * In `examples/webpack/exapmle-builder.js`, spaces could not be added after a couple `function`s for some reason.  While editing this, I reworked `ExampleBuilder` to be a class.
 * In `src/ol/format/WMSGetFeatureInfo.js`, the `// @ts-ignore` comment needed to be moved down one line so it applied to the `parsersNS` argument.
2020-04-06 12:54:09 -06:00
Andreas Hocevar 79ccef7bf6 Do not append hit canvas to document body 2020-04-05 09:55:09 +02:00
Szabo Bogdan 6aa398cbec Fix hit detection for images with missing size 2020-03-26 21:23:23 +01:00
Andreas Hocevar 07b02fe947 Do not exceed color range 2020-02-17 21:58:45 +01:00
Andreas Hocevar d0b4967ec0 Fix feature lookup after removal of alpha 2019-11-18 08:56:20 +01:00
Andreas Hocevar fcd98774a0 Do not fail when hit detecting features without style 2019-11-14 14:32:11 +01:00
Andreas Hocevar ac50cc3460 New eslint config with no-multi-assign 2019-11-02 15:20:21 +01:00
Andreas Hocevar 4b13c6dae0 Speed up rendering by not using alpha 2019-10-30 14:36:23 +01:00
Andreas Hocevar 90d6a6f441 Move hit detection to its own module 2019-10-14 14:40:06 +02:00