Skip to content

Commit

Permalink
add hirise ortho layer
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Herwig committed Nov 8, 2012
1 parent 5d19392 commit f373753
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ <h6 class='description'>Mapping Mars with <a href="http://nasa.gov">NASA</a> and
<div class='inner'>
<div id='layer-switcher'>
<ul>
<li id='hirise'>
<a class='title' data-layer='herwig.map-fsvqb17k' href='#'>HiRISE Ortho</a>
<div class='description'><span class='arrow'>&nbsp;</span><p>Imagery provided by NASA JPL/University of Arizona's <a href="http://hirise.lpl.arizona.edu">High Resolution Imaging Experiment</a>, on board the Mars Reconnaisance Orbiter.</p>
</div>
</li>
<li id='red-planet'>
<a class='title' data-layer='herwig.mars-dem,herwig.mars-gazetteer' href='#'>The Red Planet</a>
<div class='description'><span class='arrow'>&nbsp;</span><p>Terrain Data Source: Mars Global Surveyor (MGS), Mars Orbiter Laser Altimeter.The source for the location dataset is the International Astronomical Union (IAU) Working Group for Planetary System Nomenclature (WGPSN).</p>
Expand Down
20 changes: 14 additions & 6 deletions site.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ $(function() {

// Build map, returns function to update map.
var buildMap = function(tilejson) {
// Tile layer, position on New York City
var map = new MM.Map('map',
new wax.mm.connector(tilejson));
map.setCenterZoom(new MM.Location(48.27,
-4.33),
3);
if (tilejson.handle == 'hirise') {
map.setCenterZoom(new MM.Location(
-4.7270,137.4051),
11);
};
wax.mm.zoomer(map).appendTo(map.parent);

// Interaction
Expand Down Expand Up @@ -45,6 +49,7 @@ $(function() {
$(map.layers[0].parent).fadeOut(500, function() {
map.removeLayerAt(0);
});

interaction = wax.mm
.interaction()
.map(map)
Expand All @@ -55,6 +60,11 @@ $(function() {
legend.content(tilejson);
$(legend.element()).animate({opacity: 1}, 500);
}
if (tilejson.handle == 'hirise') {
map.setCenterZoom(new MM.Location(
-4.7270,137.4051),
11);
}
updateUI(tilejson);
};
};
Expand All @@ -64,13 +74,12 @@ $(function() {
wax.tilejson(tileUrl($('a', el).attr('data-layer')), function(tilejson) {
tilejson.handle = $(el).attr('id');
layers[tilejson.handle] = tilejson;
// As soon as first map is loaded, build it and
// attach updateMap handler to all layer controls.
if (i == 0) {
var updateMap = buildMap(tilejson);
$('#layer-switcher li .title').click(function() {;
updateMap(layers[$(this).parent().attr('id')]);
return false;
return false;

});
}
});
Expand All @@ -90,5 +99,4 @@ $(function() {
$('.modal .close').click(function() {
$('.modal').stop().fadeOut(100);
});
});

});

0 comments on commit f373753

Please sign in to comment.