I have the same problem. Here is my code snippet:
<script type="text/javascript">
var options = {};
var map;
var polygon;
var poly_pkt = [new GLatLng(50.19, 13.00),new GLatLng(50.20,
13.00),new GLatLng(50.20, 13.01),new GLatLng(50.19, 13.01),new
GLatLng(50.19, 13.00)];
function startShape() {
map.clearOverlays();
if (polygon != null) { GetCoords(polygon);}
var color = '#ff0000';
polygon = new GPolygon(poly_pkt, color, 2, 0.7, color, 0.2);
startDrawing(polygon, "Shape", function() {GetCoords(polygon);},
color);
}
function GetCoords(poly) {
var i = poly.getVertexCount();
document.myform.myinput.value = i;
// ... and other functions ...
}
function startDrawing(poly, name, onUpdate, color) {
map.addOverlay(poly);
poly.enableDrawing(options);
poly.disableEditing({onEvent: "mouseout"});
poly.enableEditing({onEvent: "mouseover"});
GEvent.addListener(poly, "endline", function() {
GEvent.addListener(poly, "lineupdated", onUpdate);
GEvent.addListener(poly, "click", function(latlng, index) {
if (typeof index == "number") {
poly.deleteVertex(index);
}
});
});
}
function add_polygon() {
polygon = new GPolygon(poly_pkt, "#ff0000", 2, 0.7, "#ff0000", 0.2 );
map.addOverlay(polygon);
GetCoords(polygon);
}
function initialize() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.setCenter(new GLatLng(50.2, 13.0), 13);
map.clearOverlays();
add_polygon();
}
}
</script>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---