Commit Graph

1169 Commits

Author SHA1 Message Date
Olivier Guyot 7e9c620914 Fix linting and typechecking errors 2022-07-15 22:33:52 +02:00
Olivier Guyot 143c19ca03 Add utils for generating webgl buffers from lines and polygons
Uses @mapbox/earcut for polygon (what else), and a home made logic for lines
2022-07-15 22:33:52 +02:00
Olivier Guyot a18ffaed54 Move webgl utils out of ol/renderer/webgl/Layer module into their own module 2022-07-15 22:33:52 +02:00
Olivier Guyot eb0db9e3df Introduce batch renderers for each type of geometry
Batch renderers are responsible for generating render instructions and
interacting with the worker to obtain the final webgl buffers
2022-07-15 22:33:52 +02:00
Olivier Guyot b5fbed5437 Introduce MixedGeometryBatch for webgl rendering
This class keeps an up-to-date list of line, polygon and point geometries
to render as well as vertices counts, geometries count, rings count etc.
2022-07-15 22:33:52 +02:00
Andreas Hocevar 884c0c6129 Resolve conflicts 2022-07-15 10:51:08 +02:00
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
Andreas Hocevar 78e7f378fe Merge pull request #12106 from IQGeo/issue-12101
improve text width calculation
2022-06-08 15:39:29 +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
Luis Camacho 5e2b9fb629 fix to text width calculation
now considers new lines to match rendering
2022-05-22 12:29:19 +01: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
Andreas Hocevar ec1eec829c Merge pull request #13328 from EvertEt/strictnullchecks-3
Improve some nullable map types
2022-02-07 21:12:08 +01:00
Tim Schaub f10ba5c1e3 Avoid duplicate imports 2022-02-05 11:46:26 -07:00
EvertEt 15de4bb5ab Improve some nullable map types
Closes #13326
2022-02-04 17:05:52 +01:00
Maximilian Krög f0e768bb9a Remove case of MulitPolygon RenderFeature 2022-01-29 21:51:29 +01:00
Maximilian Krög 856f239280 Add function to convert RenderFeature to Feature 2022-01-29 17:52:07 +01:00
Tim Schaub 68ea485e69 Dispatch precompose and postcompose events for WebGL layers 2021-12-15 16:59:51 -07:00
Andreas Hocevar d4cc76f3f1 Add background to MapboxVector layer 2021-11-19 18:17:55 +01:00
Tim Schaub 2adf74ece4 Include WebGL context in render events for WebGL layers 2021-10-29 08:39:47 -06: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
Simon Seyock 7fc664c3fe sources and layers. 2021-07-10 11:28:48 +02:00
Simon Seyock 3365576548 Add PluggableMap. 2021-07-10 11:28:47 +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
Maximilian Krög bf0671fc08 Fix layer canvas reuse
If the scale values have more than 6 decimals they are rounded and can no longer be
compared to the created transform string.
2021-05-18 15:43:55 +02:00
AndersVittrup aa61c47fc4 Fixed document ref in hitdetect
fixed lint
2021-05-13 20:51:40 +02:00
Andreas Hocevar 7ec5cbffe9 Set block layout for text measurement 2021-04-16 22:46:14 +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