On Jan 25, 8:12 am, dsloan <[email protected]> wrote:
> My Google maps code works fine until I introduce the line "var iw = new
> google.maps.InfoWindow();" as seen below. It says it's not a constructor,
> but the documentation and other examples I've seen clearly show that it is.
> Do I need to load another library or something? The markers, controls, are
> all created ok, just the InfoWindow which causes the problem. I've left out
> code to actually do anything with this info window just yet, just need to
> get past the constructor problem.
>
> function initialize() {
>         if(GBrowserIsCompatible()) {
>           var map = new GMap2(document.getElementById('map'));
>           map.setCenter(new GLatLng(39.91, 116.38), 2);
>           map.addControl(new GLargeMapControl());
>           var icon = new GIcon(G_DEFAULT_ICON);
>           var markers = [];
>           for (var i = 0; i < 100; ++i) {
>             var latlng = new GLatLng(data.photos[i].latitude,
> data.photos[i].longitude);
>             var marker = new GMarker(latlng, {icon: icon});
>           var iw = new google.maps.InfoWindow();
>             markers.push(marker);
>           }
>         }
>       }

That is v2 code.  The v2 group is:
http://groups.google.com/group/google-maps-api

v2 doesn't have an google.maps.InfoWindow constructor.  See the v2
documentation for the v2 function and Mike Williams' tutorial for how
to use them.
(links to all of the above in the v2 group)

  -- Larry

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to