Merge pull request #466 from codeforamerica/api-updates

Make attribute presence checks more flexible
Update ohanakapa gem to version 1.1.1

This includes a security fix to redact the API Token from error logs.
Merge pull request #472 from codeforamerica/update-ohanakapa

Update ohanakapa gem to version 1.1.1
Fixes #365 - Edit UX for results map

In this branch, @millerEric made some UX changes to the results map
view in response to Issue #365 ("Google Map rollover is cropped out of
view some times."). @millerEric used infoBox.js from the Google
Maps utility library, because it allows for easy customizability,
including position and styling. Presently, the infoBox is displayed to
the right of markers to decrease the likelihood of it being cropped out
of the window. The infoBox can be styled either within its options
object, or by linking to a CSS stylesheet. @anselmbradford moved all
styles to CSS.

- @millerEric set the marker's optimized property to false in order to
prevent events from propagating through the infoBox onto the map (e.g.
to prevent markers underneath an open infoBox from registering a
mouseover event).

- @anselmbradford added a z-index for the close box [x] per
@millerEric original edit, because it was visible but not clickable.

- infoBox.js requires the google maps api to be fully loaded before
it is loaded. This has presented some difficulties because of the
asynchronous loading of the google maps api. @anselmbradford nested the
dependencies so they loaded in order, which consequentially required
the result-map-manager to become self-executing, for better or worse.

@anselmbradford's commit also edits the following:

- Removes the clearMarkers method, which is only needed if the map results
were updated via ajax (which isn’t currently used).

- Removes the metadata and summary text variables, which were no longer
used.

- Adds additional code comments to the map manager code.

- Configures infobox states using a bit mask so that complex interactions
can be programmed as toggleable flags that are then evaluated for to determine
when to open or close the infobox.

- Configures jshint task to allow bitwise operations that are needed for
a bitmask.

- Adds additional styles to the infobox to make it more consistent with
links and other such styling in other parts of the app.

- Adds CSS corner arrow to info box so it’s clearer which marker the info box
is pointing toward.
Fixes #338 - Adds two marker sizes.

- Built on the original work by @abourai in
https://github.com/codeforamerica/ohana-web-search/tree/338-map-icon-sizes,
adds two marker sizes and ability to swap between the two sizes when resizing
the map.
- Changes infobox to use a background gradient for corner instead of a
div.
Adds generic map markers

- Makes map markers generic.
- Sets info box corner color to the same as the markers.
- Removes marker title so that the browser’s default title shown on
hover doesn’t overlap the info box.
Fixes #473 - turns off poi markers

Google provides default markers for Points-Of-Interest, which are
clickable to show an info window. This commit hides these markers so
that the user doesn’t inadvertently click these markers.
Makes detail and result maps markers consistent

The detail view map marker was the default marker. This commit makes it
the same as the large marker shown on the search results map.
Fixes touch display map issue

Since touch displays don’t have mouseover events, this commit sets the
needed variables when tapping a marker as if it had been moused over
first.
Fixes #402 - Updates coordinates and map data

- Updates coordinates field to use latitude/longitude in places where
array bracket syntax was used to access these values.
- Updates cassettes to include latitude/longitude in response.
- Replace `generate_map_data` method with client-side JS code
- Define new @total_map_markers instance variable that can be used in
the views to determine whether or not to display a map, and for the
`format_map_summary` helper.

- Fix bug where the conditional for displaying
`@map_search_summary_html` was removed. See the bug in action here:
http://ohana-web-search-demo.herokuapp.com/organizations?utf8=%E2%9C%93&
keyword=test+location+with+no+street
Fixes #241 - add overlapping marker algorithm

- Adds https://github.com/jawj/OverlappingMarkerSpiderfier for handling
overlapping markers.
- Updates marker graphics and adds large/small spiderfied marker icons.
- Adds street address and city to info box.
- Moves info box close button to upper-left to aid in making the
opening/closing action of the info box closer together. Also, removes
corner gradient.
Embeds infobox script

The info box script was being loaded externally. This commit adds the
script locally as a vendor script (like the Google Map Spiderfier) as
the remote script wasn’t being loaded asynchronously so it could block
the page if it failed to load.