Due to changing business needs and the quick growth of technology, in today's web applications users want many options and capabilities in their applications. So let us learn in this article how to integrate the Google auto-complete search for places in maps.
Google provides many facilities to their users and other developers working on various technologies to integrate their product into applications.
Google Place Autocomplete Map Search
Key points for integrating Google Maps:
- You can customize Google Maps depending on your requirements.
- its provides the suggestion while typing.
- "Start" - "All Programs" - "Microsoft Visual Studio 2010".
- "File" - "New WebSite" - "C#" - "ASP.NET Empty Web Application" (to avoid adding a master page).
- Provide the web site a name such as "GoogleLocationSearch" or another as you wish and specify the location.
- Then right-click on Solution Explorer - "Add New Item" then Default.aspx page.
Now add one HTML input TextBox control and div tag on the default.aspx page and specify the ID as follows:
Now let us add a stylesheet CCS file by right-clicking on the solution and create the following CSS classes:
Now create the following functions to call the Google Maps API:
Now run the application. The initial map will look as follows:
Now enter a place into the preceding search text box. Let us assume I am searching for MCN solutions, then it gives the following auto-complete search places suggestions:
In the preceding example you see that it gives the auto-complete text box while I am searching the places in Google Maps. Now let us enter a city name now; it shows the following suggestions:
Now let us consider I am searching for Noida and after clicking on the suggested text, its shows the location as follows:
From all the preceding examples, we have learned how to integrate Google Maps Auto Location search into an ASP.Net web application.
- You need an active internet connection to view Google Maps.
I hope this article is useful for all readers. If you have any suggestion then please contact me including beginners also.