Openlayers 3 turn off smooth scrolling

I currently have OpenLayers 3 integration with many update features, this makes scrolling stutter especially when "kinetic" movement (scrolling) is used. Is there a way to turn this smooth scrolling with inertia so that the user can drag to move the map?

Removing animation on zoom will also help.

I looked in the ol.animation area for them - is this the right place?

+3


source to share


1 answer


Kinetics can be disabled by interaction ol.interaction.DragPan

. Removing animation while scaling can be done by passing duration: 0

in ol.interaction.MouseWheelZoom

.

See a live example here: http://jsfiddle.net/9v6fd6as/1/



Here's a sample source code:

var map = new ol.Map({
  layers: [
    new ol.layer.Tile({
      source: new ol.source.OSM()
    })
  ],
  interactions: ol.interaction.defaults({
    dragPan: false,
    mouseWheelZoom: false
  }).extend([
    new ol.interaction.DragPan({kinetic: false}),
    new ol.interaction.MouseWheelZoom({duration: 0})
  ]),
  target: 'map',
  view: new ol.View({
    center: [0, 0],
    zoom: 2
  })
});

      

+3


source







All Articles