How to add Mapbox API key in modern interface?

Mike 5 years ago

Hi all,
when I open Traccar in modern interface I see the map control in upper right corner
under the [+] [-] Zoom.

There it says "Mapbox ..."
When I click nothing happens.

When I open DevTools I see the following message:

Error: An API access token is required to use Mapbox GL.

So far so good.

The question is: Where do I enter the API key?
I found nothing to configure in traccar.xml, neither in the modern interface!

BTW. I already have an Mapbox API key.
Could somebody pleas advice!

Thanx so much!
=)

Mike 5 years ago

I also found that the location button below the map selector does not work.
there is a red line over it and tooltip sais "Location not available"

How can I make location (that button) available?

Anton Tananaev 5 years ago

Where do I enter the API key?

In the user or server attributes.

How can I make location (that button) available?

It means that it's not supported by your browser for some reason.

Mike 5 years ago

Hi Anton,
thanx for your reply.

I hoped, it would be that easy, but reality tell another story , unfortunately
I am logged in as admin in the "modern" interface and have the newest sources from your website installed.

If I go to server, I have only:

  • Settings->Announcement (no field for API key)
  • User Rights (no field for API key)
  • Properties (no field for API key)
    So where do you mean, should the field be?

Location works in Firefow (newest) if over https
Ok, that works.
Thanx

Anton Tananaev 5 years ago

Use mapboxAccessToken attribute.

Mike 5 years ago

Hi Anton,
thanx for oyur fast reply.

But I don't know what you are talking about.
I already havean URL with the mapboxAccessToken:
https://api.mapbox.com/styles/mapbox/streets-v11/tiles/{z}/{x}/{y}?access_token=<mymapBoxAccessToken>

But where to put this URL in traccar,
that I can use the map selector, Mapbox Streets,
in the modern interface in traccar?

I like the map selector in the modern interface, but would also like to use mapbox.

Kind regards,
Mike

I found no place where to put it in modern interface or configure it.

Anton Tananaev 5 years ago

You put it in the attributes, as I mentioned.

Mike 5 years ago

Hi Anton,

thats what I tried.
But I found no according field to put the API key into.

When I am logged in to the modern interface I g to the navigation on top left and select "server".
The I go to "properties" -> "add".

And there are only the following fields available:

  • notification key
  • Web: Liveroute length
  • Web: Enlarge with selection
  • Web: Maximum zoom
  • Interface: Disable report
  • Interface: Disable events
  • Interface: Disable vehicle functions
  • Interface: Disable driver
  • Interface: Disable calculated values
  • Interface: Disable calendar
  • Interface: Disable maintenance
  • Interface: disable position attributes
  • Distance unit
  • Speed unit
  • Volume unit
  • Timezone

IMHO no valid field for API key .... :-(

Anton Tananaev 5 years ago

You need to type the key that I provided instead of selecting one of the predefined options.

Mike 5 years ago

That! works like a charm
:-)
Thanx for your help!