Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hidden base layer attributions #271

Merged
merged 2 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CHANGELOG
8.5.4+dev (20XX-XX-XX)
----------------------------

-
- Fix hidden base layer attributions (#271)

8.5.4 (2023-07-03)
-----------------------
Expand Down
35 changes: 0 additions & 35 deletions mapentity/static/mapentity/leaflet.informationcontrol.js

This file was deleted.

28 changes: 0 additions & 28 deletions mapentity/static/mapentity/mapentity.forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,34 +37,6 @@ MapEntity.GeometryField = L.GeometryField.extend({
this._addExtraLayers(map);
},

_addExtraControls: function (map) {
if (map.attributionControl._map) {
map.removeControl(map.attributionControl);
}
map.addControl(new L.Control.ResetView(this._getResetBounds.bind(this)));

/*
* Allow to load files locally.
*/
var pointToLayer = function (feature, latlng) {
return L.circleMarker(latlng, {style: window.SETTINGS.map.styles.filelayer})
.setRadius(window.SETTINGS.map.styles.filelayer.radius);
},
onEachFeature = function (feature, layer) {
if (feature.properties.name) {
layer.bindLabel(feature.properties.name);
}
},
filecontrol = L.Control.fileLayerLoad({
fitBounds: true,
layerOptions: {style: window.SETTINGS.map.styles.filelayer,
pointToLayer: pointToLayer,
onEachFeature: onEachFeature}
});
map.filecontrol = filecontrol;
map.addControl(filecontrol);
},

_addExtraLayers: function (map) {
// Layer with objects of same type
var objectsLayer = this.buildObjectsLayer();
Expand Down
3 changes: 0 additions & 3 deletions mapentity/static/mapentity/mapentity.map.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ $(window).on('entity:map', function (e, data) {
map.boxZoom.disable();
}

map.attributionControl.setPrefix('');

var mapBounds = $container.data('mapextent');
if (mapBounds) {
map.fitBounds(mapBounds);
Expand Down Expand Up @@ -231,7 +229,6 @@ $(window).on('entity:map:list', function (e, data) {
var map = data.map,
bounds = L.latLngBounds(data.options.extent);

map.removeControl(map.attributionControl);
map.doubleClickZoom.disable();

map.addControl(new L.Control.Information());
Expand Down
4 changes: 0 additions & 4 deletions mapentity/static/mapentity/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -650,10 +650,6 @@ span.filter-info {
background-color: rgba(240, 240, 240, 0.5);
}

.map-panel .leaflet-control-attribution {
display: none;
}

.map-panel .leaflet-control-information {
display: block;
}
Expand Down
1 change: 0 additions & 1 deletion mapentity/templates/mapentity/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@
<script type="text/javascript" src="{% static 'mapentity/leaflet-objectslayer.js' %}"></script>
<script type="text/javascript" src="{% static 'mapentity/leaflet-serializers.js' %}"></script>
<script type="text/javascript" src="{% static 'mapentity/leaflet-datatables.js' %}"></script>
<script type="text/javascript" src="{% static 'mapentity/leaflet.informationcontrol.js' %}"></script>
<script type="text/javascript" src="{% static 'mapentity/leaflet.enumeration.js' %}"></script>

<!-- Forms -->
Expand Down