# Google maps marker location from gps coordinate in dataset

**URL:** <https://forum.wixstudio.com/t/google-maps-marker-location-from-gps-coordinate-in-dataset/4511>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [February 28, 2023, 3:58pm UTC](https://forum.wixstudio.com/t/google-maps-marker-location-from-gps-coordinate-in-dataset/4511 "2023-02-28T15:58:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![philip4554](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/philip4554/32/26943_2.png) [@philip4554](https://forum.wixstudio.com/u/philip4554)\
**Post date:** [February 28, 2023, 3:58pm UTC](https://forum.wixstudio.com/t/google-maps-marker-location-from-gps-coordinate-in-dataset/4511/1 "2023-02-28T15:58:51Z")

</div>

Here is the page: [https://philip5454.wixsite.com/chamonix-trail/photos/chavantsvaudagne-01](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?
