赞
踩
前段时间一直想把mapbox的底图添加到cesium中,一直没找到方法。刚刚在cesium的api 中找到了相关的接口,发现现在各种应用开发越来越简便了;里面相关参数写的很详细,如下:
以下是代码:
- /*
- * @Author: dzj
- * @Date: 2020-01-06 18:37:18
- * @LastEditTime : 2020-01-06 18:38:40
- * @LastEditors : Please set LastEditors
- * @Description: In User Settings Edit//
- * @FilePath: \undefinedg:\学习文档汇总\cesium\cesiumAPI.js
- */
-
- // 添加mapbox自定义地图实例
- var layer=new Cesium.MapboxStyleImageryProvider({
- url:'https://api.mapbox.com/styles/v1',
- username:'dengzengjian',
- styleId: 'ck5290o2z121u1cle7mdtfmdk',
- accessToken: 'pk.eyJ1IjoiZGVuZ3plbmdqaWFuIiwiYSI6ImNqbGhnbWo1ZjFpOHEzd3V2Ynk1OG5vZHgifQ.16zy39I-tbQv3K6UnRk8Cw',
- scaleFactor:true
- });
-
-
- viewer.imageryLayers.addImageryProvider(layer);
再上张效果图:
关注我,及时获取更多干货
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。