I wonder whether someone could help me please.
I have put together a form shown here which allows the user to select and deselect marker categories on the map.
What I’m now trying to do, is on a marker click populate a text box called ‘address’ with the address details.
I’ve tried placing this line document.getElementById('address').value = address; where I thought it should be placed which is after
google.maps.event.addListener(marker, 'click', function() {
But I receive the error saying that the ‘address is undefined’. I must admit I’m not sure why because the address is part of the marker data pulled from my php script.
Would it be at all possible that someone could provide some guidance please on where I’ve gone wrong.
Many thanks
You need to recover the address from the “marker” object.
If you try the code below in FireFox you will see the “marker” objects inner structure and then be able to workout how to access the data within it