InfoWindow.open expects an MVCObject with a position as the second argument
of the open call().
Instead call:
infowindow = new google.maps.InfoWindow({content:myHtml});
infowindow.setPosition(posX);
infowindow.open(map);
On Wed, Jun 9, 2010 at 10:26 AM, janzaldo <[email protected]> wrote:
> Hi!,
> I insert a kmlLayer in a map and all is ok, when I click a point in
> the map I want that showup an infowindow with the data associate with
> it, all works, I can get the data but when I try to open the
> infowindow I get this error
>
> ------------------------
> Error: b.get is not a function
> Archivo Fuente:
> http://maps.gstatic.com/intl/es_ar/mapfiles/api-3/1/3/main.js
> LĂnea: 25
> ------------------------
>
> The link where it is
> http://www.juan-anzaldo.com/2010/geolocalizacion/gmapsKML.html
>
> The code where I create the kmlLayer
>
> georssLayer = new google.maps.KmlLayer('http://www.juan-anzaldo.com/
> 2010/geolocalizacion/kml/CasillasGoogle.kml',
> {suppressInfoWindows: true, preserveViewport: true} );
> georssLayer.setMap(map);
> google.maps.event.addListener(georssLayer, 'click', function(kmlEvent)
> {
> var text = kmlEvent.featureData.name;
> var posicionDeClick = kmlEvent.position;
> var posX = new google.maps.LatLng(posicionDeClick.lat(),
> posicionDeClick.lng());
> muestraInfo(text, posX);
> });
>
> var infowindow;
> function muestraInfo(text, posX)
> {
> myHtml = text+"htmlcode";
> alert (myHtml)
> if (infowindow) infowindow.close();
> infowindow = new google.maps.InfoWindow({content:myHtml});
> infowindow.open(map, posX ); <== ERROR
> }
>
>
> thanks for your help
>
> --
> 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]<google-maps-js-api-v3%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>
--
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.