Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var input=[];
- var marker_uluru=createMapMarker(new google.maps.LatLng(-25.363882,131.044922),'Uluru Rock');
- var marker_mermaid=createMapMarker(new google.maps.LatLng(-28.0440,153.4370),'Mermaid Beach');
- var marker_sydneyopera=createMapMarker(new google.maps.LatLng(-33.8587,153.4370),'Sydney Opera House');
- var marker_bondibeach=createMapMarker(new google.maps.LatLng(-33.8910,151.2777),'Bondi Beach');
- var marker_reef=createMapMarker(new google.maps.LatLng(-18.2861,147.7000),'Great Barrier Reef');
- input.push(marker_uluru);
- input.push(marker_mermaid);
- input.push(marker_sydneyopera);
- input.push(marker_bondibeach);
- input.push(marker_reef);
- var result=mapFunc(addMarkerToCurrentMap,input);
- var uluru_data=getLatitudeAndLongitudeFromMarker(marker_uluru);
- console.log('uluru data latitude '+uluru_data.latitude);
- console.log('uluru data longitude '+uluru_data.longitude);
- 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)];
- //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
- var mpath=createPolyline(arr,'#ffb636');
- addPolylineToMap(mpath,map);
- var pathArr=mpath.getPath();
- addToPolyline(mpath,new google.maps.LatLng(-34.9290,138.6010));
- addToPolyline(mpath,new google.maps.LatLng(-9.5136,147.2188));
- removeFromPolyline(mpath);
- removeFromPolylineAt(mpath,0);
- //When creating a polygon there is no need to specify the polygon's closing side because google maps will do it for you
- var polyPoints=[];
- 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));
- console.log(polyPoints.length);
- var polygonOptions=new configurePolygonOptions('#FF0000',2,0.8,'#FF0000',0.35);
- polygonOptions.setPaths(polyPoints);
- var pgon=createPolygon(polygonOptions);
- addPolygonToMap(pgon);
- console.log('polygon has been added');
- var rect=new createRectangle('#FF0000',2,0.8,'#FF0000',0.35);
- rect.setBounds(new google.maps.LatLngBounds(new google.maps.LatLng(23.1333,113.2667),new google.maps.LatLng(14.5833,120.9667)));
- rect.setMap(map);
- rect.setEditable(true);
- rect.setDraggable(true);
- rect.setGeodesic(true);
- var _rect=new google.maps.Rectangle(rect);
- //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.
- //To modify anything you can also use _rect.setMap() and circle.setMap()etc...
- //get Bounds is a point(south-east and north-west)
- console.log('rectangle has been added');
- var circe=new configureCircle('#FF0000',2,0.8,'#FF0000',0.35);
- circe.setMap(map);
- circe.setCenter(map.center);
- circe.setRadius(192241.45);
- circe.setEditable(true);
- circe.setDraggable(true);
- var circle=new google.maps.Circle(circe);
- console.log('Circle has been added');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement