Skip to content

Commit

Permalink
Fix : Cluster not displaying on mobile + responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
clementp0 committed Jun 13, 2024
1 parent dd147d1 commit 217333c
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions assets/js/page/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ ClusterIcon.prototype.setCenter = function(center) {
*/
ClusterIcon.prototype.createCss = function(pos) {
var style = [];
style.push('background-image:url(' + this.url_ + ');');
style.push('background-image:url(' + this.url_ + ');background-size: contain;');
var backgroundPosition = this.backgroundPosition_ ? this.backgroundPosition_ : '0 0';
style.push('background-position:' + backgroundPosition + ';');

Expand Down Expand Up @@ -1326,7 +1326,7 @@ function setMarkers(map, items) {


new MarkerClusterer(map, markers, {
imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m',
imagePath: '/assets/cluster/m',
gridSize: 60,
maxZoom: 15,
minimumClusterSize: 3
Expand Down
13 changes: 12 additions & 1 deletion assets/scss/page/map.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// map page
#map-wrapper-inner {
height: calc(100vh - 88px);
height: calc(100dvh - 44px);
position: relative;
overflow: hidden;

Expand Down Expand Up @@ -255,4 +255,15 @@
100% {
color: #e9cd11;
}
}

// Override properties

footer{
display: none!important;
}

body{
min-height: 100%!important;
padding-bottom: 0!important;
}
Binary file added public/assets/cluster/m1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/cluster/m2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/cluster/m3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/cluster/m4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/cluster/m5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions templates/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="default">

<script src="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css" integrity="sha512-MV7K8+y+gLIBoVD59lQIYicR65iaqukzvf/nwasF0nqhPay5w/9lJmVM2hMDcnK1OnMGCdVK+iQrJ7lzPJQd1w==" crossorigin="anonymous" referrerpolicy="no-referrer"/>
<link rel="manifest" href="../manifest.json">

Expand Down
2 changes: 1 addition & 1 deletion templates/map/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% include 'sidebar.html.twig' %}
{% endif %}

<div class="loading-container">
<div class="loading-container" style="display:none">
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-size: 20px;">
<div class="loading-image">
<img src="/assets/loading.png">
Expand Down

0 comments on commit 217333c

Please sign in to comment.