Check browser developer tools. Are there any errors or warnings there?
Hi, thanks for the reply.
Following your suggestion, first I tried the mapbox url without the access token parameter (you know, the map url without the "?access_token=..." at the end). In this case, the browser developer tools console shows that Traccar tries to get the tiles, but a 401 error (unauthorized) occurs for each one.
Later, I tried the full mapbox url (the map url with the "?access_token=..." at the end). In this case, immediately after press save in "Server Settings", the browser developer tools console shows "PUT http://localhost:8082/api/server?_dc=1466808899494 400 (Bad Request) ext-all.js:22". Using browser developer tools, an inspection in Network->Response tab reveals the following error (edited map url):
{"details":"Value too long for column "MAPURL VARCHAR(128)": "'https://api.mapbox.com/user/map/{z}/{x}/{y}?access_token=123456789... (191)"; SQL statement:\nUPDATE server SET\n registration = ?,\n readonly = ?,\n map = ?,\n bingKey = ?,\n mapUrl = ?,\n distanceUnit = ?,\n speedUnit = ?,\n latitude = ?,\n longitude = ?,\n zoom = ?,\n twelveHourFormat = ?\n WHERE id = ?; [22001-191] - JdbcSQLException (... < QueryBuilder:431 < DataManager:463 < ServerResource:46 < ...)","message":"Value too long for column "MAPURL VARCHAR(128)": "'https://api.mapbox.com/user/map/{z}/{x}/{y}?access_token=123456789... (191)"; SQL statement:\nUPDATE server SET\n registration = ?,\n readonly = ?,\n map = ?,\n bingKey = ?,\n mapUrl = ?,\n distanceUnit = ?,\n speedUnit = ?,\n latitude = ?,\n longitude = ?,\n zoom = ?,\n twelveHourFormat = ?\n WHERE id = ?; [22001-191]"}
So, it seems that the full mapbox url is too long.
Any ideas or workarounds for solving this issue?
Thank you in advance for any help you can provide.
Looks like you need to manually change column size in the database.
Hi.
Finally, following your last suggestion, I was able to use a mapbox map as base layer.
Thank you.
I've already added an task to my backlog to increase column size, so it should be fixed for everybody in one of the next releases.
Ok, thanks for your time.
Hello Friend.
How did you solve the issue?
jan cna you help me with the url directions because I am goilng clueless on dding the map to traccar
HI! Can you put the long "URL" ??? without the token!!!
I put the long url including token and it worked
SORRY! I was misunderstood! If you can share the URL, for others!
sorry for the late reply got caught up with work. This is the url that worked for me
https://api.mapbox.com/styles/v1/[USERNAME]/[STYLE ID]/tiles/256/{z}/{x}/{y}@2x?access_token=[TOKEN]
THX!!!! Worked for me too!!!
It worked using this url? If so then I am happy helping someone.
Hi.
Following instructions from https://www.traccar.org/forums/topic/can-you-help-me-with-own-maps/, I tried to set a Mapbox map as base layer. I included the access token parameter in the url (needed for use Mapbox API).
Problem is that only a blank map is displayed.
¿Could be a compatibility issue between Traccar and Mapbox?
Thank you in advance for any help you can provide.