This topic describes how to configure a map to display query results.
Background information
You can color and mark a map to display geographic data. Log Service provides three types of maps: map of China, world map, and AMap. The display modes of an AMap include the anchor point and heat map. You can include specific functions in query statements to display analysis results as maps.
Each map consists of the following elements:
- Map canvas
- Colored area
Procedure
Example of a map of China
To display query results on a map of China, you can execute the following query statement
that includes the ip_to_province function:
* | select ip_to_province(remote_addr) as address, count(1) as count group by address order by count desc limit 10
Select address for Provinces and count for Value Column.

Example of a world map
To display query results in a world map, you can execute the following query statement
that includes the ip_to_country function:
* | select ip_to_country(remote_addr) as address, count(1) as count group by address order by count desc limit 10
Select address for Country and count for Value Column.

Example of an AMap
To display query results on an AMap, you can execute the following query statement
that includes the ip_to_geo function. The address column in the dataset contains the
latitude and longitude values, which are separated by a comma (,). If the longitude
and latitude values are contained in two separate columns named lng and lat, you can
use the
concat('lat', ',', lng')
function to combine the two columns into one column.* | select ip_to_geo(remote_addr) as address, count(1) as count group by address order by count desc limit 10
By default, the display mode of the anchor points is returned. If the anchor points are densely distributed on the map, you can select the display mode of heat map.