Want to display an InfoWindow when clicking a Marker on a Google Map

twands
twands used Ask the Experts™
on
Hello:   This is a followup to a earlier wuestion dealing with using Google Maps within Access.  I am having an issue getting an InfoWindow to Popup on my map when I click a marker.  I have what I believe to be the right code but it is giving me a syntax error when I try to map the markers.  If I rem out the code the markers plot fine.  I have attached a Database and the associated map.

Here is the code that is giving me the problem.

// Create an InfoWindow to display a Message about the Marker when clicked
  var infowindow = new google.maps.InfoWindow({
       content: 'It Works'
})

// Adding a click Event for the Marker
 google.maps.event.addListener(oMap.markers, 'click', function() {
//  Call the open method of the InfoWindow
     infowindow.open(omap, oMap.markers);
})

You can run the code by opening the New Properties and selecting New Properties from the Mapping Options drop down and then click Map my Properties.

Any help or suggestions will be greatly appreciated.

Thanks,

Tim Google-Mapping-.zip
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Simon BallChief information Officer

Commented:
your mdb is well locked down, i cannot get into the form to fiddle and try and diagnose the problem.

Author

Commented:
Here is a unzipped version.  Let me know if you have any other issues getting in. Geocoding.html MapGeocoding.mdb
Simon BallChief information Officer

Commented:
have you you locked the mdb so i cannot go into design mode or open the DB window using f11.

i cannot get in to the code to step through, and test

11/26 Forrester Webinar: Savings for Enterprise

How can your organization benefit from savings just by replacing your legacy backup solutions with Acronis' #CyberProtection? Join Forrester's Joe Branca and Ryan Davis from Acronis live as they explain how you can too.

Author

Commented:
All rescrictions have been taken off of theis DB.   MapGeocoding.mdb
Simon BallChief information Officer

Commented:
Sorry i have been on holidays, setting up new business and working on some contracts..

I shall have a look at your new opened DB now..

Do you still need this question answered?

Author

Commented:
Yes please
Simon BallChief information Officer

Commented:
OK i am in it, stepped through and see where the problem occurs... will dig around for you.
Chief information Officer
Commented:
oh man,

i did some digging and found the problem line but my post has not submitted...

I played with the script code a bit to debug...

.getPosition()

is the source of the problem,  but i don;t know how to fix it...

we need a maps expert
oMap.adjustViewPort = function() {
	if (oMap.map) {
		var bounds = new google.maps.LatLngBounds();
		for (var i in oMap.markers) {
			
			if (i != "0"){
			alert(i);
			alert (oMap.markers[i].getPosition());
			//bounds.extend(oMap.markers[i].getPosition());
			}
		}
		//oMap.map.fitBounds(bounds);
}}
google.maps.event.addDomListener(window,'load', oMap.init);

Open in new window

Author

Commented:
Thanks for taking a look at it.  I appreciate your time.  I was hoping it was something simple but apprarently it is not.  I may have to start over with the mapping with mapping code that does what I need and then try to add my database logic into that.  
Simon BallChief information Officer

Commented:
good idea.

sorry i was not much help :P
James MurrellProduct Specialist

Commented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Author

Commented:
I don't have a problem closing this question but I don't think any point should be awarded.  No solution was ever given.  I would prefer that someone would give a viable solution but so far there has been none.  

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial