5 votes

pset8 info window does not displaying news links

labelClass: "labels", Defined in CSS as 'label', not 'labels'. labelContent: markers.place_name, The passed variable to this function is place, not markers. Did you define the parameters variable ...
user avatar
4 votes
Accepted

How to add labels to Markers?

There is an example of MarkerWithLabel here that should show you how to do that. It's the labelContent property. Transcript of an example from that link: var latLng = new google.maps.LatLng(49.47805, ...
user avatar
4 votes

pset8 infoWindow appearing with wrong marker

Had the same trouble. Fix it with 'var' before 'marker = new...'. Else you overwrite the same variable each time.
user avatar
  • 41
2 votes
Accepted

Pset8 AddMarker not working - update.php returns invalid JSON?

As ChrisG said in the comments, you don't need to add two different click listeners for each marker. I'm comparing your code to mine, and my click listener just uses showInfo(marker, content) -- ...
user avatar
  • 3,035
2 votes
Accepted

Pset8: How to set label position and font?

You can assign anchor value for label so it does not overlap with the icon, like this var marker = new MarkerWithLabel({ position: latLng, map: map, labelContent: place["place_name"], ...
user avatar
  • 158
2 votes

pset8 addMarker click event opens info window on wrong marker

Man... you'll be so pissed off with this... You should declare a NEW marker variable every time you call addMarker, but you don't do this here: marker = new google.maps.Marker({...... When you do ...
user avatar
2 votes

CS50 Mashup: addMarker clarification

You are always setting myLatLang here var myLatlng = new google.maps.LatLng(42.3770, -71.1256); // Cambridge, Massachussets, so all the markers will go "there". The argument place is the result of the ...
user avatar
2 votes
Accepted

pset8- AddMarkers, not even working to for a simple console.log() test

You told the program to "get" info from "articles" here $.getJSON(Flask.url_for("articles")) but you didn't tell it what to GET. Assuming your articles function returns data as per the examples (eg ...
user avatar
2 votes
Accepted

CS50 Pset8: Final Questions before Wrap-Up

How does the computer recognize that those few lines inside a JavaScript file is actually html and not JavaScript codes? It doesn't. It's not javascript or html to the function, it's data. When it is (...
user avatar
2 votes
Accepted

CS50 Pset8: Info Window Not Showing

One problem is this syntax markers += marker;. That does not add an element to an array in js. The array method push adds elements to an array. Another problem is here marker.addListener(map, "click"...
user avatar
2 votes
Accepted

Mashup: removeMarkers not removing markers? PLEASE HELP

The removeMarkers will get rid of one marker, the last one added. The problem is in addMarker. addMarker will be called for each "place" and should add one marker to the map and one marker to the ...
user avatar
1 vote
Accepted

Mashup, how to add label outside the icons?

If you use a custom icon for your marker, you can set its labelOrigin to place it underneath. https://developers.google.com/maps/documentation/javascript/markers (and then look for custom icons)
user avatar
  • 18.3k
1 vote
Accepted

Pset8: Please help, all my markers and news disappeared (Other peoples code don't work either)

Looks like you missed out at least one setting for your marker. Be sure you have in your new Marker map: map, So that the markers will go on the map. I added that one line and your markers ...
user avatar
  • 18.3k
1 vote

pset8: javascript: addMarker clarification for showInfo function

This google.maps.event.addListener(marker, 'click', showInfo(marker, articlesContent); is sending the result of the showInfo function.
user avatar
1 vote
Accepted

problems with markers on addmarkers pset8

I was able to reproduce the reported error sqlalchemy.exc.ArgumentError: This text() construct doesn't define a bound parameter named 'ne_lng' by modifying the (first) SELECT sql in the update ...
user avatar
1 vote
Accepted

Pset8: add marker, article links not clickable

Review the MDN doc on anchor tag and then verify that your add marker uses valid attributes. (Hint typo!). Perhaps clicking on the red do in the top right of the inspector will give more info. IMO ...
user avatar
1 vote

Where to start in addMarker() function?

Observe the function signature: function addMarker(place). place is received as an argument. addMarker is called in a loop from the update function. You only need to add a marker for the place ...
user avatar
1 vote
Accepted

pset8 mashup - markers not showing up in map

This can happen if latitude and/or longitude are TEXT columns. They need to be NUMERIC columns, otherwise the select SQL in the update route returns no rows and addMarker doesn't get called.
user avatar
1 vote
Accepted

pset8 addMarker undefined in info window

I incorporated this addMarker function into my app and it showed the list of articles in the info window (though the articles don't have "links"). So I "tweaked" articles; changed return jsonify(...
user avatar
1 vote
Accepted

pset8,MarkerWithLabel

MarkerWithLabel is not part of Google maps APIs, it is a third party product. Here's the doc for Google Marker Labels. IMO don't let this detail distract from completing the pset.
user avatar
1 vote

Pset8: How to set label position and font?

Yes you can, as suggested here Google Maps API page var image = { url: "https://maps.google.com/mapfiles/kml/pal2/icon31.png", labelOrigin: new google.maps.Point(15,40) } var ...
user avatar
1 vote

pset8 addmarker info window

Here's a problem: marker.addListener("click",function(){ $.ajax({url:"../articles.php", type:"GET", data:{geo:place.place_name}, success:function(response){ ...
user avatar
  • 3,035
1 vote
Accepted

trouble with addMarker in pset8. getJSON seems to work but I'm not getting results

When you first click the marker, the .done() function hasn't delivered your JSON data yet, thus content will still be "" when you call showInfo(marker, content); at the very end. Try to move showInfo(...
user avatar
1 vote

pset8 infowindow shows up only after click twice

After discussing with my friends, we found the problem is due to the order of the code (although I am still not very clear why this old order would be buggy): instead of including getJSON function in ...
user avatar
1 vote

pset8 mashup addmarker

If you went to Developer Tools > Console, you would probably see something like ReferenceError: myLatlng is not defined on some of the lines there. The issue is that you assign myLatlng (with ...
user avatar
  • 146
1 vote
Accepted

addMarker pset8 mashup JSON not returning data

I was struggling with this for quite some time - my code looked very similar to yours. I searched forever (since I didn't really know how to express my question) until I found this here: https://...
user avatar
  • 425
1 vote
Accepted

pset8 2015 Mashup addMarker

addMarker only adds the marker image and attaches a click event to this marker. I found this information rather helpful: https://developers.google.com/maps/documentation/javascript/events?csw=1#...
user avatar
  • 425
1 vote

pset8 addMarker trouble getting lat lng

As far as I can tell, the issue is that the is being passed in as a string. So I turned them into floats by doing the following (using parseFloat): var mylat = parseFloat(place.latitude); ...
user avatar
1 vote

How to successfully add marker in pset8 mashup?

first-off there is some change about EDX 2015 class. read this https://courses.edx.org/courses/HarvardX/CS50x3/2015/info Now Marker with label you have to read this http://google-maps-utility-...
user avatar
1 vote

No markers visible

I can see a mistake in the object you're passing to MarkerWithLabel function, I don't think a comma after "label" is needed.
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible