Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the size of the map through variables #66

Open
rfarkv opened this issue Jan 23, 2025 · 1 comment
Open

Change the size of the map through variables #66

rfarkv opened this issue Jan 23, 2025 · 1 comment

Comments

@rfarkv
Copy link

rfarkv commented Jan 23, 2025

Hi!
I'm using variables to set height and weight, something like this:

string mapaHeight = "100vh";
string mapaWidth = "100vw";

       <RealTimeMap @ref="realTimeMap"  OnMouseUpMap="onMouseUpMap" OnClickMap="onClickMap" OnAfterMapLoaded="@AfterMapLoaded" OnZoomLevelEndChange="@OnZoomLevel" Parameters="parameters" height=@mapaHeight width=@mapaWidth ></RealTimeMap>

Then i have a method that do some stuff and calculate the new site of the map, i then change the value of the variables:

public void string ChangeMapSize()
{
        ...
        mapaWidth = "50vw";
        mapaHeight = 50vh";

       StateHasChanged();
}

The problem is the map is not changing, at all.
I change both variables, and call StateHasChanged, nothing happens. Am i missing something?

@rfarkv
Copy link
Author

rfarkv commented Jan 23, 2025

@ichim after i update the variables (ChangeMapSize method) if i open dev tools on Edge, the map is updated with the correct values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant