Parcourir la source

taille par défaut de la carte au chargement

julpec il y a 8 ans
Parent
commit
c7206c47c1
2 fichiers modifiés avec 10 ajouts et 1 suppressions
  1. 6 0
      celutz/settings.py
  2. 4 1
      panorama/templates/panorama/main.html

+ 6 - 0
celutz/settings.py

@@ -130,6 +130,12 @@ PANORAMA_TILES_DIR = "tiles"
 # (in meters)
 PANORAMA_MAX_DISTANCE = 50000
 
+# Max and min latitudes and longitudes for the default main map view
+MAP_MIN_LAT = 45.17
+MAP_MAX_LAT = 45.20
+MAP_MIN_LONG = 5.68
+MAP_MAX_LONG = 5.77
+
 # Celery configuration
 BROKER_URL = 'django://'
 CELERY_TASK_SERIALIZER = 'json'

+ 4 - 1
panorama/templates/panorama/main.html

@@ -4,6 +4,7 @@
 {% load distance_filter %}
 {% load i18n %}
 {% load l10n %}
+{% load utils %}
 
 {% block title %}{% trans "Celutz, a panorama viewer"%}{% endblock title %}
 
@@ -145,7 +146,9 @@
                 popup.on('mouseover', marker.openPopup);
                 popup.on('mouseout', marker.closePopup);
                 markerClusters.addLayer( marker );
-                allMarkers.push([{{ pano.latitude }}, {{ pano.longitude }}]);
+                if ( {{ pano.latitude }} > {% get_setting 'MAP_MIN_LAT' %} && {{ pano.latitude }} < {% get_setting 'MAP_MAX_LAT' %} && {{ pano.longitude }} > {% get_setting 'MAP_MIN_LONG' %} && {{ pano.longitude }} < {% get_setting 'MAP_MAX_LONG' %} ) {
+                    allMarkers.push([{{ pano.latitude }}, {{ pano.longitude }}]);
+                }
             {% endfor %}
             map.addLayer( markerClusters );
             // Add POI