Questions tagged [ol-interaction]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
207 views

Stop/prevent showing context menu in OpenLayers 3

I am trying to make the context menu in a way that I can control where to show and where not to show. The summary is like I should be able to enable and disable the context menu in OpenLayers 3. I am ...
  • 139
0 votes
2 answers
872 views

Enable and disable layer modifying in OpenLayers

I have this project where I have to allow the user to edit his feature. At this point I can show the feature. But I want to also allow the user to modify the feature. The feature can't me able to be ...
  • 255
1 vote
0 answers
135 views

Kinetic properties in OpenLayers 6

I'd like to know how to adjust properties of ol/Kinetic. And also, what are the default properties when using the default ol/interaction/DragRotateAndZoom ? Properties are decay, minVelocity and ...
  • 374
3 votes
0 answers
215 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:...
  • 1,131
1 vote
0 answers
64 views

How to differentiate between features and labels for select interaction and applying styles in OpenLayers?

I am using a style function to style a vector layer with text labels. For the text style I have set overflow to true so that labels can exceed the dimensions of a polygon. I now want to use another ...
  • 153
1 vote
0 answers
178 views

Difference between an interaction and eventListener in OpenLayers

I am wondering when should I use an interaction instead of an eventListener. For example I can have a handler function like this: function handler(evt) { if (evt.type === 'click') { console....
1 vote
1 answer
2k views

Drawing shapes and features in OpenLayers 4

Using OpenLayers 4, I want to make a map giving the ability to draw shapes AND features. For this I want to combine the draw shapes example with the draw features example, both given on the website of ...
  • 371
1 vote
1 answer
2k views

OpenLayers interaction is not working when initializing in map object

There is a problem to set interaction for the map object in OpenLayers. I've used this code but it's not working: var osmLayer = new ol.layer.Tile({ source: new ol.source.OSM() }); var ...
1 vote
2 answers
3k views

How can I use shift or ctrl key without openlayers 3?

I want to verify if Shift or Ctrl key is pressed to make my own multiselection. I use a digitizer to draw polygon, rectangle, etc... to make selection from geometry on server-side (with mapguide api)....
7 votes
3 answers
12k views

How unselect a feature ithat select with OpenLayers-3.8.2's selectInteraction?

I'm using OpenLayers-3.8.2. I want to select a feature and then delete it. my code is as follow: deleteFeature = function(event){ var feature = event.selected[0]; myLayer.getSource()....
  • 228