Adding City to Looker Google Map

Hello I’m pretty new to Looker i have been working with Looker Studio for sometime and we used to have only the city as dimension and works fine with Google Maps in Looker Studio

Now trying to replicate the same in Looker its not working for the cities its works only for the countries with the map_layer_name: countries

is there something similar for cities or the only choice is going with (lang,lat) because we dont have those

No Reply ??

You don’t really need a map layer for cities. You just need to create dimension of type “location” to make your points appear on the map

@Dawid thanks for the reply

but when i change my dimension to location it gives this error

The “location” field type does not use the “sql” parameter. Please use “sql_latitude” and “sql_longitude” instead.

my lookml code

dimension: main_city {
type: location
description: “main city description”
sql: ${TABLE}.main_city ;;
}

Exactly, you need to split your longitude and latitude into two fields

Thats the whole issue i was talking about in looker studio i just had the city names and using the google map visualization i was able to visualize acurately but in Looker i dont have this and i need
lang, lat for each city which i dont have

I can see two possible options:

That’s what Data Studio does in the background, connects to the Google APIs to reverse geocode it but since it’s based on a city name, the results may be inaccurate (one place name → multiple locations). There’s nothing native in Looker to get that information, you need to supply Looker with latitude and longitude

1 Like