शुरू करेंमुफ़्त में शुरू करें

Swapping Popups for Labels

Popups are great, but they require a little extra effort. That is when labels come to our aid. Using the label argument in the addCircleMarkers() function we can get more information about one of our markers with a simple hover!

ipeds %>% 
    leaflet()  %>% 
    addProviderTiles("CartoDB")  %>% 
    addCircleMarkers(label = ~name, radius = 2)

Labels are especially helpful when mapping more than a few locations as they provide quick access to detail about what each marker represents.

यह अभ्यास पाठ्यक्रम का हिस्सा है

Interactive Maps with leaflet in R

पाठ्यक्रम देखें

इंटरैक्टिव व्यावहारिक अभ्यास

इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।

# Add circle markers with labels identifying the name of each college
map %>% 
    addCircleMarkers(data = ca, radius = 2, label = ___)
कोड संपादित करें और चलाएँ