Drawing a non-square map with pydeck

Hi all,

I’m drawing a map using Pydeck and it works great, but i’m looking for a way that the map won’t be square but a rectangle. or alternatively, drawing the map giving 4 coordinates, one for each corner.

thanks!

Hi @yehren -

The Deck class object takes height and width, do those accomplish what you are trying to do?

https://pydeck.gl/deck.html#deck

Best,
Randy

Thanks @randyzwitch,
Unfortunately i’m changing both height and width but it doesn’t make any change.

I’m developing with PyCharm with Streamlit version 0.69. maybe it is related somehow to the version but when i’m using the most updated version my app get stuck quickly…

Here is a piece of my code which draw the map:

pp = pdk.Deck(
            initial_view_state=viewstate,
            height=1000,
            width='100%',
            map_provider='mapbox',
            # api_keys='MAPBOX_API_KEY',
            map_style="mapbox://styles/mapbox/light-v9",
            #map_style=pdk.map_styles.SATELLITE,
            layers=[slayer, tlayer],
            tooltip=tooltip
        )

        deckchart = st.pydeck_chart(pp, use_container_width=True)

maybe there is another flag to enable? or any other sujestion?
Thanks!
Yair

In this case, I think your issue is because you are both using height/width and use_container_width. So your map will be overridden to the column width.

What happens if you do height=1000 and width = 1500?

I tried to set use_container_width=True or False and changed height and width to 1000 and 1500 and to other values but the map insist to stay in the exact same size…