Compare commits

..

4 commits

Author SHA1 Message Date
Yohan Boniface
48f4daf419
fix: catch cluster error at zoom in certain situation (#2464)
Some checks are pending
Test & Docs / docs (push) Waiting to run
Test & Docs / lint (push) Waiting to run
Test & Docs / tests (postgresql, 3.10) (push) Waiting to run
Test & Docs / tests (postgresql, 3.12) (push) Waiting to run
Eg. to reproduce: a map with a limitBounds that makes uMap immediately
zoom to fit the bbox.
2025-01-30 18:49:19 +01:00
Yohan Boniface
a18b240c65 fix: catch cluster error at zoom in certain situation
Eg. to reproduce: a map with a limitBounds that makes uMap immediately
zoom to fit the bbox.

Co-authored-by: David Larlet <david@larlet.fr>
2025-01-30 18:40:05 +01:00
David Larlet
e6db23d4d3
fix: better buttons positionning for the homepage (#2463) 2025-01-30 11:35:40 -05:00
David Larlet
0e5cdec97e
fix: better buttons positionning for the homepage 2025-01-30 10:16:09 -05:00
6 changed files with 21 additions and 10 deletions

View file

@ -145,6 +145,7 @@ h2.tabs a:hover {
}
.highlights {
text-align: center;
margin-bottom: calc(var(--box-margin) * 2);
}
.highlights img.colophon {
display: inline-block;
@ -183,8 +184,6 @@ input[type="submit"],
}
.wrapper .button,
.wrapper input {
height: 56px;
line-height: 43px;
font-weight: bold;
}

View file

@ -83,7 +83,7 @@ input[type="submit"] {
border-radius: 2px;
font-weight: normal;
cursor: pointer;
padding: 3px 12px;
padding: var(--button-padding);
border: none;
text-decoration: none;
background-color: white;
@ -342,11 +342,12 @@ input.switch:checked ~ label:after {
width: 100%
}
.button-bar {
grid-gap: 7px;
grid-gap: var(--gutter);
}
.umap-multiplechoice.by2,
.button-bar.half {
grid-template-columns: 1fr 1fr;
justify-items: center;
}
.button-bar.by3,
.button-bar.by5,
@ -363,6 +364,7 @@ input.switch:checked ~ label:after {
.button-bar .button,
.button-bar [type="button"] {
display: inline-block;
width: 100%;
}
.umap-multiplechoice input[type='radio'] {
display: none;

View file

@ -63,7 +63,17 @@ export const Cluster = L.MarkerClusterGroup.extend({
addLayer: function (layer) {
this._layers.push(layer)
return L.MarkerClusterGroup.prototype.addLayer.call(this, layer)
try {
return L.MarkerClusterGroup.prototype.addLayer.call(this, layer)
} catch (error) {
console.debug(error)
// Certainly a race condition when loading a clustered layer
// while zooming (this for example can happen at load, when the
// initial zoom is changed by uMap).
// FIXME: remove when this is merged:
// https://github.com/Leaflet/Leaflet.markercluster/pull/1048/files
return this
}
},
removeLayer: function (layer) {

View file

@ -41,7 +41,7 @@ footer .i18n_switch {
display: flex;
flex-direction: column;
}
.umap-nav a {
.umap-nav a:not(.button) {
color: var(--color-darkBlue);
padding: .4rem;
}
@ -51,7 +51,7 @@ footer .i18n_switch {
.umap-nav h1 {
margin-bottom: 0;
}
.umap-nav h1 a {
.umap-nav h1 a:not(.button) {
background-image: url("./img/logo.svg");
background-position: left center;
background-repeat: no-repeat;
@ -74,7 +74,6 @@ html[dir="rtl"] .umap-nav h1 a {
.umap-nav .button,
.umap-nav .button:hover {
text-decoration: none;
min-width: 150px;
margin-inline-start: 1rem;
}

View file

@ -24,6 +24,7 @@
--button-primary-color: var(--color-darkBlue);
--button-neutral-background: var(--color-lightGray);
--button-neutral-color: var(--color-darkGray);
--button-padding: 8px 16px;
/* Sizes and spaces */
--gutter: 8px;

View file

@ -60,10 +60,10 @@
{% spaceless %}
<div class="button-bar {% if demo_map %}half{% endif %}">
{% if not UMAP_READONLY %}
<a href="{% url 'map_new' %}" class="button button-primary half">{% trans "Create a map" %}</a>
<a href="{% url 'map_new' %}" class="button button-primary">{% trans "Create a map" %}</a>
{% endif %}
{% if demo_map %}
<a href="{{ demo_map.get_absolute_url }}" class="button half neutral">{% trans "Play with the demo" %}</a>
<a href="{{ demo_map.get_absolute_url }}" class="button neutral">{% trans "Play with the demo" %}</a>
{% endif %}
</div>
{% endspaceless %}