tangram-es icon indicating copy to clipboard operation
tangram-es copied to clipboard

Multiple text markers with text source function are not working

Open vilinet opened this issue 5 years ago • 2 comments

REPRODUCE: marker = map.addMarker(); marker.setPoint(tappedPoint); marker.setVisible(true); marker.setStylingFromString(style_Below); { "style": "text", "text_source": "function() { return 'a'; }", "font": { "size":"32px" } }

UPDATE: Not the caching the issue.. Still looking for it.

vilinet avatar Apr 11 '19 09:04 vilinet

If i remove the following lines from markerManager.cpp:374-376

 for (auto& p : params) {
        if (p.function >= 0) { p.function+=offset); }
   }

it works well. Is there any idea what this block meant to do?

vilinet avatar Apr 11 '19 10:04 vilinet

I attached a possible fix below that keeps tracking of the function hash and id in the StyleContext. So it will always get the correct id. Works well with more layers, scenes, functions.

2055_fix_patch.txt

vilinet avatar Apr 12 '19 10:04 vilinet