Location:

Map Capture

Service Introduction

According to the parameters entered by the user, draw the map and return the screenshot of the map. The returned result is in PNG format.

Interface address

https://lbs.navinfo.com/open-api/map/v1/snapshot

Request method

POST
request header Content-Type is application/json; charset=UTF-8, body is json string.

Request parameters

See the following table for the description of map snapshot parameters::

Parameter Type Meaning Required Default Remarks

ak

string

Developer Key

Yes

If there is no key, please apply

width

int

image width

Yes

Unit: pixel; Greater than 0

height

int

image height

Yes

Unit: pixel; Greater than 0

zoom

int

map zoom level

Yes

greater than or equal to 0

center

string

center point coordinates

No

support g02 or g84 coordinate,example:116.35609,39.92374

coordType

string

coordinate type

No

Default: g02,
g02: National Survey Office (gcj02) coordinates.
g84: coordinates acquired by GPS device

ratio

int

map ratio

No

Default: 1,
options: 1 ,
2

graph

json

The map information to be drawn can not be transmitted when only screenshots are take

No

example. {markers:[],line:[]}

markers

json

draw markers

No

lonlat

string

Longitude and latitude coordinates of points on the map

Yes

Support 02 or 84 coordinate;example:116.35609,39.92374

name

string

The name displayed on the dimension marker

No

nameX

int

The x-axis distance from the name to the marked point

No

Unit: pixel; Default: 0

nameY

int

The y-axis distance from the name to the marked point

No

Unit: pixel; Default: 0

x

int

The x-axis offset of the marker

No

Unit: pixel; Default: 0

y

int

The y-axis offset of the marker

No

Unit: pixel; Default: 0

color

string

The color of the marker name

No

Color values are in RGB mode;example:#FF0000;default:#000000(black)

iconColor

string

icon Color

No

Effective only when the default icon is used; The color value adopts RGB mode; For example: #ff0000; Default: #1296db (blue)

fontSize

int

Y-axis offset of the marker

No

Unit: pixel; Default: 0

fontFamily

string

fontFamily

No

default : Open Sans Regular,Fonts now supported :Open Sans Regular,Alibaba PuHuiTi Light,Alibaba PuHuiTi Bold,Alibaba PuHuiTi Heavy,Alibaba PuHuiTi Medium,Alibaba PuHuiTi Regular

iconUrl

string

URL address of custom marker icon

No

When the value is empty, the default icon is used. The icon size limit is 1024 wide and 1024 high; Currently only PNG format is supported

lines

json

draw lines

No

linePoints

linePoints

polyline geometry data

Yes

Includes line geometry and color parameters

points

array

the coordinates of line

Yes

support g02 or g84 coordinate;exapmle:["116.35609,39.92374","116.35609,39.92372"]; At least two latitude and longitude points are required

color

string

line color

No

The color value adopts RGB mode; example: #ff0000; Default: #000000 (black)

width

int

line width

No

Unit: pixel; Default value: 2; Range: 0-100

style

int

Shape of line

No

0 is a solid line and 1 is a dotted line; Default: 0

opacity

float

opacity of lines

No

Range: 0-1; Default: 0.6

circles

json

draw circle

No

lonlat

string

Latitude and longitude coordinates of a circle on a map

Yes

support g02 or g84 coordinate;exapmle:116.35609,39.92374

distance

float

半径

Yes

Default unit: km; Greater than or equal to 0

color

string

The color of the circle border

No

The color value adopts RGB mode; For example: ff0000; Default: ff0000 (red)

unit

string

Radius unit

No

Optional parameters: miles, kilometers, degrees, radians; default value: kilometers

width

string

The border width of the circle drawn

No

Unit: pixel; Default value: 2; Range: 0-100

style

int

The shape of the border line

No

0 is a solid line and 1 is a dotted line; Default: 0

backgroundColor

string

Color of circle

No

The color value adopts RGB mode; For example: #ff0000; Default: #00ff00 (green)

backgroundOpacity

float

opacity of circles

No

Range: 0-1; Default: 0.6

polygons

json

draw polygon

No

points

array

Longitude and latitude array of inflection points of border segments

Yes

Support g02 or g84 coordinate ; example: ["116.35609,39.92374","116.35609,39.92372"];Note: the beginning and end must be the same latitude and longitude point.

color

string

The color of the polygon border

No

The color value adopts RGB mode; For example: #ff0000; Default: #ff0000 (red)

width

int

The thickness of the border

No

Unit: pixel; Default value: 2; Range: 0-100

style

int

The shape of the border line

No

0 is a solid line and 1 is a dotted line; Default: 0

backgroundOpacity

float

opacity of rectangle

No

Range: 0-1; Default: 0.6

backgroundColor

string

The color of the polygon

No

The color value adopts RGB mode; For example: #ff0000; Default: #00ff00 (green)

rects

json

draw rectangle

No

start

string

Longitude and latitude of the upper left corner of the rectangle

Yes

Support g02 or g84 coordinate; example:["116.35609,39.92374","116.35609,39.92372"]

end

string

Longitude and latitude of the lower right corner of the rectangle

Yes

Support g02 or g84 coordinate; example:["116.35609,39.92374","116.35609,39.92372"]

color

string

The color of the polygon border

No

The color value adopts RGB mode; For example: ff0000; Default: ff0000 (red)

width

int

The thickness of the border

No

Unit: pixel; Default value: 2; Range: 0-100

backgroundOpacity

float

opacity of rectangle

No

Range: 0-1; Default: 0.6

backgroundColor

string

The color of the rectangle

No

The color value adopts RGB mode; For example: #ff0000; Default: #00ff00 (green)

style

int

The shape of the border line

No

0 is a solid line and 1 is a dotted line; Default: 0

Response data

Return Value Type Meaning Remarks

status

int

Return status

See status code tablefor details.

Service example

Parameter Type Meaning Required Remarks

ak

你的ak

string

Developer Key

Yes

Click to apply

Run


                        
TOP