0
votes

I am trying to add some basic text tools to an Openlayers map.

Here is a link to my code: https://jsfiddle.net/mcneela86/05jc7ab2/

At the moment I am drawing a rectangle and adding some text on .on('drawend', func). And changing the text when the rectangle is selected.

What I need to figure out is how I can let the user click and edit the text in the rectangle. And have it saved when the text tool in unseleted.

Any ideas would be greatly appreciated.

1

1 Answers

1
votes

Try to use an overlay (popup) that opens when the feature is selected. An ol.Overlay is an HTML element that is displayed over the map and attached to a single map location. You can add a from in it to handle text edition and save it as a property of the selected feature.