Get Current Location Javascript Google Maps, It works fine … The above code sets the default location of the map canvas to Palo Alto.