itowns icon indicating copy to clipboard operation
itowns copied to clipboard

Feature and layer Style

Open gchoqueux opened this issue 4 years ago • 3 comments

There isn't simple method to get feature/featureCollection/layer Style. It's necessary to improve the architecture and expose methods to obtain the style.

gchoqueux avatar Feb 11 '20 16:02 gchoqueux

My suggestion:

  • FeatureCollection has the master style
  • Feature has its own style, with default values read from the FeatureCollection style
  • same goes for FeatureGeometry which inherits from the style of Feature (and so FeatureCollection)

With this, only two things need to be done:

  • add a Style#clone() method
  • in the constructor of each of these types, add an option to initiate the style, true by default

Generally speaking, regarding these types, what we are also missing either a great tutorial concerning the creation of FeatureCollection/Feature/FeatureGeometry, or either a better API (it is too complicated to understand bindNewGeometry/startSubGeometry/... imho.

zarov avatar Feb 12 '20 07:02 zarov

Can this approach is able to apply to the diffrent layers? such as vector tiles?

am2222 avatar Mar 10 '20 18:03 am2222

@am2222 what do you mean ?

zarov avatar Mar 12 '20 08:03 zarov

Created #1924 and #1923 as followups of this issue. Closing

jailln avatar Oct 14 '22 08:10 jailln