On Sunday, February 6, 2011 at 2:35:50 PM UTC-5, Anders E wrote: > > I have a map that shows a Fusion Tables layer based on kml polygons > that are in the Fusion table. > > What I want to do is trigger a click event on that layer with a > certain LatLong in order to get the Fusion tables row back and display > that info using my own function openInfoWindow() (with default > infowindows suppressed) > > Short version of code: > ------- > > layer = new google.maps.FusionTablesLayer(ELK.table_id); > layer.setOptions({suppressInfoWindows : true}); > var query = ["select geo from ",table_id," where '",category,"' > > 0"].join(''); > layer.setQuery(query); > layer.setMap(mymap); > > google.maps.event.addListener(layer, 'click', > function(e){ > infoWindow.close() > openInfoWindow(e); > }); > ----------- > The event is triggered like this: > > google.maps.event.trigger(layer, 'click', new > google.maps.LatLng(64.9227249653748,13.49316406250001)); > -------- > > The problem is that the e object returned by the click event is not a > "fusion tables row" object, but an object consisting only of the > latlng that was "clicked" > > Is there a way to trigger the "real click on a FT layer" so that the > FT feature object will be returned (with row/columns)? > > Anders
Hi Anders, To access the row object you can get that from the event object passed to the callback, google.maps.event.addListener(layer, 'click', function (e) { let row = e.row; let address = row.address.value; let longitude = row.longitude.value; let latitude = row.latitude.value; }); -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-maps-js-api-v3+unsubscr...@googlegroups.com. To post to this group, send email to google-maps-js-api-v3@googlegroups.com. Visit this group at https://groups.google.com/group/google-maps-js-api-v3. For more options, visit https://groups.google.com/d/optout.