Alright,

Problem solved.  I was trying to get the dimensions of the image
before it was finished loading. I solved it by:

var newImg = new Image();

                newImg.onload = function() {

Overlay Code

}

newImg.src = imageUrl;

On Mar 30, 1:57 pm, Joey <[email protected]> wrote:
> I think I may have figured this out. I was creating a new image,
> setting the source to the image I was going to overlay and sometimes
> it would not create the image object. I was trying to get the height
> from it. So I was trying to overlay an object with the bounds of 0,0
> and 0,0 so nothing was showing up.
>
> I'm going to play around with it more to make sure.
>
> On Mar 30, 1:49 pm, Joey <[email protected]> wrote:
>
> > I am using lat lon parameters. I'm just being cheeky by providing
> > coordinates from 0,0 (somewhere near Africa)
>
> > var newImg = new Image();
> >             newImg.src = CurrentDistrictObject.overlayImage;
> >             var scale = .001*.687;
>
> >             var height = newImg.height*scale;
> >             var width = newImg.width*scale;
> >                 var zoom = 11;
> >                 map.setCenter(new GLatLng(height/2, width/2), 11);
>
> > What I'm doing here is loading the image I'm going to use as an
> > overlay and I'm getting the dimensions. I then take the image height
> > and multiply it by a scale I came up with playing around with resizing
> > the image. At zoom level 11 around 0,0 lat,lon the height of the
> > image*scale in to latitude and longitude make the image appear the
> > right size. I then center on the middle of the image.
>
> > On Mar 30, 1:38 pm, Rossko <[email protected]> wrote:
>
> > > > I seem to be having a problem with GGroundOverlays. The problem is
> > > > that when I add agroundoverlay to the map like below in the
> > > > following link, it doesn't always load.
>
> > > >http://mystateusademo.com/edit/mapOverlay.aspx?id=2
>
> > > I don't get anything anytime, in IE6 or FF2.
>
> > > Don't like this line for example -
> > >    map.setCenter(new GLatLng(height/2, width/2), 11);
>
> > > GLatLng expects lat and long parameters, not the pixel size of an
> > > image.
>
> > > cheers, Ross K
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to