This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function playSomeSound(genre) { | |
SC.get('/tracks', { | |
genres: genre | |
//bpm: { | |
//from: 100 | |
// } | |
}, function(tracks) { | |
var random = Math.floor(Math.random() * 49); | |
SC.oEmbed(tracks[random].uri, { auto_play: true}, document.getElementById('target')); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var map2 = L.map('map2').setView([44.56357, -123.28141355887], 14); | |
L.tileLayer('http://{s}.tiles.mapbox.com/v3/YOUR_MAP_ID_HERE/{z}/{x}/{y}.png', | |
{ | |
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>', | |
maxZoom: 18 | |
}).addTo(map2); | |
var points = [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var map1 = L.map('map1').setView([44.55957, -123.28141355887], 13); | |
L.tileLayer('http://{s}.tiles.mapbox.com/v3/YOUR_MAP_ID_HERE/{z}/{x}/{y}.png', | |
{ | |
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>', | |
maxZoom: 18 | |
}).addTo(map1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="map1"></div> | |
<script src="./js/tutMap1.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// bldgcrawler.php | |
// Loops through sequential get requests to the OSU Campus Map and retrieves | |
// any additional landmark info as JSON reply. Parse JSON reply and output | |
// to browser. | |
// Vaughan Schmidt | |
// schmicar@onid.engr.oregonstate.edu | |
// 2014.11.13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myMarker = null; | |
var myLL; | |
var lat = 0; | |
var lng = 0; | |
var closeet = null; | |
var closestIdx = null; | |
var closestDist = 0; | |
// from: http://www.w3schools.com/html/html5_geolocation.asp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// while we're at it, find the closest marker to user | |
closest = L.GeometryUtil.closest(map3, points, myLL); | |
for (i = 0; i < points.length; i++) { | |
var delta = 1E-14; | |
var latDiff = Math.abs(points[i].lat - closest.lat); | |
var lngDiff = Math.abs(points[i].lng - closest.lng); | |
if (((latDiff < delta) && (lngDiff < delta))) { | |
closestIdx = i; | |
closestDist = myLL.distanceTo(points[i]); |
NewerOlder