Here is the page: https://philip5454.wixsite.com/chamonix-trail/photos/chavantsvaudagne-01
Here is the code:
import wixData from ‘wix-data’ ;
$w . onReady ( function () {
});
export function dynamicDataset_ready ( ) {
$w ( ‘#text42’ ). text = “Dataset Ready” ;
let currentItem = $w ( ‘#dynamicDataset’ ). getCurrentItem ();
$w ( ‘#googleMaps1’ ). location = {
“latitude” : currentItem . latitude ,
“longitude” : currentItem . longitude
}
}
export function button1_click ( event ) {
$w ( ‘#text42’ ). text = “Button Pressed” ;
let currentItem2 = $w ( ‘#dynamicDataset’ ). getCurrentItem ();
$w ( ‘#googleMaps1’ ). location = {
“latitude” : currentItem2 . latitude ,
“longitude” : currentItem2 . longitude
}
}
I got this from a YT video explaining the same scenario. In my case the correct thing happens when I click the button but when the page loads its showing the wrong location. I have no idea why. Dataset ready should be the trigger?