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

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -