1

I've got myself quite confused with the addMarker function in the 2015 pset8 Mashup. Am I correct in thinking the addMarker function should take one single place from the JSON returned from search.php, and then add this place as a marker to the map?

I am struggling too to understand the separation between this functionality and later in scripts.js where addMarker is called within the update function. Excluding the articles functionality, should addMarker be a function that takes data from the JSON output by search, extracts the lat and lng, and plots this one marker on the map, leaving the update function to execute the loop that adds markers for every place on the current map?

1

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#EventArguments

The function in the click event is loadinfo.

Let me know, if you need additional hints.

2

You must log in to answer this question.

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