Hi,

I'm trying to customize this 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