作者: 狐狸家的鱼
Github: 八至
一、HTML-map
var drarGraphic;
var drawType;function addDrawInteraction(){
var geometryFunction;
console.log(drawType);
if(drawType !== ''){
if (drawType === 'RecTangle') {
drawType = 'Circle';
geometryFunction = ol.interaction.Draw.createRegularPolygon(4);
}
drarGraphic = new ol.interaction.Draw({
type:drawType,
source:vectorSource,//数据源
geometryFunction