I am trying to be cleverer than I need to be, and come across some code which I don’t understand and hoping someone can shed some light. I have created the code below which is meant to show the location of potential ice-cream parlors in the North of England. I can get them to individually display if I type the same code 5 times, but want to make it cleaner than that. Google uses the following – but do not understand what the i++ stuff means (and obviously Google doesn’t help!) can someone shed some light, or point me in the direction of a good resource?
for (var i = 0; i < locations.length; i++) {
var city = locations;
var myLatLng = new google.maps.LatLng(city[1], city[2]);
var marker = new google.maps.Marker({
position: myLatLng,
map: map,
shadow: shadow,
icon: image,
shape: shape,
title: city[0],
zIndex: city[3]
});
Where this is the full code:
src="http://maps.googleapis.com/maps/api/js?key=AIzaSyBdLpdNtBopewQfcN08ywhMcotCTS5AmOQ&&sensor=false">