embed traccar map in my own website ?

Carsten Voigt7 years ago

Hi !
After some hours of try and error I finally succeeded and got my own traccar server up and running.

Now I am trying to get the map running in an iframe on my own website.
Firefox shows me my position, Safari shows only the map, without position marker.
Java is installed and switched on for this website.

Can anyone help ?

Anton Tananaev7 years ago

You are asking about embedding Traccar in the title, but then you are talking about some issue in Safari browser. What does one relate to another?

Carsten Voigt7 years ago

Well, I read all your posts about embedding a traccar map in websites, but I must say it was very confusing and took me hours of testing.
In some threads you talk about an app to install (on my web server or on the traccar server ?) and in other posts you mention the method with an URL with token (which I am using at the moment, but it only works with firefox).
I think you are a great programmer at all and I like traccar so much, but for "normal" users like me it would be very helpful to write a documentation with more examples and less code.

Maybe you can tell me how the URL with token works (I can see it loads the app.js script from a cloud flare server ?) to help me troubleshooting ? Otherwise I would be very happy if you could provide a specific "To-Do" how its made to embed a traccar map into the code of a website.

Anton Tananaev7 years ago

Sorry, but where do you see loading app.js from cloudflare?

Carsten Voigt7 years ago

In the source code of the traccar map-plugin on my website:

<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Traccar</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/3.20.1/ol.css" type="text/css">
</head>
<body style="margin: 0; padding: 0;">
<div id="map" style="width: 100%; height: 100%; position:fixed;"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/3.20.1/ol.js" type="text/javascript"></script>
<script id="loadScript" src="app.js"></script>
</body>
</html>
Anton Tananaev7 years ago

OK, but where do you see app.js being loaded from cloudflare?

Carsten Voigt7 years ago

I don´t know, it looked like that. As I mentioned before, I am a "normal user" with nearly no programming skills.
Would you please simply help me embedding the traccar map on my website ?

Do i have to install this app.js on the webserver to get it work ?

Anton Tananaev7 years ago

Embedding web app into own website doesn't seem like something that "normal user" would do. You need certain technical knowledge to do that.

Carsten Voigt7 years ago

I did that before with another tracking service (unfortunately it does not longer exist).
Adding a URL with some parameters (like a token) as iframe into a html-element into Apple iWeb is manageable even for me.
Well, if you can´t help me (or don´t want to) I will cancel my traccar experiment, sadly...

Anton Tananaev7 years ago

I believe that there is enough information out there to integrate it. All you need is a token in the URL query parameters, as pointed out before. If you need any further help, we can provide premium paid support.

Carsten Voigt7 years ago

Thanks, but No thanks !