Skip to content

feat(draw): added possibility to use a predefined radius when drawing circle in drawing tool #1090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 32 commits into from
Dec 15, 2022

Conversation

MSPKarengeo
Copy link
Contributor

@MSPKarengeo MSPKarengeo commented Aug 3, 2022

Please check if the PR fulfills these requirements

What is the current behavior? (You can also link to an open issue here)
infra-geo-ouverte/igo2#666

What is the new behavior?
added possibility to use a predefined radius when drawing circle in drawing tool

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications:
N/A

Other information:

@MSPKarengeo MSPKarengeo requested a review from LAMM26 August 3, 2022 15:25
Copy link
Contributor Author

@MSPKarengeo MSPKarengeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test

@@ -21,184 +21,138 @@
</div>

<div class="draw-options mat-typography">
<mat-slide-toggle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remettre les inputs sur des lignes distinctes, comme version précédente

@@ -21,184 +21,138 @@
</div>

<div class="draw-options mat-typography">
<mat-slide-toggle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remettre les inputs sur des lignes distinctes, comme version précédente

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

j'ai modifie le fichier draw.component.html

(colorPickerChange)="onColorChange(labelsAreShown, false)"/>
</mat-form-field>
</div>
<mat-slide-toggle *ngIf="isCircle()" [checked]="usePredefinedRadius" [labelPosition]="'before'"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idem

(colorPickerChange)="onColorChange(labelsAreShown, false)">
</mat-form-field>
</div>
<mat-slide-toggle *ngIf="isLineString() || isPolygon()" [checked]="freehandMode" [labelPosition]="'before'"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idem

<div class="radius-unit" *ngIf="isCircle()">
<form class="radius-form">
<mat-form-field class="radius">
<input matInput type="number" min="0" placeholder="{{ 'igo.geo.spatialFilter.radius' | translate }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idem

{{ 'igo.geo.draw.fill' | translate }}
</span>

<mat-form-field class="fill-field" appearance="outline" floatLabel="always" tooltip-position="below"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idem

@@ -90,6 +92,7 @@ export class DrawComponent implements OnInit, OnDestroy {

@Input() store: FeatureStore<FeatureWithDraw>; // Drawing store


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove newline

@@ -459,6 +459,9 @@ export class GeometryFormFieldInputComponent implements OnInit, OnDestroy, Contr
if (olGeometry.get('radius')) {
value.radius = olGeometry.get('radius');
olGeometry.set('radius', value.radius);
console.log(value.radius);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove logs

@@ -467,7 +470,8 @@ export class GeometryFormFieldInputComponent implements OnInit, OnDestroy, Contr
const center = olGeometry.getCenter();
const coordinates = olproj.transform(center, this.map.projection, 'EPSG:4326');
const radius = Math.round(olGeometry.getRadius() * (Math.cos((Math.PI / 180) * coordinates[1])));

console.log(radius);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove logs

"icon": "Icons",
"InsertvalueRadius": "Insert predefined radius",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove capitalization (insertValueRadius)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Use a predefined radius"

@@ -681,7 +681,9 @@
"drawing": "Draws",
"fill": "Fill",
"finish": "Finish current drawing",
"freehandMode": "Use a predefined radius",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this translation

@MSPKarengeo MSPKarengeo marked this pull request as ready for review August 10, 2022 13:05
@pelord pelord marked this pull request as draft October 24, 2022 13:53
@PhilippeLafreniere18 PhilippeLafreniere18 changed the title feat(geo): added possibility to use a predefined radius when drawing circle in drawing tool feat(draw): added possibility to use a predefined radius when drawing circle in drawing tool Nov 2, 2022
@PhilippeLafreniere18 PhilippeLafreniere18 marked this pull request as ready for review December 9, 2022 13:46
@pelord pelord merged commit 4a93c0d into next Dec 15, 2022
cbourget pushed a commit that referenced this pull request Mar 21, 2023
… circle in drawing tool (#1090)

* feat(draw): test rayon cercle

* tests

* tests draw rayon fixe

* lint

* change circle radius of interactionStyle

* style-olinteractionstyle

* resolve conflict

* replaced build scripts in packages

* lint and freehand mode for lines and polygons

* console logs for tests

* dubugging

* condition if radDef with mistakes

* ajout_de_radius_dans_map

* rayon_predefinie_final

* drawcomponenthtml_modifyed

* fix merge errors

* wip

* fix(draw/spatial-filter): fix drawStyle interaction

* refactor(draw): keep only one toggle for freehand

* fix(draw/spatial-filter): fix interaction style on freehand

Co-authored-by: MAXIME LAMER <maxime.lamer@msp.gouv.qc.ca>
Co-authored-by: Philippe Lafreniere <philippe.lafreniere@msp.gouv.qc.ca>
@alecarn alecarn deleted the draw_rayon branch December 15, 2023 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants