python-3.x - 属性错误 : 'Map' object has no attribute 'Marker'

标签 python-3.x geopandas folium

我有以下代码:

import folium
from folium.plugins import MarkerCluster

map1 = folium.Map(location=SF_COORDINATES, zoom_start=12)
marker_cluster = MarkerCluster().add_to(map1) 

for each in data[0:MAX_RECORDS].iterrows():
    map1.Marker(location = [each[1]['Y'],each[1]['X']], 
    clustered_marker = True).add_to(marker_cluster)

display(map1)

我收到此错误消息:

AttributeError: 'Map' 对象没有属性 'Marker'

有人可以帮忙吗?谢谢。

最佳答案

Markerfolium 的一部分,而不是 folium.Map 的一部分。

参见 folium Getting Started .

关于python-3.x - 属性错误 : 'Map' object has no attribute 'Marker' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53064690/

相关文章:

python - Scrapy - 无法在 XMLFeedSpider 中发出额外请求

python - 具有功能的自定义异常

python - 将一个 GeoPandas 数据框中的每个点链接到另一个数据框中的多边形

python - 运行使用 folium 的可执行文件时,Branca Python 模块无法找到 2 个必要的 json 文件

python-3.x - PyCharm 中的 Folium map 问题

python - Tkinter 中的 if 语句被 else 语句删除

python - 属性错误 : module 'fiona' has no attribute '_loading'

python - 在 OSMnx map 顶部绘制折线

python - 与 Folium 中标记的数字范围相关的颜色范围

从分割点索引整数区间的 Pythonic 方法