- Print
- PDF
raster
- Print
- PDF
We are preparing a localization service for the content. We will do our best to provide the localization service as soon as possible.
Overview
Static Map is a service that helps you easily use NAVER Maps to display locations on your web page, without requiring JavaScript.
To get the image you want within an HTML page, you should create a URL that fits the request format and place it in the <img> tag.
Request
ID-KEY based authentication
curl "https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300¢er=127.1054221,37.3591614&level=16" \
-H "X-NCP-APIGW-API-KEY-ID: {Client ID issued when registering an application}" \
-H "X-NCP-APIGW-API-KEY: {Client Secret issued when registering an application}" -v
HTTP Referer based authentication
- If your browser calls IMG tags or Ajax, you can call them at the URL below. You must register the Web service URL with the corresponding application for the reference certificate. For more information, Refer User guide > AI·NAVER API > Common Guide > Application How to use Application > How to register application
<img src="https://naveropenapi.apigw.ntruss.com/map-static/v2/raster-cors?w=300&h=300¢er=127.1054221,37.3591614&level=16&X-NCP-APIGW-API-KEY-ID={Client ID issued when registering an application}">
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
crs | string | N | Coordinate system. It is WGS8 coordinate system (EPSG:4326) if not specified. Supported coordinate systems are as follows: - EPSG:4326: WGS84 longitude and latitude - NHN:2048: UTMK - NHN:128: Katech TM128 - EPSG:4258: GRS80 longitude and latitude - EPSG:4162: Bessel longitude and latitude - EPSG:2096: Korea East Belt - EPSG:2097: Korea Central Belt - EPSG:2098: Korea West Belt - EPSG:3857 or EPSG:900913: Google Maps - EPSG:5179: Korea 2000 / Unified CS |
center | string | Y or N | Center coordinates. Enter a value in the “center=x-coordinate,y-coordinate” format. The order of x and y coordinates is based on the coordinate system specified. For example, if you choose the WGS84 lng-lat coordinate system, you should specify coordinates in the order of <longitude,latitude>. This parameter can be omitted if you specify the markers parameter. |
level | int | Y or N | Zoom level. This parameter can be omitted if you specify the markers parameter. - Input range: 0-20 |
w, h | int | Y | Width and height of the image. Enter a value in the “w=width&h=height” format. At least 1-1024 pixels supported. |
maptype | string | N | Map type. Available values are as follows: - basic: Basic map image (default) - satellite: Satellite map image - terrain: Terrain map |
format | string | N | Format of the image to return. Available values are as follows: - png: 24 bit (default) - jpg or jpeg: Compression quality of 85%, 24 bit |
scale | int | N | Option for supporting high resolution displays. Available values are as follows: - 1: Low resolution (default) - 2: High resolution |
markers | string | N | Specifies marker styles and locations. |
Request Header
The header is required only for ID-KEY-based authentication.
Header | Description |
---|---|
X-NCP-APIGW-API-KEY-ID | Client ID issued when registering an appX-NCP-APIGW-API-KEY-ID:{Client ID} |
X-NCP-APIGW-API-KEY | Client Secret issued when registering an appX-NCP-APIGW-API-KEY:{Client Secret} |
Request Body
- No request body required.
Response
Response Body
It returns an image file (in png or jpeg) based on the parameters specified, if the request is successfully made.
If an error occurs, an HTTP status code other than 200 is returned in JSON.
Examples
Request Example
center
Defines the coordinates of the center of the map.
- Format: center=x-coordinate,y-coordinate
The center coordinates are a comma-separated pair of x- and y-coordinates. The coordinates should be in the order of <longitude,latitude>.
Note that you can omit the center and level parameters if you specify the markers parameter to display a map at the optimized zoom level and location.
The following example requests an image of which the center coordinates are 127.1054221,37.3591614 based on the WGS86 coordinate system.
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300¢er=127.1054221,37.3591614&level=16
The center of the following image is the center coordinates.
level
Sets the zoom level of the map.
- Format: level=Zoom level
The zoom level is at least 1 and up to 20.
Note that you can omit the center and level parameters if you specify the markers parameter to display a map at the optimized zoom level and location.
The following example requests a map at level 11.
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300¢er=127.1054221,37.3591614&level=11
A map at level 11 is displayed as follows.
w, h
Sets the width and height of the map image. The width and height can be between 1 and 1024 pixels, respectively.
- Format: w=Width&h=Height
The following example requests a map 300 pixels wide and 200 pixels high.
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=200¢er=127.1054221,37.3591614&level=16
A map in the requested size is displayed as follows.
maptype
Defines the map type.
- Format: maptype=basic|satellite|terrain
- basic: Basic map type.
- satellite: Satellite map type.
- terrain: Terrain map type.
Basic
The following example requests a basic map.
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300¢er=127.1054221,37.3591614&level=11&maptype=basic
A basic map is displayed as follows.
Satellite
The following example requests a satellite map.
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300¢er=127.1054221,37.3591614&level=11&maptype=satellite
A satellite map is displayed as follows.
Terrain
The following example requests a terrain map.
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300¢er=127.1054221,37.3591614&level=11&maptype=terrain
A terrain map is displayed as follows.
format
Sets the format of the map image.
- Format: format=Image format (png or jpg or jpeg)
The format of the image to return is png or jpeg (jpg). - png (default) is a 24-bit PNG format. If this parameter is not specified or it is set to an unsupported format, it is considered “png.”
- jpeg (jpg) is a 24-bit JPEG format with the compression quality of 85%. (Both jpg and jpeg keywords are supported.)
png
The following example requests a map image in PNG.
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300¢er=127.1054221,37.3591614&level=16&format=png
A map in JPEG is displayed as follows.
jpeg (jpg)
The following example requests a map image in JPEG (JPG).
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300¢er=127.1054221,37.3591614&level=16&format=jpg
A map in JPEG is displayed as follows.
scale
Sets the option for supporting high resolution displays.
- Format: scale=1|2
- 1: Low resolution image. It returns a 256 x 256 tile based image created with the requested w and h (in pixels). It is the default value, and can be omitted.
- 2: High resolution image. It returns a 512 x 512 tile based image created with the requested w and h. That is, it returns the same map coverage area as a request with scale=1, but with twice as many pixels in each dimension. For example, if a map with 320 x 320 is requested, a 640 x 640 image is returned.
Low resolution
The following example requests a low resolution map (scale=1).
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300¢er=127.1054221,37.3591614&level=16&scale=1
A low resolution map is displayed as follows.
High resolution
The following example requests a high resolution map (scale=2).
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300¢er=127.1054221,37.3591614&level=16&scale=2
A high resolution map is displayed as follows.
markers
Adds markers at specified locations on the map. It adds as many markers as the requested number, which can be up to 20.
If you specify the markers parameter without specifying the center and level parameters, the API returns a map containing markers at the optimized zoom level and locations.
- Format: markers=property:value|property:value1,value2|...
Property | Value | Required | Default | Description | Example |
---|---|---|---|---|---|
type | d (default), n (number), a (alphabet) | N | d | Marker type | type:d or type:n |
size | tiny, small, mid | N | mid | Marker size. If it is type, the label is omitted. | size:tiny or size:small |
color | Pre-defined color or 0xFFFFFF (24-bit color code) | N | None | It is 0x08da76 by default if not specified. Pre-defined colors are character strings defined for frequently used colors. Pre-defined colors are listed below: - Default: 0x08DA76 - Blue: 0x029DFF - Orange: 0xFE8C52 - Yellow: 0xFFBA01 - Red: 0xFF6355 - Brown: 0xA4885B - Green: 0x63AA41 - Purple: 0xD182C8 - Gray: 0x666666 | color:green or color:0x00FF00 |
label | A-Z, 0-9 | N | None | Displays only markers if not specified. | label:A, label:9 |
pos | x1 y1,x2 y2, ... | Y | None | Location at which a marker is to be displayed. Multiple locations can be added. | pos:127.15(empty space)38.15,126.12(empty space)37.523 |
viewSizeRatio | 0.1~2.0 | N | 1.0 | Adjusts the marker size based on the default design for each marker type and size. - Only one decimal place allowed. - It is 0.1 if less than 0.1, and 2.0 if greater than 2.0. | viewSizeRatio:2.0 |
Default markers
The following examples request various default markers (type:d) and show result images.
- Request by size - size:tiny
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300&markers=type:d|size:tiny|pos:127.1054221%2037.3591614
- Request by size - size:small
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300&markers=type:d|size:small|pos:127.1054221%2037.3591614
- Request by size - size:mid
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300&markers=type:d|size:mid|pos:127.1054221%2037.3591614
- Request multiple sized markers - size:mid + small + tiny
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300&markers=type:d|size:mid|pos:126.9865479%2037.5612557&markers=type:d|size:small|color:red|pos:126.9870479%2037.5695075%2C126.9950680%2037.5612557%2C126.9743160%2037.5620754&markers=type:d|size:tiny|color:green|pos:126.9810479%2037.5695075%2C126.9950680%2037.5672557%2C126.9843160%2037.5570754
- Change color - red
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300&markers=type:d|size:small|pos:127.1054221%2037.3591614|color:red
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300&markers=type:d|size:small|pos:127.1054221%2037.3591614|color:0xFF6355
- Change size - 0.5
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300&markers=type:d|size:mid|pos:127.1054221%2037.3591614|viewSizeRatio:0.5
- Change size - 2
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300&markers=type:d|size:mid|pos:127.1054221%2037.3591614|viewSizeRatio:2.0
Number markers
- Combination of multiple number markers
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300&markers=type:n|size:mid|pos:126.9865479%2037.5612557|label:1&markers=type:n|size:small|color:blue|pos:126.9870479%2037.5695075|label:2&markers=type:n|size:small|color:blue|pos:126.9950680%2037.5612557|label:3&markers=type:n|size:small|color:blue|pos:126.9743160%2037.5620754|label:4
Alphabet markers
- Combination of multiple alphabet markers
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300&markers=type:a|size:mid|pos:126.9865479%2037.5612557|label:a&markers=type:a|size:small|color:blue|pos:126.9870479%2037.5695075|label:b&markers=type:a|size:small|color:blue|pos:126.9950680%2037.5612557|label:c&markers=type:a|size:small|color:blue|pos:126.9743160%2037.5620754|label:d
Tooltip markers
- Marker size is fixed to tiny
- label contents will be presented as tooltip
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?crs=EPSG:4326&scale=1&format=png&w=375&h=258&markers=type:t|pos:126.9616187%2037.507435|label:%EB%8F%99%EC%9E%91%EA%B5%AC,%20%EC%84%9C%EC%B4%88%EA%B5%AC,%20%EA%B4%80%EC%95%85%EA%B5%AC&markers=type:t|color:blue|pos:126.96060539999999%2037.507685699999996|label:%EB%8F%99%EC%9E%91%EA%B5%AC,%20%EC%84%9C%EC%B4%88%EA%B5%AC,%20%EC%9A%A9%EC%82%B0%EA%B5%AC%20%EB%B0%A9%EB%A9%B4&markers=type:t|color:0xEE3A3A|pos:126.9616377%2037.506708950000004|label:%EB%8F%99%EC%9E%91%EA%B5%AC,%20%EC%84%9C%EC%B4%88%EA%B5%AC,%20%EC%9A%A9%EC%82%B0%EA%B5%AC%20%EB%B0%A9%EB%A9%B4
Custom markers
Defines custom markers (external markers).
Customer markers have the following limitations.
- The maximum size of a custom marker is 64 x 64 pixels for default displays, and 128 x 128 pixels for high resolution retina displays (scale=2).
- If there is no response within 2 seconds from the request URL of a custom marker, creating a custom marker will stop.
- Custom markers can remain with internal cache for up to 1 day. If only the marker image is changed with the same URL, the custom marker may not be updated for up to 1 day.
- The svg and image formats are supported.
Property | Value | Required | Default | Description | Example |
---|---|---|---|---|---|
type | e (external) | Y | None | Custom marker type | type:e |
icon | URL path | Y | None | URL path. png and svg formats are available. | icon:http://aaa/bbb.svg or icon:http://aaa/bbb.png |
anchor | Location where the marker is displayed | N | bottom(0.5, 1.0) | Offset value of the marker image location on the map. It is used to delicately adjust the location where the marker is displayed. It can be set to a double or text type. A double type can have a precision to two decimal places (0.00-1.00), and can be specified in the order of xOffset and yOffset. (Example: 0.0,0.0 for the top left, and 1.0,1.0 for the bottom right) A text type can be specified as follows. - top: 0.5, 0.0 - bottom: 0.5, 1.0 (default) - left: 0.0, 0.5 - right: 1.0, 0.5 - center: 0.5, 0.5 - topleft: 0.0, 0.0 - topright: 0.0, 1.0 - bottomleft: 1.0, 0.0 - bottomright: 1.0, 1.0 For example, for a pin-shaped icon which is usually displayed based on the bottom center of the image, a double type value is “double:0.5,1.0” and a text type value is “text:bottom.” | anchor:0.5,0.0 or anchor:top |
pos | x1 y1,x2 y2, ... | Y | None | Location at which a marker is to be displayed. Multiple locations can be added. | pos:127 38,126 37 |
The following example requests a custom marker.
https://naveropenapi.apigw.ntruss.com/map-static/v2/raster?w=300&h=300&scale=2&markers=type:e|anchor:center|icon:https://aaa.bbb.com/icon/construction-medium@2x.png|pos:127.0597827%2037.5118871
The following map is displayed as a result.
Error Codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | 100 | Bad request | The request contains invalid parameters. |
500 | 900 | Internal error | An internal error has occurred. If the problem persists, contact us. |
503 | 500 | Service Unavailable | The service is temporarily unavailable for system maintenance. Please try again later. |
504 | 510 | Gateway Timeout | The service is temporarily unavailable because of system overload. Please try again later. |