I have an address field on a page. On the same page, I have a button "Map Location". On click of the button, I set the address into a localStorage variable and then launch another page (MapLocation) which has the Map component. On page load of MapLocation, I have the following code:
var fulladdress = localStorage.getItem("fulladdress");
var map = Appery("map");
map.options["address"] = fulladdress;
map.refresh();
The map gets displayed but the address is not marked. I do get an error/warning in the Firebug that the map is not initialized.
If I add a button on MapLocation page and execute the same code on button click, everything works fine. The marker is added in the right location and it also zooms to the right level.
How can I get it to work on load instead of button click?
Thanks