-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HW4-Zixuan Xu #2
base: master
Are you sure you want to change the base?
Conversation
}; | ||
var makeMarkers = function(parseData) { | ||
var markers = []; | ||
_.forEach(parseData, function(x){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small improvement suggestion: using _.map
instead of _.each
, which creates the array and doesn't require the push
/* ===================== | ||
Define a resetMap function to remove markers from the map and clear the array of markers | ||
===================== */ | ||
var resetMap = function() { | ||
var resetMap = function(myMarkers) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_.forEach(myData, function(x){ | ||
var marker; | ||
if (booleanField && x["UCR Code"] == 600) { | ||
marker = L.marker([x.Lat, x.Lng]).bindPopup(x["General Crime Category"]).addTo(map); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hadn't requested clarifying comments before this HW was due... but for next time, it'd be helpful to have some comments to help understand what it is you are trying to filter here by so I could get a good idea from the outset without needing to understand all the logic.
But it looks good.
No description provided.