jupyter笔记本中的mapbox gl:添加自定义标记

时间:2020-07-06 07:18:48

标签: python jupyter-notebook mapbox geospatial mapbox-gl

我在jupyter笔记本中使用mapbox-gl,我希望能够更改标记样式或添加自定义标记。但是,根据此处的文档:enter image description here,我需要更新index.html文件。

在Jupyter笔记本中渲染地图,我认为我无法访问html文件。有没有一种方法或参数可以帮助我更改标记样式。

理想情况下,我想对在jupyter笔记本中渲染的地图实施此操作:https://docs.mapbox.com/help/tutorials/custom-markers-gl-js/#add-html-markers

这是代码(请参考此处的示例:https://docs.mapbox.com/help/tutorials/custom-markers-gl-js/#add-html-markers):

# Generate data breaks and color stops from colorBrewer
color_breaks = mapclassify.classifiers.Natural_Breaks(LeaseSample['Col1'], k=4, initial=0).bins
color_stops = create_color_stops(color_breaks, colors='YlOrRd')

# Create the viz from the dataframe
viz = CircleViz(df,
                access_token=token,
                height='400px',
                color_property = "Col1",
                label_property = 'Col1',
                label_size = 12,
                label_color = '#131516',
                color_stops= color_stops,
                center = (-112.0913905, 33.4514652),
                stroke_width = 0.7,
                zoom = 10,
                below_layer = 'waterway-label'
               )

viz.show() 

https://github.com/mapbox/mapboxgl-jupyter

0 个答案:

没有答案
相关问题