Hi,

I am trying to get started using http://econym.googlepages.com/eshapes.htm.

1) Does anyone know which algorithm is being used to draw the shapes?

2) My problem is that the function definition has the following
signature

GPolygon.Shape = function(point,r1,r2,r3,r4,rotation,vertexCount,
strokeColour,strokeWeight,Strokepacity,fillColour,fillOpacity,opts,tilt)

where r1, r2, r3 & r4 are in meters but I do not have any clue about
what they really represent! I know that point is the center GLatLng
object and I understand the rest parameters. My problem is that I want
to calculate the r1, r2, r3 & r4 parameters dynamically from GLatLng
objects which I use.

So firstly, I must understand what they represent in order to perform
any calculation.
Any help will be appreciated.

Thanks in advance
Nikos

p.s. If someone can help me I provide the full code snippet:

GPolygon.Shape = function(point,r1,r2,r3,r4,rotation,vertexCount,
strokeColour,strokeWeight,Strokepacity,fillColour,fillOpacity,opts,tilt)
{
    var rot = -rotation*Math.PI/180;
    var points = [];
    var latConv = point.distanceFrom(new GLatLng(point.lat()
+0.1,point.lng()))*10;
    var lngConv = point.distanceFrom(new
GLatLng(point.lat(),point.lng()+0.1))*10;
    var step = (360/vertexCount)||10;

    var flop = -1;
    if (tilt) {
        var I1=180/vertexCount;
    } else {
        var  I1=0;
    }
    for(var i=I1; i<=360.001+I1; i+=step) {
    var r1a = flop?r1:r3;
    var r2a = flop?r2:r4;
    flop = -1-flop;
    var y = r1a * Math.cos(i * Math.PI/180);
    var x = r2a * Math.sin(i * Math.PI/180);
    var lng = (x*Math.cos(rot)-y*Math.sin(rot))/lngConv;
    var lat = (y*Math.cos(rot)+x*Math.sin(rot))/latConv;

    points.push(new GLatLng(point.lat()+lat,point.lng()+lng));
    }
    return (new
GPolygon(points,strokeColour,strokeWeight,Strokepacity,fillColour,fillOpacity,opts))
}


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to