I have used the Wix google maps element in Editor and a few lines of code to display a single location by lat/long coordinates (overriding the address set in the Editor), and never had any problems. But when I try to use the same element and code in a lightbox it inexplicably works once (if at all), then never again.
To troubleshoot, and to rule out coding errors, I tried replacing my code [which passed variables to the lightbox using getContext() ] with Wix’s sample code and a fixed location. The results were the same: the lightbox map correctly displays the location the first time I add the maps element (“#googleMaps1”) to the lightbox and run the code, but the next time and beyond (without any changes to code!) it only shows the element’s default Wix HQ location. It also seems to make no difference whether I use a button link or code to open the lightbox.
Anyone have an idea what is going on?
Map lightbox code:
$w.onReady(function () {
$w(“#googleMaps1”).location = {
“latitude”: 49.2745117,
“longitude”: -123.104314,
“description”:“Somewhere over Vancouver”
};
});