Hello, I have that code:
$(document).ready(function(){000"], ["orange", "#ff8800"],
["green","#008000"],
["blue", "#000080"], ["purple", "#800080"]];
var options = {};
var lineCounter_ = 0;
//var shapeCounter_ = 0;
var markerCounter_ = 0;
var colorIndex_ = 0;
var map;
function getColor(named) {
return COLORS[(colorIndex_++) % COLORS.length][named ? 0 : 1];
}
function startLine() {
var color = getColor(false);
var line = new GPolyline([], '#ff0000');
startDrawing(line, "Line " + (++lineCounter_), function() {
var len = line.getLength();
$('#tour_length').html((Math.round(len / 10) / 100) + "
km");
alert(line.getLength());
}, color);
}
function startDrawing(poly, name, onUpdate, color) {
map.addOverlay(poly);
poly.enableDrawing(options);
poly.enableEditing({onEvent: "mouseover"});
poly.disableEditing({onEvent: "mouseout"});
GEvent.addListener(poly, "endline", function() {
GEvent.addListener(poly, 'lineupdated', function(){
onUpdate();
})
GEvent.addListener(poly, "click", function(latlng,
index) {
if (typeof index == "number") {
poly.deleteVertex(index);
}
});
});
}
function initialize() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(25.0, 0.0), 2);
map.setUIToDefault();
var typyMapy = map.getMapTypes();
typyMapy[0].getName= function() { return "Mapa";}
typyMapy[1].getName = function() { return "Satelita";}
typyMapy[2].getName = function() { return "Hybryda";}
map.addControl(new GMapTypeControl());
map.clearOverlays();
featureTable_ = document.getElementById("featuretbody");
}
}
initialize();
startLine();
})
I got so far and stucked:/ I must get coords of each point of the
polyline.
How can I put it to an array, and while removing 1 line from polyline
also remove it from array?
Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---