Map Markers Not Displaying (JavaScript/Google Maps API V3) -
Map Markers Not Displaying (JavaScript/Google Maps API V3) -
i'm having problem getting map markers display using google maps api v3. i'm attempting maintain them in single array, create displaying big amount relatively simple. currently, map loads fine, throws error uncaught typeerror: object #<object> has no method 'setvalues'
when attempting draw markers. error repeats each iteration run settimeout()
. recommendations appreciated.
this javascript used:
var map; var markers = [ [ 45.768366, -108.5975760, 'fitness 19' ], [ 45.785684, -108.6144625, 'granite fitness' ], ... (more, syntactically correct) [ 45.7920092, -108.4886232, 'steepworld' ] ]; function mapinit() { var conf = { zoom: 11, center: new google.maps.latlng(45.7832856,-108.5006904), maptypeid: google.maps.maptypeid.roadmap } map = new google.maps.map(document.getelementbyid('mapcont'),conf); for(i in markers) { window.settimeout('mark('+i+')',i*200); } } function mark(i){ google.maps.marker({ position: google.maps.latlng(markers[i][0],markers[i][1]), animation: google.maps.animation.drop, title: markers[i][2] }); }
it's new
keyword makes difference!
i had same problem. using new keyword when constructing marker object makes work 1 time again in chrome @ least. putting in differed timeout event didn't. , here thought new
nil syntactic sugar...
javascript google-maps
Comments
Post a Comment