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

save map coordinates in localStorage #1220

Closed
wants to merge 25 commits into from

Conversation

vanithaak
Copy link
Contributor

Fixes #998 (<=== Add issue number here)

Co-authored by: @7malikk

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • PR is descriptively titled 📑 and links the original issue above 🔗
  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with grunt test
  • code is in uniquely-named feature branch and has no merge conflicts 📁
  • screenshots/GIFs are attached 📎 in case of UI updates
  • @mention the original creator of the issue in a comment below for help or for a review

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

Thanks!

GIF

MapKnitter.Lite.-.Google.Chrome.2022-10-22.23-17-57.mp4

@gitpod-io
Copy link

gitpod-io bot commented Oct 22, 2022

@vanithaak
Copy link
Contributor Author

@jywarren , @TildaDares , @cesswairimu please review our pr!

@@ -95,7 +95,9 @@ <h3 id="offcanvasRightLabel">Images</h3>
form.addEventListener('submit', (event) => {
event.preventDefault();
const url = input.value.replace('details', 'metadata');
let fetchedFrom
let splitUrl = url.split('/');
Copy link
Member

Choose a reason for hiding this comment

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

Hi, it looks like you may be mixing code from separate PRs here. This can happen if you work from your main branch and don't separate work into different branches. Could you reset it so these unrelated changes are not included in the PR?

You could try this -- https://stackoverflow.com/questions/7147270/hard-reset-of-a-single-file or just copy the version from the publiclab main branch (https://github.com/publiclab/Leaflet.DistortableImage) over your own and add it so there are no changes shown here. Let me know if you need help!

@@ -218,7 +218,7 @@ L.DistortableCollection = L.FeatureGroup.extend({

json.images = json.images.reverse();
json.avg_cm_per_pixel = this._getAvgCmPerPixel(json.images);

json.images.map(each=> localStorage.setItem('locations', JSON.stringify(each.nodes)));
Copy link
Member

Choose a reason for hiding this comment

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

Here is your code, i see! Actually I wonder if this code should be outside the generateExportJson() method. Should there be a method like collection.saveToLocalStorage() instead? What do you think?

@jywarren
Copy link
Member

Oh no, I don't see your localstorage code anymore! Did you possibly overwrite it by mistake?

@7malikk
Copy link
Collaborator

7malikk commented Oct 25, 2022

@vanithaak

@jywarren
Copy link
Member

Ah should this be closed in favor of #1225 ?

@vanithaak
Copy link
Contributor Author

@jywarren, yes this pr should be closed. I have worked on #1225 now. Thanks!

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

Successfully merging this pull request may close these issues.

MapKnitter Lite: fetch images from Internet Archive
3 participants