def plot_route(route, park_names, latitudes, longitudes, display_text=True):
    """
    Arguments:
        - route: List[int]: The order of the parks to visit (shape (n,))
        - park_names: List[str]: The names of the parks (shape (n,))
        - latitudes: np.ndarray: The latitudes of the parks (shape (n,))
        - longitudes: np.ndarray: The longitudes of the parks (shape (n,))
        - display_text: bool: Whether to display the park names on the map
    """
    fig = px.scatter_geo(
                    lat=latitudes,
                    lon=longitudes,
                    scope='usa',
                    text=park_names if display_text else None,
                    title='Parks in the US',
                    width=800,
                    height=500)


    # add route lines to the map
    for i in range(len(route)):
        i_next = (i + 1) % len(route)
        fig.add_trace(
            px.line_geo(lat=[latitudes[route[i]], latitudes[route[i_next]]],
                        lon=[longitudes[route[i]], longitudes[route[i_next]]]).data[0]
        )

    # set text_size to small
    fig.update_traces(textfont_size=6, textposition='bottom center')

    fig.show()