How to retrieve googleMap information using Velo

Hi Gurus,

I am currently modifying the wix blog/post with an additional data collection and without datasets. The additional collection “PostMaster” references to the “post” collection and contains, among other things, the autocomplete address field from google maps.

  1. Now I am desperately trying to display the addresses in the “Post Master” collection address field → in a text field of the wix post page.

2.) Additionally I have the google map on the “post” page which should show the title, description and link at the pin. → Remark: A dataset does not work on the wix post page, so the data must come directly from the collection.

Maybe someone here has an idea?

Here is the code:

import wixData from ‘wix-data’;
import wixLocation from ‘wix-location’;

$w.onReady(function () {
articleCollection();
wixLocation.onChange(() => {
articleCollection();
});

});

function articleCollection() {
$w(‘#post1’).getPost()
.then((post) => {
let postId = post._id;
console.log(postId)
wixData.query(“PostMaster”)
.eq(‘postReference’, postId)
.find()
.then((results) => {

if (results.items.length > 0) {

$w(‘#companyAddress’).text = results.items[0].companyAddress;
//PROBLEM: THE TEXT FIELD IS BLANK AND DOES NOT SHOW THE ADDRESS FROM THE COLLECTION

$w(“#googleMaps”).title = results.items[0].companyName;
$w(“#googleMaps”).description = results.items[0].companyAddress;
$w(“#googleMaps”).link = results.items[0].companyLink;
//PROBLEM: PROPERTIES (TITLE, DESCRIPTION, LINK MIGHT BE WRONG

// THE LOCATION PIN WORKS:
$w(“#googleMaps”).location = results.items[0].companyAddress.location;
if (results.items[0].companyAddress) {
$w(“#googleMaps”).show();
} else {
$w(“#googleMaps”).collapse();
$w(“#googleMaps”).hide();
}