Fix SIDC label icons

This commit is contained in:
Dave Conway-Jones 2021-07-02 13:15:03 +01:00
parent 2335e7ed9a
commit fc99940d99
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
2 changed files with 8 additions and 6 deletions

View File

@ -11,6 +11,7 @@ map web page for plotting "things" on.
### Updates ### Updates
- v2.15.5 - Fix SDIC icons to accept iso-coded icons as labels.
- v2.15.4 - Let clear heatmap command do what it says. - v2.15.4 - Let clear heatmap command do what it says.
- v2.15.3 - Fix panit command to work, try to use alt units, popup alignments. - v2.15.3 - Fix panit command to work, try to use alt units, popup alignments.
- v2.15.0 - let speed be text and specify units if required (kt,kn,knots,mph,kmh,kph) default m/s. - v2.15.0 - let speed be text and specify units if required (kt,kn,knots,mph,kmh,kph) default m/s.
@ -21,10 +22,6 @@ map web page for plotting "things" on.
- v2.13.0 - Tidy velocity layer. Feedback any url parameters. - v2.13.0 - Tidy velocity layer. Feedback any url parameters.
- v2.12.1 - Only show online layer options if we are online. - v2.12.1 - Only show online layer options if we are online.
- v2.12.0 - Add live rainfall radar data layer. Remove some non-loading overlays. - v2.12.0 - Add live rainfall radar data layer. Remove some non-loading overlays.
- v2.11.2 - Allow thicknesss of arc to be specified by weight.
- v2.11.1 - Better handle KML point info - add popup.
- v2.11.0 - Add option to smooth tracks using bezier curves.
- v2.10.0 - Save latest position to browser for refresh if in iframe/dashboard. Allow fractional Zoom levels.
- see [CHANGELOG](https://github.com/dceejay/RedMap/blob/master/CHANGELOG.md) for full list of changes. - see [CHANGELOG](https://github.com/dceejay/RedMap/blob/master/CHANGELOG.md) for full list of changes.

View File

@ -1259,7 +1259,7 @@ function setMarker(data) {
return m; return m;
} }
//console.log("DATA" typeof data, data); // console.log("DATA", typeof data, data);
if (data.deleted) { // remove markers we are told to if (data.deleted) { // remove markers we are told to
delMarker(data.name); delMarker(data.name);
return; return;
@ -1686,7 +1686,7 @@ function setMarker(data) {
} }
else if (data.hasOwnProperty("SIDC")) { else if (data.hasOwnProperty("SIDC")) {
// "SIDC":"SFGPU------E***","name":"1.C2 komp","fullname":"1.C2 komp/FTS/INSS" // "SIDC":"SFGPU------E***","name":"1.C2 komp","fullname":"1.C2 komp/FTS/INSS"
myMarker = new ms.Symbol( data.SIDC.toUpperCase(), { uniqueDesignation:data.name }); myMarker = new ms.Symbol( data.SIDC.toUpperCase(), { uniqueDesignation:unescape(encodeURIComponent(data.name)) });
// Now that we have a symbol we can ask for the echelon and set the symbol size // Now that we have a symbol we can ask for the echelon and set the symbol size
var opts = data.options || {}; var opts = data.options || {};
var sz = 25; var sz = 25;
@ -1695,6 +1695,11 @@ function setMarker(data) {
} }
opts.size = opts.size || sz; opts.size = opts.size || sz;
opts.size = opts.size * (opts.scale || 1); opts.size = opts.size * (opts.scale || 1);
// escape out any isocodes eg flag symbols
var optfields = ["additionalInformation","higherFormation","specialHeadquarters","staffComments","type","uniqueDesignation"];
optfields.forEach(function (item) {
if (opts.hasOwnProperty(item)) { opts[item] = unescape(encodeURIComponent(opts[item])); }
});
myMarker = myMarker.setOptions(opts); myMarker = myMarker.setOptions(opts);
var myicon = L.icon({ var myicon = L.icon({
iconUrl: myMarker.toDataURL(), iconUrl: myMarker.toDataURL(),