2

Is there any way to create table or any html element in text style for features? i tried other ways like putting overlay on feature then in overlay i used table and html elements but had some problems with it also control of overlays to disable and enable on map for each feature was hard.

asked Nov 9, 2019 at 12:55

1 Answer 1

1

It uses canvas text operations so HTML elemensts are not possible https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Drawing_text (but text wrapping using \n is supported, see https://openlayers.org/en/latest/examples/vector-labels.html). If you need to produce a table effect you would need an array of styles using offsetX and offsetY and the appropriate text for each entry, for example https://codesandbox.io/s/vector-layer-2n47l

answered Nov 9, 2019 at 14:10
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.