I have this issue as well. I couldn't find much in the API doc. You need a Marker object and you don't have one, you've got Features because you uploaded them to the data layer.
However, in the InfoWindow documentation , it says you can create an MVCObject with position set. I did this below in the event handler. You don't have to put it on the map, just handle the click event by creating the MVCObject and submitting that to the infoWindow constructor.
Example:
function initialize(mapID) {
var myLatlng = new google.maps.LatLng(38.951644, -92.334127);
var mapOptions = {
zoom: 12,
center: myLatlng
}
var map = new google.maps.Map(document.getElementById(mapID), mapOptions);
map.data.addGeoJson(realestate_js.geojson_results);
map.data.setStyle(function(feature){
// setStyle executes this function on each feature...
// each feature then receives the "google.maps.Data.StyleOptions" object
// which defines its icons and stuff.
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#Data.StyleOptions
return {
'clickable':true,
'icon':feature.A.icon,
'title':feature.A.address1,
}
});
var fakeMarker = new google.maps.MVCObject();
var infoWindow = new google.maps.InfoWindow({
'content':"",
});
map.data.addListener('click', function(event){
fakeMarker.set('position', {'lat':event.latLng.A, 'lng':event.latLng.F});
var infoWindow = new google.maps.InfoWindow({
'content':"<h1>Info Window Content here</h1><p>omg this so text</p>" + ,
});
infoWindow.open(map, fakeMarker);
});
}