import folium
import numpy as np
import pandas
from folium.plugins import MarkerCluster
import os
# df=pandas.read_csv(r'..\notebooks2\twitterposts\tweethistory_trail_510_since2018-05-03.csv')
df=pandas.read_csv(r'C:\Users\kimhs\Google Drive\Work_related\notebooks2\twitterposts\tweethistory_#ValleyFair_20180611.csv')
# print(df)
lats = df['lat']
longs = df['long']
tweet = df['text']
# Try to add in address later
# fullAddress = str(list(zip(address, city, state, zipcode)))
# print(fullAddress)
#-----------------------------
# With Plotname -- broken :..(
# locationInfo = list(zip(plotnames, lats, longs))
# popups = ['Plotname: {}; <br>long: {}<br>lat: {}'.format(plotnames, longs, lats) for (plotnames, lats, longs) in locationInfo]
#-----------------------------
# No Plotname
locationInfo = list(zip(lats, longs))
popups = ['<br>long: {}<br>lat: {}'.format(longs, lats) for (lats, longs) in locationInfo]
# Get list of lats/longs to feed the popups.
# Add different tiles: https://deparkes.co.uk/2016/06/10/folium-map-tiles/
m = folium.Map(
location=[np.mean(lats), np.mean(longs)],
# tiles='Cartodb Positron',
# tiles='MapQuest Open Aerial',
zoom_start=13
)
# Create new Leaflet MarkerClusterGroup from js lib
marker_cluster = MarkerCluster(
name='Valley Fair Tweets',
overlay=True,
control=True,
icon_create_function=None
)