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
+1 -1
View File
@@ -117,7 +117,7 @@ class EsriJSON extends JSONFeature {
feature.setId(/** @type {number} */(esriJSONFeature.attributes[opt_options.idField])); feature.setId(/** @type {number} */(esriJSONFeature.attributes[opt_options.idField]));
} }
if (esriJSONFeature.attributes) { if (esriJSONFeature.attributes) {
feature.setProperties(esriJSONFeature.attributes); feature.setProperties(esriJSONFeature.attributes, true);
} }
return feature; return feature;
} }
+3 -3
View File
@@ -651,7 +651,7 @@ function readRte(node, objectStack) {
const geometry = new LineString(flatCoordinates, layout); const geometry = new LineString(flatCoordinates, layout);
transformGeometryWithOptions(geometry, false, options); transformGeometryWithOptions(geometry, false, options);
const feature = new Feature(geometry); const feature = new Feature(geometry);
feature.setProperties(values); feature.setProperties(values, true);
return feature; return feature;
} }
@@ -682,7 +682,7 @@ function readTrk(node, objectStack) {
const geometry = new MultiLineString(flatCoordinates, layout, ends); const geometry = new MultiLineString(flatCoordinates, layout, ends);
transformGeometryWithOptions(geometry, false, options); transformGeometryWithOptions(geometry, false, options);
const feature = new Feature(geometry); const feature = new Feature(geometry);
feature.setProperties(values); feature.setProperties(values, true);
return feature; return feature;
} }
@@ -704,7 +704,7 @@ function readWpt(node, objectStack) {
const geometry = new Point(coordinates, layout); const geometry = new Point(coordinates, layout);
transformGeometryWithOptions(geometry, false, options); transformGeometryWithOptions(geometry, false, options);
const feature = new Feature(geometry); const feature = new Feature(geometry);
feature.setProperties(values); feature.setProperties(values, true);
return feature; return feature;
} }
+1 -1
View File
@@ -121,7 +121,7 @@ class GeoJSON extends JSONFeature {
} }
if (geoJSONFeature['properties']) { if (geoJSONFeature['properties']) {
feature.setProperties(geoJSONFeature['properties']); feature.setProperties(geoJSONFeature['properties'], true);
} }
return feature; return feature;
} }
+1 -1
View File
@@ -159,7 +159,7 @@ class IGC extends TextFeature {
const layout = altitudeMode == IGCZ.NONE ? GeometryLayout.XYM : GeometryLayout.XYZM; const layout = altitudeMode == IGCZ.NONE ? GeometryLayout.XYM : GeometryLayout.XYZM;
const lineString = new LineString(flatCoordinates, layout); const lineString = new LineString(flatCoordinates, layout);
const feature = new Feature(transformGeometryWithOptions(lineString, false, opt_options)); const feature = new Feature(transformGeometryWithOptions(lineString, false, opt_options));
feature.setProperties(properties); feature.setProperties(properties, true);
return feature; return feature;
} }
+5 -5
View File
@@ -517,7 +517,7 @@ class KML extends XMLFeature {
// we do not remove the styleUrl property from the object, so it // we do not remove the styleUrl property from the object, so it
// gets stored on feature when setProperties is called // gets stored on feature when setProperties is called
feature.setProperties(object); feature.setProperties(object, true);
return feature; return feature;
} }
@@ -1524,7 +1524,7 @@ function readLineString(node, objectStack) {
readFlatCoordinatesFromNode(node, objectStack); readFlatCoordinatesFromNode(node, objectStack);
if (flatCoordinates) { if (flatCoordinates) {
const lineString = new LineString(flatCoordinates, GeometryLayout.XYZ); const lineString = new LineString(flatCoordinates, GeometryLayout.XYZ);
lineString.setProperties(properties); lineString.setProperties(properties, true);
return lineString; return lineString;
} else { } else {
return undefined; return undefined;
@@ -1545,7 +1545,7 @@ function readLinearRing(node, objectStack) {
readFlatCoordinatesFromNode(node, objectStack); readFlatCoordinatesFromNode(node, objectStack);
if (flatCoordinates) { if (flatCoordinates) {
const polygon = new Polygon(flatCoordinates, GeometryLayout.XYZ, [flatCoordinates.length]); const polygon = new Polygon(flatCoordinates, GeometryLayout.XYZ, [flatCoordinates.length]);
polygon.setProperties(properties); polygon.setProperties(properties, true);
return polygon; return polygon;
} else { } else {
return undefined; return undefined;
@@ -1638,7 +1638,7 @@ function readPoint(node, objectStack) {
readFlatCoordinatesFromNode(node, objectStack); readFlatCoordinatesFromNode(node, objectStack);
if (flatCoordinates) { if (flatCoordinates) {
const point = new Point(flatCoordinates, GeometryLayout.XYZ); const point = new Point(flatCoordinates, GeometryLayout.XYZ);
point.setProperties(properties); point.setProperties(properties, true);
return point; return point;
} else { } else {
return undefined; return undefined;
@@ -1676,7 +1676,7 @@ function readPolygon(node, objectStack) {
ends.push(flatCoordinates.length); ends.push(flatCoordinates.length);
} }
const polygon = new Polygon(flatCoordinates, GeometryLayout.XYZ, ends); const polygon = new Polygon(flatCoordinates, GeometryLayout.XYZ, ends);
polygon.setProperties(properties); polygon.setProperties(properties, true);
return polygon; return polygon;
} else { } else {
return undefined; return undefined;
+1 -1
View File
@@ -216,7 +216,7 @@ class MVT extends FeatureFormat {
const geometry = transformGeometryWithOptions(geom, false, this.adaptOptions(opt_options)); const geometry = transformGeometryWithOptions(geom, false, this.adaptOptions(opt_options));
feature.setGeometry(geometry); feature.setGeometry(geometry);
feature.setId(id); feature.setId(id);
feature.setProperties(values); feature.setProperties(values, true);
} }
return feature; return feature;
+2 -2
View File
@@ -91,7 +91,7 @@ class OSMXML extends XMLFeature {
transformGeometryWithOptions(geometry, false, options); transformGeometryWithOptions(geometry, false, options);
const feature = new Feature(geometry); const feature = new Feature(geometry);
feature.setId(values.id); feature.setId(values.id);
feature.setProperties(values.tags); feature.setProperties(values.tags, true);
state.features.push(feature); state.features.push(feature);
} }
if (state.features) { if (state.features) {
@@ -137,7 +137,7 @@ function readNode(node, objectStack) {
transformGeometryWithOptions(geometry, false, options); transformGeometryWithOptions(geometry, false, options);
const feature = new Feature(geometry); const feature = new Feature(geometry);
feature.setId(id); feature.setId(id);
feature.setProperties(values.tags); feature.setProperties(values.tags, true);
state.features.push(feature); state.features.push(feature);
} }
} }
+1 -1
View File
@@ -350,7 +350,7 @@ function readFeatureFromGeometry(object, arcs, scale, translate, property, name,
properties[property] = name; properties[property] = name;
} }
if (properties) { if (properties) {
feature.setProperties(properties); feature.setProperties(properties, true);
} }
return feature; return feature;
} }