aboutsummaryrefslogtreecommitdiff
path: root/web/app/DeviceImages.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-11-08 17:28:30 +0500
committerAbyss777 <abyss@fox5.ru>2016-11-08 17:28:30 +0500
commit03c7abe38d7d4852e80630d9f3f2124387f65d2c (patch)
tree6864f4f447023a1f85ea969b394a7942a01f7949 /web/app/DeviceImages.js
parentdbd7cb8ca62dd7fbc62fbfb9ccc16fc4b8a08d64 (diff)
downloadtrackermap-web-03c7abe38d7d4852e80630d9f3f2124387f65d2c.tar.gz
trackermap-web-03c7abe38d7d4852e80630d9f3f2124387f65d2c.tar.bz2
trackermap-web-03c7abe38d7d4852e80630d9f3f2124387f65d2c.zip
- Make icon inner space transparent
- Use array of fillId - Make default icon consistent with other - Use bare arrow for route markers
Diffstat (limited to 'web/app/DeviceImages.js')
-rw-r--r--web/app/DeviceImages.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/web/app/DeviceImages.js b/web/app/DeviceImages.js
index c79406b0..d781b529 100644
--- a/web/app/DeviceImages.js
+++ b/web/app/DeviceImages.js
@@ -20,7 +20,7 @@ Ext.define('Traccar.DeviceImages', {
singleton: true,
getImageIcon: function(color, zoom, angle, category) {
- var image, device, svg, width, height, rotateTransform, scaleTransform, transform;
+ var image, device, svg, width, height, rotateTransform, scaleTransform, transform, fill;
// Get right image or fallback to default arrow
if (category) {
device = Ext.getStore('DeviceImages').findRecord('key', category);
@@ -36,7 +36,13 @@ Ext.define('Traccar.DeviceImages', {
width = parseFloat(svg.documentElement.getAttribute('width'));
height = parseFloat(svg.documentElement.getAttribute('height'));
// Colorize
- svg.getElementById(device.get('fillId')).style.fill = color;
+ fill = device.get('fillId');
+ if (!Ext.isArray(fill)) {
+ fill = [fill];
+ }
+ for (i = 0; i < fill.length; i++) {
+ svg.getElementById(fill[i]).style.fill = color;
+ }
// Prepare rotate transformation
rotateTransform = 'rotate(' + angle + ' ' + (width / 2) + ' ' + (height / 2) + ')';
svg.getElementById(device.get('rotateId')).setAttribute('transform', rotateTransform);