diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-04-25 18:34:38 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2019-04-25 18:34:38 -0700 |
commit | eb4c3b7910312d0f75ee358cd5607dd68e5400cf (patch) | |
tree | 6b24de1d1541920bb4ca71fcb877376c17311389 | |
parent | 17c237aa7bfc1956ef231f42bfb31d911eb8ad3a (diff) | |
download | etbsa-traccar-web-eb4c3b7910312d0f75ee358cd5607dd68e5400cf.tar.gz etbsa-traccar-web-eb4c3b7910312d0f75ee358cd5607dd68e5400cf.tar.bz2 etbsa-traccar-web-eb4c3b7910312d0f75ee358cd5607dd68e5400cf.zip |
Fix map labels encoding (fix #737)
-rw-r--r-- | web/app/view/map/MapController.js | 3 | ||||
-rw-r--r-- | web/app/view/map/MapMarkerController.js | 9 |
2 files changed, 7 insertions, 5 deletions
diff --git a/web/app/view/map/MapController.js b/web/app/view/map/MapController.js index 38b2340..7ba0ee3 100644 --- a/web/app/view/map/MapController.js +++ b/web/app/view/map/MapController.js @@ -83,7 +83,8 @@ Ext.define('Traccar.view.map.MapController', { var feature = new ol.Feature( Traccar.GeofenceConverter.wktToGeometry(this.getView().getMapView(), geofence.get('area'))); feature.setStyle(this.getAreaStyle( - geofence.get('name'), geofence.get('attributes') ? geofence.get('attributes').color : null)); + Ext.String.htmlDecode(geofence.get('name')), + geofence.get('attributes') ? geofence.get('attributes').color : null)); this.getView().getGeofencesSource().addFeature(feature); return true; }, this); diff --git a/web/app/view/map/MapMarkerController.js b/web/app/view/map/MapMarkerController.js index 295d2f5..630497a 100644 --- a/web/app/view/map/MapMarkerController.js +++ b/web/app/view/map/MapMarkerController.js @@ -130,7 +130,7 @@ Ext.define('Traccar.view.map.MapMarkerController', { }, updateDevice: function (store, data) { - var i, device, deviceId, marker, style; + var i, device, deviceId, deviceName, marker, style; if (!Ext.isArray(data)) { data = [data]; @@ -148,8 +148,9 @@ Ext.define('Traccar.view.map.MapMarkerController', { this.updateDeviceMarker(style, this.getDeviceColor(device), device.get('category')); marker.changed(); } - if (style.getText().getText() !== device.get('name')) { - style.getText().setText(device.get('name')); + deviceName = Ext.String.htmlDecode(device.get('name')); + if (style.getText().getText() !== deviceName) { + style.getText().setText(deviceName); marker.changed(); } } @@ -260,7 +261,7 @@ Ext.define('Traccar.view.map.MapMarkerController', { style = this.getLatestMarker(this.getDeviceColor(device), position.get('course'), device.get('category')); - style.getText().setText(device.get('name')); + style.getText().setText(Ext.String.htmlDecode(device.get('name'))); marker.setStyle(style); marker.setId(device.get('id')); this.latestMarkers[deviceId] = marker; |