防止openlayers在draw绘制状态按shift功能失效

发布时间 2023-08-18 12:08:51作者: 斩月飞仙
new Draw({
        source: this.map.source,
        type: type,
        geometryFunction: geometryFunction,
        condition: () => {
          return true;
        },
        freehandCondition: () => {
          return false;
        }
      });

  freehandCondition可以设置默认按键条件,返回false即按键shift失效

  condition为false则绘制功能失效,为true生效