Edit the UX for results map view, using infoBox.js. #397
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this branch, I made some UX changes to the results map view in response to Issue #365 ("Google Map rollover is cropped out of view some times."). I tried using 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. Some issues that I encountered along the way included the following:
(1) I had to 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).
(2) I had to add a line to infoBox.js (line 274) to increase the z-index of the close box [x], because it was visible but not clickable. This doesn't seem to be a bug in infoBox in general, so I'm thinking it was conflicting with something else on the Ohana page.
(3) 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. I changed require.js shim to handle the fact that infoBox depends on google maps api. Unfortunately this problem is still not fully resolved. Presently, it works fine about 50% of the time, and the other 50% of the time it throws an error on page load, saying that infoBox could not find the google maps api.