Questions tagged [draw-interaction]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
150 views

OpenLayers: draw a shape (square or circle) where the user clicks on map [closed]

In OpenLayers 6, using OSM, I'm trying to draw either a square or a circle where the user clicks on a map. The shape should be (around) 5km of side or radius. So far I've produced the following to ...
user avatar
  • 111
1 vote
0 answers
38 views

Concatenating coordinates inside geometryFunction

While looking at this example, I came upon the following code (taken verbatim by using 'view page source'): interaction: new ol.interaction.Draw({ type: 'Polygon', source: vector.getSource(...
user avatar
2 votes
0 answers
114 views

2D canvas library for OpenLayers. Drawing custom interactive objects

I am looking for the 2D canvas library like Konva.js that I can use above OpenLayers 5.x. I need to draw shapes with font inside that are interactive - can be dragged over the map to the appropriate ...
user avatar
  • 121
0 votes
0 answers
149 views

Converting feature from draw interaction to WKT string

I've problems with converting the feature which I'm getting in draw interaction into the WKT string. I saw multiple examples which looks like it should be simple but I'm always getting the following ...
user avatar
3 votes
0 answers
203 views

Drawing an Ellipse in Openlayers 4 with interaction

In OpenLayers 2, I could easily create a Control to draw an ellipse like this: new OpenLayers.Control.DrawFeature(layer, OpenLayers.Handler.RegularPolygon, { handlerOptions:...
user avatar
  • 1,121
2 votes
1 answer
1k views

In OpenLayers how can I enable users to cancel the completion of a polygon, and carry on drawing it?

I am using the OpenLayers v4.6.5 Draw interaction. drawInteraction = new ol.interaction.Draw({...}); map.addInteraction(drawInteraction); I want users to be able to add properties to the features ...
user avatar
1 vote
1 answer
2k views

openlayers interaction only on left mouse

Using openlayers (latest - 4), I have a drawing interaction that draws a circle - let drawCircle = new ol.interaction.Draw({source: source, type: "Circle"}); map.addInteraction(drawCircle); Both ...
user avatar
0 votes
1 answer
897 views

finishCondition based on feature being drawn

I have a draw interaction in Openlayers 4. I'm using it to draw polygons. I would like to continue drawing the polygon if its area is less than a default value. I tried using the property ...
user avatar
7 votes
1 answer
7k views

Get feature from ol.interaction.Draw on drawend

My problem seems simple but I cannot find any questions that successfully solve it. I want to draw a circle using ol.interaction.Draw, and access the feature that is created immediately. My code as ...
user avatar
  • 285
0 votes
1 answer
1k views

Openlayers VectorTiles Draw Interaction

I am trying to add a the draw interaction to my openlayers 4.1.0 VectorTile layer. I have been able to add the draw interaction to a Vector layer, but not a VectorTile layer. Below is my js code: ...
user avatar
2 votes
1 answer
1k views

Creating points projected on line using QGIS?

How can we create points perpendicularly on a line with QGis ? Otherwise, how can we draw a line between one point and a line ? Here is a picture to show what we want :
user avatar
2 votes
2 answers
5k views

How to remove points on the Openlayers map?

I am experimenting with openlayers. I am adding points to the map using this example. However, I also want to delete unwanted points from the map. For example, I clicked 6 points on the map and I want ...
user avatar
  • 287
2 votes
1 answer
1k views

Openlayers 3 - Line with two points

I'm trying to create a tool which enables the user to draw a linestring with only 2 points. It's surprising how long I've searched and can't find an example or someone asking the question. I know ...
user avatar
  • 995
1 vote
1 answer
491 views

Selection with circle using JSTS

Anybody know if there is a possibility of using JSTS library with OL3, to create a circle for selecting marker in a map. Actually i succeed creating a polygon which can select markers and return the ...
user avatar
2 votes
1 answer
7k views

Openlayers drawing interaction geometryFunction

Can anyone help me to convert this function so that it is not dependant on the ol3-debug file as I don't know quite what is replaced upon build. The function works but only in debug mode. It is in ...
user avatar
  • 995
3 votes
4 answers
14k views

Problem in remove interaction after draw end in openlayers-3

I'm using OpenLayers-3.8.2. I have a draw Ineraction as follow: function drawEnd(){ map.removeInteraction(drawIneraction). } var drawInteraction = new ol.interaction.Draw({ source: mysource, ...
user avatar