Lately, I was assigned to have a map displayed on WordPress page based on location from custom fields. The purpose is to load the map with the page while the locations from custom fields are read.
It is my first time to play around with Google Map API. I chose the latest V3 version. And after I played around, I came up with this shortest solution to quickly show the route on the map from Point A to Point B.
First of all, please make sure you have your Google Map API key ready. This can be done by login to https://code.google.com/apis/console with your google account. And there are lots of solutions can be found on google to get that key.
Once you have your API Key ready. Please have this code in the header.
Then here comes my code.
Then make sure that you have the html code div ready.
Once we have code ready, we can test it in our local server and find out the result before uploading to server.
More fun with Google Map API will be posted later.