Openlayers 3绘制圆圈

时间:2015-09-03 09:23:53

标签: javascript openlayers-3

我正在使用openlayers 3而我正在尝试绘制一个圆圈,但它没有,我在提到的代码中是否有任何错误???

function DrawCircle() {
            var circleCoordinates = [3210202.3139208322, 5944966.311907868, 3075978.8922520624, 6055647.128864803];
            var circle = new ol.geom.Circle(circleCoordinates);
            var feature = new ol.Feature(circle);

            var id = guid();
            feature.featureID = id;
            feature.setProperties({
                'id': id,
                'name': typeSelect.value,
                'description': 'Some values'
            })
            source.addFeature(feature);
        };

1 个答案:

答案 0 :(得分:0)

点击此处查看API文档:http://openlayers.org/en/v3.8.2/apidoc/ol.geom.Circle.html

您将错误的选项传递给构造函数。

new ol.geom.Circle(center,opt_radius,opt_layout)