You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 30, 2018. It is now read-only.
I'm having a bizarre problem when using the ui-gmap-search-box directive: Any leading whitespace (or other text) in the template causes directive to fail when adding the control to the map, with the error "Uncaught TypeError: Cannot read property 'zIndex' of undefined" from Google Maps.
I've tracked it down to the Control.prototype.link function: it uses controlDiv.contents() to get the contents of the template, then pushes the first element of that into maps.controls. But the first element is a whitespace text element, so there's an error when Google Maps tries to add a text element rather than a true DOM node. I've found that using controlDiv.children() instead of .contents() solves the problem.
I haven't been able to duplicate the problem yet though frustratingly enough. Will keep trying.
The text was updated successfully, but these errors were encountered:
Figured it out: I couldn't reproduce the problem because it only manifests when you include the full version of jQuery, rather than relying on jqLite. It appears to have something to do with the .append() method; jQuery's append() seems to include leading whitespace as text nodes, while jqLite appends only the DOM nodes. This looks like a bug in jqLite, which I think should be emulating the standard jQuery functionality. Either way, the problem could be avoided by using controlDiv.children() rather than controlDiv.controls() in Control.prototype.link.
I'm having a bizarre problem when using the ui-gmap-search-box directive: Any leading whitespace (or other text) in the template causes directive to fail when adding the control to the map, with the error "Uncaught TypeError: Cannot read property 'zIndex' of undefined" from Google Maps.
So with the following:
This works:
But this doesn't:
I've tracked it down to the Control.prototype.link function: it uses
controlDiv.contents()
to get the contents of the template, then pushes the first element of that into maps.controls. But the first element is a whitespace text element, so there's an error when Google Maps tries to add a text element rather than a true DOM node. I've found that usingcontrolDiv.children()
instead of.contents()
solves the problem.I haven't been able to duplicate the problem yet though frustratingly enough. Will keep trying.
The text was updated successfully, but these errors were encountered: