Open page in bottom sheet breaks Map property bindings

Scenario:
I have an app that is successfully using the map component with

  • markers set
  • initial location set
  • a slider value bound to the map component for dynamically changing the lat. & long. delta
  • a page variable bound to the map component visible property to toggle on & off the visibility to properly reset the map

I am also using the “Open page in bottom sheet” component.

I have attached the Open Bottom Sheet function to the marker pressed event of the Map component. When a marker is clicked on the map, The event is successfully received and the bottom sheet is opened.

When I swipe down to get rid of the Bottom Sheet it disappears off the screen as you would want.

Problem:
At this point, after the Open Bottom Sheet has been used the binding for the lat/long delta no longer works and the map component visibility binding no longer works. This means that the slider that dynamically sets the lat/long delta value doesn’t change the zoom on the map even though it worked before the Open Bottom Sheet was invoked.

Also, the button that sets the map component visiblity from false to true to re-initialize the map, no longer works. There is a page variable mapVisibility that successfully worked before showing the Bottom Sheet but it doesn’t set the map visibility to false then true after the bottom sheet is shown and then dismissed.

It would appear that the bindings for the lat/long delta (slider value) and the visibility property got disconnected?

Any thoughts would be greatly appreacited!

Hi! Sorry for the belated answer.

The page opened in the bottom sheet is a different page, so it doesn’t have access to the page variable or other variables present on the page below it. App variables have to be used for communicating between these pages, so please try moving the slider and toggle variables to use app variables instead and hopefully that would make everything work like you intended to :slight_smile:

Thanks for the response @Mevi !

My problem is actually somewhat the opposite of that.

The page variables that are meant to work on the main map page work fine with the map page. They break once I open and then close the bottom sheet.

I am not trying to access page variables from the open bottom sheet component. It is just the use of that bottom page that breaks the map page that I launch it from

Oh. Hmmm. Thanks for reporting this! I was able to reproduce the issue and report it further.

1 Like

Hi Mevi,

I’m having somewhat similar issues with the map component and dynamic binding.

I initially tried to directly bind the map’s markers to render to a data variable but I could not get the map to show without causing the app to crash. I therefore used an intermediary page variable to store the list of markers that I would load on the page prior to showing the map (to prevent the app from crashing), and that worked fine.

I cannot, however, use the same technic for the initial map region after I get the user’s location through the GPS location flow function (tried to bind the initial map region to the sensor values, to page variables, to output from a previous node…without success).

Using the debugger I can see that the variable values are correct, but the initial map region seems to only accept hardcoded values. Is this a known limitation or is there a specific way to pass the values to the map component?

Thanks :slight_smile:

Hmm :thinking: I have never tried to use it like that but it sounds like a very typical usecase and like you’ve tested it thoroughly – I would say it’s a bug, so please report it through our bug tracker! :slight_smile:

Sorry please disregard previous comments, managed to get it to work with two simple page variables of type number for longitude and latitude in the end (I was trying with an object with two fields of type number, which for some reason doesn’t seem to work).

1 Like