Code2night
  • Home
  • Guest Posts
  • Tutorial
  • Languages
  • 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
  • Register
  • Login
  1. Home
  2. Blogpost

Integrating Google Map Places Api in Asp.Net MVC

Date- Jul 31,2021

18088

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 โ†’

Comments

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 Join Us On Facebook
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
  • Blogs
  • 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
© 2026 Code2Night. All Rights Reserved.
Made with for developers  |  Privacy  ยท  Terms
Translate Page