Just wanted to add that I've looked at the other threads about
capturing the vertex data from polygons.  My question is specifically
about how to incorporate that functionality into this demo mapplet.
I'm lost on where and how to add the getVertex() method.


Thanks,
Precar.


On Feb 12, 1:20 pm, precar <[email protected]> wrote:
> Hi,
>
> I'm trying tocustomizethis 
> map:http://gmaps-samples.googlecode.com/svn/trunk/poly/mymapstoolbar.html.
>
> Specifically, what I need is to be able to save a polyline or polygon
> the user draws on the map, and display it on another map elsewhere on
> the site.
>
> I started inside the startShape() function, where:
>
>   startDrawing(polygon, "Shape " + (++shapeCounter_), function() {
>     var cell = this;
>     var area = polygon.getArea();
>     cell.innerHTML = (Math.round(area / 10000) / 100) + "km<sup>2</
> sup>";
>   }, color);
>
> I changed the above to:
>
>   startDrawing(polygon, "Shape " + (++shapeCounter_), function() {
>     var cell = this;
>     var count = polygon.getVertexCount();
>     var vertices = new Array();
>    for (i=0;i<count;i++) {
>     vertices[i] = polygon.getVertex(i);
>     cell.innerHTML = vertices;
>   }, color);
>
> The idea was that instead of displaying the area of the polygon, it
> would give the vertices of the polygon, which I could save to a
> database and redraw later on another map.  But this approach gives me
> nothing.  I can use getVertex() on a specific vertex (1, 2, 3, etc.),
> which outputs a value, but the loop doesn't give me anything.
>
> Can someone shed some light on what I might be doing wrong?  Am I
> putting the loop in the wrong place/function?  Or is the loop wrong
> altogether, should I be doing something else?
>
> Thanks,
> Precar.
--~--~---------~--~----~------------~-------~--~----~
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