tangram-es
tangram-es copied to clipboard
Multiple text markers with text source function are not working
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.
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?
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.