javascript - google maps load error "google" undefined -


ok, have problem on when loading maps, part shows "google" undefined.

var polyline = [     new google.map.latlng(3.032617, 101.376),     new google.map.latlng(3.03255, 101.3759),     new google.map.latlng(3.032467, 101.3758),     new google.map.latlng(3.031867, 101.3753),     new google.map.latlng(3.0318, 101.3753) ];  var polylineopts = {   path: polyline,   map: map,   strokecolor: 'blue',   strokeopacity: 1.6,   strokeweight: 3,   geodesic: true };  var poly = new google.maps.polyline(polylineopts); 

i expect error "google" undefined. javascript case sensitive.

should be:

var polyline = [     new google.maps.latlng(3.032617, 101.376),     new google.maps.latlng(3.03255, 101.3759),     new google.maps.latlng(3.032467, 101.3758),     new google.maps.latlng(3.031867, 101.3753),     new google.maps.latlng(3.0318, 101.3753) ];  var polylineopts = {   path: polyline,   map: map,   strokecolor: 'blue',   strokeopacity: 1.6,   strokeweight: 3,   geodesic: true };  var poly = new google.maps.polyline(polylineopts); 

working example


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -