Skip to content

Commit 059b4ac

Browse files
committed
Removed legend and overlay control.
1 parent dbbe728 commit 059b4ac

3 files changed

Lines changed: 1 addition & 47 deletions

File tree

users/static/js/user-map-component.js

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -179,39 +179,6 @@ function createUserMenuControl(options) {
179179
return control;
180180
}
181181

182-
/**
183-
* Create legend control instance on the bottom right of the map.
184-
* The legend contains the icon and the name of the role:
185-
* 1. User
186-
* 2. Trainer
187-
* 3. Developer
188-
*
189-
* @returns {object} control
190-
*/
191-
function createLegendControl(){
192-
var control;
193-
control = L.Control.extend({
194-
options: {
195-
position: 'bottomright'
196-
},
197-
onAdd: function () {
198-
var legend_container = L.DomUtil.create('div',
199-
'info legend');
200-
legend_container.innerHTML += $("#legend").html();
201-
202-
//Prevent firing drag and onClickMap event when clicking this control
203-
var stop = L.DomEvent.stopPropagation;
204-
L.DomEvent
205-
.on(legend_container, 'click', stop)
206-
.on(legend_container, 'mousedown', stop)
207-
.on(legend_container, 'dblclick', stop)
208-
.on(legend_container, 'click', L.DomEvent.preventDefault);
209-
return legend_container;
210-
}
211-
});
212-
return control;
213-
}
214-
215182
/**
216183
* Listener to geolocation. Called when location is found.
217184
* NOTE:

users/templates/html/base.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,7 @@
9393
};
9494
user_menu_control = createUserMenuControl(user_menu);
9595
map.addControl(new user_menu_control);
96-
$(".user-menu-control").tooltip({placement: 'right',
97-
container: 'body'});
98-
99-
// Create Legend Control:
100-
legend_control = createLegendControl();
101-
map.addControl(new legend_control);
96+
$(".user-menu-control").tooltip({placement: 'right', container: 'body'});
10297
</script>
10398

10499
{% block js_container %}

users/templates/html/index.html

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,6 @@ <h3 class="modal-title">Request Edit Link</h3>
8787
users_layer.addTo(map);
8888
developers_layer.addTo(map);
8989
trainers_layer.addTo(map);
90-
91-
//Specify all layers on overlays_layers control
92-
overlays_layer = {
93-
"Users": users_layer,
94-
"Developers": developers_layer,
95-
"Trainers": trainers_layer
96-
}
97-
L.control.layers(null, overlays_layer).addTo(map)
9890
})
9991
</script>
10092
{% endblock %} <!--endblock of js_container -->

0 commit comments

Comments
 (0)