Skip to content

Commit

Permalink
If the user selects a scheme when creating a new feature, don't overw…
Browse files Browse the repository at this point in the history
…rite that decision
  • Loading branch information
dabreegster committed Nov 20, 2024
1 parent d57a27c commit 369badc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/draw/point/PointMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
gjSchemes.update((gj) => {
f.id = newFeatureId(gj);
f.properties.scheme_reference = getArbitrarySchemeRef(gj);
f.properties.scheme_reference ||= getArbitrarySchemeRef(gj);
cfg.newPointFeature(f);
gj.features.push(f);
return gj;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/draw/polygon/PolygonMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
f.properties = { ...f.properties, ...$featureProps };
gjSchemes.update((gj) => {
f.id = newFeatureId(gj);
f.properties.scheme_reference = getArbitrarySchemeRef(gj);
f.properties.scheme_reference ||= getArbitrarySchemeRef(gj);
cfg.newPolygonFeature(f);
gj.features.push(f);
return gj;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/draw/route/RouteMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
f.properties = { ...f.properties, ...$featureProps };
gjSchemes.update((gj) => {
f.id = newFeatureId(gj);
f.properties.scheme_reference = getArbitrarySchemeRef(gj);
f.properties.scheme_reference ||= getArbitrarySchemeRef(gj);
cfg.newLineStringFeature(f);
gj.features.push(f);
return gj;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/draw/snap_polygon/SnapPolygonMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
f.properties = { ...f.properties, ...$featureProps };
gjSchemes.update((gj) => {
f.id = newFeatureId(gj);
f.properties.scheme_reference = getArbitrarySchemeRef(gj);
f.properties.scheme_reference ||= getArbitrarySchemeRef(gj);
cfg.newPolygonFeature(f);
gj.features.push(f);
return gj;
Expand Down

0 comments on commit 369badc

Please sign in to comment.