Hello!
There is a way that i can add map in my dynamic page and connect it to the database?
Thank you :)
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
OK, thanks for all the great info.
Now a follow up question..
I have developed a custom Event Detail page on which I would like to place a map.
But as far as I can tell I cannot add columns to the Wix Events collection to store long and lat
Any idease?
Oh, i got it working now! Finally! My problem was that i inserted a map via html code. But i just had to use the map provided by WIX. Awesome!
Thank you for your input whoudoux. I also spotted that code a while ago in another discussion.
WIX keeps telling me that my location (in $w("#googleMaps1").location = .... is undefined. I mustve done something wrong because i dont hear anybody complaning about that. Haha
Plus, i think that my html code is not prepared for that function. It is centered on a specific point on the map and i dont prepare any marker function. But i honestly dont know what to write there exactly. Any hints?
Greetings, Dawd
Try this :
$w.onReady(function () {
$w("#dynamicDataset").onReady(() => {
let currentItem = $w("#dynamicDataset").getCurrentItem();
$w("#googleMaps1").location = {
"latitude": currentItem.latitude,
"longitude": currentItem.longitude,
"description": currentItem.description
};
});
});
Hey Roi,
i actually planned to use Yoavs code. I replaced his Information about the database and the html body with mine but WIX still gives me a lot of errors. The values i enter "arent valid selector names". Any clue why the code above wont work?
Greetings,
Dawd
Thanks Roi (I've been away) - shall be catching-up on this project and seeing if you're still around to help out.
Hi Gwix and Nevo,
Feel free to paste here your code.
We will have a look.
Roi
I agree with you. I am new at this too
Shame - I realise the system is still new but if anyone else has managed to pull google coordinates from a database to display a relevant map, can you share the process please? Yoav gave a good, quick response, but many of us just aren't that skilled enough to follow his instruction - I get errors I don't know what to do with...
No :(
Hey nevo - did you ever get this to work?
Thank you for the fast reply!
Hay nevo,
Sure you can, but you will need some coding.
The map APIs accept a geo location. Given you have the location in your database, lets assume in the field location, what you can is set the map location on the dataset onReady event.
$w('#DATASET').onReady(() => { let location = $w('#DATASET').getCurrentItem().location; let addressSummary = $w('#DATASET').getCurrentItem().address; $w('#MAP').location = { latitude: location.lat, longitude: location.long, description: addressSummary } });