NREL / routee-compass

An energy-aware routing engine
https://nrel.github.io/routee-compass/
BSD 3-Clause "New" or "Revised" License
10 stars 5 forks source link

Add optional folium_map parameter to plot_routes_folium. #224

Closed vbmendes closed 4 months ago

vbmendes commented 4 months ago

Closes #199.

This PR adds the folium_map parameter to the plot_routes_folium function.

For this, I refactored the plot_route_folium and broke it into 3 helper functions:

  1. result_dict_to_coords to convert a result from CompassApp into a sequence of coordinates in the format (lat, lng).
  2. _create_empty_folium_map
  3. plot_coords_folium to plot the coordinates in a folium Map.

This way, I can reuse these three pieces of code in the plot_routes_folium function.