Unable to see a new Position KEY

Ferchoes6 years ago

Hallo Anton, i tried to create a new Position Key, the KEY_HUMIDITY, I have defined it in the Position class as KEY_HUMIDITY="humidity". Besides i added in the json files the following "positionHumidity": "Humidity", and finally i added in the PositionAttributes.js the following:

{
key:'humidity',
name: Strings.positionHumidity,
valueType: 'number',
dataType: 'percentage'
}

I compile and delete the cookies but i can not see it in the traccar web when i open the key list by adding a new column in reports panel. Please what i missing?. Can you me help.

Anton Tananaev6 years ago

I don't see any obvious problems. Probably you are either missing something or you are still using old code.

Ferchoes6 years ago

I use the traccar 3.14, just only doubt Strings.positionHumidity where is defined this class or is related to the strings in json files?

Anton Tananaev6 years ago

It's from JSON files.

Ferchoes6 years ago

Anton, a last doubt about this theme, i edited the PositionAttributes.js and i just left three elements in the data variable in the file. I restarted the server and when i open the traccar web i can see still the whole list. That means that only the file replace is not enough to modify the list.....can you please confirm me if in this case it is necessary to create the traccar installer to see the changes?

Anton Tananaev6 years ago

Have you compiled your JavaScript code?

Ferchoes6 years ago

Sorry nop, I thought it was not necessary, which tool should i use?.... i have the traccar project in eclipse

Anton Tananaev6 years ago

I would recommend to read documentation next time:

https://www.traccar.org/build/

Ferchoes6 years ago

Dear Anton, thank you for the great support. Believe me, i read a lot and search for similar questions before asking you. My intention was not wasting your time. I misunderstood the part of that link "Web interface is written in JavaScript, so it doesn't generally require compiling". My fault.

Thanks a lot.