Info Windows Problem

2009-02-19 Thread james.norma...@googlemail.com

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
-~--~~~~--~~--~--~---



Re: Info Windows Problem

2009-02-19 Thread james.norma...@googlemail.com

Hi Sorry - http://janorman.co.uk/sites/Arabian2.0/map-test.php

On Feb 19, 8:45 pm, Ralph Ames  wrote:
> Please read the posting guidelines and provide a link to your 
> map.http://groups.google.com/group/Google-Maps-API/web/suggested-posting-...
> nes
>
> Ralph
>
> www.easypagez.com/maps/map_index.html
> -

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Info Windows Problem

2009-02-19 Thread james.norma...@googlemail.com

Thanks ever so much for your response ;-) Works now !

On Feb 19, 9:38 pm, "geocode...@gmail.com" 
wrote:
> On Feb 19, 1:09 pm, "james.norma...@googlemail.com"
>
>  wrote:
> > Hi Sorry -http://janorman.co.uk/sites/Arabian2.0/map-test.php
>
> If you want to open an infoWindow on a marker, you need to define the
> infoWindowAnchor property of its 
> icon:http://code.google.com/apis/maps/documentation/reference.html#GIcon.i...
>
>  -- Larry
>
>
>
> > On Feb 19, 8:45 pm, Ralph Ames  wrote:
>
> > > Please read the posting guidelines and provide a link to your 
> > > map.http://groups.google.com/group/Google-Maps-API/web/suggested-posting-...
> > > nes
>
> > > Ralph
>
> > >www.easypagez.com/maps/map_index.html
> > > -
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---