Skip to main content

Questions tagged [ol-interaction]

Filter by
Sorted by
Tagged with
1 vote
1 answer
198 views

Prevent map click event being fired when select interaction is fired in OpenLayers7.3?

Code to listen on map click: map.on('click', function (evt) { console.log('============='); }); Code on select interaction: const selectClick = new Select({ condition: click, }); map....
timewalker's user avatar
0 votes
0 answers
704 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 ...
Basil's user avatar
  • 139
1 vote
2 answers
2k 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 be able to be ...
Stephen's user avatar
  • 285
1 vote
0 answers
251 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 ...
BFlat's user avatar
  • 394
3 votes
0 answers
292 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:...
Lokomotywa's user avatar
  • 1,181
1 vote
0 answers
72 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 ...
conste's user avatar
  • 153
1 vote
0 answers
259 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....
Iman Tahriri's user avatar
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 ...
Jelle's user avatar
  • 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 ...
Nasser Tahani's user avatar
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)....
VincentDEJ's user avatar
7 votes
3 answers
13k 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()....
itsme's user avatar
  • 238