configure google maps api in traccar 6.3

Gerard Iscala5 months ago

Please help me, I already have the Google Maps API.

In my TracCar application I have configured the following:

Settings/Server/Attributes/Google API Key : my API Key.

Settings/Preferences/Active Maps : select Google Roads.

Settings/Account/Preferences/Default Map : select Google Roads.

That is my configuration: But the map is not displayed and is blank.

Anton Tananaev5 months ago

Have you enabled Tiles API for your Google API key?

Gerard Iscala5 months ago

I have set it up as follows and it works now.

Settings/Server/Preferences/Custom Map: https://mt0.google.com/vt/lyrs=m,traffic&hl=en&x={x}&y={y}&z={z}&s=Ga

Settings/Server/Preferences/Default Map: Custom.

Settings/Preferences/Active Maps: Custom.

Settings/Preferences/Layer on Map: Google Traffic.

This way it works perfectly for me.

Anton Tananaev5 months ago

This doesn't require the key. That's why it's working.

Gerard Iscala5 months ago

Does that mean I can use that custom map without the Google Maps API?

Gerard Iscala5 months ago

Have you enabled Tiles API for your Google API key?

This needs to be enabled on my traccar 6.3 server? In order to be able to use my Google Maps API Key.?

n5na5 months ago

Took me a while to find out where to enable Map Tiles too. You need to be logged into Google.

Go to https://mapsplatform.google.com/

In the upper right corner there's a blue button that says "Get started". Click that. You should be at the Google Maps Platform.

On the left hand side of the screen there is a list of items. Click on "APIs & Services". There's a group of services to choose from. Find "Map Tiles API" and click "ENABLE".

After I did that my Google Maps started working. It may take a few minutes to start working though.

Segarra5 months ago

Hello, but this API, for private use, is free?

Anton Tananaev5 months ago

It's not free, but there is some free quota I think.

Segarra5 months ago

Oki... thanks

n5na5 months ago

You can check out the pricing at https://mapsplatform.google.com/pricing/

It shows 2D Tiles are $0.60 / 1000 requests. You get a $200 credit per month so that should cover 333,333 requests per month for map tiles. Under the FAQ it says "Requests can either be calls to the API, or load events of maps or panoramas. User interactions like zooming or panning are not charged. See Google Maps Platform Billing"

Looks to me unless you have a public map that gets hundreds of views per day it's basically free. You do have to set up a billing account though with a credit card.

Anton Tananaev5 months ago

I don't think that's a correct assessment of pricing. Loading each tile is an API call.

n5na5 months ago

Hmmm...I think you're right. I guess a map is made up of many tiles.

I've set a daily quota on my API so I assume when the quota is reached it will quit working.