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

Modified function getCmPerPixel to es6 funcion in src/util/ImageUtil.js #1166

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/util/ImageUtil.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
L.ImageUtil = {

getCmPerPixel(overlay) {
var map = overlay._map;
getCmPerPixel:((overlay)=> {
let map = overlay._map;
Copy link
Member

Choose a reason for hiding this comment

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

Here I think it could be const perhaps? And on line 6 as well, if I understand right!

Thank you for your help!!

Copy link
Member

Choose a reason for hiding this comment

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

Hi @kabuur would you mind making this change and then hopefully we can merge this! Thank you!

Suggested change
let map = overlay._map;
const map = overlay._map;


var dist = map
let dist = map
.latLngToLayerPoint(overlay.getCorner(0))
.distanceTo(map.latLngToLayerPoint(overlay.getCorner(1)));

return (dist * 100) / overlay.getElement().width;
},
}),
};