0

I'v almost(finally) finished pset8, but dont know what's wrong with the addmarker part :-

function addMarker(place)
{
    // TODO

    var myPos = new google.maps.LatLng(place.latitude,place.longitude);

    var marker = new MarkerWithLabel({

    position: myPos,
    labelContent : place.place_name,
    labelAnchor: new google.maps.Point(15,0),

    })

    $.getJSON("articles.php",place.postal_code)
    .done(function(data,textStatus,jqXHR){

      for(var i=0;i < data.length;i++)
      {

       showInfo(marker,data[i]);

      }

    }
    .fail(function(jqXHR,textStatus,jqXHR){
       showInfo(marker,errorThrown);
    })

    google.maps.event.addListener(marker,"click",fucntion (e) { info.open(map,this); });

   marker.setMap(map);

}
3
  • I see you're missing a semicolon after creating an instance of MarkerWithLabel. you should open up the JavaScript console see if there are any error messages! – kzidane Dec 9 '15 at 9:31
  • Oh yeah fixed it but still not working, and fixed a typo in the fail part too but still it isnt working. – Jedi18 Dec 9 '15 at 10:10
  • are there any errors in the console? – kzidane Dec 9 '15 at 10:10
0

When calling these values you have to turn them to numbers. I had this same issue.

0

There are a couple of errors in your script. 1. I'm not sure if you saw it, but the is a typo in your event listener. 2. You shouldn't call the info window explicitly in your event listener, but instead you should call showInfo , passing the appropriate arguments to the function. If this answered your question, check it answered.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .