Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你好,请问能否HTML页面的代码 #1

Open
hainanwangchao opened this issue Mar 23, 2018 · 1 comment
Open

你好,请问能否HTML页面的代码 #1

hainanwangchao opened this issue Mar 23, 2018 · 1 comment

Comments

@hainanwangchao
Copy link

你好,请问能否HTML页面的代码

@hsg77
Copy link

hsg77 commented Jul 19, 2019

下面加载没显示地图出来,后台byte[] data = dao.getContents(type, x, y, z);也是调用了的有返回值
这段代码哪里有问题?

function addMVTSourceLayer_vector()
{
    //"https://vector.mapzen.com/osm/all/{z}/{x}/{y}.mvt?api_key=vector-tiles-LM25tq4"
    //http://localhost:8081/xzq_xiang/1/1/1
    var titleUrl="http://localhost:8081/xzq_xiang/{z}/{x}/{y}";
    if(!map.getSource("MVT矢量瓦片数据")) {
        map.addSource("MVT矢量瓦片数据", {
                type: "vector",
                tiles: [titleUrl]
        });
    }
    if(!map.getLayer("MVT矢量瓦片数据")) {
        map.addLayer({//添加图层进行三维的显示
            'id': "MVT矢量瓦片数据",//图层名称
            'name':"MVT矢量瓦片数据",
            'type': 'fill',   //显示类型为fill,line,symbol,circle,heatmap,raster,hillshade,background,fill-extrusion
            'source': "MVT矢量瓦片数据",
            "source-layer": "MVT矢量瓦片数据",
            "filter": ["==", "$type", "Polygon"],  /* 数据过滤器 */
            "paint": {
                "fill-color": "#3887be"
            }
        });
    }
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants