365bet现场滚球静态地图API
静态图API介绍
天地图地图静态图API,可实现将天地图地图以图片形式嵌入到您的网页中。您只需发送HTTP请求访问天地图静态图服务,便可在网页上以图片形式显示您的地图。静态图API较之JavaScritp API载入的动态网站,既能满足基本的地图信息浏览,又能加快网页访问速度。 静态图API是Web服务天地图API服务中的一种,它根据所设定的参数,通过标准HTTP协议,返回PNG格式的地图图片。通过给<img>标签设置src属性即可将地图图片显示在网页中。用户可以指定图片的尺寸、地图型类、图的显示范围(包含中心点和缩放级别),还可以放置一些覆盖物在地图上,以生成符合需求的地图图片。
http://api.tianditu.gov.cn/staticimage?center=116.40,39.93&width=400&height=300&zoom=10&tk=您的密钥
默认的是矢量底图和中文注记地图在后面加上T相应的参数就会输出相应的静态底图图片例如:
http://api.tianditu.gov.cn/staticimage?center=116.40,39.93&width=400&height=300&zoom=10&layers=vec_c,eva_c&tk=您的密钥
示例描述:返回400 x 300尺寸,中心点位在北京的地图图片。
功能介绍:
输出PNG格式的地图图片,地图大小、显示范围、缩放级别可设定。
可输出添加多种覆盖物的地图图片,包括普通标注点、自定义样式标注点、标签、折线和多边形M
接口说明
使用条款与限制:
欢迎使用天地图HTML5 API。
请求频率无限制,URL请求长度为2048, 点标记数量26个
服务地址:
http://api.tianditu.gov.cn/staticimage
组成说明:
域名: http://lbs.tianditu.gov.cn
服务名: staticimage
<img 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 400 图片宽度 取值范围:[1, 1024]。
height 300 图片宽度 取值范围:[1, 1024]。
center 116.39127,39.90712 地图中心点位置,参数为经纬度坐标。坐标格式:lng <经度>,lat <纬度>,116.39127,39.90712。
zoom 10 地图级别,取值范围[3,18]。
markers null 标注,为经纬度格式,多个标注之间用竖线隔开,如: lng1,lat1|lng2,lat2|lng3,lat3。
zoom 10 与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 null 折线,可通过经纬度描述;折线之间用竖线"|"分隔;每条折线的点之间用分号";"分隔;点坐标用逗号","分隔。坐标格式:lng <经度>,lat <纬度>,例如116.39127,39.90712。
pathStyles null 折线样式 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
null 此参数是为了获得当前给定中心点经纬度、宽度、和高度范围后,用户自己想在生成的静态图上标注,本参数就是将指定的经纬度坐标转换成静态图上相对于静态图左上角(0,0)的屏幕坐标,返回的字符串为双竖线隔开的坐标对。当请求中有此参数时,优先处理此参数。markers,markerStyles,paths,pathStyles参数都不起作用, 参数格式为:lng0,lat0|lng1,lat1|lng2,lat2。
应用实例
一般底图展示:
http://api.tianditu.gov.cn/staticimage&tk=您的密钥
http://api.tianditu.gov.cn/staticimage?center=116.40,39.93zoom=14&layers= img_c,cva_c&tk=您的密钥
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=您的密钥