Search and autocomplete with Google Maps API
I needed to make autocomplete streets in the web sitr. I found cool plugin geocomplete. It works on the basis of google maps api. It is very simple to use this plugin. First of all you need to include api and library.
<script src="http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script>
<script src="/assets/components/modxsite/templates/main/js/jquery.geocomplete.js" type="text/javascript"></script>
Then you need add script and call autocomplete event from input element.
<script>// <![CDATA[
$(function(){
$("#address").geocomplete();
});
// ]]></script>
0 Comments