在 OpenLayers 中为 ol.events.condition.shiftKeyOnly 导入 ES 模块

问题描述 投票:0回答:1

我正在使用

的开放层约定
var osm_default = new TileLayer({
  source: new OSM()
});

但是我该如何处理

var dragBoxInteraction = new DragBox({
  condition: ol.events.condition.shiftKeyOnly,

其他一切都通过

处理
import GeoJSON from 'ol/format/GeoJSON.js';
import Feature from 'ol/Feature.js';
import Style from 'ol/style/Style';
import Stroke from 'ol/style/Stroke.js';
import {defaults} from 'ol/interaction/defaults';
import {transform} from 'ol/proj.js';
import TileLayer from 'ol/layer/Tile.js';
// the following doesn't work. A SWAG
import {shiftKeyOnly} from 'ol​/events​/condition';
javascript node-modules openlayers
1个回答
0
投票

我很接近。

import {shiftKeyOnly} from 'ol/events/condition.js';

© www.soinside.com 2019 - 2024. All rights reserved.