Help for configuring deviceOverspeed.vm

Sezai sezen 6 years ago

First of all, I apologize for the poor translation.

How can I convert google maps link to deviceOverspeed.vm file instead of traccar server link?

Sezai sezen 6 years ago

< b >Point: < a href="$webUrl?eventId=$event.id">#{if}($position.address)$position.address#{else}$position.latitude&deg;, $position.longitude&deg;#{end}</a>< br >

How do I need to encode the above address to google maps?

roneskinder 6 years ago

Im currently sending a google map image with the event location, just added this line:
<img src="https://maps.googleapis.com/maps/api/staticmap?zoom=15&size=500x300&maptype=roadmap&markers=color:red%7Clabel:I%7C$position.latitude,$position.longitude&key=YOUR_GOOGLE_API_KEY" alt="Event location" width="500" height="300" border="0" style="border:0; outline:none; text-decoration:none; display:block;">

Sezai sezen 6 years ago
https://www.google.com.tr/maps/place/$position.latitude&deg;+$position.longitude&deg;

I found the solution.

Robbie 5 years ago

Hi,
I would like to do the same, but just get a mail with the the variables $position.latitude°+$position.longitude° not the actual values of these variables.
What am I doing wrong?

Sezai sezen 5 years ago

imaj

Robbie 5 years ago

Hi Sezai,
You picture is gone...

Rob

Sezai sezen 5 years ago
Robbie 5 years ago

I get a page not found error.
Could you just paste the text in the chat?

Sezai sezen 5 years ago

When I enter the code as text here it does not appear exactly.

try this address: http://adrian.gen.tr/code.PNG

Robbie 5 years ago

Hi Sezai,
Yes, got it now. :-)

So you just pasted the whole text in "DeviceOverspeed.vm" ?
I will try that. Thanks.

Couldnt we create a variable so we dont need to change every file in the template folder?
En what about future updates? I assume you made a backup of the Template folder and copy it back after an update?

Rob

Sezai sezen 5 years ago

I assume you made a backup of the Template folder and copy it back after an update?

Yes :)

Robbie 5 years ago

Hi Sezai,
It gives me the message "site not found"

This is how I filled it in DeviceOnline.vm (used this one for testing)

#set($subject = "$device.name: online")
<!DOCTYPE html>
<html>
<body>
Device: $device.name<br>
Online<br>
Time: $dateTool.format("YYYY-MM-dd HH:mm:ss", $event.serverTime, $locale, $timezone)<br>
Link: </b> <a href="https://www.qooqle.com.tr/maps/place/$position.latitude&deg;+$position.longitude&deg;/">$position.address</a><br>
</body>
</html>  

I see what you mean, it messes up the code.

Robbie 5 years ago

Did you just paste the code in the template file?
Looks like its is missing the values in the variables, do I need other adjiustments in Traccar website?

Sezai sezen 5 years ago

Yes, it is missing, the visible line is enough for google maps. If you want to see it on traccar, it already exists in the original file. What do you want to do?