Login Register
Code2night
  • Home
  • Guest Posts
  • Blog Archive
  • Tutorial
  • Languages
    • Angular
    • C
    • c#
    • C#
    • HTML/CSS
    • Java
    • JavaScript
    • Node.js
    • Python
    • React
    • Security
    • SQL Server
    • TypeScript
  • Post Blog
  • Tools
    • JSON Beautifier
    • HTML Beautifier
    • XML Beautifier
    • CSS Beautifier
    • JS Beautifier
    • PDF Editor
    • Word Counter
    • Base64 Encode/Decode
    • Diff Checker
    • JSON to CSV
    • Password Generator
  1. Home
  2. Blogpost

Integrating Google Map Places Api in Asp.Net MVC

Date- Jul 31,2021

18095

Google Maps Google map api

Google Map Places API-

Google Map places api help us to integrate a dynamic place search in any input box which searches from the places available on google map and gives exact locations. For integrating google map api in Asp.Net MVC you have to follow these steps:

Step 1- 

First of all you have to create a account on google console . After creating the account on google console you have to create api key for places api. Remember, places api is paid and you have to add a billing account for making that work. Once you get api key, you have to follow further steps :-

So , you have to add a input box and then add the following script into your view.

 <script src="https://maps.googleapis.com/maps/api/js?v=3.11&sensor=false&libraries=places&key=<You Key HERE>" type="text/javascript"></script>

Remember, in this script you have to place your api key in place of <Your Key Here>

After  placing your api key in the script you have to add the script given into your view.

google.maps.event.addDomListener(window, 'load', function () {
                var places = new google.maps.places.Autocomplete(document.getElementById('PickUpLocation'));
                google.maps.event.addListener(places, 'place_changed', function () {
                    var place = places.getPlace();
                    var address = place.formatted_address;
                    var latitude = place.geometry.location.lat();
                    var longitude = place.geometry.location.lng();

                 
                });
            });
			

So , just place this script on your view and pass the id of your input box. After that, just reload the page and your will see whenever you will type any name. It will show places related to that search. Have a look at below result.

So, this is how will see it finally and use it for places search in future. If you have any issues you can comment  and ask.

S
Shubham Batra
Programming author at Code2Night — sharing tutorials on ASP.NET, C#, and more.
View all posts →

Related Articles

Implement Stripe Payment Gateway In ASP.NET
Sep 10, 2020
Jquery Full Calender Integrated With ASP.NET
Sep 30, 2020
Microsoft Outlook Add Appointment and Get Appointment using Asp.Net MVC
Oct 03, 2020
How to implement JWT Token Authentication and Validate JWT Token in ASP.NET MVC using JWT
Oct 12, 2022

Comments

Contents

More in ASP.NET MVC

  • Payumoney Integration With Asp.Net MVC 23088 views
  • MVC Crud Operation with Interfaces and Repository Pattern wi… 21777 views
  • Using Ajax in Asp.Net MVC 21127 views
  • Stopping Browser Reload On saving file in Visual Studio Asp.… 20548 views
  • Exception Handling and Creating Exception Logs in Asp.net MV… 20382 views
View all ASP.NET MVC posts →

Tags

AspNet C# programming AspNet MVC c programming AspNet Core C software development tutorial MVC memory management Paypal coding coding best practices data structures programming tutorial tutorials object oriented programming Slick Slider StripeNet
Free Download for Youtube Subscribers!

First click on Subscribe Now and then subscribe the channel and come back here.
Then Click on "Verify and Download" button for download link

Subscribe Now | 1760
Download
Support Us....!

Please Subscribe to support us

Thank you for Downloading....!

Please Subscribe to support us

Continue with Downloading
Be a Member
Join Us On Whatsapp
Code2Night

A community platform for sharing programming knowledge, tutorials, and blogs. Learn, write, and grow with developers worldwide.

Panipat, Haryana, India
info@code2night.com
Quick Links
  • Home
  • Blog Archive
  • Tutorials
  • About Us
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Guest Posts
Free Dev Tools
  • JSON Beautifier
  • HTML Beautifier
  • CSS Beautifier
  • JS Beautifier
  • Password Generator
  • QR Code Generator
  • Hash Generator
  • Diff Checker
  • Base64 Encode/Decode
  • Word Counter
By Language
  • Angular
  • C
  • c#
  • C#
  • HTML/CSS
  • Java
  • JavaScript
  • Node.js
  • Python
  • React
  • Security
  • SQL Server
  • TypeScript
© 2026 Code2Night. All Rights Reserved.
Made with for developers  |  Privacy  ·  Terms
Translate Page