javascript - Create triangle in google map -
I was searching this question about the last 1-2 hours, but if this question has been posted before I did not get any reply, please give me a link and delete it anyway
There is a marker in my Google map and a mobile tower like this
I have a 120 degree 10km Click the marker to make the triangle,
Here's my code:
google.maps.event.addListener (Marker2, "click", function (e) {Var myLatLng = e.latLng Var Tlat = myLatLng.lat (); var Tlng = myLatLng.lng (); var Tlng2 = Tlng + (10 * 0.009); var Tlng3 = Tlng- (10 * 0.009); var Tlat2 = Tlat + 30; var Tlat3 = Tlat-30; var Triangle Cores = [New google.maps.LatLng (Tlat2, Tlng2), new google.maps.LatLng (Tlat, Tlng), new google.maps.LatLn G (Tlat3, Tlng3;; TriangleCoords; Triangle = New google.maps.Polygon ({Path: Triangle Quards, Stroke Color: "# FF 20000", Stroke Opacity: 0.8, StrokeWeight: 3, Bhill Collar: "#FF 20000" , Bharopcity: 0.35}); Triangle.setMap (map);
My current latitude is long 23.061389, 76.37222199999997
I do not know 10 * 0.009
is the right formula for finding or 30 Whether or not to add a degree is
follow the link
This will help you create a rectangle with any type of size polygon, source code on Google Map V3.
Comments
Post a Comment