Skip to content

Commit

Permalink
Chinese characters 1
Browse files Browse the repository at this point in the history
  • Loading branch information
morehawes committed May 5, 2024
1 parent 9fc5fa1 commit 7ae9557
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 23 deletions.
25 changes: 18 additions & 7 deletions dist/js/waymark-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -7834,21 +7834,32 @@ function Waymark_Map() {
.join("");
};

this.make_key = function (str) {
if (!str) {
return str;
this.make_key = function (str_in) {
if (!str_in) {
return str_in;
}

//No cyrillic
str = this.transliterate(str);
str_out = this.transliterate(str_in);

//No underscores
str = str.replace(/[^a-z0-9+]+/gi, "");
str_out = str_out.replace(/[^a-z0-9+]+/gi, "");

//Lower
str = str.toLowerCase();
str_out = str_out.toLowerCase();

// Check for empty str_out
if (!str_out) {
// Convert to hex
str_out = str_in
.split("")
.map(function (char) {
return char.charCodeAt(0).toString(16);
})
.join("");
}

return str;
return str_out;
};

this.get_feature_overlay_type = function (feature) {
Expand Down
2 changes: 1 addition & 1 deletion dist/js/waymark-js.min.js

Large diffs are not rendered by default.

25 changes: 18 additions & 7 deletions docs/public/dist/latest/js/waymark-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -7834,21 +7834,32 @@ function Waymark_Map() {
.join("");
};

this.make_key = function (str) {
if (!str) {
return str;
this.make_key = function (str_in) {
if (!str_in) {
return str_in;
}

//No cyrillic
str = this.transliterate(str);
str_out = this.transliterate(str_in);

//No underscores
str = str.replace(/[^a-z0-9+]+/gi, "");
str_out = str_out.replace(/[^a-z0-9+]+/gi, "");

//Lower
str = str.toLowerCase();
str_out = str_out.toLowerCase();

// Check for empty str_out
if (!str_out) {
// Convert to hex
str_out = str_in
.split("")
.map(function (char) {
return char.charCodeAt(0).toString(16);
})
.join("");
}

return str;
return str_out;
};

this.get_feature_overlay_type = function (feature) {
Expand Down
2 changes: 1 addition & 1 deletion docs/public/dist/latest/js/waymark-js.min.js

Large diffs are not rendered by default.

25 changes: 18 additions & 7 deletions src/js/Waymark_Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,21 +444,32 @@ function Waymark_Map() {
.join("");
};

this.make_key = function (str) {
if (!str) {
return str;
this.make_key = function (str_in) {
if (!str_in) {
return str_in;
}

//No cyrillic
str = this.transliterate(str);
str_out = this.transliterate(str_in);

//No underscores
str = str.replace(/[^a-z0-9+]+/gi, "");
str_out = str_out.replace(/[^a-z0-9+]+/gi, "");

//Lower
str = str.toLowerCase();
str_out = str_out.toLowerCase();

// Check for empty str_out
if (!str_out) {
// Convert to hex
str_out = str_in
.split("")
.map(function (char) {
return char.charCodeAt(0).toString(16);
})
.join("");
}

return str;
return str_out;
};

this.get_feature_overlay_type = function (feature) {
Expand Down

0 comments on commit 7ae9557

Please sign in to comment.