Skip to content

Commit

Permalink
Update vehicle_live_map.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ezracohen1 committed Jul 23, 2021
1 parent 6281484 commit d83a801
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions vehicle_live_map.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@

import json
import folium
with open('vehicles-location.json') as myfile:
vehicle_data=[myfile.read()]
def main():
with open('vehicles-location.json') as myfile:
vehicle_data=[myfile.read()]
print(get_ids_locations(vehicle_data))
#for i in vehicle_data:
# map = folium.Map(vehicle_data.value("001078f6-acfd-42fe-8c9c-84cecbb83630", 'location'))
#map.save('html')


dict(vehicle_data)
map = folium.Map(vehicle_data.value("001078f6-acfd-42fe-8c9c-84cecbb83630", 'location'))
map.save('html')
class Vehicle:
def __init__():
id=

def
def get_ids_locations(list_of_dicts):
ids=[]
latitudes=[]
longitudes=[]
for i in list_of_dicts:
for key, value in list_of_dicts.items():
if type(value) is dict and key=="location":
get_ids_locations(value)
else:
if key=="lat":
latitudes.append(value)
elif key=="lng":
longitudes.append(value)
elif key=="id":
ids.append(value)
return ids, latitudes, longitudes

0 comments on commit d83a801

Please sign in to comment.