Skip to content

Commit

Permalink
Merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
onyxfish committed Apr 17, 2012
2 parents 9df7d3d + 0da1a97 commit 2db9cb6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
11 changes: 11 additions & 0 deletions assets/css/art.css
Expand Up @@ -57,3 +57,14 @@ body { padding: 40px 0 0 0; }
}
}

div[id^="popup-"]{
position: absolute;
bottom: 50px;
left: 50px;
z-index: 1002;
background-color: #2c2c2c;
padding: 8px;
border: 1px solid #444;
color: white;
font-size: 16px;
}
28 changes: 13 additions & 15 deletions assets/js/art.js
Expand Up @@ -13,6 +13,9 @@ ART.utils = {};
/* Settings */

ART.settings.fusion_table_id = "1OHO4HXJyZNjKiGDrG_Mmdp-NTTmNE9lhkBPOMwk";
ART.settings.default_coords = new L.LatLng(32.33523, -95.3011);
ART.settings.default_zoom = 13;
ART.settings.artwork_zoom = 18;

/* Utility functions */

Expand Down Expand Up @@ -251,14 +254,14 @@ ART.views.map = Backbone.View.extend({
}, this);

if (artwork) {
this.map.setView(new L.LatLng(artwork.get("latitude"), artwork.get("longitude")), 18);
this.map.setView(this.art_coords(artwork), ART.settings.artwork_zoom);
}
}
},

render: function() {
this.map = new L.Map("map-canvas", { minZoom:13, maxZoom:20 });
this.map.setView(new L.LatLng(32.33523, -95.3011), 13);
this.map.setView(ART.settings.default_coords, ART.settings.default_zoom);
this.map.addLayer(this.base_layer);

this.clusterer = new LeafClusterer(this.map, [], { gridSize: 32 });
Expand All @@ -268,7 +271,7 @@ ART.views.map = Backbone.View.extend({
this.clusterer.clearMarkers();

this.artwork_collection.each(function(artwork) {
var latlng = new L.LatLng(artwork.get("latitude"), artwork.get("longitude"));
var latlng = this.art_coords(artwork);

var marker = new L.Marker(latlng);

Expand All @@ -282,17 +285,6 @@ ART.views.map = Backbone.View.extend({

var popup = $("<div></div>", {
id: "popup-" + artwork.get("slug"),
css: {
position: "absolute",
bottom: "50px",
left: "50px",
zIndex: 1002,
backgroundColor: "#2c2c2c",
padding: "8px",
border: "1px solid #444",
color: "white",
fontSize: "16px"
},
html: description
});

Expand All @@ -313,10 +305,16 @@ ART.views.map = Backbone.View.extend({

resize: function() {
var h = $(window).height(),
offsetTop = 40;
offsetTop = $(".navbar-fixed-top").height();

$('#map-canvas').css('height', (h - offsetTop));
this.map.invalidateSize();
},

art_coords: function(artwork){
var lat = artwork.get("latitude");
var lon = artwork.get("longitude");
return new L.LatLng(lat,lon);
}
});

Expand Down

0 comments on commit 2db9cb6

Please sign in to comment.