I was searching from last 1-2 hours about this question but didn’t get any answer if this question is posted before then please give me link and delete this one anyways,
I’ve a marker in my google map and its like mobile tower
I want to create 10 KM triangle of 120 degree on that marker click,
here’s the 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 triangleCoords = [
new google.maps.LatLng(Tlat2, Tlng2),
new google.maps.LatLng(Tlat, Tlng),
new google.maps.LatLng(Tlat3, Tlng3)
];
alert(triangleCoords);
Triangle = new google.maps.Polygon({
paths: triangleCoords,
strokeColor: "#FF0000",
strokeOpacity: 0.8,
strokeWeight: 3,
fillColor: "#FF0000",
fillOpacity: 0.35
});
Triangle.setMap(map);
My current lat-long is 23.061389, 76.37222199999997 I don’t know 10*0.009 is correct formula to find out km or adding 30 degree is correct or not
Follow the link
http://www.birdtheme.org/useful/v3tool.html
this will help you to draw any type of shape polygon, rectangle with source code on Google Map V3.