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

GeoJSON file limit? #55

Closed
DrogoNevets opened this issue Jan 9, 2025 · 5 comments
Closed

GeoJSON file limit? #55

DrogoNevets opened this issue Jan 9, 2025 · 5 comments

Comments

@DrogoNevets
Copy link
Contributor

I am trying to add a GeoJSON file of all the UK counties (available here) and it only inserts a few of them, not all of them

any ideas?

morehawes pushed a commit that referenced this issue Jan 10, 2025
- Add missing MultiPolygon support. Raised [here](https://wordpress.org/support/topic/large-kml-display-issue/) and [here](#55).
- [Taxonomy label fix](#47).
- [Added Name to GPX metadata on Export](#48).
@morehawes
Copy link
Collaborator

Thanks for reaching out. It looks like there was missing support for MultiPolygons. I have fixed this in the latest release and was able to import all counties.

Please let me know if you are still having issues.

Cheers,

Joe

@DrogoNevets
Copy link
Contributor Author

Ha, just came here to say exactly that - will test it now and let you know

@DrogoNevets
Copy link
Contributor Author

That looks much better! thanks chap!

Screenshot 2025-01-10 at 08 43 27

@DrogoNevets
Copy link
Contributor Author

a workaround that seems to work, though this is more at the leaflet level rather than the waymark level so there might be a better solution i've not found yet

const enrichPopups = (waymark) => {
  if (typeof Waymark !== "object" || typeof jQuery !== "function") {
    console.error("Waymark or jQuery not loaded");
  }

  const map = waymark.map;

  map.eachLayer((layer) => {
    if (typeof layer.toGeoJSON === "function") {
      if (!layer._popup) {
        return;
      }
      const popup = layer._popup;
      const popupContent = popup._content;
      const $popupContent = jQuery(popupContent);

      const button = document.createElement("button");
      button.textContent = "Click me!";
      button.addEventListener("click", () => {
        map.closePopup();
        waymark.map.fitBounds(layer._bounds);
      });

      $popupContent.children("ul").append(button);
    }
  });
};

@morehawes
Copy link
Collaborator

That looks much better! thanks chap!

Glad that did it!

Joe

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

No branches or pull requests

2 participants