tangrams / tangram

WebGL map rendering engine for creative cartography
https://tangram.city
MIT License
2.22k stars 290 forks source link

support size: % and auto when no sprites set #638

Closed meetar closed 6 years ago

meetar commented 6 years ago

Support percentage and ratio sizes, eg: size: 50% and size: [16px, auto] when no sprites set, to match ES implementation. https://github.com/tangrams/tangram-es/blob/43efd63c69d1c018c80ee00bb8eab33f7788168b/core/src/style/pointStyleBuilder.cpp#L350

Sub-issues: #642, #644

Related:

tallytalwar commented 6 years ago

Just a clarification here, no sprite but a texture is used in a draw rule.

meetar commented 6 years ago

@tallytalwar Double-checking: this is the current ES behavior, correct?

tallytalwar commented 6 years ago

Yes, gone through all the issues you have created, the examples you mentioned in those do work in ES. So yes it is the current ES behavior.

Thanks

meetar commented 6 years ago

How about #641? Does 'density' still apply to a texture with no sprites? Looking at https://github.com/tangrams/tangram-es/pull/1786 it seems it does, can you confirm?

tallytalwar commented 6 years ago

Yup it does.

Refer: https://github.com/tangrams/tangram-es/blob/ff7aebda89998d005fcd390a8060cfa67e5ba720/core/src/style/pointStyleBuilder.cpp#L313

The size is set using the density if it is determined to have a texture. And then is updated based on the sprite information (using the same texture density) if a sprite is mentioned in the draw rules.