Implementing .kml layer

mdtaylorlrim6 years ago

I am trying to implement a kml file. I have tried it in both the server preferences and in the user preferences with no luck. Logged out and back in between changes. .kml file is in /opt/traccar/web/test.kml

In the POI Layer: /test/kml

The test.kml file is the one in the GitHub discussion. I have tried other .kml files. Is there a log file where javascript errors might be located for the traccar web? How can I diagnose why the POI .kml files are not being implemented?

Mark

Anton Tananaev6 years ago

Why /test/kml instead of correct /test.kml?

mdtaylorlrim6 years ago

Typo, sorry. It does read:

/test.kml

Anton Tananaev6 years ago

I would recommend trying full URL. If it still doesn't work check browser developer console for any issues.

mdtaylorlrim6 years ago

Ok, I put in the full url. No change. I can enter the full url in a browser and it returns the kml in a xml format in the browser as expected.

Developer console shows no errors and all 200 for response codes. I see nothing in the developer console where it calls the kml but I wouldn't expect it to.

Since this .kml file is on the same host with my own Traccar server it shouldn't need CORS, right?

Any reason to have to restart the server after entering the url in the POI Layer preference?

Mark

Anton Tananaev6 years ago

Yeah, you don't need to worry about CORS.

mdtaylorlrim6 years ago

I'm using Open Street Map for the map layer. It should work with that, right? Should it work with any map layer?

Anton Tananaev6 years ago

It should work with any map layer.

mdtaylorlrim6 years ago

I moved the test.kml file to another web application on the same serve where I know .kml files work, and the test.kml does work it it. I just cannot get Traccar to recognize it, or use it.

Are there any known browsers that Traccar does not display well? I have used Firefox, IE, Edge, and Chrome. My firefox does not work and play well with javascript so I use IE and it works well for everything except the .kml file. Any other suggestions?

mdtaylorlrim6 years ago

And the answer is, only Chrome will utilize the .kml files, at least for me. I have not figured out what the difference is but Chrome was the answer.

Thanks Anton

abyss6 years ago

I have working kml layer on Firefox 59.0.2.
May be you have some errors in kml itself, Chrome ignores them, but Firefox just not show.

asher3 years ago

can some one add the steps on how to add KML and GPX to the solution?

mdtaylorlrim3 years ago

Place a .kml file in the web directory.
Click Settings, Server, then place the name of the .kml file in the POI Layer blank.
Refresh