map in slideshow

So i can see that i have to try and declare the values for latitude, longitude and location. All i’m trying to do is pull the address from the collection onto the map on the dynamic page

The selector isn’t valid for the field key or google map 1 at the moment so i do not know what to enter in # as i already have the address stored in the collection

I’m not sure what let address . value is as i have no other element

@adcatch02 The GoogleMap component does not have a .value property. You need to use the .location property to set and retrieve the location.

Also, you first try to get the address from the map, and then immediately after you try to set it with ltrAddress field from currentItem . Do you have a ltrAddress field in your database collection? What does your db collection look like?

@yisrael-wix Hi Yisrael,

ok how do i do this. This is everything i have in regards to this code
ltrAddress is the field key in my collection that has the address input from google places API as follows and within that field you can see its been broken down into address, latitude and longitude

on my dynamic page i have a google map and thats it really.

How would i write the code to so that it works with the location property?
Thanks
Adam

@adcatch02 See the location API for setting the map location.

Furthermore, the error in your code seems to indicate that you don’t have a latitude field in your location. You will need to check the data in your collection.

@yisrael-wix thanks Yisrael so i’ve added the API but not sure about the latitude field, currently the entire field key is set as address should this be set as a number?

The problem is that you use semicolons instead of commas inside the object.

Which object ?

@adcatch02 lines 35-37 in your last screenshot should have a commas instead of semicolons.

great that has removed those errors thanks @J.D.
last thing to sort out is this
An error occurred in one of datasetReady callbacks TypeError: undefined is not an object (evaluating ‘myLocation.latitude’)

Probably $w(“#googleMaps1”).location is undefined.

It’s 100% ltrAddress as fieldkey. Now do I need to declare ltrAddress somewhere as a value in the code ? Apart from
lines 35-37

Should address, latitude, longitude start with a capital A, L and L respectively ?

@jonatandor35 How do I define googlemaps1 ?

I’m wondering if line 34 is the problem as the content within the fieldkey says address not location ?

I don’t understand your code.
How can you use myLocation in lines 30-32 if you only declare it in line 33?
And what’s the purpose of lines 30-33? What are you trying to do? Where are you using the values you retrieve on lines 30-32?

@jonatandor35 sorry J.D. i’m trying to follow the instructions that you guys have been giving me to show a collection map location on the map on the page.

I don’t know how i keep going wrong. So from what you maybe saying is put line 33 code above line 30?

I would massively appreciate the correct code snippet to show the location from the collection on the page map. I would love to achieve this before the new year, so i will keep trying but obviously keep getting it wrong