0

Using the Draw interaction with version 4.6.5 or 5.0.3, I want to draw resp. place some text on the map. The text is a point with some specific properties read by the style function on the vector layer. By default the sketch geometry is visualised as a point because I cannot set the properties on the sketchpoint by the exported API to let it look like my text. As of now, I have to access the private property sketchPoint_ and also call

createOrUpdateSketchPoint_({
      coordinate: [0, 0]
});

if it is null to set my text style on it. Is there a way to achieve that by using the regular API?

Chris
  • 234
  • 1
  • 11

1 Answers1

0

The Draw interaction has a style parameter you can use to style the sketch. See the doc page: https://openlayers.org/en/latest/apidoc/module-ol_interaction_Draw-Draw.html

Viglino Jean-Marc
  • 1,371
  • 8
  • 6