improve test for emoji like before conversion
This commit is contained in:
parent
8e98bad30f
commit
ab44c8900d
@ -1706,8 +1706,11 @@ function setMarker(data) {
|
|||||||
opts.size = opts.size * (opts.scale || 1);
|
opts.size = opts.size * (opts.scale || 1);
|
||||||
// escape out any isocodes eg flag symbols
|
// escape out any isocodes eg flag symbols
|
||||||
var optfields = ["additionalInformation","higherFormation","specialHeadquarters","staffComments","type","uniqueDesignation","speed"];
|
var optfields = ["additionalInformation","higherFormation","specialHeadquarters","staffComments","type","uniqueDesignation","speed"];
|
||||||
|
const regex = /\p{Extended_Pictographic}/ug;
|
||||||
optfields.forEach(function (item) {
|
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);
|
myMarker = myMarker.setOptions(opts);
|
||||||
var myicon = L.icon({
|
var myicon = L.icon({
|
||||||
|
Loading…
Reference in New Issue
Block a user