Skip to content
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

Update L.LatLng initializers to class factory syntax #248

Closed
6 tasks
sashadev-sky opened this issue May 8, 2019 · 11 comments · Fixed by #257
Closed
6 tasks

Update L.LatLng initializers to class factory syntax #248

sashadev-sky opened this issue May 8, 2019 · 11 comments · Fixed by #257

Comments

@sashadev-sky
Copy link
Member

First Time?

This is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.

If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!

We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you 💝

If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!

🤔 What you will need to know.

Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.

The problem

What's supposed to happen:

From the official Leaflet docs:

Class Factories
You may have noticed that Leaflet objects are created without using the new keyword. This is achieved by complementing each class with a lowercase factory method:

new L.Map('map'); // becomes:
L.map('map');

What actually does happen:

We use Leaflet's built-in L.LatLng to initialize the starting positions of our images corners, but we don't take advantage of their suggested class factory syntax. Let's update the code in the files indicated below.

Solution

Where to find the relevant lines of code:

Remove the new keyword from the following code blocks and update L.LatLng to L.latLng :

distortable = L.distortableImageOverlay('/examples/example.png', {
corners: [
new L.LatLng(41.7934, -87.6052),
new L.LatLng(41.7934, -87.5852),
new L.LatLng(41.7834, -87.5852),
new L.LatLng(41.7834, -87.6052)
]
});

overlay = L.distortableImageOverlay('/examples/example.png', {
corners: [
new L.LatLng(41.7934, -87.6052),
new L.LatLng(41.7934, -87.5852),
new L.LatLng(41.7834, -87.5852),
new L.LatLng(41.7834, -87.6052)
]
}).addTo(map);

overlay2 = L.distortableImageOverlay('/examples/example.png', {
corners: [
new L.LatLng(41.7934, -87.6050),
new L.LatLng(41.7934, -87.5850),
new L.LatLng(41.7834, -87.5850),
new L.LatLng(41.7834, -87.6050)
]
}).addTo(map);

  1. lets update the comment in our SpecHelper.js file just for consistency:
    * > expect(new L.LatLng(0, 0.00005)).to.be.closeToLatLng(new L.LatLng(0, 0))

Thanks!!

Step by Step

  • Claim this issue with a comment here, below, and ask any clarifying questions you need
  • Fork the repository and set it up locally following the main repo README instructions https://github.com/publiclab/Leaflet.DistortableImage
  • Create a new feature branch with a unique name descriptive to the issue
  • Try to fix the issue following the steps above, but even before you're done, you can:
    commit your changes to your branch and start a pull request (see contributing to Public Lab software) but mark it as "in progress" if you have questions or if you haven't finished
  • Reference this issue in your pull request body
  • Once you submit your pull request, if there's an additional checklist provided for getting it merged, get those boxes checked off. Either way, mention me @sashadev-sky for a review.

Please keep us updated

💬⏰ - We encourage contributors to be respectful to the community and provide an update within a week of claiming a first-timers-only issue. We're happy to keep it assigned to you as long as you need if you update us, but if we don't see any activity a week after you claim it we may reassign it to give someone else a chance. Thank you in advance!

If this happens to you, don't sweat it! Grab another open issue.

💬 Get help

If you need any help - here are some options:

@Prasanth-N
Copy link

Can I claim this issue? Can you tell me how to get started?

@sashadev-sky
Copy link
Member Author

@Prasanth-N yes go ahead!

  1. Fork the main repo from the main page https://github.com/publiclab/Leaflet.DistortableImage, otherwise you'll only get anonymous credit
  2. clone your forked version by clicking the "clone or download" button - copy paste the url given and use the command $ git clone <paste_url> locally
  3. Follow the README instructions for any local setup
  4. Make your changes on a new feature branch (create this with $ git checkout -b <new_branch_name and use $ git branch to make sure you are on this branch)
  5. $ git push origin <new_branch_name to submit a pull request then visit the main repo page on Github and you'll see a prompt to create your PR

Let me know if you have more questions :)

@aysegulkoca
Copy link
Contributor

@sashadev-sky Can I claim this issue? Prasanth-N hasn't responded yet and I want to make a first-good-issue, thanks.

@Prasanth-N
Copy link

Prasanth-N commented May 14, 2019

I am working on this. Will update in a day or two

@aysegulkoca
Copy link
Contributor

@Prasanth-N I have a homework due to tomorrow, so I need an issue reallty fast. I'm so sorry but would you let me this issue, pretty please? I can't find another open issue.

@Prasanth-N
Copy link

Alright fine, you can take this if you need it so badly.

@aysegulkoca
Copy link
Contributor

Thank you so much!

@sashadev-sky
Copy link
Member Author

@Prasanth-N That was very kind of you 😇Issue #250 is very similar and has not had any updates from the user who claimed it in 6 days. After 7 we consider (only for FTOs) the issue abandoned and it's open to whomever to claim. Would you be interested in taking that one if there is no reply from the user by tomorrow?

I can mention you there in that case when it's time

@Prasanth-N
Copy link

@sashadev-sky Thanks a lot! I am interested. Please let me know when its available.

@sashadev-sky
Copy link
Member Author

@Prasanth-N will do! will be in the next 24 hrs.

@sashadev-sky
Copy link
Member Author

@Prasanth-N The issue is all yours now! I'll mention you there too :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants