On Sep 7, 2:58 am, jspcat <[email protected]> wrote: > Hola, > > Tengo la siguiente duda con la api de google maps: > > Este codigo que lo extraje > dehttp://code.google.com/apis/ajax/playground/#event_arguments > > function initialize() { > if (GBrowserIsCompatible()) { > var map = new GMap2(document.getElementById("map_canvas")); > map.setCenter(new GLatLng(37.4419, -122.1419), 13); > > GEvent.addListener(map,"click", function(overlay,latlng) { > if (latlng) { > var myHtml = "<a href='http://www.google.com'>LINK</a>"; > alert(latlng); > map.openInfoWindow(latlng, myHtml); > } > }); > map.addControl(new GSmallMapControl()); > map.addControl(new GMapTypeControl()); > } > } > > Funciona en solitario perfecto, es justo lo que quiero pero a la hora > de aplicarlo a mi código( lo único que cambio es que es a un marker en > vez de al map) > > Ya nada mas cargar la página me salta este error > Error: f.d is undefined > Archivo de > origen:http://maps.gstatic.com/intl/es_es/mapfiles/api-3/2/3/main.js > Línea: 21 > > Pero si hago click en el marker es cuando me salta el break de f.d is > undefined > > Alguna idea de porque puede ser esto?Estoy seguro que es por > definiciones.... > > Muchas Gracias > > Saludos!
translated to english: Hello, I have the following question to the Google Maps API: This code that I extracted from http://code.google.com/apis/ajax/playground/ # event_arguments function initialize () ( if (GBrowserIsCompatible ()) ( var map = new GMap2 (document.getElementById ("map_canvas")); map.setCenter (new GLatLng (37.4419, -122.1419), 13); GEvent.addListener (map, "click", function (overlay, latlng) ( if (latlng) ( myHtml var = "<a href='http://www.google.com'> LINK </ a>"; alert (latlng) map.openInfoWindow (latlng, myHtml) ) )); map.addControl (new GSmallMapControl ()); map.addControl (new GMapTypeControl ()); ) ) Solo works perfect, just what I want but when to apply it to my code (the only thing that changed is that it is a marker in instead of the map) Nothing more to load the page I skip this error Error: f.d is undefined Source File: http://maps.gstatic.com/intl/es_es/mapfiles/api-3/2/3/main.js Line: 21 But if I click on the marker is when I skip the break of fd is undefined Any idea why is that? I'm sure it is definitions .... Thank you very much Greetings! Reply: That code is v2 code, the error message says you are including the v3 API. Either get a key for the v2 API: http://code.google.com/apis/maps/signup.html or change your code to use v3: http://code.google.com/apis/maps/documentation/javascript/ -- Larry Translated to spanish: Ese código es v2 código, el mensaje de error dice que usted es como la API de v3. Cualquiera de obtener una clave para el API v2: http://code.google.com/apis/maps/signup.html o cambiar el código para utilizar v3: http://code.google.com/apis/maps/documentation/javascript/ - 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.
