Skip to content

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

Merged
pelord merged 32 commits into
nextfrom
draw_rayon
Dec 15, 2022
Merged

feat(draw): added possibility to use a predefined radius when drawing circle in drawing tool#1090
pelord merged 32 commits into
nextfrom
draw_rayon

Conversation

@MSPKarengeo

@MSPKarengeo MSPKarengeo commented Aug 3, 2022

Copy link
Copy Markdown
Contributor

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

@MSPKarengeo MSPKarengeo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

test

</div>

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

Copy link
Copy Markdown
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

Comment thread packages/geo/src/lib/draw/draw/draw.component.html
</div>

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Idem


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


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove newline

if (olGeometry.get('radius')) {
value.radius = olGeometry.get('radius');
olGeometry.set('radius', value.radius);
console.log(value.radius);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove logs

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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove logs

Comment thread packages/geo/src/locale/en.geo.json Outdated
"finish": "Finish current drawing",
"freehandMode": "Use a predefined radius",
"icon": "Icons",
"InsertvalueRadius": "Insert predefined radius",

Copy link
Copy Markdown
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
Copy Markdown
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"

Comment thread packages/geo/src/locale/en.geo.json Outdated
"drawing": "Draws",
"fill": "Fill",
"finish": "Finish current drawing",
"freehandMode": "Use a predefined radius",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove this translation

Comment thread packages/geo/src/lib/draw/draw/draw.component.html
@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