Skip to content

Commit

Permalink
fix bug with spotlight and marker-click; update images in json
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Herwig committed Aug 6, 2013
1 parent 8aa1ec8 commit 3a165fb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 70 deletions.
15 changes: 15 additions & 0 deletions _includes/rover.js
Expand Up @@ -80,7 +80,22 @@ $.getJSON('/planets/js/locations.geojson', function (geoJson) {
markerLayer.on('click', function (e) {
e.layer.unbindPopup();
var n = e.layer.feature.properties;
var coords = [e.latlng.lng,e.latlng.lat];
var id = $(this).attr('id')
$('#pictures').scrollTo('#' + n['uid'], 500);
if ($('.image-marker') != undefined) {
$('.image-marker').remove()
}
var marker = new L.marker([coords[1], coords[0]], {
id: id,
icon: L.divIcon({
className: 'image-marker',
html: '<div class="spotlight"></div>',
iconSize: new L.Point(90, 90),
})
}).addTo(map);
map.setView(new L.LatLng(coords[1], coords[0]), 18);

});
});
})

0 comments on commit 3a165fb

Please sign in to comment.