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
I would like to create auto suggest base on what user key in on a search box.
But i dont know how to get the existing map and markers render by the package.
It seems i need to put the javascript inside the rendered code.
Is there any way i add an event listener inside the rendered code ?
Thank you.
var searchBox = new google.maps.places.SearchBox(document.getElementById('searchmap'));
google.maps.event.addListener(searchBox, 'places_changed', function () {
var places = searchBox.getPlaces();
var bounds = new google.maps.LatLngBounds();
var i, place;
for (i = 0; place = places[i]; i++) {
bounds.extend(place.geometry.location);
marker_0.setPosition(place.geometry.location);
}
map.fitBounds(bounds);
map.setZoom(15);
});
The text was updated successfully, but these errors were encountered:
Hi,
I would like to create auto suggest base on what user key in on a search box.
But i dont know how to get the existing map and markers render by the package.
It seems i need to put the javascript inside the rendered code.
Is there any way i add an event listener inside the rendered code ?
Thank you.
The text was updated successfully, but these errors were encountered: