Hi, all: I'm currently integrating a map inside a web page. This map shows several points and we want to display a pop-up window associated to click event.
The problem we're having is that we do not get to display information windows associated with Marker. We tried using bindInfoWindowHtml of GMarker without GEvent and has not worked. Actually, we're using GEvent but it only shows the pop-up on the first point. what are we doing wrong??? any idea??? As We are working localy, you can see source code next: <script src="http://maps.google.com/maps? file=api&v=2.x&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1- m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type="text/javascript"></script> <script type="text/javascript"> var businesses = [ {name: 'Osha Union', street: '2033 Union St', city: 'San Francisco', state: 'CA', zip: '94102', country: 'USA', phone: '(415) 567-6742', lat: 37.797456, lng: -122.432752}, {name: 'Osha Geary Street', street: '696 Geary Street', city: 'San Francisco', state: 'CA', zip: '94102', country: 'USA', phone: '(415) 673-2368', lat: 37.786558, lng: -122.414789}, {name: 'Osha Thai', street: '819 Valencia Street', city: 'San Francisco', state: 'CA', zip: '94110', country: 'USA', phone: '415.826.7738', lat: 37.759782, lng: -122.421408}, {name: 'Osha Thai Restaurant', street: '149 2nd St', city: 'San Francisco', state: 'CA', zip: '94110', country: 'USA', phone: '(415) 278-9991', lat: 37.787394, lng: -122.398986}, {name: 'Osha Thai', street: '100 Drumm St', city: 'San Francisco', state: 'CA', zip: '94110', country: 'USA', phone: '(415) 788-6742', lat: 37.794616, lng: -122.396531}]; var map; var geocoder; var mm; var indice; var bounds; var message; function initialize() { map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(43.361321,-5.847913), 10); geocoder = new GClientGeocoder(); mm = new GMarkerManager(map); bounds = new GLatLngBounds(); indice=0; showLocations(); } function showLocations() { bucle(); function bucle() { var addressAct = businesses[indice].street+","+ businesses[indice].city+","+ businesses[indice].state+","+ businesses[indice].country; geocoder.getLocations(addressAct,function (response) { map.clearOverlays(); if (!response || response.Status.code != 200) { alert("Sorry, we were unable to geocode that address"); } else { place = response.Placemark[0]; point = new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]); var marker = new GMarker(point); marker.bindInfoWindowHtml(indice); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml("<b>text</b>"); }); mm.addMarker(marker,0,17); bounds.extend(point); map.setZoom(map.getBoundsZoomLevel(bounds)-1); map.setCenter(bounds.getCenter()); mm.refresh(); } indice++; if (indice<businesses.length) bucle(); }); } mm.refresh(); } Thanks for the help. Juanma. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en -~----------~----~----~----~------~----~------~--~---
