Last change
on this file since 7828 was 7798, checked in by ddboer, 15 years ago |
Range circles created for the clusters, delete doens't work good. Onle deletes lasts entrie.
|
File size:
699 bytes
|
Line | |
---|
1 | function drawCircle(lat, lng, radius, strokeColor, strokeWidth, strokeOpacity, fillColor, fillOpacity) {
|
---|
2 |
|
---|
3 | var d2r = Math.PI/180;
|
---|
4 | var r2d = 180/Math.PI;
|
---|
5 | var Clat = radius * 0.0089437672; // Convert statute kilometers into degrees latitude
|
---|
6 | var Clng = Clat/Math.cos(lat*d2r);
|
---|
7 | var Cpoints = [];
|
---|
8 | for (var i=0; i < 33; i++) {
|
---|
9 | var theta = Math.PI * (i/16);
|
---|
10 | Cy = lat + (Clat * Math.sin(theta));
|
---|
11 | Cx = lng + (Clng * Math.cos(theta));
|
---|
12 | var P = new GLatLng(Cy, Cx);
|
---|
13 | Cpoints.push(P);
|
---|
14 | }
|
---|
15 |
|
---|
16 | polygon = new GPolygon(Cpoints, strokeColor, strokeWidth, strokeOpacity, fillColor, fillOpacity);
|
---|
17 |
|
---|
18 |
|
---|
19 | return polygon;
|
---|
20 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.