user_map123
user_map123

Reputation: 15

OpenLayers pop-up form when a feature is selected

Just wondering if anyone knows of anything to similar to clicking a feature (point) on an OpenLayers Map and it triggering a small pop-up form for completion?

I've found this in regards to adding text labels, but I don't want my label to appear... https://subscription.packtpub.com/book/web_development/9781785287756/3/ch03lvl1sec34/adding-text-labels-to-geometry-points

Realistically, I want an illusion for the user to have interactivity with a contact page map. They can draw a point on the map (this code is complete), but now I'd like to offer them the opportunity to click that point they've just drawn and add text in a pop-up - is this possible?

https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_popup_form - essentially this type of form but after the point has been drawn

Upvotes: 0

Views: 315

Answers (1)

Thomas
Thomas

Reputation: 48

Tooltip packages such as Popovers from Bootstrap (example), Tippy, or Popper (on which the previous ones are based) all allow HTML content to be displayed such a tooltip. So you could trigger the creation of a tooltip within your on('click') even listener, that persists until the form is submitted.

Upvotes: 1

Related Questions