improve test for emoji like before conversion

pull/180/head
Dave Conway-Jones 3 years ago
parent 8e98bad30f
commit ab44c8900d
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF

@ -1706,8 +1706,11 @@ function setMarker(data) {
opts.size = opts.size * (opts.scale || 1);
// escape out any isocodes eg flag symbols
var optfields = ["additionalInformation","higherFormation","specialHeadquarters","staffComments","type","uniqueDesignation","speed"];
const regex = /\p{Extended_Pictographic}/ug;
optfields.forEach(function (item) {
if (opts.hasOwnProperty(item)) { opts[item] = unescape(encodeURIComponent(opts[item])); }
if (opts.hasOwnProperty(item) && regex.test(opts[item])) {
opts[item] = unescape(encodeURIComponent(opts[item]));
}
});
myMarker = myMarker.setOptions(opts);
var myicon = L.icon({

Loading…
Cancel
Save