Leaflet.DistortableImage
Leaflet.DistortableImage copied to clipboard
Update method creation syntax to ES6 `EditHandle.js`
ππ₯β First Timers Only.
This issue is reserved for people who never contributed to Open Source before. We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you π
π€ What you need to know.
Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.
π Step by Step
-
[ ] π Claim this issue: Comment below.
Once claimed we add you as contributor to this repository.
-
[ ] π Accept our invitation to this repository. Once accepted, assign yourself to this issue
-
[ ] π Update the file \src/edit/handles/EditHandle.js in the
Leaflet.DistortableImage
repository (press the little pen Icon) and edit the line as shown below.
@@ -1,5 +1,5 @@
L.EditHandle = L.Marker.extend({
- initialize: function(overlay, corner, options) {
+ initialize(overlay, corner, options) {
var latlng = overlay.getCorner(corner);
L.setOptions(this, options);
@@ -19,31 +19,31 @@ L.EditHandle = L.Marker.extend({
L.Marker.prototype.initialize.call(this, latlng, markerOptions);
},
- onAdd: function(map) {
+ onAdd(map) {
L.Marker.prototype.onAdd.call(this, map);
this._bindListeners();
this.updateHandle();
},
- onRemove: function(map) {
+ onRemove(map) {
this._unbindListeners();
L.Marker.prototype.onRemove.call(this, map);
},
- _onHandleDragStart: function() {
+ _onHandleDragStart() {
this._handled.fire('editstart');
},
- _onHandleDragEnd: function() {
+ _onHandleDragEnd() {
this._fireEdit();
},
- _fireEdit: function() {
+ _fireEdit() {
this._handled.edited = true;
this._handled.fire('edit');
},
- _bindListeners: function() {
+ _bindListeners() {
this.on({
contextmenu: L.DomEvent.stop,
dragstart: this._onHandleDragStart,
@@ -55,7 +55,7 @@ L.EditHandle = L.Marker.extend({
this._handled.on('update', this.updateHandle, this);
},
- _unbindListeners: function() {
+ _unbindListeners() {
this.off({
contextmenu: L.DomEvent.stop,
dragstart: this._onHandleDragStart,
@@ -68,7 +68,7 @@ L.EditHandle = L.Marker.extend({
},
/* Takes two latlngs and calculates the scaling difference. */
- _calculateScalingFactor: function(latlngA, latlngB) {
+ _calculateScalingFactor(latlngA, latlngB) {
var overlay = this._handled;
var map = overlay._map;
@@ -82,15 +82,15 @@ L.EditHandle = L.Marker.extend({
},
/* Distance between two points in cartesian space, squared (distance formula). */
- _d2: function(a, b) {
+ _d2(a, b) {
var dx = a.x - b.x;
var dy = a.y - b.y;
return Math.pow(dx, 2) + Math.pow(dy, 2);
},
/* Takes two latlngs and calculates the angle between them. */
- calculateAngleDelta: function(latlngA, latlngB) {
+ calculateAngleDelta(latlngA, latlngB) {
var overlay = this._handled;
var map = overlay._map;
-
[ ] πΎ Commit your changes
-
[ ] π Start a Pull Request. There are two ways how you can start a pull request:
-
If you are familiar with the terminal or would like to learn it, here is a great tutorial on how to send a pull request using the terminal.
- [ ] π Done Ask in comments for a review :)
π€β Questions
Leave a comment below!
This issue was created by First-Timers-Bot.
Hi, i want to clam this issue
Hi, I want to claim this issue
Hi @ashish-parjapat, please go ahead. Thank you!
Hi, first timer here. Can i work on this?
Hi @Dezzy12, please leave a comment here https://github.com/publiclab/plots2/issues/11105 and weβll look for an issue for you to work on. Thank you!
Hi , I would like to claim this issue#1050
Hi @MAX-786, someone has already been assigned. Thank you!
Hi @TildaDares. ππΌ I'm here to take on the next available issue. π
Hi @NPDebs, please leave a comment in https://github.com/publiclab/plots2/issues/11105 and weβll look for an issue for you to work on. Thank you!
Hello, I am a first-timer. can I work on this?
Hi @olamideazeez, please leave a comment in https://github.com/publiclab/plots2/issues/11105 and weβll look for an issue for you to work on. Thank you!
I'd like to claim this issue π©βπ¦° @TildaDares
I'd like to claim this issue π©βπ¦° @TildaDares
HiΒ @Chinazaekpere-Ike , please leave a comment inΒ publiclab/plots2#11105Β and @TildaDares will look for an issue for you to work on. Thank you! π€Έπ½ββοΈ
hi, @TildaDares @jywarren has this issue been resolved. if not id like to work on it
Hi @THEDARKMAN007, contributors are only allowed to work on one FTO. You can look for other non-FTO issues to work or help a other contributions make their own contributions. Thank you!
Hi @ashish-parjapat, do you need any help with this? Please reach out if you do.
Hi @olamideazeez, you can go ahead and work on this. Thank you!