I'm having some trouble with Google maps not displaying Latitude and Longitude on a dynamic page. What I'm trying to do is view a location on the map using lat & long to be displayed per location...
top of page
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.
bottom of page
Just added the code into my page, it works perfect. No need to use rich text, works perfect with text values too
Can someone who worked with that code tell me about his html code content? That would be nice :)
I was wondering if i got something wrong within my html code. I didnt mention any marker function there. Also it is still centered on a specific point on the map.
Did you include anything special to your html code?
I checked everything. Still not working i think. "location" is still underlined red. What about the permissions for the page or the database?
Is the Map name google map named "#googlemap1" also makes sure you are using the number field for lat and long.... Make sure the spelling is exact!!! Let me know if any of this helps
Hello Security Risk,
thank you for that code!
I copied the code but i cant get it to work somehow. Furthermore, WIX tells me, that the location-command is "undefined". Why that?
While i am trying to figure it out, i am looking forward to your answer!
Greetings,
Dawd
Ok I figured it out and for anyone else who wants to know Make sure the Latitude & Longitude is set to "Numbers", not text or anything else. mapdescription needs to be set to "Rich text" in your Dataset.
also exact code that works is pasted below
$w.onReady( function () {
$w("#dynamicDataset").onReady( () => {
let currentItem = $w("#dynamicDataset").getCurrentItem();
$w("#googleMaps1").location = {
"latitude": currentItem.latitude,
"longitude": currentItem.longitude,
"description": currentItem.mapdescription
};
} );
} );
Hi,
As the error message indicates, please make sure that the Field Type of "latitude" field in your database is set to Number.
For further info about field types, please see this article: https://support.wix.com/en/article/field-type-support-and-limitations-in-the-content-manager