Commit Graph

89 Commits

Author SHA1 Message Date
Maximilian Krög
a076899470 Make Text options typesafe 2022-07-29 21:24:46 +02:00
Maximilian Krög
69caa06783 Replace TextPlacement enum with typedef 2022-07-19 22:56:45 +02:00
Maximilian Krög
1df5afcdbf Remove deprecated label cache 2022-07-17 04:15:24 +02:00
Tim Schaub
3a061ed576 Use union type instead of enum for canvas builder type 2022-07-15 10:51:07 +02:00
Luis Camacho
5e2b9fb629 fix to text width calculation
now considers new lines to match rendering
2022-05-22 12:29:19 +01: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
Andreas Hocevar
79f5f46d27 Remove lint 2021-06-28 18:10:51 +02:00
Tim Schaub
2e4b2e10ab Fix additional doc links 2021-06-17 21:59:51 -06: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
Andreas Hocevar
7ec5cbffe9 Set block layout for text measurement 2021-04-16 22:46:14 +02:00
Simon Seyock
2ad5789797 Add descriptions for properties. 2021-02-04 18:19:33 +01:00
Simon Seyock
f590cb3473 Harmonize jsdoc 2021-02-02 12:14:56 +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
Andreas Hocevar
7a5e0db59f Remove decluttering for a fresh start 2020-09-18 23:31:20 +02:00
mike-000
cf0e650435 allow scale to be two dimensional
add getScaleArray() method

test two dimension scale icons
test two dimension scale text

add example of icon and label scaling
use smaller icon and larger interval
test two dimensional scale icons
test two dimensional scale icons
2020-05-20 09:54:47 +01: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
3f7f999db0 Avoid try/catch, DOM and workers 2020-03-23 12:46:24 +01:00
Andreas Hocevar
6dcc54bfb8 'action' instead of 'type' as message identifier 2020-03-23 12:46:24 +01:00
Andreas Hocevar
06f6ba13c8 Make font loading work in workers 2020-03-23 12:46:22 +01:00
Andreas Hocevar
56edbb2d73 Make createTransformToString a standalone function 2020-03-23 12:46:21 +01:00
Maximilian Krög
ab9d7cdc70 Draw image with configured opacity 2020-02-18 14:09:36 +01:00
Andreas Hocevar
262373a4b5 Remove circular dependency 2020-02-12 20:31:18 +01:00
Andreas Hocevar
7266f37f85 Remove unused export and variable 2020-01-30 14:56:11 +01:00
Andreas Hocevar
542b77eef8 Save and restore before rendering labels 2020-01-30 09:14:03 +01:00
Andreas Hocevar
fd935bae53 Remove label cache, render text directly to target canvas 2020-01-13 22:12:53 +01:00
Andreas Hocevar
48ec398037 Do not bypass measureTextWidth 2019-11-05 21:08:48 +01:00
Andreas Hocevar
ac50cc3460 New eslint config with no-multi-assign 2019-11-02 15:20:21 +01:00
Andreas Hocevar
442213f85b Store correct font value 2019-11-01 22:06:00 +01:00
Frederic Junod
0e402073da Add more typecast for typescript 2019-09-27 13:11:30 +02:00
ahocevar
bd3f35eef0 Declutter multi geometries per geometry instead of per feature 2019-08-17 23:55:20 +02:00
Andreas Hocevar
ff063caa4e Merge pull request #9755 from ahocevar/font-loading
Font loading improvements
2019-07-15 12:21:28 +02:00
Frederic Junod
ad51c7c08f Use CanvasLineCap type instead of string 2019-07-05 11:11:35 +02:00
Frederic Junod
7a8a0c18ae Use CanvasLineJoin type instead of string 2019-07-05 11:07:10 +02:00
ahocevar
4b48997a0b Check font style and weight in addition to family 2019-07-04 16:12:35 +02:00
ahocevar
ab2d97d49b Don't give up too early when waiting for fonts 2019-07-04 16:11:39 +02:00
ahocevar
5616c535b0 Clean up properly when clearing label cache 2019-07-04 16:10:28 +02:00
ahocevar
b4306da7bb Fix font comparison, less context.font operations 2019-07-04 16:06:13 +02:00
ahocevar
c56ad4363d Canvas opacity instead of css 2019-05-22 16:47:22 +02:00
ahocevar
b06c84cef9 More efficient default stroke style 2019-03-19 13:58:20 +01:00
ahocevar
b33ceaa400 More efficient default fill color 2019-03-19 13:57:10 +01:00
ahocevar
4a7b3cde56 Take line-height into account when measuring text height 2019-03-09 08:25:09 +01:00
ahocevar
592b6cf362 Keep track of used labels 2019-01-23 21:52:22 +01:00
ahocevar
e37734826c Release canvas memory faster 2019-01-21 23:04:31 +01:00
Tim Schaub
8b50c3c6cb Pass along the ability to measure and cache text width 2018-11-19 15:34:48 -07:00
ahocevar
3d203f990e Move measureTextWidths to render/canvas 2018-11-15 15:20:41 +01:00
Frederic Junod
9c52e0d6d9 Remove extra imports in jsdoc
The symbols are already imported (es6 import)
2018-09-19 14:52:58 +02:00
ahocevar
79674363e6 Fix imports in TextState 2018-09-13 11:42:59 +02:00
Frederic Junod
c8747d87a4 Add missing properties in TextState typedef 2018-09-06 09:30:28 +02:00