Javascript Help – Google Maps API3 Coding

Home Forums XDC Public forums Technical Support and Digital Media Javascript Help – Google Maps API3 Coding

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #20040
    TurksMeister
    Participant

    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">






    #84068
    TurksMeister
    Participant

    Aha – its a loop! And that would make sense too… might be able to work this out myself… maybe!

    #84069
    TurksMeister
    Participant

    Im 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);
    #84070
    XDC wild egg tamer
    Participant

    what language is this you speak?

    #84071
    XDCMADMAX
    Participant

    get out and meet girls

    #84072
    Alzir
    Keymaster

    I love how his last thread was entitled “dear xdc techies”, followed by this 🙂

    #84073
    Occa
    Participant

    You nerd 8)

    #84074
    xdcmaniac
    Participant

    Chris, you need some boobies to play with.

    #84075
    XDCMADMAX
    Participant

    @=xdc=maniac wrote:

    Chris, you need some boobies to play with.

    And not your own

    #84076
    TurksMeister
    Participant

    Yep – 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!

    #84077
    Occa
    Participant

    I thought that playing battlefield is maxines job ❓ Or was it Queeks I guess he has a bit more hours behind bf than max 😆

    #84078
    TurksMeister
    Participant

    All that work and this is what I madehttp://studentnet.kingston.ac.uk/~k1258285/

    #84079
    xdcmaniac
    Participant

    So, if I’m in Leeds and fancy an ice cream, you’re the man to speak to. You still need some boobies.

    #84080
    Alzir
    Keymaster

    Not many ice cream parlours about.

    #84081
    xdc the doc
    Participant

    Holy shit!

    A google map…..

    with some placemarkers on it?

    Have google been in touch yet to offer you a job? 🙂

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.