{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "name": "folium_walkthrough_4.ipynb", "provenance": [], "private_outputs": true, "collapsed_sections": [], "authorship_tag": "ABX9TyMBWUFQAZS9dLhxOPVEFEZU", "include_colab_link": true }, "kernelspec": { "name": "python3", "display_name": "Python 3" } }, "cells": [ { "cell_type": "markdown", "metadata": { "id": "view-in-github", "colab_type": "text" }, "source": [ "<a href=\"https://colab.research.google.com/gist/Caellwyn/776f6a1f8a971d7ebacdd461fa87e7fe/folium_walkthrough_4.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" ] }, { "cell_type": "code", "metadata": { "id": "s15304zrgRO6" }, "source": [ "# Add popups to each marker. Use HTML code to artfully display\n", "# hours, images, contact information, and the names of the \n", "# organizations that hosts the markets.\n", "\n", "for index, row in df.iterrows():\n", " text = f\"\"\"\n", " <h3><b> {row.Name} </b></h3><br>\n", " <p style=\"text-align:center;\">{row.hours}</p> \n", " <p style=\"text-align:center;\">\n", " <img src=\"https://bit.ly/3iOISd4\" alt=\"Farmer's Market Photo\" style = \"width:200px;height:200px;\"> \n", " <br>\n", " Image Courtesy of Kyle Neiber<br></p>\n", " <p style=\"text-align:center;color:blue\">\n", " {row.org_name}<br>\n", " {row.phones}\n", " </p>\n", " \"\"\"\n", " folium.Marker(\n", " [row['latitude'],row['longitude']],\n", " popup = folium.Popup(text, max_width = 400),\n", " tooltip = row['Name']).add_to(farmers_markets)\n", " \n", "farmers_markets" ], "execution_count": null, "outputs": [] } ] }