Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle fusion tables data and changing image to markers
    primarykey
    data
    text
    <p>Here is my problem. I want to set different image to standard markers given by fusion tables. I extract data from the column that contains my points "(coord,coord)" BUT when I associate this coordinates to a marker, this one is not showed! I think that the solution is soooo easy but I can't get it :(. Please read in the section "HERE IS THE PROBLEM" in the middle of this code to have a clear idea. Thanks!!!!</p> <pre><code> function initialize() { geocoder = new google.maps.Geocoder(); map = new google.maps.Map(document.getElementById('map_canvas'), { center: new google.maps.LatLng(46.06454, 13.23561), //the center lat and long zoom: 9, //zoom mapTypeId: google.maps.MapTypeId.ROADMAP //the map style }); //make gviz request setData(); } /* GVIZ - get data from Fusion Tables */ function setData() { //create a viz query to send to Fusion Tables var query = new google.visualization.Query('http://www.google.com/fusiontables/gvizdata?tq=' + encodeURIComponent("SELECT dove FROM 781907")); //set the callback function that will be called when the query returns query.send(getData); } function getData(response) { numRows = response.getDataTable().getNumberOfRows(); for (i = 0; i &lt; numRows; i++) { var row = response.getDataTable().getValue(i,0); codeAddress(row); } } var geocoder; function codeAddress(latlng) { // HERE IS THE PROBLEM!!!! // Test show correctly "(lat,lng)" BUT no marker showed on the map! document.getElementById("test").innerHTML = latlng; geocoder.geocode( { 'latLng': latlng}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { var marker = new google.maps.Marker({ map: map, position: latlng //icon: new google.maps.MarkerImage("http://www.google.com/images/icons/product/fusion_tables-32.png") }); } }); } </code></pre> <p><strong>UPDATE</strong>: Based on @Trott's answer, maybe something like this? But still not running. Any advice?</p> <pre><code>function getData(response) { numRows = response.getDataTable().getNumberOfRows(); //create an array of row values for (i = 0; i &lt; numRows; i++) { rowtext = response.getDataTable().getValue(i,0); var strArr[] = rowtext.split(","); document.getElementById("via").innerHTML = rowtext; row = new google.maps.LatLng(strArr[0],strArr[1]); codeAddress(row); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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