-
Notifications
You must be signed in to change notification settings - Fork 16
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
Write <map-a> as a custom element #402
Comments
I found this: WICG/webcomponents#634 It seems as though it's not possible to wrap |
I think it should be possible to work around that using |
For example, the following should theoretically work: <svg xmlns="http://www.w3.org/2000/svg">
...
<foreignObject width="" height="">
<div xmlns="http://www.w3.org/1999/xhtml">
<map-a> <!-- or if it's fine to "pollute" this element, remove `<div>` and set the namespace attribute here. -->
<svg xmlns="http://www.w3.org/2000/svg">
<g>
<path d=""/>
</g>
</svg>
</map-a>
</div>
</foreignObject> But perhaps that's not flexible enough? |
@Malvoz Does that allow nesting? For example: <svg xmlns="http://www.w3.org/2000/svg">
...
<foreignObject width="" height="">
<div xmlns="http://www.w3.org/1999/xhtml">
<map-a> <!-- or if it's fine to "pollute" this element, remove `<div>` and set the namespace attribute here. -->
<svg xmlns="http://www.w3.org/2000/svg">
<g>
<map-a>
<path d=""/>
</map-a>
</g>
</svg>
</map-a>
</div>
</foreignObject> Or would you have to create another |
<svg xmlns="http://www.w3.org/2000/svg">
...
<foreignObject width="" height="">
<map-a xmlns="http://www.w3.org/1999/xhtml">
<g xmlns="http://www.w3.org/2000/svg">
<path d=""/>
</g>
</map-a>
</foreignObject> would be more like what we would need, since we're inside a leaflet map pane with css transforms happening, and I doubt the browser would be coded to look inside a foreignObject for more svg content. |
@ahmadayubi re #402 (comment), yes the inner |
It's a lot of nesting in that, each |
The objective of the map-a would be a) to provide encapsulation/modularity of code and The major constraint would be (I believe) that the graphics inside the map-a would have to be accessible to the css transforms that leaflet applies to the ancestor map overlay pane div, without needing special replication or complexity, such as opening a new svg element. It would not be a big deal if foreignObject s could be nested, I think, as long as we keep the namespaces straight. Nothing would beat interactive testing in devtools to see if it would work! |
You could use |
I don't think using a regular element achieves everything we want especially regarding custom element modularization of code, so closing for now. We'll keep the branch as unresolved. |
The text was updated successfully, but these errors were encountered: