CS1210 Fall 2021 Discussion Section 11

Part of HW11 involves adding map markers corresponding to Tweet locations. Your task here should help with that. Write function createMarkerString(currentTweetIndex, tweetLatLonList, mapCenterLatLon) where
The output should be a string of the form "&markers=color:red|latC,lonC&markers=color:yellow|size:small|lat0,lon0|...|latk,lonk" where latC, lonC are the latitude and longitude of the current tweet, and lati, loni in the yellow markers part are lats/lons for every tweet except the current one.

For example, createMarkerString(1, [[40.7452888, -73.9864273], None, [40.76056, -73.9659]], [40.758895, -73.985131]) should return "&markers=color:red|40.758895,-73.985131&markers=color:yellow|size:small|40.7452888,-73.9864273|40.76056,-73.9659"

If you complete this function correctly, you should be able to use it in HW11. It will construct a piece of the string you need in getMapUrl.

One way to test your output is to combine it with additional parts of a Google Static Map URL and paste it into a browser address bar. For example, add the result returned by the example above to the end of "http://maps.google.com/maps/api/staticmap?center=40.758895,-73.985131&zoom=13&size=400x400&key=YOURGOOGLEKEY" (after replacing YOURGOOGLEKEY with your key) and try it in a browser. You should get an image like:


Submit to ICON a python file containing the createMarkerString function