Don't dispatch change events when reading features

Based on initial work by https://github.com/Jinkwon
This commit is contained in:
Frederic Junod
2019-01-15 09:00:46 +01:00
parent aa0bc8175b
commit 787fd4aa44
8 changed files with 15 additions and 15 deletions

View File

@@ -117,7 +117,7 @@ class EsriJSON extends JSONFeature {
feature.setId(/** @type {number} */(esriJSONFeature.attributes[opt_options.idField]));
}
if (esriJSONFeature.attributes) {
feature.setProperties(esriJSONFeature.attributes);
feature.setProperties(esriJSONFeature.attributes, true);
}
return feature;
}

View File

@@ -651,7 +651,7 @@ function readRte(node, objectStack) {
const geometry = new LineString(flatCoordinates, layout);
transformGeometryWithOptions(geometry, false, options);
const feature = new Feature(geometry);
feature.setProperties(values);
feature.setProperties(values, true);
return feature;
}
@@ -682,7 +682,7 @@ function readTrk(node, objectStack) {
const geometry = new MultiLineString(flatCoordinates, layout, ends);
transformGeometryWithOptions(geometry, false, options);
const feature = new Feature(geometry);
feature.setProperties(values);
feature.setProperties(values, true);
return feature;
}
@@ -704,7 +704,7 @@ function readWpt(node, objectStack) {
const geometry = new Point(coordinates, layout);
transformGeometryWithOptions(geometry, false, options);
const feature = new Feature(geometry);
feature.setProperties(values);
feature.setProperties(values, true);
return feature;
}

View File

@@ -121,7 +121,7 @@ class GeoJSON extends JSONFeature {
}
if (geoJSONFeature['properties']) {
feature.setProperties(geoJSONFeature['properties']);
feature.setProperties(geoJSONFeature['properties'], true);
}
return feature;
}

View File

@@ -159,7 +159,7 @@ class IGC extends TextFeature {
const layout = altitudeMode == IGCZ.NONE ? GeometryLayout.XYM : GeometryLayout.XYZM;
const lineString = new LineString(flatCoordinates, layout);
const feature = new Feature(transformGeometryWithOptions(lineString, false, opt_options));
feature.setProperties(properties);
feature.setProperties(properties, true);
return feature;
}

View File

@@ -517,7 +517,7 @@ class KML extends XMLFeature {
// we do not remove the styleUrl property from the object, so it
// gets stored on feature when setProperties is called
feature.setProperties(object);
feature.setProperties(object, true);
return feature;
}
@@ -1524,7 +1524,7 @@ function readLineString(node, objectStack) {
readFlatCoordinatesFromNode(node, objectStack);
if (flatCoordinates) {
const lineString = new LineString(flatCoordinates, GeometryLayout.XYZ);
lineString.setProperties(properties);
lineString.setProperties(properties, true);
return lineString;
} else {
return undefined;
@@ -1545,7 +1545,7 @@ function readLinearRing(node, objectStack) {
readFlatCoordinatesFromNode(node, objectStack);
if (flatCoordinates) {
const polygon = new Polygon(flatCoordinates, GeometryLayout.XYZ, [flatCoordinates.length]);
polygon.setProperties(properties);
polygon.setProperties(properties, true);
return polygon;
} else {
return undefined;
@@ -1638,7 +1638,7 @@ function readPoint(node, objectStack) {
readFlatCoordinatesFromNode(node, objectStack);
if (flatCoordinates) {
const point = new Point(flatCoordinates, GeometryLayout.XYZ);
point.setProperties(properties);
point.setProperties(properties, true);
return point;
} else {
return undefined;
@@ -1676,7 +1676,7 @@ function readPolygon(node, objectStack) {
ends.push(flatCoordinates.length);
}
const polygon = new Polygon(flatCoordinates, GeometryLayout.XYZ, ends);
polygon.setProperties(properties);
polygon.setProperties(properties, true);
return polygon;
} else {
return undefined;

View File

@@ -216,7 +216,7 @@ class MVT extends FeatureFormat {
const geometry = transformGeometryWithOptions(geom, false, this.adaptOptions(opt_options));
feature.setGeometry(geometry);
feature.setId(id);
feature.setProperties(values);
feature.setProperties(values, true);
}
return feature;

View File

@@ -91,7 +91,7 @@ class OSMXML extends XMLFeature {
transformGeometryWithOptions(geometry, false, options);
const feature = new Feature(geometry);
feature.setId(values.id);
feature.setProperties(values.tags);
feature.setProperties(values.tags, true);
state.features.push(feature);
}
if (state.features) {
@@ -137,7 +137,7 @@ function readNode(node, objectStack) {
transformGeometryWithOptions(geometry, false, options);
const feature = new Feature(geometry);
feature.setId(id);
feature.setProperties(values.tags);
feature.setProperties(values.tags, true);
state.features.push(feature);
}
}

View File

@@ -350,7 +350,7 @@ function readFeatureFromGeometry(object, arcs, scale, translate, property, name,
properties[property] = name;
}
if (properties) {
feature.setProperties(properties);
feature.setProperties(properties, true);
}
return feature;
}