Skip to content

Commit

Permalink
Initial fixes for #883:
Browse files Browse the repository at this point in the history
- I've added the 'name' property wherever I couldn't see any.
- I called the layers 'coreFoo' or 'pluginFoo' so far, depending on if the layer is added in Core or by a Plugin. I'm not sure this is the best way to go, perhaps we could use another prefix or syntax.
- Those layers that already had a 'type' property were not modified: I only added (duplicated) the existing value from 'type', while keeping it. Replacing 'type' with 'name' will require more search-and-replace, which I'm not doing right now.
  • Loading branch information
jacobwod committed Dec 16, 2021
1 parent ec637ad commit 3db14a5
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions new-client/src/components/Search/MapViewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,16 @@ class MapViewModel {
? this.featureStyle.getDefaultSearchResultStyle
: null
);
// FIXME: Remove "type", use only "name" throughout
// the application. Should be done as part of #883.
this.resultsLayer.set("type", "searchResultLayer");
this.resultsLayer.set("name", "pluginSearchResults");
this.drawSource = this.getNewVectorSource();
this.drawLayer = this.getNewVectorLayer(
this.drawSource,
this.getDrawStyle()
);
this.drawLayer.set("name", "pluginSearchDraw");
this.map.addLayer(this.drawLayer);
this.map.addLayer(this.resultsLayer);
};
Expand Down
3 changes: 3 additions & 0 deletions new-client/src/models/DrawModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ class DrawModel {
// TODO: Make sure type is the way to go, a bit confusing setting the
// layer name on that property. Hmm...
this.#drawLayer.set("type", this.#layerName);
// FIXME: Remove "type", use only "name" throughout
// the application. Should be done as part of #883.
this.#drawLayer.set("name", this.#layerName);
// Then we can add the layer to the map.
this.#map.addLayer(this.#drawLayer);
};
Expand Down
3 changes: 3 additions & 0 deletions new-client/src/models/KmlModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ class KmlModel {
// TODO: Make sure type is the way to go, a bit confusing setting the
// layer name on that property. Hmm...
this.#kmlLayer.set("type", this.#layerName);
// FIXME: Remove "type", use only "name" throughout
// the application. Should be done as part of #883.
this.#kmlLayer.set("name", this.#layerName);
// Then we can add the layer to the map.
this.#map.addLayer(this.#kmlLayer);
};
Expand Down
1 change: 1 addition & 0 deletions new-client/src/plugins/Collector/CollectorModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ class CollectorModel {
});

this.layer = new Vector({
name: "pluginCollector",
source: this.vectorSource,
style: this.getVectorStyle(),
});
Expand Down
1 change: 1 addition & 0 deletions new-client/src/plugins/Edit/EditModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ class EditModel {
});

this.layer = new Vector({
name: "pluginEdit",
source: this.vectorSource,
style: this.getVectorStyle(),
});
Expand Down
3 changes: 3 additions & 0 deletions new-client/src/plugins/FmeServer/models/MapViewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ class MapViewModel {
);
// Make sure to set the layer type to something understandable.
this.#drawLayer.set("type", "fmeServerDrawLayer");
// FIXME: Remove "type", use only "name" throughout
// the application. Should be done as part of #883.
this.#drawLayer.set("name", "fmeServerDrawLayer");
// Then we can add the layer to the map.
this.#map.addLayer(this.#drawLayer);
};
Expand Down
1 change: 1 addition & 0 deletions new-client/src/plugins/Measure/MeasureModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class MeasureModel {
this.localObserver = settings.localObserver;
this.source = new VectorSource();
this.vector = new VectorLayer({
name: "pluginMeasure",
source: this.source,
style: this.createStyle,
});
Expand Down

0 comments on commit 3db14a5

Please sign in to comment.