Posts

Showing posts with the label maps

Google Maps | Creating a simple, fully customized map

Image
Problem: One of the most common things we need to do as developers is to create a Google Map for our client websites. Although this is pretty straight-forward, there are many customization properties available if we considering digging into them. Below are provided some of the most common map requirements while building Google Maps. Solution: *** Enabling the service *** In order to start using the Google Maps service, we need to open our Google Console and do two things: - Enable the Google Maps API v3 service in the "Services" tab. - Create a new browser key in the API Access tab.   Activate the Maps V3 API   Create a browser key   Don't add any hosts for now (later you should restrict the api key by setting *.yourdomain.com/* ) Your API Key is available now *** Find out the location *** The first thing we want to do is access https://maps.google.com/ and enter the location we want. Sadly enough, Google doesn't tell you th...

Google Maps stuck at loading

Problem: After adding the Google Maps API v3 to a website, the map page, in Firefox , displays a strange behavior. When the request comes from another page, most times, the map page keeps loading the Google Maps API ("retrieving data from maps.googleapis.com ") but it never actually ends. Follow-up scripts end up never being loaded. If we stop the page load and refresh it (F5 or CTRL+F5), the page loads correctly. Solution: There are lots of posts already with people trying to figure this out. Some are recomending changing the google script call to asynchronous: http://stackoverflow.com/questions/14233350/infinite-load-on-firefox-transferring-data-from-maps-googleapis-com https://developers.google.com/maps/documentation/javascript/tutorial#Loading_the_Maps_API However, for me, I just needed to move from $( document ). ready (function () {                     initializeMap(); ...