Fix ModifyOption features as optional (#20737)

This commit is contained in:
Junyoung Clare Jang
2017-10-23 18:00:02 -04:00
committed by Sheetal Nandi
parent ca383e858b
commit dd92ec5ddd
2 changed files with 9 additions and 3 deletions

View File

@@ -12620,7 +12620,7 @@ declare module olx {
* insertVertexCondition: (ol.EventsConditionType|undefined),
* pixelTolerance: (number|undefined),
* style: (ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined),
* features: ol.Collection.<ol.Feature>,
* features: (ol.Collection.<ol.Feature>|undefined),
* wrapX: (boolean|undefined),
* source: (ol.source.Vector|undefined)}}
*/
@@ -12630,7 +12630,7 @@ declare module olx {
insertVertexCondition?: ol.EventsConditionType;
pixelTolerance?: number;
style?: (ol.style.Style | ol.style.Style[] | ol.StyleFunction);
features: ol.Collection<ol.Feature>;
features?: ol.Collection<ol.Feature>;
wrapX?: boolean;
source?: ol.source.Vector;
}

View File

@@ -702,10 +702,16 @@ jsonValue = geojsonFormat.writeGeometryObject(geometry, writeOptions);
//
// ol.interactions
//
let modify: ol.interaction.Modify = new ol.interaction.Modify({
let modifyFeature: ol.interaction.Modify = new ol.interaction.Modify({
insertVertexCondition: ol.events.condition.never,
features: new ol.Collection<ol.Feature>(featureArray),
});
let modifySource: ol.interaction.Modify = new ol.interaction.Modify({
insertVertexCondition: ol.events.condition.never,
source: new ol.source.Vector({
features: new ol.Collection<ol.Feature>(featureArray),
}),
});
let draw: ol.interaction.Draw = new ol.interaction.Draw({
type: "Point",