I have problems with gmaps api instant (geocoder) and jquery autocomplete combobox. If one of the two is in the product, works perfectly. But if the two coexist in the same page, break, throwing this error in console:

Cannot set property '_renderItem' of undefined

This was the line that contains this code:

input.data("autocomplete")._renderItem =function( ul, item ){

return $("<li>")

.data("item.autocomplete", item )

.append("<a>"+ item.label +"</a>")

.appendTo( ul );

});

Looking around, I found a possible solution:

var obj = input.data("autocomplete");

obj &&(obj._renderItem =function( ul, item ){

return $("<li>")

.data("item.autocomplete", item )

.append("<a>"+ item.label +"</a>")

.appendTo( ul );

});

But that only makes the map going smoothly, but the combobox still malfunctioning.

Replies(4)

Your code is either strange or intended for some very special situation. _renderItem() is normally used to change the appearance of the list items in the dropdown - like make them bold. It is not intended to create Autocomplete. You show no source: option. It is a mystery to me how anything would show up, and not surprising that Google Map does not get a value to map. You have to set a value in the input box for Google Map to use.

I'd suggest you look at the Autocomplete documentation and start with something simple. Get Map working with it, and then add features.

jQuery Combobox widget is very complex code. I don't recommend changing any of it unless you are a real pro. I use the ComboBox plug-in because it is much simpler to use with its options. You may want to look at it at:

If you continue with the Combobox widget, I'd suggest you use a .change() function that triggers whenever the value of the input box changes. The trigger fires GMap and it updates. Here's code that I use, and maybe it can be a model for the things you want to do.