I've forked AngularUI's uiMap directive in order to swap InfoWindow for InfoBox and to add MarkerClusters. I've made some extensive updates to uiMap -> icMap; most notably I moved directive logic out of the controllers, making uiMap the "master" directive). I've got almost everything working, except that clicking a native MapMarker doesn't open the infobox.
I think the reason is that I'm not properly binding the click event to the native MapMarker (ic-map.js:163).
Before I re-organised uiMap I had simply added a icMapInfoBox
directive in map.js. Its open event was registered/triggered by:
ui-event="{'map-click':'openMarkerInfo(marker)'}"
which called openMarkerInfo() defined in its controller (copy/paste from my repo: GitHub Gist).
However, now when I click a native MapMarker, nothing happens and I get no errors in the console (but all other events still fire properly).
Original Plunk
Simplified Plunk (removed MarkerClusters)
In both plunks, the problem probably lies in ic-map.js (first file in the list)
map.json is a data file
angular.js, angular-ui.js, and infobox.js are lib files
Edit I noticed that InfoBox.map
is undefined
; I'm guessing that has something to do with the problem.
Edit The undefined InfoBox.map property was part of the problem: The manual call to InfoBox.open on ic-map.js:189 works (template isn't being compiled, but that's a different problem), but the click event still doesn't trigger InfoBox.open. Also the template is not getting included.
SOLVED: I had been treating marker
a DOM object instead of just a js object. Will post solution soon.