SyntaxFix
Write A Post
Hire A Developer
Questions
instead of this
var defaultLocation = new google.maps.LatLng(lat, lng);
use this
var defaultLocation = new window.google.maps.LatLng(lat, lng);
and this worked for me.