0

I'm trying to do addMarker() on Problem Set 8. I've got one marker showing on the map with a label, but that's it. I can't figure out how to show all of the markers that should go on the map at a particular area.

Since the search textbox also isn't working, which is another I need help with, I'll post a link to the whole scripts.js file. I'll show application.py as well if someone asks. Thanks in advance for any help.

scripts.js link: https://pastebin.com/b918p91h

1 Answer 1

0

The TODO for addmarker() function specifies you to come up with a code to just add a marker. Showing the markers in a respective area of the map is done by the prewritten code in update() function.

Also the search thing is implemented in the application.py module, so upload that code too.

So the fault might be in your implementation of addMarker. Try removing the comma after map: map and remove the marker.setMap(map) because you have already set the map inside the new Marker object. Give it a try.

13
  • So is my use of showInfo() alright (including the second argument being passed to it)? Thanks for the tips, by the way; I'll make the changes. As for application.py, I'll have to get to my workspace on CS50 IDE first which I currently can't do because it's still "waking up from hibernation". Commented May 4, 2017 at 18:50
  • Link to application.py: pastebin.com/vYkQaUXk . About marker.setMap(map), would it really be okay to remove that? I don't have it anywhere else in the addMarker() function, do I? Or do you mean it's not needed? Commented May 4, 2017 at 19:02
  • I took out the call to setMarker(), but the map still has only one marker showing on it. Commented May 4, 2017 at 19:51
  • I think removing the call to setMarker() is making the marker unclickable. Commented May 4, 2017 at 19:54
  • Yea the marker.setMap(map) can be removed as you have already set the map using map: map. Commented May 5, 2017 at 4:30

You must log in to answer this question.

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