http://api.tianditu.gov.cn/staticimage
组成说明:
域名:
http://lbs.tianditu.gov.cn
服务名: staticimage
src="http://api.tianditu.gov.cn/staticimage?center=116.40,39.93&width=400&height=300&zoom=10&layers=vec_c,eva_c&tk=您的密钥">
服务列表参数说明:
width
图片宽度 取值范围:[1, 1024]。
height
图片宽度 取值范围:[1, 1024]。
center
116.39127,39.90712
地图中心点位置,参数为经纬度坐标。坐标格式:lng
,116.39127,39.90712。
地图级别,取值范围[3,18]。
markers
标注,为经纬度格式,多个标注之间用竖线隔开,如: lng1,lat1|lng2,lat2|lng3,lat3。
与markers有对应关系,markerStyles可设置默认图标样式和自定义图标样式。同一个点的描述参数之间用逗号","隔开,不同点之间的风格描述用竖线"|"隔开,风格描述主要有size,label,url[,sLabel,fontColor,fontSize]。
尺寸size:取值为l,m,s,-1;l--大图标
m--中等图标 s--小图标,-1表示自定义图标,
默认图标的标签label:当尺寸取值为l或m时,label为图标的标签,取值为[0-9],[A-Z],
自定义图标资源url:当且仅当第一个参数为-1时,后面的url自定义图标、sLabel标注、fontColor,
字体颜色为字符串表示的16进制色码比如0xff0000表示红色、fontSize字号大小才起作用,
ontSize可选参数[,sLabel,fontColor,fontSize]:当且仅当第一参数为-1,url值不为空时,子标签为自定义图标标签。
注意:对于中文标签要用URI编码格式。
paths
折线,可通过经纬度描述;折线之间用竖线"|"分隔;每条折线的点之间用分号";"分隔;点坐标用逗号","分隔。坐标格式:lng
,例如116.39127,39.90712。
pathStyles
color,weight,opacity[,fillColor]取值范围:
颜色color:16进制表示的数值,如默认值蓝色0xff0000,
线宽weight:[1-40],默认值6,
透明度opacity:[0-1],默认值0.6,
填充图颜色fillColor:16进制表示的数值,
此参数为可选参当由此参数时,这些将自动封闭为面,并以此颜色填充面的颜色。
layers
vec_c,cva_c
表示静态图叠加层的类型,如:"vec_c,cva_c" 或者 "img_c,cva_c" 等,这样的类型组合 img_c--影像图,vec_c--矢量底图,
ter_c--地形图,
cva_c--中文注记,
eva_c--英文注记,cta_c--地形注记。
特别说明参数
pixLocation
此参数是为了获得当前给定中心点经纬度、宽度、和高度范围后,用户自己想在生成的静态图上标注,本参数就是将指定的经纬度坐标转换成静态图上相对于静态图左上角(0,0)的屏幕坐标,返回的字符串为双竖线隔开的坐标对。当请求中有此参数时,优先处理此参数。markers,markerStyles,paths,pathStyles参数都不起作用,
参数格式为:lng0,lat0|lng1,lat1|lng2,lat2。
http://api.tianditu.gov.cn/staticimage?center=116.40,39.93&width=500&height=500&zoom=13&layers=
ter_c,cta_c&tk=您的密钥
http://api.tianditu.gov.cn/staticimage?
center=116.40,39.93&width=500&height=500&zoom=12&layers=vec_c,cva_c
&markers=116.34867,39.94593|116.42626,39.94731|116.4551,39.90267
|116.43381,39.86766|116.34249,39.87178|116.32807,39.90748&tk=您的密钥
用大图标标注用数字做标签
http://api.tianditu.gov.cn/staticimage?
center=116.40,39.93&width=500&height=500&zoom=12&layers=vec_c,cva_c
&markers=116.34867,39.94593|116.42626,39.94731|116.4551,39.90267
|116.43381,39.86766|116.34249,39.87178|116.32807,39.90748 &markerStyles=
l,1|l,2|l,3|l,4|l,5|l,6&tk=您的密钥
用大图标标注用字母做标签
http://api.tianditu.gov.cn/staticimage?
center=116.40,39.93&width=500&height=500&zoom=12&layers=vec_c,cva_c
&markers=116.34867,39.94593|116.42626,39.94731|116.4551,39.90267
|116.43381,39.86766|116.34249,39.87178|116.32807,39.90748 &markerStyles=
l,A|l,B|l,C|l,D|l,E|l,F&tk=您的密钥
用中等图标标注用字母做标签
http://api.tianditu.gov.cn/staticimage?
center=116.40,39.93&width=500&height=500&zoom=12&layers=vec_c,cva_c
&markers=116.34867,39.94593|116.42626,39.94731|116.4551,39.90267
|116.43381,39.86766|116.34249,39.87178|116.32807,39.90748 &markerStyles=
m,A|m,B|m,C|m,D|m,E|m,F&tk=您的密钥
自定义图标标注位置
http://api.tianditu.gov.cn/staticimage?
center=116.40,39.93&width=730&height=500&zoom=12&layers=vec_c,cva_c
&markers=116.34867,39.94593|116.42626,39.94731|116.4551,39.90267
|116.43381,39.86766|116.34249,39.87178|116.32807,39.90748 &markerStyles=-1,
http://www.baidu.com/img/bdlogo.gif|-1, http://i1.sinaimg.cn/dy/deco/2013/0329/logo/LOGO_1x.png|-1,
http://news.sohu.com/upload/itoolbar/index/toolbar_logo.png|-1,
http://material.mediav.com/product/jd/logo/logo_760_100.jpg|-1,
http://www.bankofbeijing.com.cn/images/logo.gif|-1,
http://appserver.lenovo.com.cn/LenovoImage/Lenovo_index_great_03.jpg&tk=您的密钥
自定义标注标签
这里的中文名字要用URI编码格式代替
标注一:%E6%A0%87%E6%B3%A8%E4%B8%80
标注二:%E6%A0%87%E6%B3%A8%E4%BA%8C
标注三:%E6%A0%87%E6%B3%A8%E4%B8%89
标注4:%E6%A0%87%E6%B3%A84
标注5:%E6%A0%87%E6%B3%A85
标注6:%E6%A0%87%E6%B3%A86
http://api.tianditu.gov.cn/staticimage?
center=116.40,39.93&width=500&height=500&zoom=12&layers=vec_c,cva_c
&markers=116.34867,39.94593|116.42626,39.94731|116.4551,39.90267
|116.43381,39.86766|116.34249,39.87178|116.32807,39.90748 &markerStyles=-1, A,%E6%A0%87%E6%B3%A8%E4%B8%80|-1,
B,%E6%A0%87%E6%B3%A8%E4%BA%8C|-1, C,%E6%A0%87%E6%B3%A8%E4%B8%89|-1, D,%E6%A0%87%E6%B3%A84|-1,
E,%E6%A0%87%E6%B3%A85|-1, ,%E6%A0%87%E6%B3%A86&tk=您的密钥
自定义标注字体大小和颜色
http://api.tianditu.gov.cn/staticimage?
center=116.40,39.93&width=550&height=500&zoom=12&layers=vec_c,cva_c
&markers=116.34867,39.94593|116.42626,39.94731|116.4551,39.90267
|116.43381,39.86766|116.34249,39.87178|116.32807,39.90748 &markerStyles=-1, A,%E6%A0%87%E6%B3%A8%E4%B8%80|-1,
B,%E6%A0%87%E6%B3%A8%E4%BA%8C,0x9400D3,30|-1, C,%E6%A0%87%E6%B3%A8%E4%B8%89,,40|-1,
D,%E6%A0%87%E6%B3%A84,0xFF00FF,50|-1, E,%E6%A0%87%E6%B3%A85,0x00f0f0,60|-1,,%E6%A0%87%E6%B3%A86,0x00ff0a,70&tk=您的密钥
添加默认颜色风格的折线
http://api.tianditu.gov.cn/staticimage?
center=116.40,39.93&width=500&height=500&zoom=12&layers=vec_c,cva_c
&paths=116.34867,39.94593;116.42626,39.94731;116.4551,39.90267
|116.43381,39.86766;116.34249,39.87178;116.32807,39.90748&tk=您的密钥
添加自定义风格折线
http://api.tianditu.gov.cn/staticimage?
center=116.40,39.93&width=500&height=500&zoom=12&layers=vec_c,cva_c
&paths=116.34867,39.94593;116.42626,39.94731;116.4551,39.90267
|116.43381,39.86766;116.34249,39.87178;116.32807,39.90748 &pathStyles=0xff0000,8,0.7|0x00ff00,19,1&tk=您的密钥
添加面的应用
自定义面和标注---东海防空识别区
这里的中文名字用URI编码格式代替 中文名: 东海防空识别区
URI格式:%E4%B8%9C%E6%B5%B7%E9%98%B2%E7%A9%BA%E8%AF%86%E5%88%AB%E5%8C%BA
http://api.tianditu.gov.cn/staticimage?
center=121.97298,32.85941&width=500&height=500&zoom=5&layers=vec_c,cva_c
&paths=121.7833,33.1833;125.00,33.1833;128.6333,31.00;125.00,25.6333;
123.00,24.75;120.96666,26.73333;122.882,29.83268;121.7833,33.1833 &pathStyles=0x0000ff,5,0.6,0x0000f0
&markers=124.35765,30.41634 &markerStyles=-1,,%E4%B8%9C%E6%B5%B7%E9%98%B2%E7%A9%BA%E8%AF%86%E5%88%AB%E5%8C%BA&tk=您的密钥
http://api.tianditu.gov.cn/staticimage?
center=121.97298,32.85941&width=500&height=500&zoom=5&layers=img_c,cva_c,cta_c
&paths=121.7833,33.1833;125.00,33.1833;128.6333,31.00;125.00,25.6333;
123.00,24.75;120.96666,26.73333;122.882,29.83268;121.7833,33.1833
&pathStyles=0x0000ff,5,0.6,0x0000f0&markers=124.35765,30.41634
&markerStyles=-1,,%E4%B8%9C%E6%B5%B7%E9%98%B2%E7%A9%BA%E8%AF%86%E5%88%AB%E5%8C%BA&tk=您的密钥
标注标签、折线、填充面的应用
http://api.tianditu.gov.cn/staticimage?
center=116.40,39.93&width=500&height=500&zoom=12&layers=vec_c,cva_c
&markers=116.34867,39.94593|116.42626,39.94731|116.4551,39.90267
|116.43381,39.86766|116.34249,39.87178|116.32807,39.90748 &markerStyles=l,1|l,2|l,3|l,4|l,5|l,6
&paths=116.34867,39.94593;116.42626,39.94731;116.4551,39.90267;
116.43381,39.86766;116.34249,39.87178;116.32807,39.90748;116.34867,39.94593 &pathStyles=0x0000ff,4,0.5,0xff0000&tk=您的密钥
http://api.tianditu.gov.cn/staticimage?
center=116.40,39.93&width=500&height=500&zoom=12&layers=vec_c,cva_c
&markers=116.34867,39.94593|116.42626,39.94731|116.4551,39.90267
|116.43381,39.86766|116.34249,39.87178|116.32807,39.90748
&markerStyles=l,1|l,2|l,3|l,4|l,5|l,6&paths=116.34867,39.94593;
116.34249,39.87178;116.32807,39.90748;116.34867,39.94593|116.42626,39.94731;
116.4551,39.90267;116.43381,39.86766;116.42626,39.94731
&pathStyles=0x0000ff,4,0.5,0xff0000|0x0000ff,4,0.5,0x00ff00&tk=您的密钥
影像图叠加注记
http://api.tianditu.gov.cn/staticimage?
center=116.40,39.93&width=500&height=500&zoom=12&layers=img_c,cva_c,cta_c
&markers=116.34867,39.94593|116.42626,39.94731|116.4551,39.90267
|116.43381,39.86766|116.34249,39.87178|116.32807,39.90748 &markerStyles=l,1|l,2|l,3|l,4|l,5|l,6
&paths=116.34867,39.94593;116.34249,39.87178;116.32807,39.90748;
116.34867,39.94593|116.42626,39.94731;116.4551,39.90267;116.43381,39.86766;116.42626,39.94731
&pathStyles=0x0000ff,4,0.5,0xff0000|0x0000ff,4,0.5,0x00ff00&tk=您的密钥
使用参数pixLocation返回相对位置的屏幕标注坐标
http://api.tianditu.gov.cn/staticimage?
center=116.40,39.93&width=500&height=500&zoom=12&layers=vec_c,cva_c
&pixLocation=116.34867,39.94593|116.42626,39.94731|116.4551,39.90267
|116.43381,39.86766|116.34249,39.87178|116.32807,39.90748&tk=您的密钥
返回值坐标:101,204||327,200||411,330||349,432||83,420||41,316
上面的坐标是下面返回图的相对于左上角(0,0)的值,比如第一个坐标对101,204 表示距左侧101个像素和距上边204个像素的位置处,其他的点以此类推。
http://api.tianditu.gov.cn/staticimage?
center=116.40,39.93&width=500&height=500&zoom=12&layers=vec_c,cva_c&tk=您的密钥