import pydeck as pdk
import os

# Map of San Francisco from 1906
here = os.path.dirname(os.path.abspath(__file__))
local_image = os.path.join(here, "../../fixtures/red-dot.png")


def create_local_image_test_object():
    # Specifies the corners of the image bounding box
    BOUNDS = [
        [-122.52690000000051, 37.70313158980733],
        [-122.52690000000051, 37.816395657523195],
        [-122.34604834372873, 37.816134829424335],
        [-122.34656848822227, 37.70339041384273],
    ]
    bitmap_layer = pdk.Layer(
        "BitmapLayer", id="b39571b8-7d3d-43bf-b846-9a3ca0e5a72f", image=local_image, bounds=BOUNDS, opacity=0.7
    )
    view_state = pdk.ViewState(
        latitude=37.7576171,
        longitude=-122.5776844,
        zoom=10,
        bearing=-45,
        pitch=60,
    )
    r = pdk.Deck(bitmap_layer, initial_view_state=view_state, map_provider="mapbox", map_style=pdk.map_styles.SATELLITE)
    return r
