Replies: 6 comments 13 replies
-
First part, establish new object model
|
Beta Was this translation helpful? Give feedback.
-
Second part, make it backwards compatible
|
Beta Was this translation helpful? Give feedback.
-
First I'll try to see if I understood correctly. Seems like you define two goals:
Backwards compatibility is only maintained for users of the documented Folium features, not for external plugins or users extending Folium in custom ways. To understand the steps you are describing, it would really help me to see some code. Maybe you can make a very barebones example of this setup? Like, separately from the existing Folium code, just a dummy example to show the proposed architecture? It's interesting and I very much would like to understand it fully. |
Beta Was this translation helpful? Give feedback.
-
I'm also inspired to try out adding multiple parents to the Branca element and still allow rendering. I.e. changing |
Beta Was this translation helpful? Give feedback.
-
Another thought: seems the Github Issues are just about adding icon and divicon to markers. Maybe the simplest thing is to just do something custom for those particular elements. That's not unheard of, we have other classes that do some special stuff around rendering. |
Beta Was this translation helpful? Give feedback.
-
I made some progress for a PoC. There is one problem that I immediately ran into. I cannot easily use a thread local variable as the new root element. This will work in most typical use cases, but not for running the tests. However, we can probably use the Figure element that is used as the parent of There are however a few things I do not really understand in Branca that hinder my progress. How does the
Where does the output of the rendered children go? I also see that some render methods do not render anything at all, but just do structural manipulation (adding children to their parents and stuff). Am I correct that there are two versions of
|
Beta Was this translation helpful? Give feedback.
-
There are a few issues open that it is impossible to reuse elements such as Icons for layers. Apart from the CustomIcons, other things that are currently impossible are circular references. E.g. I would like to pass a reference to a LayerControl from a Layer and vice versa, so that they can update the other's state during events. This is currently not possible.
The underlying cause of this is the
Branca
object model.Branca
only allows containment relations. This is fine for modelling HTML or any other document object model. However, it does not much theLeaflet
object model, which uses references instead of containment.The following is a two part proposal on how to make references possible. I will first describe the required changes to the object model. Second I will describe how we can make this proposal work without breaking existing client code. Out of scope will be developers who may have made custom plugins or inherited from our object model outside of the
Folium
project.Beta Was this translation helpful? Give feedback.
All reactions