Uncaught TypeError: imageStyle.getImageState is not a function

在这里插入图片描述
这个错误也是遇得到哟,柑橘自己好无辜呀,我哪里错了,找了半天原来还是自己找的错误


	import Circle from 'ol/geom/Circle';

    feature.setStyle(new Style({
          image: new Circle({
            radius: num,
            fill: new Fill({
              color: colorVal
            }),
            stroke: new Stroke({
              color: 'white',
              width: 1
            })
          })
        })
    );

且,原来是谁引错了一个类,哎。

直接
import Circle from 'ol/geom/Circle';
改为
import {Circle as StyleCircle} from 'ol/style';

记录哈,帮助查找错误伙伴时缩小范围

原文地址:https://www.cnblogs.com/dengxiaoning/p/12309802.html