python-visualization / python-visualization/folium

Adding a colormap to a Layer or FeatureGroup

未关闭
#399 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

enhancement
主要语言
Python
星标
7.4k
派生
2.3k
平均合并
17 小时 22 分钟
30 天内合并 PR
11

描述

Hopefully, this is just a case of I'm-Doing-It-Wrong.

I'd like to be able to associate a colormap with a specific layer (e.g. GeoJson or TopoJson layer), independently of say, another layer of just markers or just a different choropleth layer. This way, if I deselect a layer in the LayerControl, both the GeoJson layer and the associated colormap go away (which also lets me have a separate colormap per Geo/TopoJson layer).

I've tried adding the colormap to the layer itself as well as adding both the layer and colormap to a FeatureGroup, but neither of these approaches seem to work.

Have a look at: https://github.com/eddies/folium/blob/59f88bca397a600b138abfc21591373ac3a66a78/tests/test_colormap_layer.py for an example (sorry, it's not a Jupyter notebook--long story about problems w/ Jupyter and virtualenvs)

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 tests/test_colormap_layer.py 开始,并运行现有示例,以了解 colormap 如何附加到 GeoJson、TopoJson 和 FeatureGroup 图层。完成的标准是:图层的 colormap 在 LayerControl 中跟随该图层,在取消选择图层时消失,同时不同图层可以分别保留各自的 colormap。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, python
领域
data-visualization
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。