[folium] MarkerCluster

SOOYEON·2022년 11월 9일
0

pandas

목록 보기
36/37
import requests
import pandas as pd
import numpy as np
import folium
from folium.plugins import MiniMap


from folium.plugins import MarkerCluster
mc = MarkerCluster()

minimap = MiniMap() 
m = folium.Map(location=[36.6907215, 128.1486511],   # 중심좌표 : 문경시 36.6907215, 128.1486511
                   zoom_start= 7)
def marker_map(df):
    
    # minimap
    m.add_child(minimap)
    
    # Marker
    for i in range(len(df)):
        mc.add_child(
            folium.Marker([df['y'][i],df['x'][i]],
                          tooltip=df['place_name'][i],
                          popup =folium.Popup(df['address_name'][i],
                                              max_width=450, max_height=450),
                          icon=folium.Icon(color = 'blue',icon='ok')
                         )
        )
        m.add_child(mc)
    return m
mc_map(df)

0개의 댓글