Thoern
unread,May 20, 2011, 6:45:59 AM5/20/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Maps JavaScript API v3
I use a draw polygon by insertin nodes as below.
But when having a KML layer in the map the KML layer is ontop the
polygon..
How do you change to make the polygon sit ontop the KML?
Is it just a question of creating a new instance of the kml layer
BEFORE the polygon in the
"Initialize map function"? or is this some native behavior?
poly = new google.maps.Polygon({
strokeWeight: 3,
fillColor: '#5555FF'
});
poly.setMap(map);
poly.setPaths(new google.maps.MVCArray([path]));
google.maps.event.addListener(map, 'click', addPoint);
}
function addPoint(event) {
path.insertAt(path.length, event.latLng);
var marker = new google.maps.Marker({
position: event.latLng,
map: map,
draggable: true
});
markers.push(marker);
marker.setTitle("#" + path.length);
google.maps.event.addListener(marker, 'click', function() {
marker.setMap(null);
for (var i = 0, I = markers.length; i < I && markers[i] !=
marker; ++i);
markers.splice(i, 1);
path.removeAt(i);
}
);
google.maps.event.addListener(marker, 'dragend', function() {
for (var i = 0, I = markers.length; i < I && markers[i] !=
marker; ++i);
path.setAt(i, marker.getPosition());
}
);
}