Pastebin is 300% more awesome when you are logged in. Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 13th, 2013  |  syntax: None  |  size: 1.27 KB  |  views: 39  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. // ARRAY
  2. var linePath = [
  3. new google.maps.LatLng(37.772323, -122.214897),
  4. new google.maps.LatLng(21.291982, -157.821856),
  5. new google.maps.LatLng(-18.142599, 178.431),
  6. new google.maps.LatLng(-27.46758, 153.027892)
  7. ];
  8.  
  9. // console.log(linePath);
  10. [P { Ia=37.772323, Ja=-122.21489700000001}, P { Ia=21.291982, Ja=-157.82185600000003}, P { Ia=-18.142599, Ja=178.43100000000004}, P { Ia=-27.46758, Ja=153.02789200000007}]
  11.        
  12. // ARRAY
  13. $("input[name='submit']").click(function() {
  14.     var geocoder = new google.maps.Geocoder();
  15.     locations = new Array();
  16.     $("input[name='address[]']").each(function() {
  17.         geocoder.geocode({"address" : this.value }, function(results) {
  18.             var addrLl = results[0].geometry.location;
  19.             locations.push(addrLl);
  20.             var marker = new google.maps.Marker({
  21.                 map: map,
  22.                 position: addrLl
  23.             });
  24.         });
  25.     });
  26.  
  27.     var connect = new google.maps.Polyline({
  28.         path: locations,
  29.         strokeColor: "#FF0000",
  30.         strokeOpacity: 1.
  31.     });
  32.     connect.setMap(map);
  33.     return false;
  34. });
  35.  
  36. // console.log(locations);
  37. []
  38.    [+] 0    P { Ia=41.8843266, Ja=-78.79295300000001}
  39.    [+] 1    P { Ia=35.9614504, Ja=-79.04755590000002}
  40.        
  41. locations = new Array();
  42.        
  43. locations = new MVCArray();