Note that there are some explanatory texts on larger screens.

plurals
  1. POgoogle maps api 3 - how to open infowindow, for polygons from FusionTables, on click on html element
    text
    copied!<p>So I have a problem; I have google api 3 code which calls 2 Fusion tables, and now I want to add some html elements which would be clickable and when clicked, they would call certain polygons from fusion tables and automatically open their (already customized) infowindows.</p> <p>My code is here: <a href="http://jsfiddle.net/zVaGN/1/" rel="nofollow">http://jsfiddle.net/zVaGN/1/</a></p> <p>And i want to get this effect: <a href="http://econym.org.uk/gmap/example_egeotestmon.htm" rel="nofollow">http://econym.org.uk/gmap/example_egeotestmon.htm</a></p> <p>I have been looking at this code and I cannot find a solution because i'm not that skilled at coding. I need some function that calls a layer from the fusiontable by calling some proprety (column in fusion table) and then when a user clicks on an html element the particular layer's infowindow pops up.</p> <p>Please help guys!</p> <p>UPDATE: it is already possible to get the infowindow when the poylgon is clicked, but i want to get the effect that the infowindow opens upon clicking another html element, please take a look at this example: jsfiddle.net/zVaGN Here i have put the link on top, before the map, that says "Sisak" and now i want that when i click on this link the infowindow of this polygon (named Sisak in my fusiontalbe) pops up. Is this possible?</p> <p>UPDATE 2: So i already have my customized infowindows which were made in fusiontables, and i only want that the function queries the value in the html element with the fusiontable values and calls the infowindow popup? Do You understand, so i have my polygons, i have the custom infowindows for every polygon, and now i want to make a html list besides my googlemap so that when a user clicks on specific name in the sidebar list, then the infowindow of that polygon popsup?</p> <p>I have tried putting this code that would call the infowindow made in fusiontables but i doesno't work. This is google api:</p> <pre><code> function izbor() { var infowindow = google.maps.FusionTablesLayer({ }); infowindow.open(map); } </code></pre> <p>And later on in the body of html i try to implement this function:</p> <pre><code>&lt;div style="position:absolute; top:700px; left:100px;" &gt; &lt;a href="#" title="Sisak" value="Sisak" onclick="izbor()"&gt;Sisak&lt;/a&gt;&lt;br /&gt; &lt;/div&gt; </code></pre> <p>But nothis happens</p> <p>I also tried this code to call the infowindow created in fusiontables which has a div class="googft-info-window":</p> <pre><code>function izbor() { var infowindow = new google.maps.InfoWindow({ query: {"SELECT '.googft-info-window' FROM" + tableid}; }); infowindow.open(map); } </code></pre> <p>But nothing happens</p> <p>Also tried this code with ExtendedData because when i export my fusiontable to kml it parses the infowindow as ExtendedData</p> <pre><code>function izbor() { var infowindow = new google.maps.InfoWindow({ query: {" SELECT 'ExtendedData' FROM " + tableid}; }); infowindow.open(map); } </code></pre> <p>But again nothing:(</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload