From 435698d53b0f5d31919f3442ffba98f46f362f6b Mon Sep 17 00:00:00 2001 From: echarp Date: Sun, 1 Mar 2015 16:50:02 +0100 Subject: [PATCH] Attempt to modify the map gridSize --- app/assets/javascripts/maps.js.coffee | 5 +++-- app/assets/stylesheets/maps.css.sass | 11 +++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/maps.js.coffee b/app/assets/javascripts/maps.js.coffee index ebcdca25..54458b95 100644 --- a/app/assets/javascripts/maps.js.coffee +++ b/app/assets/javascripts/maps.js.coffee @@ -1,3 +1,4 @@ +# Setting up OpenStreeMap from a generic #map element $(document).ready -> $('#map.events').each -> map = L.map 'map' @@ -19,7 +20,7 @@ $(document).ready -> if (feature.properties && feature.properties.popupContent) layer.bindPopup feature.properties.popupContent - map.addLayer L.markerClusterGroup().addLayer layer + map.addLayer L.markerClusterGroup({gridSize: 10}).addLayer layer if (layer.getBounds()._northEast && layer.getBounds()._southWest) # Automatic focus to all displayed events @@ -49,6 +50,6 @@ $(document).ready -> if (feature.properties && feature.properties.popupContent) layer.bindPopup(feature.properties.popupContent) - map.addLayer L.markerClusterGroup().addLayer layer + map.addLayer L.markerClusterGroup({gridSize: 10}).addLayer layer marker = L.marker([coord[0], coord[1]]).addTo map diff --git a/app/assets/stylesheets/maps.css.sass b/app/assets/stylesheets/maps.css.sass index aa1c2b60..9676eee0 100644 --- a/app/assets/stylesheets/maps.css.sass +++ b/app/assets/stylesheets/maps.css.sass @@ -14,12 +14,11 @@ &.event height: 20em -.tags - #map - width: 40% - height: 60em - margin: 1.6em 2% - +inline-block() +.tags #map + width: 40% + height: 60em + margin: 1.6em 2% + +inline-block() html.iframe #map width: 100%