Passing array as parameter google maps
This question already has an answer here:
Error: Expected ")"
google.maps.event.addDomListener(window, 'load', initialize(markers());
should be
google.maps.event.addDomListener(window, 'load', initialize(markers()));
It was something about how load functions:
google.maps.event.addDomListener(window, 'load', initialize(markers()));
this method, google load "initialize()" before all, then markers() doesn't exist already.
so if you move to
bodythe script and the markers() to
headworks perfectly. 链接地址: http://www.djcxy.com/p/81514.html
下一篇: 传递数组作为参数谷歌地图