Hi, On my Map I have info windows which hopefully respond upon the user clicking on the icon. I have tried various techniques in fixing it however I am unable to get the info window to open. Please would somebody be able to describe where I am going wrong with the script.
<script src="http://maps.google.com/maps? file=api&v=2.x&key=KEY" type="text/javascript"></script> <script type="text/ javascript"> function initialize() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map_canvas")); var minLat=29.611388888889; var minLng=35.018055555556; var maxLat=31.7225; var maxLng=35.993055555556; botLeft = new GLatLng(minLat, minLng); topRight = new GLatLng(maxLat, maxLng); bounds = new GLatLngBounds(botLeft, topRight); map.setCenter(new GLatLng(((maxLat + minLat) / 2.0),((maxLng + minLng) / 2.0)),map.getBoundsZoomLevel(bounds)); var baseIcon = new GIcon(); baseIcon.iconSize = new GSize(20, 20); baseIcon.iconAnchor = new GPoint(10, 10); var DepartingIcon = new GIcon(baseIcon); DepartingIcon.image = "includes/maps/images/dep.png"; var Departing = new GLatLng(31.7225, 35.993055555556); markerOptions = { icon: DepartingIcon }; var DepartingMarker = new GMarker(Departing, markerOptions); map.addOverlay(DepartingMarker); var ArrivingIcon = new GIcon(baseIcon); ArrivingIcon.image = "includes/maps/images/arr.png"; var Arriving = new GLatLng(29.611388888889, 35.018055555556); markerOptions = { icon: ArrivingIcon }; var ArrivingMarker = new GMarker(Arriving, markerOptions); GEvent.addListener(ArrivingMarker, "click", function() { var html = 'Info Window Message'; ArrivingMarker.openInfoWindowHtml(html); }); map.addOverlay(ArrivingMarker); var LineOptions = {geodesic:true}; var Line = new GPolyline([Arriving, Departing],"#ff0000", 2, 0.3, LineOptions); map.addOverlay(Line); map.setMapType(G_PHYSICAL_MAP); map.addControl(new GLargeMapControl()); } } </script> I am using the latest version of FF so there should not be any compatibility issues. James --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
