Commit ec11b3d8 authored by Eric Duminil's avatar Eric Duminil
Browse files

rename

parent 2f951dcb
......@@ -89,7 +89,7 @@ var regionChooser = (function(){
// but to a feature overlay which holds a collection of features.
// This collection is passed to the modify and also the draw
// interaction, so that both can add or modify features.
var featureOverlay = new ol.FeatureOverlay({
var drawnLayer = new ol.FeatureOverlay({
style : new ol.style.Style({
fill : new ol.style.Fill({
color : 'rgba(255, 155, 51, 0.5)'
......@@ -106,11 +106,9 @@ var regionChooser = (function(){
})
})
});
featureOverlay.setMap(map);
drawnLayer.setMap(map);
//TODO: Rename to Javascript naming convention (CamelCase).
var selected_features = featureOverlay.getFeatures();
selected_features.on('add', function(event) {
drawnLayer.getFeatures().on('add', function(event) {
var feature = event.element;
feature.on("change", function() {
displayInfo();
......@@ -118,7 +116,7 @@ var regionChooser = (function(){
});
var modify = new ol.interaction.Modify({
features : featureOverlay.getFeatures(),
features : drawnLayer.getFeatures(),
// the SHIFT key must be pressed to delete vertices, so
// that new vertices can be drawn at the same position
// of existing vertices
......@@ -129,7 +127,7 @@ var regionChooser = (function(){
map.addInteraction(modify);
var draw = new ol.interaction.Draw({
features : featureOverlay.getFeatures(),
features : drawnLayer.getFeatures(),
type : 'Polygon'
});
map.addInteraction(draw);
......@@ -317,7 +315,7 @@ var regionChooser = (function(){
displayHelp();
document.documentElement.className = ''; // Stop waiting
draw.setActive(true);
featureOverlay.getFeatures().clear();
drawnLayer.getFeatures().clear();
intersections.clear();
focusOnMap();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment