手绘地图导览瓦片图规则

手绘地图导览Iframe引用

手绘地图接入小程序webView的分享参数

接口名称

手绘地图导览瓦片图规则
更新时间:2021-08-08 15:42:26 查看相关接口

接口地址

接口说明

                                    
手绘地图相关信息,及拥有的级别和对应的瓦片图范围。

如仅做展示用,可考虑以iframe方式嵌入页面。参考接口“手绘地图导览Iframe引用
请求方式: get
参数说明
字段名是否必须数据类型是否参与签名说明
clientId必须int参与签名商家ID:和景运管家运营人员联系索要
mapId必须int参与签名地图ID:和景运管家运营人员联系索要
time必须float参与签名当前时间戳秒数,10位数字时间戳
platform不必须string如果传入,则参与签名地图的平台(高德:amap;百度:bmap;腾讯:tmap;谷歌:gmap)
sign必须string不参与签名签名结果字符串 加密规则:参考说明

返回参数说明:
字段名是否必须数据类型说明
pic_host必须string瓦片图域名
data必须list地图级别及对应的瓦片范围
err_code必须int返回错误码:0正常,其他值为异常
data.list:
字段名是否必须数据类型说明
zoom必须int地图级别
x_min必须int最小地图X轴瓦片图序号
x_max必须int最大地图X轴瓦片图序号
y_min必须int最小地图Y轴瓦片图序号
y_max必须int最大地图Y轴瓦片图序号
latitude必须float地图中心维度
longitude必须float地图中心经度
platform必须string地图的平台(amap:高德;bmap:百度;tmap:腾讯;gmap:谷歌)
瓦片图路径: /uploades/map/map_{mapId}/{zoom}/tile{x}_{y}.png 瓦片图URL即为:瓦片图域名 + 瓦片图路径
本系统手绘地图导览基于高德地图、百度地图、腾讯地图、谷歌地图开放平台开发。 百度地图开发文档: https://lbsyun.baidu.com/index.php?title=jspopular3.0 高德地图开发文档: https://lbs.amap.com/api/javascript-api/summary

更多说明

//百度地图瓦片图加载示例代码(前端)
var fileHost = 'http://file.weijingtong.net';
var tileLayer = new BMap.TileLayer({isTransparentPng: true}); 
tileLayer.getTilesUrl = function(tileCoord, zoom) {
    var x = tileCoord.x;
    var y = tileCoord.y;
    var imagePath;
    var hasImg = true;
    if (false) {}
    
    //超出瓦片图范围
    else if( zoom == 10 && (x < 182 || x > 182 || y < 52 || y > 53 ) ){
           hasImg = false;
    } 
    //超出瓦片图范围
    else if( zoom == 11 && (x < 364 || x > 364 || y < 105 || y > 106 ) ){
           hasImg = false;
    } 
    //超出瓦片图范围
    else if( zoom == 12 && (x < 728 || x > 728 || y < 211 || y > 212 ) ){
           hasImg = false;
    } 
    //超出瓦片图范围
    else if( zoom == 13 && (x < 1457 || x > 1457 || y < 423 || y > 424 ) ){
           hasImg = false;
    } 
    //超出瓦片图范围
    else if( zoom == 14 && (x < 2914 || x > 2915 || y < 847 || y > 848 ) ){
           hasImg = false;
    } 
    //超出瓦片图范围
    else if( zoom == 15 && (x < 5829 || x > 5830 || y < 1695 || y > 1696 ) ){
           hasImg = false;
    } 
    //超出瓦片图范围
    else if( zoom == 16 && (x < 11658 || x > 11661 || y < 3390 || y > 3392 ) ){
           hasImg = false;
    } 
    //超出瓦片图范围
    else if( zoom == 17 && (x < 23316 || x > 23323 || y < 6780 || y > 6785 ) ){
           hasImg = false;
    } 
    //超出瓦片图范围
    else if( zoom == 18 && (x < 46632 || x > 46647 || y < 13560 || y > 13570 ) ){
           hasImg = false;
    } 
    //超出瓦片图范围
    else if( zoom == 19 && (x < 93265 || x > 93294 || y < 27121 || y > 27142 ) ){
           hasImg = false;
    }
     
    if (!hasImg) { 
        imagePath = fileHost + "/uploades/images/image/37/20210713/160026_732753.png"; //透明占位图
    }
    else{
        imagePath = fileHost + "/uploades/map/map_37/" + zoom + "/tile" + x + "_" + y + '.png?v=2021-08-07-00-14-02';  //根据当前坐标,选取合适的瓦片图
    }
    return imagePath;
}

var map = new BMap.Map('allmap', {enableMapClick: false, minZoom: 10, maxZoom: 19});
map.addTileLayer(tileLayer); 
当前时间:2024-09-19 09:45:22