Commit Graph

714 Commits

Author SHA1 Message Date
Tim Schaub
3a061ed576 Use union type instead of enum for canvas builder type 2022-07-15 10:51:07 +02:00
Tim Schaub
9a6f8493fb Use union instead of enum for geometry type 2022-07-15 10:48:37 +02:00
Maximilian Krög
d45e08d197 Fix icon offset for hitdetect image
It only worked correctly with pixel ratio of 1
2022-05-25 22:33:57 +02:00
Tim Schaub
bbbca0ab78 Update ESLint config and plugins 2022-05-23 15:01:07 -06:00
Andreas Hocevar
fc5f85dbcf Add null return type 2022-05-13 19:39:47 +02:00
VLCEK Martin
e1593ce59d Support declutter mode for image styles
Allows to specify for each image style, whether the image
should be decluttered, always drawn but still serving as
obstacle, or drawn without being an obstacle for other
images/texts.

The layer must still have declutter = true set for this
property to have any effect.
2022-05-05 12:34:00 +02:00
Denis
585ae66961 Fix review for text justify 2022-04-14 13:06:49 +02:00
Denis
1850e16bde Improve jsDoc and some naming 2022-04-13 14:11:28 +02:00
Denis
4db25c86c8 Implement text justify within the label box
See: https://github.com/openlayers/openlayers/issues/13481
2022-04-13 00:08:15 +02:00
Andreas Hocevar
18f06b8b9a Rich text labels 2022-02-23 12:36:56 +01:00
Maximilian Krög
b29ab8f104 Link to class instead of module pages 2022-02-14 21:53:07 +01:00
Tim Schaub
f10ba5c1e3 Avoid duplicate imports 2022-02-05 11:46:26 -07:00
MoonE
9e37182649 Merge pull request #12646 from ashchurova/fix-8136-hit-detection-custom-renderer
Support for hit detection in styles with custom rendering
2021-09-29 20:22:57 +02:00
Andreas Hocevar
df493725c6 Fix sprite offset for pixel ratio !== 1 2021-08-30 22:05:34 +02:00
Anna Shchurova
eafcbb3ec0 Fixed lint 2021-08-23 13:42:56 -04:00
Anna Shchurova
820c123335 Added 'default' section and fixed more linting errors 2021-08-23 13:02:26 -04:00
Anna Shchurova
711ae69bb5 Fixed linting errors 2021-08-20 21:55:05 -04:00
Anna Shchurova
ba65896cef Fixed case for POINT 2021-08-20 15:50:04 -04:00
Anna Shchurova
aa58a358ea Added new 'hitDEtectionRenderer' property to ol.style.Style and used it in custom drawing 2021-08-20 15:10:59 -04:00
Maximilian Krög
f1ecc87425 High resolution image style for immediate renderer 2021-07-11 12:32:03 +02:00
Andreas Hocevar
79f5f46d27 Remove lint 2021-06-28 18:10:51 +02:00
MoonE
e82a86f563 Merge pull request #12194 from MoonE/immediate-pixel-ratio
Respect pixel ratio with immediate render
2021-06-18 19:31:00 +02:00
Tim Schaub
2e4b2e10ab Fix additional doc links 2021-06-17 21:59:51 -06:00
Maximilian Krög
c55366d35e use correct stride for draw image 2021-06-17 00:14:34 +02:00
Maximilian Krög
3791dee358 Fix immediate render with pixel ratio != 1 2021-06-17 00:14:27 +02:00
AndersVittrup
aa61c47fc4 Fixed document ref in hitdetect
fixed lint
2021-05-13 20:51:40 +02:00
Maximilian Krög
4f962a651a Fix rendering of MultiPolygon text styles
When overflow is false and some of a MultiPolygon's polygons are
outside the rendered extent the coordinates and geometryWidths arrays are
not kept in sync. Therefore the width check will filter on wrong data and
some texts may not be rendered.
2021-04-05 22:33:15 +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
Simon Seyock
2ad5789797 Add descriptions for properties. 2021-02-04 18:19:33 +01:00
Simon Seyock
8facb252f1 Replace google closure syntax = with brackets around name 2021-02-03 14:06:02 +01:00
Simon Seyock
f590cb3473 Harmonize jsdoc 2021-02-02 12:14:56 +01:00
Andreas Hocevar
fc20e77cea Fix image with text decluttering 2021-01-15 00:29:58 +01:00
Andreas Hocevar
1cc9fdb6ec Fix handling of VectorTile renderBuffer 2021-01-10 18:59:07 +01:00
Tim Schaub
aed4773ecb Hit lines even if they are dashed 2020-12-30 12:33:06 -07:00
Andreas Hocevar
c4f5709349 Simplify custom circle rendering 2020-12-19 21:35:00 +08:00
changqing
811c130241 Implement custom circle render 2020-12-15 15:38:23 +08:00
Maximilian Krög
23dc768c2e Order callback calls by distance to click position
All callback calls for hits with a tolerance > 0 are queued and
called ordered by distance after all hits are detected.
2020-12-01 23:21:59 +01:00
Maximilian Krög
c076d273e7 Cache hit detect indexes and check closest pixels first. 2020-12-01 20:19:58 +01:00
Andreas Hocevar
28aaa2e0d3 Pass geometry to forEachFeatureAtPixel callback 2020-11-27 13:43:28 +01:00
Andreas Hocevar
11b9a0f5ed Merge pull request #11722 from ahocevar/text-align-rtl
Correct meaning of 'start' and 'end' text align for LTR text
2020-11-15 20:45:16 +01:00
Andreas Hocevar
7232001d9f Regex with better distinction between LTR and RTL characters
Co-authored-by: MoonE <maxi_kroeg@web.de>
2020-11-15 08:59:43 +01:00
Andreas Hocevar
7cc45c967b Correct meaning of 'start' and 'end' text align for LTR text 2020-11-06 18:13:50 +01:00
Maximilian Krög
b6ee7084c9 Fix stroke for text along path wiht negative x scale 2020-11-05 22:35:54 +01:00
Andreas Hocevar
c9ebf79df5 Add types and comments to make combined image+text decluttering clearer 2020-10-05 19:17:22 +02:00
Andreas Hocevar
8e862766fc New decluttering implementation 2020-09-27 21:13:26 +02:00