mapbox-gl
Version:
A WebGL interactive maps library
18 lines (13 loc) • 535 B
JavaScript
const rtlTextPlugin = require('../source/rtl_text_plugin');
module.exports = function(text, layer, globalProperties, featureProperties) {
const transform = layer.getLayoutValue('text-transform', globalProperties, featureProperties);
if (transform === 'uppercase') {
text = text.toLocaleUpperCase();
} else if (transform === 'lowercase') {
text = text.toLocaleLowerCase();
}
if (rtlTextPlugin.applyArabicShaping) {
text = rtlTextPlugin.applyArabicShaping(text);
}
return text;
};