Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
var geocoder; var location1; function initialize() { geocoder = new GClientGeocoder(); } function showLocation(address) { var locations = 0; geocoder.getLocations(address, function (response) { if (!response || response.Status.code != 200) { alert("There was an error"); } else { location1 = {lat: response.Placemark[0].Point.coordinates[1], lon: response.Placemark[0].Point.coordinates[0]}; } }); var glatlng1 = new GLatLng(location1.lat, location1.lon); var brenham = new GLatLng(30.152289,-96.384881); var college_station = new GLatLng(30.610584,-96.306002); var miledistance1 = glatlng1.distanceFrom(brenham); var miledistance2 = glatlng1.distanceFrom(college_station); if (miledistance1 <= miledistance2) { locations = (miledistance1 * .000621371192); } else { locations = (miledistance2 * .000621371192); } return locations; } window.onload=function() {initialize();}
This paste will be private.
From the Design Piracy series on my blog: