Home › Forums › XDC Public forums › Technical Support and Digital Media › Javascript Help – Google Maps API3 Coding
- This topic has 15 replies, 8 voices, and was last updated 13 years ago by
XDC_Wolf.
-
AuthorPosts
-
November 1, 2012 at 4:36 pm #20040
TurksMeister
ParticipantI 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">
November 1, 2012 at 4:43 pm #84068TurksMeister
ParticipantAha – its a loop! And that would make sense too… might be able to work this out myself… maybe!
November 1, 2012 at 4:52 pm #84069TurksMeister
ParticipantIm an idiot – I left some code at the bottom which was buggering it up – fixed now!
var mylatlng = new google.maps.LatLng(51.507359, -0.26797730);
var myMarkerOptions = {
position: mylatlng,
map: mymap
}
var marker = new google.maps.Marker(myMarkerOptions);November 1, 2012 at 6:41 pm #84070XDC wild egg tamer
Participantwhat language is this you speak?
November 1, 2012 at 6:44 pm #84071XDCMADMAX
Participantget out and meet girls
November 1, 2012 at 7:03 pm #84072Alzir
KeymasterI love how his last thread was entitled “dear xdc techies”, followed by this 🙂
November 1, 2012 at 7:30 pm #84073Occa
ParticipantYou nerd 8)
November 1, 2012 at 8:00 pm #84074xdcmaniac
ParticipantChris, you need some boobies to play with.
November 1, 2012 at 8:18 pm #84075XDCMADMAX
Participant@=xdc=maniac wrote:
Chris, you need some boobies to play with.
And not your own
November 2, 2012 at 9:29 am #84076TurksMeister
ParticipantYep – I am teaching myself to be a techie! Exciting stuff!
And I have a rather amazing lady friend who I see more often than Max see’s his wife… what with his 646 hours and 22 mins playing time! That’s a casual 26 days full time!
November 2, 2012 at 1:02 pm #84077Occa
ParticipantI thought that playing battlefield is maxines job ❓ Or was it Queeks I guess he has a bit more hours behind bf than max 😆
November 2, 2012 at 1:53 pm #84078TurksMeister
ParticipantAll that work and this is what I madehttp://studentnet.kingston.ac.uk/~k1258285/
November 2, 2012 at 7:45 pm #84079xdcmaniac
ParticipantSo, if I’m in Leeds and fancy an ice cream, you’re the man to speak to. You still need some boobies.
November 2, 2012 at 8:05 pm #84080Alzir
KeymasterNot many ice cream parlours about.
November 3, 2012 at 12:53 pm #84081xdc the doc
ParticipantHoly shit!
A google map…..
with some placemarkers on it?
Have google been in touch yet to offer you a job? 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.
