Advertisement
vamsiampolu

Javascript initialize code

Feb 15th, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var input=[];
  2.     var marker_uluru=createMapMarker(new google.maps.LatLng(-25.363882,131.044922),'Uluru Rock');
  3.     var marker_mermaid=createMapMarker(new google.maps.LatLng(-28.0440,153.4370),'Mermaid Beach');
  4.     var marker_sydneyopera=createMapMarker(new google.maps.LatLng(-33.8587,153.4370),'Sydney Opera House');
  5.     var marker_bondibeach=createMapMarker(new google.maps.LatLng(-33.8910,151.2777),'Bondi Beach');
  6.     var marker_reef=createMapMarker(new google.maps.LatLng(-18.2861,147.7000),'Great Barrier Reef');
  7.     input.push(marker_uluru);
  8.     input.push(marker_mermaid);
  9.     input.push(marker_sydneyopera);
  10.     input.push(marker_bondibeach);
  11.     input.push(marker_reef);
  12.     var result=mapFunc(addMarkerToCurrentMap,input);
  13.     var uluru_data=getLatitudeAndLongitudeFromMarker(marker_uluru);
  14.     console.log('uluru data latitude '+uluru_data.latitude);
  15.     console.log('uluru data longitude '+uluru_data.longitude);
  16.     var arr=[new google.maps.LatLng(3.1357,101.6880),new google.maps.LatLng(1.3000,103.8000),new google.maps.LatLng(-6.2000,106.8000),new google.maps.LatLng(-7.2653,112.7425),new google.maps.LatLng(-31.9522,115.8589)];
  17.     //The array above is no longer useful once the polyline has been created,you can obtain this array using getArray on the polyline but cannot mutate it
  18.     var mpath=createPolyline(arr,'#ffb636');
  19.     addPolylineToMap(mpath,map);
  20.     var pathArr=mpath.getPath();
  21.     addToPolyline(mpath,new google.maps.LatLng(-34.9290,138.6010));
  22.     addToPolyline(mpath,new google.maps.LatLng(-9.5136,147.2188));
  23.     removeFromPolyline(mpath);
  24.     removeFromPolylineAt(mpath,0);
  25.     //When creating a polygon there is no need to specify the polygon's closing side because google maps will do it for you
  26.     var polyPoints=[];
  27.     polyPoints.splice(0,0,new google.maps.LatLng(-34.9290,138.6010),new google.maps.LatLng(-37.8136,144.9631),new google.maps.LatLng(-27.4679,153.0278));
  28.     console.log(polyPoints.length);
  29.     var polygonOptions=new configurePolygonOptions('#FF0000',2,0.8,'#FF0000',0.35);
  30.     polygonOptions.setPaths(polyPoints);
  31.     var pgon=createPolygon(polygonOptions);
  32.     addPolygonToMap(pgon);
  33.     console.log('polygon has been added');
  34.     var rect=new createRectangle('#FF0000',2,0.8,'#FF0000',0.35);
  35.     rect.setBounds(new google.maps.LatLngBounds(new google.maps.LatLng(23.1333,113.2667),new google.maps.LatLng(14.5833,120.9667)));
  36.     rect.setMap(map);
  37.     rect.setEditable(true);
  38.     rect.setDraggable(true);
  39.     rect.setGeodesic(true);
  40.     var _rect=new google.maps.Rectangle(rect);
  41.     //To modify any property of the rectangle or polygon,you need to use the object we built using the constructor functions,which we must obtain using built-in methods of the Rectangle,Polygon and other objects.
  42.     //To modify anything you can also use _rect.setMap() and circle.setMap()etc...
  43.  
  44.     //get Bounds is a point(south-east and north-west)
  45.     console.log('rectangle has been added');
  46.     var circe=new configureCircle('#FF0000',2,0.8,'#FF0000',0.35);
  47.     circe.setMap(map);
  48.     circe.setCenter(map.center);
  49.     circe.setRadius(192241.45);
  50.     circe.setEditable(true);
  51.     circe.setDraggable(true);
  52.     var circle=new google.maps.Circle(circe);
  53.     console.log('Circle has been added');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement