当我在React传单中设置标记的图标选项时,它抛出TypeError:
无法读取NewClass._initIcon上未定义的属性'createIcon'。
var newIcon = L.icon({
iconUrl: require('leaflet/dist/images/marker-icon.png'),
shadowUrl: require('leaflet/dist/images/marker-shadow.png')
});
<Marker
draggable={false}
position={coordinates}
ref={null}
icon={newIcon}
>
<Popup minWidth={90}>
<span>
{'title'}
</span>{' '}
<br />
<span>{'some comment'}</span>
</Popup>
</Marker>