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

Add support for pasting GeoJSON links #996

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

yushan-mu
Copy link
Contributor

fixes issue #992

src/mapml/utils/Util.js Outdated Show resolved Hide resolved
src/mapml/utils/Util.js Outdated Show resolved Hide resolved
try {
mapEl.geojson2mapml(JSON.parse(textContent));
} catch {
console.log('Invalid link!');
Copy link
Member

Choose a reason for hiding this comment

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

I think thIS error message should be more along the lines of "Error parsing GeoJSON from:" + URL . It can be hard to figure out what's gone wrong, but if we say what we were trying to do, sometimes it makes it a bit easier to understand.

mapEl.removeChild(mapEl.lastChild);
}
// garbage collect it
l = null;
Copy link
Member

Choose a reason for hiding this comment

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

I don't believe this is necessary, since the let for l scopes it to this block. It should get collected after the block closes.

@yushan-mu yushan-mu changed the title fix for issue #992 Add support for pasting GeoJSON links Oct 18, 2024
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.

3 participants