# map in slideshow

**URL:** <https://forum.wixstudio.com/t/map-in-slideshow/31810>\
**Category:** Ask the community\
**Tags:** question, code, wix-stores\
**Created:** [December 20, 2019, 7:02am UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810 "2019-12-20T07:02:15Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![adcatch02](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/adcatch02/32/12916_2.png) [@adcatch02](https://forum.wixstudio.com/u/adcatch02)\
**Post date:** [December 20, 2019, 7:02am UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810/1 "2019-12-20T07:02:15Z")

</div>

on a dynamic page i’m trying to connect the address in collection that was created with google places API using the wix user address input

I have tried several code variations as follows

**let** myLocation = $w(“#googleMaps1”).location;

**let** txtGoogleMapsName = $w(‘#someDataSetName’).getCurrentItem().title;  
**let** txtGoogleMapsLat = $w(‘#someDataSetName’).getCurrentItem().latitude;  
**let** txtGoogleMapsLong = $w(‘#someDataSetName’).getCurrentItem().longitude;

```
    $w("#googleMaps1").location = { 

```

“longitude”: txtGoogleMapsLong,  
“latitude”: txtGoogleMapsLat,  
“description”: txtGoogleMapsName

and this one which is a mash up of the code used on the page where an address input is located with a map

in my case the address is now stored in the collection

**function** viewAddressOnMap(address) {  
$w.onReady( **function** () {  
$w(“#dynamicDataset”).onReady( () =\> {  
**let** currentItem = $w(“#dynamicDataset”).getCurrentItem();  
viewAddressOnMap(address);  
$w(“#googleMaps1”).location = {  
“latitude”: address.location.latitude,  
“longitude”: address.location.longitude,  
“description”: address.formatted  
};  
});

thanks Adam

---

<div class="post-metadata">

**Author:** ![anastasiias](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/anastasiias/32/15771_2.png) [@anastasiias](https://forum.wixstudio.com/u/anastasiias)\
**Post date:** [December 20, 2019, 9:06am UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810/2 "2019-12-20T09:06:59Z")

</div>

Hey, Adam.

Did you check [this example](https://www.wix.com/corvid/forum/corvid-tips-and-updates/example-using-the-places-api-from-google-maps-services) that might be exactly what you need?

If this is the example you were referring to, please share the link to your site so we can take a look at it.

Thanks!

---

<div class="post-metadata">

**Author:** ![adcatch02](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/adcatch02/32/12916_2.png) [@adcatch02](https://forum.wixstudio.com/u/adcatch02)\
**Post date:** [December 20, 2019, 9:50am UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810/3 "2019-12-20T09:50:23Z")

</div>

Thanks website link here  
[https://editor.wix.com/html/editor/web/renderer/edit/b9f34163-10d4-42dd-b95e-2deec974cdd0?metaSiteId=594d236f-b270-48eb-bf5b-6399d04830fd&editorSessionId=cbf8001c-50f3-4c13-8d1e-caa2cd65b4bb&referralInfo=dashboard](https://editor.wix.com/html/editor/web/renderer/edit/b9f34163-10d4-42dd-b95e-2deec974cdd0?metaSiteId=594d236f-b270-48eb-bf5b-6399d04830fd&editorSessionId=cbf8001c-50f3-4c13-8d1e-caa2cd65b4bb&referralInfo=dashboard)

on element fullWidthSlides1 which is on dynamic page fullName

and the address is in the collection under ltrAddress field key

Thanks  
Adam

---

<div class="post-metadata">

**Author:** ![adcatch02](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/adcatch02/32/12916_2.png) [@adcatch02](https://forum.wixstudio.com/u/adcatch02)\
**Post date:** [December 27, 2019, 11:37am UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810/4 "2019-12-27T11:37:46Z")

</div>

Hi i was really hoping that someone would have helped me with this by now.  
Thanks in Hoping  
Adam

---

<div class="post-metadata">

**Author:** ![adcatch02](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/adcatch02/32/12916_2.png) [@adcatch02](https://forum.wixstudio.com/u/adcatch02)\
**Post date:** [December 27, 2019, 12:07pm UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810/5 "2019-12-27T12:07:17Z")

</div>

ok so i have tried this code as i have Lat, Long and Description in my collection from using Google / Wix places API

1. $w.onReady( function () {

2. $w(“#dataset1”).onReady( () =\> {

3. let currentItem = $w(“#dataset1”).getCurrentItem();

4. $w(“#googleMaps1”).location = {

5. “latitude”: currentItem.latitude,

6. “longitude”: currentItem.longitude,

7. “description”: currentItem.location,

8. };

9. });

10. });

I am getting the following error messages from line 4.

 ![](https://us1.discourse-cdn.com/wix/original/3X/8/4/841f83d470aab4dfb875e8271dd1971d77a7239d.png)

---

<div class="post-metadata">

**Author:** ![adcatch02](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/adcatch02/32/12916_2.png) [@adcatch02](https://forum.wixstudio.com/u/adcatch02)\
**Post date:** [December 27, 2019, 12:14pm UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810/6 "2019-12-27T12:14:02Z")

</div>

I have the address saved as address field key in the collection and the input was configured using the places API from wix address input

---

<div class="post-metadata">

**Author:** ![adcatch02](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/adcatch02/32/12916_2.png) [@adcatch02](https://forum.wixstudio.com/u/adcatch02)\
**Post date:** [December 29, 2019, 5:05pm UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810/7 "2019-12-29T17:05:29Z")

</div>

Hi guys, from Wix or Wix Masters 🙂 can I get some help here please  
Thanks  
Adam

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [December 29, 2019, 5:13pm UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810/8 "2019-12-29T17:13:56Z")

</div>

Make sure that the field type is number + that the value is a number and that the value exists.

---

<div class="post-metadata">

**Author:** ![adcatch02](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/adcatch02/32/12916_2.png) [@adcatch02](https://forum.wixstudio.com/u/adcatch02)\
**Post date:** [December 29, 2019, 5:34pm UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810/9 "2019-12-29T17:34:25Z")

</div>

I would love to screen shot the database entry based on the api places input but I know it’s in address format. So how do separate the address from the number because I guess if I change the field key to number only it still won’t work. Sorry this is a mobile response.

---

<div class="post-metadata">

**Author:** ![adcatch02](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/adcatch02/32/12916_2.png) [@adcatch02](https://forum.wixstudio.com/u/adcatch02)\
**Post date:** [December 29, 2019, 10:26pm UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810/10 "2019-12-29T22:26:57Z")

</div>

ok so i changed the field key from address to number but this hasn’t worked on its own. in the code above if its correct is lat, long and description picking up the correct values ?

---

<div class="post-metadata">

**Author:** ![adcatch02](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/adcatch02/32/12916_2.png) [@adcatch02](https://forum.wixstudio.com/u/adcatch02)\
**Post date:** [December 29, 2019, 10:35pm UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810/11 "2019-12-29T22:35:01Z")

</div>

ah currentItem is for a repeater right? but this map has been placed in a slideshow

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [December 30, 2019, 11:08am UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810/12 "2019-12-30T11:08:51Z")

</div>

.getCurrentItem() is for dynamic dataset.  
Adam, your description is not detailed enough and it’s hard to understand, what values you have in your collection.

---

<div class="post-metadata">

**Author:** ![adcatch02](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/adcatch02/32/12916_2.png) [@adcatch02](https://forum.wixstudio.com/u/adcatch02)\
**Post date:** [December 30, 2019, 12:33pm UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810/13 "2019-12-30T12:33:42Z")

</div>

Thanks J.D. this is the collection field key view and the one that i’m trying to link to the map on the dynamic page

![](https://us1.discourse-cdn.com/wix/original/3X/4/1/41971c24709eef9a5498fa9c99cb5461c7a5455c.png)

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [December 30, 2019, 12:44pm UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810/14 "2019-12-30T12:44:30Z")

</div>

So you need to extract the values:

```javascript
currentItem.ltrAdress.location.latitude;//use your field key instead of ltrAdress

```

and do the same to the longitude

---

<div class="post-metadata">

**Author:** ![adcatch02](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/adcatch02/32/12916_2.png) [@adcatch02](https://forum.wixstudio.com/u/adcatch02)\
**Post date:** [December 30, 2019, 1:06pm UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810/15 "2019-12-30T13:06:54Z")

</div>

ltrAddress is the field key but address, latitude and longitude are sub fields within the field key

and i’m not sure how location fits with this

 ![](https://us1.discourse-cdn.com/wix/original/3X/7/f/7fb5c5eeeb5d5890ff8fe5bebfc24cfecfbf9672.png)

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [December 30, 2019, 1:24pm UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810/16 "2019-12-30T13:24:27Z")

</div>

Have a look:  
[https://www.wix.com/corvid/reference/$w.AddressInput.html#Address](https://www.wix.com/corvid/reference/$w.AddressInput.html#Address)

---

<div class="post-metadata">

**Author:** ![adcatch02](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/adcatch02/32/12916_2.png) [@adcatch02](https://forum.wixstudio.com/u/adcatch02)\
**Post date:** [December 30, 2019, 1:41pm UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810/17 "2019-12-30T13:41:27Z")

</div>

thanks

1. ltrAddress is fieldkey
2. and googleMaps1 is the map on the page

 ![](https://us1.discourse-cdn.com/wix/original/3X/5/b/5bf06bdfa220d792691bd0731a23fce335cf6e57.png)

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [December 30, 2019, 2:07pm UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810/18 "2019-12-30T14:07:22Z")

</div>

Delete lines 33-46.  
Make sure you use the correct selector in line 30.  
Change lines 50-52 so they’ll fit to the structure of the address object:

```javascript
"latitude": currentItem.ltrAdress.location.latitude;

```

---

<div class="post-metadata">

**Author:** ![adcatch02](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/adcatch02/32/12916_2.png) [@adcatch02](https://forum.wixstudio.com/u/adcatch02)\
**Post date:** [December 30, 2019, 2:21pm UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810/19 "2019-12-30T14:21:23Z")

</div>

I think i’m getting there but let address = $w(“#”).value; is neither the field key (ltrAddress) or googleMaps1 and i do not have another page element ?

 ![](https://us1.discourse-cdn.com/wix/original/3X/d/5/d52b57ff9bee8ab4a4d1f9b74ef9fe5a606a964b.png)

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [December 30, 2019, 2:28pm UTC](https://forum.wixstudio.com/t/map-in-slideshow/31810/20 "2019-12-30T14:28:49Z")

</div>

I don’t understand what you’re doing and what you’re trying to do.  
what is $w(“#”).value. It’s not a valid selector.  
and why do you have a } in line 32?  
and delete line 35.

[Next page](https://forum.wixstudio.com/t/map-in-slideshow/31810.md?page=2)
