-
Notifications
You must be signed in to change notification settings - Fork 284
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
Changes from 21 commits
87f5076
049a0f4
9b89862
f6225c3
4976617
2ea3e66
c71fc06
8db3a8e
3abe3f4
05d7f31
1dca9e3
7cbcb80
24df784
5b53274
9cbefd9
47f1aa2
07c7e94
773c2fe
b553cca
9c701b5
c0f9356
0ae3356
7d1732a
1acdd38
dfb8e16
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,7 +132,7 @@ L.DistortableCollection = L.FeatureGroup.extend({ | |
layer._dragStartPoints = {}; | ||
layer.deselect(); | ||
for (i = 0; i < 4; i++) { | ||
let c = layer.getCorner(i); | ||
const c = layer.getCorner(i); | ||
layer._dragStartPoints[i] = map.latLngToLayerPoint(c); | ||
} | ||
}); | ||
|
@@ -174,7 +174,7 @@ L.DistortableCollection = L.FeatureGroup.extend({ | |
let i; | ||
|
||
layersToMove.forEach((layer) => { | ||
let movedPoints = {}; | ||
const movedPoints = {}; | ||
for (i = 0; i < 4; i++) { | ||
movedPoints[i] = p.transform(layer._dragStartPoints[i]); | ||
} | ||
|
@@ -195,10 +195,10 @@ L.DistortableCollection = L.FeatureGroup.extend({ | |
|
||
this.eachLayer(function(layer) { | ||
if (this.isCollected(layer)) { | ||
let sections = layer._image.src.split('/'); | ||
let filename = sections[sections.length-1]; | ||
let zc = layer.getCorners(); | ||
let corners = [ | ||
const sections = layer._image.src.split('/'); | ||
const filename = sections[sections.length-1]; | ||
const zc = layer.getCorners(); | ||
const corners = [ | ||
{lat: zc[0].lat, lon: zc[0].lng}, | ||
{lat: zc[1].lat, lon: zc[1].lng}, | ||
{lat: zc[3].lat, lon: zc[3].lng}, | ||
|
@@ -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))); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
return json; | ||
}, | ||
}); | ||
|
There was a problem hiding this comment.
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!