Give the draw interaction a style option
This commit is contained in:
@@ -380,7 +380,8 @@
|
|||||||
* drawing finish (default is 12).
|
* drawing finish (default is 12).
|
||||||
* @property {ol.geom.GeometryType} type Drawing type ('Point', 'LineString',
|
* @property {ol.geom.GeometryType} type Drawing type ('Point', 'LineString',
|
||||||
* 'Polygon', 'MultiPoint', 'MultiLineString', or 'MultiPolygon').
|
* 'Polygon', 'MultiPoint', 'MultiLineString', or 'MultiPolygon').
|
||||||
* @property {ol.feature.StyleFunction|undefined} styleFunction Style function.
|
* @property {ol.style.Style|Array.<ol.style.Style>|ol.feature.StyleFunction|undefined} style
|
||||||
|
* Style for sketch features.
|
||||||
* @todo stability experimental
|
* @todo stability experimental
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -146,9 +146,11 @@ ol.interaction.Draw = function(options) {
|
|||||||
* @type {ol.FeatureOverlay}
|
* @type {ol.FeatureOverlay}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.overlay_ = new ol.FeatureOverlay();
|
this.overlay_ = new ol.FeatureOverlay({
|
||||||
this.overlay_.setStyleFunction(goog.isDef(options.styleFunction) ?
|
style: goog.isDef(options.style) ?
|
||||||
options.styleFunction : ol.interaction.Draw.getDefaultStyleFunction());
|
options.style : ol.interaction.Draw.getDefaultStyleFunction()
|
||||||
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
goog.inherits(ol.interaction.Draw, ol.interaction.Interaction);
|
goog.inherits(ol.interaction.Draw, ol.interaction.Interaction);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user