arthur-e / Wicket

A modest library for moving between Well-Known Text (WKT) and various framework geometries
https://arthur-e.github.io/Wicket/
Other
586 stars 227 forks source link

Fix issue of exporting to google map multiple polygon #127

Closed songjiahong closed 6 years ago

songjiahong commented 6 years ago
  1. Fix the algorithm of checking whether a polygon is clockwise
  2. Add all vertexes including the last overlapped one to the google map polygon
arthur-e commented 6 years ago

It looks like several tests are failing. Can you check out the Travis CI build details? In particular, the first Google Maps 3 test that fails:

FAILED TESTS:
  Standard WKT Test Cases: 
    Coverting WKT strings into objects: 
      ✖ should convert a basic POLYGON string to a Polygon instance
        PhantomJS 2.1.1 (Linux 0.0.0)
      Expected '(10, 30),(40, 40),(40, 20),(20, 10),(10, 30)' to equal '(10, 30),(40, 40),(40, 20),(20, 10)'.
      tests/wicket-gmap3-spec.js:834:35

It looks like maybe the first vertex is not being repeated (to close the ring)?

songjiahong commented 6 years ago

Not feeling good today, I will check these tomorrow. Looks like the tests should be updated.

arthur-e commented 6 years ago

Thanks for checking the tests @songjiahong. Let me know what you've decided about inner ring orientation, then I'll confirm the pull request.

songjiahong commented 6 years ago

All good now

arthur-e commented 6 years ago

Great! Thanks so much.