Skip to main content
2 votes
Accepted

OpenLayers interaction is not working when initializing in map object

You cannot simply pass an array with interactions, but you have to use ol.interaction.defaults().extend, like this: var interaction = new ol.interaction.DragRotateAndZoom(); var map = new ol.Map({ ...
BritishSteel's user avatar
  • 6,657
2 votes

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

In open layers 5.2, you can unselect a feature like this: deleteFeature = function (event) { var feature = event.selected[0]; myLayer.getSource().removeFeature(feature); selectInteraction....
sangelee's user avatar
1 vote
Accepted

Drawing shapes and features in OpenLayers 4

You made a mistake on the condition. if(value !== 'None' || value !== 'Square' || value !=='Box'){ should be if(value !== 'None' && value !== 'Square' && value !=='Box'){ with your ...
Chase Choi's user avatar
  • 1,087

Only top scored, non community-wiki answers of a minimum length are eligible