¿How can add new image to categories?

jenny8 years ago

Hi.

when we add a new device we can chose one category (Car, animal, person) i try change or add the same category but with other image. i add the image to opt/traccar/web/images. i check to images was.svg and i change the names, in other words the name to the new image is animal and the old image(default) is animlas but when i check in the traccar the category animal not exist. i restart the service and the pc but is the same error.

Thanks guys.

Note: sorry, i dont write english very well

Anton Tananaev8 years ago

You can't just put any arbitrary image there. Ids in your image either have to match existing images, or you have to configure ids for you image in the "DeviceImages" class. Note that if you change JavaScript code, you would have to compile it as well.

huismori8 years ago

How do you compile javascript code change on windows platform ?

Anton Tananaev8 years ago

There is a minify batch script that you can use.

huismori8 years ago

is for windows ?
where can I download it ?

thanks

Anton Tananaev8 years ago

It's in tools folder in "traccar-web" repository.

huismori8 years ago

I found it but windows version I have doesn't include sencha
what do I have to write for sencha path ?

@echo off
cd C:\Program Files\Traccar\web
set SDK=C:\[sencha path]\ext-6.2.0

sencha -sdk %SDK% compile -classpath=app.js,app,%SDK%\packages\core\src,%SDK%\packages\core\overrides,%SDK%\classic\classic\src,%SDK%\classic\classic\overrides exclude -all and include -recursive -file app.js and exclude -namespace=Ext and concatenate -closure app.min.js
Anton Tananaev8 years ago

You have to install Sencha CMD and get ExtJS.

huismori8 years ago

would you add some category and images to your project if I send you ?

Anton Tananaev8 years ago

Possibly, if they look good, consistent with existing ones and are properly licensed.

huismori8 years ago

Here you can download the images and categories will be same name as image names ;

images

thanks

PS : if you need more images, I can make for you.

Anton Tananaev8 years ago

Where did you get the images? What's the license?

huismori8 years ago

I made them using your source images, I edited yours add free images on them...

Anton Tananaev8 years ago

I need to know the source and license of those "free" images.

huismori8 years ago

http://www.iconninja.com/

if you want I can make more category icons for you.