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.
http://maps.google.com/maps?
file=api&v=2.x&key=KEY"
type="text/javascript">
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
var minLat=29.61138889;
var minLng=35.01805556;
var maxLat=31.7225;
var maxLng=35.99305556;
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.99305556);
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.61138889, 35.01805556);
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],"#ff", 2,
0.3,
LineOptions);
map.addOverlay(Line);
map.setMapType(G_PHYSICAL_MAP);
map.addControl(new GLargeMapControl());
}
}
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 Google-Maps-API@googlegroups.com
To unsubscribe from this group, send email to
google-maps-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~--~~~~--~~--~--~---