-
-
Notifications
You must be signed in to change notification settings - Fork 686
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
Polygon with Holes Marker #1293
Comments
Is there any workaround solution in the meantime? Like using paths to define polygons instead or patterns along with polygons? When spherical coordinates are given for the polygon attribute, how are they transformed into an SVG points? |
Please give a try to this branch https://github.com/mistic100/Photo-Sphere-Viewer/tree/polygon-hole The definition of a polygon with holes is similar to GeoJSON syntax if you are familiar with it. polygonPixels: [
[
// main shape
[2941, 1413], [3042, 1402], [3041, 1555], [2854, 1559],
[2739, 1516], [2775, 1469], [2941, 1413],
],
[
// first hole
[2900, 1450], [2950, 1450], [2950, 1500], [2900, 1500],
]
], |
Yes I am familiar with it. I actually tried that and it didn't work previously. But I see you have now made a Polygon into a Path. I am using Photo Sphere Viewer via npm. Is there any way I can test this branch from there? How can I test it with my project? |
you will have to build it locally and use "npm link"/"yarn link" |
Works nicely! Just had to add the fillRule property to the svgStyle so that filled polygons also have the holes cutout. Any chance this can be incorporated in the next release? Thanks a bunch. |
can you provide an example of your polygon where you have to change fillRule ? because I don't need it on the demo, and it should not be necessary if the polygon is not selfcrossing |
I need the actual data ! |
Sorry about that. I have attached the entire MarkerConfig JSON, which includes the polygon vertices. |
Ok I understand the problem : I forced the holes coordinates to be in reverse order, but as you already did it (rightfully), it cancels out
I will remove this array inversion. |
Yes that makes complete sense why the I have tested it and everything works perfectly including hovering, tooltip, etc. Thank you for the feature! Looking forward to the |
This feature/bug fix has been released in version 5.7.4. |
Describe your problem
I am able to successfully create polygon markers. Is there any way to define polygons with holes using this library?
Online demo URL
No response
Photo Sphere Viewer version
5.4.2
Plugins loaded
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: