Python 带有标签和标记的 Folium 地图
Python Folium maps with label and marker
我正在尝试学习叶子并尝试在我的区域周围放置标记和标签。
但是我在第 22 行遇到错误。
我无法解决这个问题。
文件“ipython-input-43-4e44e7187a3d”,第 22 行
home_map.add_child(家)
^
语法错误:语法无效
如有线索,我们将不胜感激。
#Home with intial zoom
import numpy as np # useful for many scientific computing in Python
import pandas as pd # primary data structure library
import folium
#define My Home's geolocation coordinates
home_latitude = 28.000000
home_longitude = 77.000000
# define the world map centered around Canada with a higher zoom level
home_map = folium.Map(location=[home_latitude, home_longitude], zoom_start=15, tiles='Stamen Terrain')
home = folium.map.FeatureGroup()
home.add_child(folium.features.CircleMarker(
[home_latitude, home_longitude],
radius=5, # define how big you want the circle markers to be
color='yellow',
fill=True,
fill_color='blue',
fill_opacity=0.6)
home_map.add_child(home)
#label the marker
folium.Marker([home_latitude, home_longitude], popup= 'Home').add_to(home_map)
# display world map
home_map
你忘了加一个)
home.add_child(folium.features.CircleMarker(
[home_latitude, home_longitude],
radius=5, # define how big you want the circle markers to be
color='yellow',
fill=True,
fill_color='blue',
fill_opacity=0.6
) #<= here
)
我正在尝试学习叶子并尝试在我的区域周围放置标记和标签。 但是我在第 22 行遇到错误。 我无法解决这个问题。
文件“ipython-input-43-4e44e7187a3d”,第 22 行 home_map.add_child(家) ^ 语法错误:语法无效
如有线索,我们将不胜感激。
#Home with intial zoom
import numpy as np # useful for many scientific computing in Python
import pandas as pd # primary data structure library
import folium
#define My Home's geolocation coordinates
home_latitude = 28.000000
home_longitude = 77.000000
# define the world map centered around Canada with a higher zoom level
home_map = folium.Map(location=[home_latitude, home_longitude], zoom_start=15, tiles='Stamen Terrain')
home = folium.map.FeatureGroup()
home.add_child(folium.features.CircleMarker(
[home_latitude, home_longitude],
radius=5, # define how big you want the circle markers to be
color='yellow',
fill=True,
fill_color='blue',
fill_opacity=0.6)
home_map.add_child(home)
#label the marker
folium.Marker([home_latitude, home_longitude], popup= 'Home').add_to(home_map)
# display world map
home_map
你忘了加一个)
home.add_child(folium.features.CircleMarker(
[home_latitude, home_longitude],
radius=5, # define how big you want the circle markers to be
color='yellow',
fill=True,
fill_color='blue',
fill_opacity=0.6
) #<= here
)