-1

in the beginning i want to say, that 1. my english is not be best (im form germany(but i hope so that you can understand what i want to say :) and 2. i know that there are many of these questions are already in this forum, but i am really new in javascript and so on, so the answers don't help me :/

ok ok , no i start with my problem :)

i have my googlemapsAPI so like the answer given in the folowing article

But now i want to have more markers then 5

how can i do it ?

thanks a lot

Community
  • 1
  • 1
  • You can add more markers in a similar fashion by making more `['Name",##.###,##.###,#],` so long as the last on does not have the , at the end. – David Starkey Apr 19 '13 at 15:52

2 Answers2

1

Literally all you need to do is add another element to the locations array.

var locations = [
  ['Bondi Beach', -33.890542, 151.274856, 4],
  ['Coogee Beach', -33.923036, 151.259052, 5],
  ['Cronulla Beach', -34.028249, 151.157507, 3],
  ['Manly Beach', -33.80010128657071, 151.28747820854187, 2],
  ['Maroubra Beach', -33.950198, 151.259302, 1],
  ['Another Marker', -33.950148, 151.259312, 6]
];

Assuming this is a serious question, I'd urge you to read up on the basics of javascript and programming in general.

Prisoner
  • 27,391
  • 11
  • 73
  • 102
1

You can also use the push-function if you want to add more markers as you go along:

locations.push(['Another Marker', -33.950148, 151.259312, 6]);

will add the marker to the end of locations.

But look at some tutorials for JavaScript, cause this is one of the basic things you should know to make your programming easy...

Slim Sim
  • 171
  • 1
  • 4