Skip to content

Commit

Permalink
Merge pull request #271 from makinacorpus/fix_attribution_openstreetmap
Browse files Browse the repository at this point in the history
Fix hidden base layer attributions
  • Loading branch information
Huquette authored Aug 14, 2023
2 parents 686cf0b + 93ab402 commit 75598fe
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 72 deletions.
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

0 comments on commit 75598fe

Please sign in to comment.