
mapbox
随笔记录下
爱吃鱼的康康
佛系
展开
-
mapbox创建自定义marker图标绑定弹框展示信息
/** * 创建自定义marker图标绑定弹框 */ let carMarker = [];//存放marker图标 for(let m= 0;m<gpsInfoList.length;m++){ let el = document.createElement("div"); el.className = "marker-car"+m; el.setAttribute(原创 2021-06-07 10:46:36 · 2379 阅读 · 3 评论 -
根据geojson不同数据类型渲染对应的点线面
//根据geojson不同数据类型渲染对应的点线面 let id = row.id;//点击表格行获取的 presionMap.uploadMangement(id).then(response=>{ if(response.data.data!=null){ if(row.dataType ==".geojson"){ let jsonPase = eval("("+response.data.data.fill原创 2021-06-03 14:01:52 · 607 阅读 · 0 评论 -
mapbox+turf+requestAnimationFrame方法实现轨迹巡航
/** 利用mapbox(js)+turf(js)+requestAnimationFrame方法 实现轨迹巡航 */ //点数据源 let carPoint = { "type":"FeatureCollection", "features":[{ "type":"Feature", "properties":{"bearing":""}, "geometry...原创 2021-06-03 11:22:01 · 1140 阅读 · 0 评论 -
记录mapbox绘制点和绘制线
/** * InitLayer 构造函数 * mapbox初始化地图 */function InitLayer(map){ this.map = map; this.coordsLineArray = [];//存放经纬度 this.k = 0;//记录几个点}/** * 绘制点图层 * 方法名 plottingMarker * e 事件 * */InitLayer.prototype.plottingMarker = function plottingMa原创 2021-01-27 15:33:14 · 2826 阅读 · 4 评论 -
mapbox中对同一个图层layer,设置不同颜色要素
/** * 同一图层layer的不同要素feature设置不同的颜色 * InitLayer 构造函数 * mapbox初始化地图 */function InitLayer(map){ this.map = map; this.jsonPoints ={ "type":"FeatureCollection", "features":[] }}/** * 添加点图层 paint是layer的一个属性,负责图层的渲染与呈现。 * mat原创 2020-12-31 14:43:11 · 4206 阅读 · 0 评论 -
基于mapbox和truf.js实现地图上测距
/** * mapbox实现在地图上测距 * 先初始化地图得到map对象 */function Ceju(map){ this.map = map;//初始化map this.markers = [];//存放markers图标 this.points = [];//存放点信息 this.inintClick = true;//判断是否是双击还是单击 this.tmp = 0;//记录点图层的长度 this.only = 0;//标识markers原创 2020-12-31 13:15:54 · 834 阅读 · 0 评论