Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5965207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:34:15+00:00 2026-05-22T19:34:15+00:00

Here is my problem. I want to set different image to standard markers given

  • 0

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!!!!

 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 < 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")

      });

    } 
  });
}

UPDATE: Based on @Trott’s answer, maybe something like this? But still not running. Any advice?

function getData(response) {

  numRows = response.getDataTable().getNumberOfRows();

  //create an array of row values
  for (i = 0; i < 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);
  }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:34:16+00:00Added an answer on May 22, 2026 at 7:34 pm

    geocoder.geocode() requires a LatLng object. Your variable latlng is simply text. You’ll need to find a way to convert it to a LatLng object. Most obvious way is probably to parse it with a regex or some other way and pass the lat and lng to new google.maps.LatLng(). There may be a more elegant solution, but that will work.

    If it helps, here’s some quick hacking I did to your code to confirm what I wrote above. I just hardcoded your first pair of coordinates. You’ll still need to write something to parse the data.

    function codeAddress(latlng) {
    //Whoops, latlng is a string.  We need it to be an object.  Let's just hardcode one for demo purposes.
    latlng=new google.maps.LatLng(46.0724339, 13.249490000000037);
    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")
    
          });
    
        }
      });
    }
    

    UPDATE: If you (@Massimo) want to do it the way you have it in your update, then you need to remove the parentheses and possibly white space. Try something more like this:

    function getData(response) {
    
      numRows = response.getDataTable().getNumberOfRows();
    
      //create an array of row values
      for (i = 0; i < numRows; i++) {
        var rowtext = response.getDataTable().getValue(i,0);
        var sanitizedText = rowtext.replace(/[\(\)\s]/g, "");
        var strArr = sanitizedText.split(",");
        document.getElementById("via").innerHTML = rowtext;
        row = new google.maps.LatLng(strArr[0],strArr[1]);
        codeAddress(row);
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

here is my Problem, I want to pass the integer 1 when this canvas
So here is my problem. I want to redirect name.domain.com/trips/1 to domain.com?username=name&trip=1 using modrewrite.
So here is my problem. I want to store 2-tuple (key, val) and want
I'm working through a problem where I want to select a different static content
I want to create an html page with a watermark. I set the background-image
I'm new to php, here is my problem: I want to select a row
PROBLEM: I have a blank Image control named Image1 . Now, I want to
I'm having a little problem where I want two different classes to be able
I am having problems here if I want to check if eerste points to
Maddening problem here. When my page loads: <body onload=getClientDateTime();> It runs this function: document.getElementById('ClientDateTime').value=hello

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.