I want to make function in my web map that search input finds location, not on autosuggest click, but on autosgested place. Explain: -user points Us in input -autosuggest list places under it, like city1, city2, etc
normal: users clicks place, map reload to this place,
what i want: user hover mouse on place, map reloads to that place
Is this possible ?
I've attached on hover to elements but nothing more...
$('body').on( 'hover', '.pac-container .pac-item', function(){
console.log($(this));
console.log($(this).data());
});
There is no mouseover-event for an Autocomplete. It should be possible the find a solution that may work now, but this will be not reliable, because it would assume a behaviour you can't rely on(it may change with the next API-version)
A clean solution would be to request the Autocomplete-Service and implement the Autocomplete based on the response on your own.
As it seems you use jQuery, so it would be an option to use jQueryUI-Autocomplete.
A jQuery-plugin that populates a jQueryUI-autocomplete with results from the places-autocomplete-service(including the hover-behaviour):
usage:
Demo: http://jsfiddle.net/doktormolle/t7ppt8cj/