源码复制成功复制失败全屏 复制 运行

自定义图例组件

#map { position:absolute; top:0; bottom:0; width:100%; }

.infolegend {

padding: 6px 8px;

font: 14px/16px Arial, Helvetica, sans-serif;

background: white;

background: rgba(255,255,255,0.8);

box-shadow: 0 0 15px rgba(0,0,0,0.2);

border-radius: 5px

}

.infolegend h4 {

margin: 0 0 5px;

color: #777;

}

.legend {

line-height: 18px;

color: #555;

}

.legend i {

width: 18px;

height: 18px;

float: left;

margin-right: 8px;

opacity: 0.7;

}

var scene = new L7.Scene({

id: 'map',

mapStyle: 'light', // 样式URL

center: [120.19382669582967, 30.258134],

pitch: 0,

zoom: 4,

zoomControl: false,

scaleControl: false

});

scene.on('loaded', function() {

var colors = ["#FFF5B8", "#FFDC7D", "#FFAB5C", "#F27049", "#D42F31", "#730D1C"];

$.getJSON('https://gw.alipayobjects.com/os/rmsportal/JToMOWvicvJOISZFCkEI.json', function(city) {

scene.PolygonLayer().source(city).color('pm2_5_24h', function(p) {

if (p > 120) {

return colors[5];

} else if (p > 65) {

return colors[4];

} else if (p > 30) {

return colors[3];

} else if (p > 15) {

return colors[2];

} else if (p > 8) {

return colors[1];

} else {

return colors[0];

}

}).shape('fill').active(true).style({

opacity: 1

}).render();

var legend = new L7.Control.Base({

position: 'bottomright'

});

legend.onAdd = function() {

var el = document.createElement('div');

el.className = 'infolegend legend';

var grades = [0, 8, 15, 30, 65, 120];

for (var i = 0; i < grades.length; i++) {

el.innerHTML += ' ' + grades[i] + (grades[i + 1] ? '–' + grades[i + 1] + '
' : '+');

}

return el;

};

legend.addTo(scene);

});

});

自定义图例组件

#map { position:absolute; top:0; bottom:0; width:100%; }

.infolegend {

padding: 6px 8px;

font: 14px/16px Arial, Helvetica, sans-serif;

background: white;

background: rgba(255,255,255,0.8);

box-shadow: 0 0 15px rgba(0,0,0,0.2);

border-radius: 5px

}

.infolegend h4 {

margin: 0 0 5px;

color: #777;

}

.legend {

line-height: 18px;

color: #555;

}

.legend i {

width: 18px;

height: 18px;

float: left;

margin-right: 8px;

opacity: 0.7;

}

var scene = new L7.Scene({

id: 'map',

mapStyle: 'light', // 样式URL

center: [120.19382669582967, 30.258134],

pitch: 0,

zoom: 4,

zoomControl: false,

scaleControl: false

});

scene.on('loaded', function() {

var colors = ["#FFF5B8", "#FFDC7D", "#FFAB5C", "#F27049", "#D42F31", "#730D1C"];

$.getJSON('https://gw.alipayobjects.com/os/rmsportal/JToMOWvicvJOISZFCkEI.json', function(city) {

scene.PolygonLayer().source(city).color('pm2_5_24h', function(p) {

if (p > 120) {

return colors[5];

} else if (p > 65) {

return colors[4];

} else if (p > 30) {

return colors[3];

} else if (p > 15) {

return colors[2];

} else if (p > 8) {

return colors[1];

} else {

return colors[0];

}

}).shape('fill').active(true).style({

opacity: 1

}).render();

var legend = new L7.Control.Base({

position: 'bottomright'

});

legend.onAdd = function() {

var el = document.createElement('div');

el.className = 'infolegend legend';

var grades = [0, 8, 15, 30, 65, 120];

for (var i = 0; i < grades.length; i++) {

el.innerHTML += ' ' + grades[i] + (grades[i + 1] ? '–' + grades[i + 1] + '
' : '+');

}

return el;

};

legend.addTo(scene);

});

});

antv图例出现分页_自定义图例组件相关推荐

  1. antv图例出现分页_带图例、文本的饼图

    源码复制成功复制失败全屏 复制 运行 F2 图表组件库 - AntV var data = [{ amount: 20, ratio: 0.1, memo: '学习', const: 'const' ...

  2. R语言ggplot2可视化自定义图例标签间距实战:自定义图例标签间距、自定义图例与图像之间的间距

    R语言ggplot2可视化自定义图例标签间距实战:自定义图例标签间距.自定义图例与图像之间的间距 目录

  3. antv图例出现分页_图例-自定义文本样式

    源码复制成功复制失败全屏 复制 运行 F2 图表组件库 - AntV var data = [{ assetType: '债券资产', percent: 73.76, const: 'const' } ...

  4. page 怎么把list 分页_自定义分页器的实现

    前言 django也有自带额分页器,但是功能较少,使用起来较为繁琐.所以我们可以使用自定义非分页器. 自定义分页器的推导思路 # queryset对象是支持索引切片操作的(不支持负数索引) book_ ...

  5. echars 饼图环形图组件修改 自定义图例 重新渲染 显示对应颜色对应区域

    如图 产品有个需求是要做一个环形图 点击图例显示具体数字 但图例加起来是超过百分百的 如图 一个范围内有男有女有丑逼 点击男的显示男的 点击女的显示女的 并且显示占总数的百分比 并且鼠标悬浮上去显示的 ...

  6. antv图例出现分页_2020,贴地飞行的 AntV 设计

    前不久,一年一度的数据可视化产品 AntV 品牌发布日又来到,今年我们给大家带来了"贴地飞行"的 AntV 设计.为什么称之为"贴地飞行"?这一年中,AntV ...

  7. 数据科学 IPython 笔记本 8.9 自定义图例

    8.9 自定义图例 原文:Customizing Plot Legends 译者:飞龙 协议:CC BY-NC-SA 4.0 本节是<Python 数据科学手册>(Python Data ...

  8. html中legend样式,echarts自定义图例legend文字和样式

    话不多说,先上效果图. 要完成这个图并不难,主要是下面那个图例比较难,需要定制. 让我们从官方文档找找思路,官方文档关于legend.formatter是这样的:链接在这 难点在于: 1.这里的图例文 ...

  9. python使用matplotlib可视化、为可视化图像添加图例(legend)、自定义图例的字体格式、字体大小、字体颜色等

    python使用matplotlib可视化.为可视化图像添加图例(legend).自定义图例的字体格式.字体大小.字体颜色等 目录

最新文章

  1. iscsi lun extend---windows客户端
  2. 20165303实验一 Java开发环境的熟悉
  3. laravel 安装配置前准备
  4. “腾讯电竞”向前,“腾讯游戏”向后
  5. c++函数模板(c++细节篇十)
  6. PCA、SVD、ZCA白化理论与实现
  7. axure8.0发布html,Axure 8.0 beta最后一批新增和改进功能的介绍
  8. redis的安装(Linux)和基本使用
  9. 基于kickstart实现网络共享以及制作光盘和U盘实现半自动安装centos6系统
  10. 自从用了Less 编写css,你比以前更快了~
  11. POJ NOI MATH-7831 计算星期几
  12. pycharm安装scrapy失败_python爬虫框架scrapy
  13. [LeetCode] Reverse Linked List 倒置链表
  14. linux免杀工具,安卓Apk免杀工具:backdoor-apk 教程
  15. 计算机信息专业致谢词,计算机专业毕业论文致谢词
  16. 如何优雅使用JDK8中的Stream对list集合中的某值求和
  17. 酷狗导致django8000端口占用
  18. 谷歌浏览器设置背景图片背景图
  19. Java高级之Git
  20. AjaxPro.NET使用,方便的在客户端直接调用服务端方法

热门文章

  1. CS229与《统计学习方法》的EM算法理解和比较,收敛性证明
  2. composer设置国内源
  3. java兔子繁殖总数_Java 兔子繁殖迭代问题
  4. JAVA开发讲义(一)-Java的自白
  5. UIAutomatorViewer初体验
  6. Python:实现euclidean distance欧式距离算法(附完整源码)
  7. MySQL数据库笔记
  8. 丢失MSVCR120.dll
  9. 第二期金牌网管师100%就业培训班招生简章
  10. RESTful从入门到熟练,看完这篇就够了