Display location on google map from address using javascript google map api
In this tutorial, I am going to show you a little useful trick that is how to display any location on google map from address if you don’t have co-ordinates (latitude and longitude).
For doing this you can simply use google map javascript api, It is quite simple, fast and easy to use.
Most of the time many websites want to display location on google map but they don’t have co-ordinates to display location on map, so don’t worry using google map api you can get the co-ordinates from address.
Suppose you have the lot’s of company details in your database and you want to display location of each company on google map but you don’t have co-ordinates in your database, you just only have the address of the company then how you’ll proceed, I am going to tell you in this tutorial.
Ok Let’s come on the track
First include google map javascript api in your page.
Add below script to get co-ordinates from address and mark co-ordinates on google map
Create a map container where location on the map will be display.
Now your final script will be..
This is the very basic example of the google map api, you can add more features on google map see api tutorial on https://developers.google.com/maps/documentation/javascript/
Hope this tutorial will help you to understand google map integration on your website.