Search and autocomplete with Google Maps API

Home » Blog » 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&amp;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

Submit a Comment

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.

Pin It on Pinterest

Share This