This file contains hidden or 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
using System; | |
using MonoTouch.Dialog; | |
using System.Drawing; | |
using MonoTouch.UIKit; | |
namespace lifeboxapp.monotouch | |
{ | |
/// <summary> | |
/// Override the default MonoTouch.Dialog Pull To Refresh view so it says "Pull To Add" | |
/// </summary> |
This file contains hidden or 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 circle (curLon, curLat, distanceKm) { | |
var i = 0; | |
var circle = []; | |
while (i < 360) { | |
circle.push(this.destination(curLon,curLat, i, distanceKm)); | |
i += 20; | |
} | |
return circle; | |
} |
This file contains hidden or 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
/* | |
* Coordinates found at Web Address : http://mbostock.github.io/protovis/ex/countries.js | |
* Original link Found : http://stackoverflow.com/a/6325428/814290 | |
* Converted to GeoJSON here so we don't have to manipulate the data for OpenLayers. | |
* | |
* Can use linq.js (http://linqjs.codeplex.com/) to query. | |
* var country = $.Enumerable.From(countries).Where("x => x.code == 'IE'").FirstOrDefault(); | |
*/ | |
var countries = [{ |
This file contains hidden or 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 buffer(leafletGeometry, distance){ | |
var reader, input, buffer, bufferGeoJSON; | |
reader = new jsts.io.GeoJSONReader(); | |
input = reader.read(leafletGeometry.toGeoJSON()); | |
buffer = input.geometry.buffer(distance); | |
bufferGeoJSON = new jsts.io.GeoJSONWriter().write(buffer); | |
return L.geoJson(bufferGeoJSON); |
This file contains hidden or 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
/// <summary> | |
/// Takes an L.latLngBounds object and returns an 8 point L.polygon. | |
/// L.rectangle takes an L.latLngBounds object in its constructor but this only creates a polygon with 4 points. | |
/// This becomes an issue when you try and do spatial queries in SQL Server or another database because when the 4 point polygon is applied | |
/// to the curvature of the earth it loses it's "rectangular-ness". | |
/// The 8 point polygon returned from this method will keep it's shape a lot more. | |
/// </summary> | |
/// <param name="map">L.map object</param> | |
/// <returns type="">L.Polygon with 8 points starting in the bottom left and finishing in the center left</returns> | |
function createPolygonFromBounds(latLngBounds) { |
This file contains hidden or 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
.replace(/\s{2,}/g, ' ')//remove all double spaces with a single | |
.replace(/[ \t\r]/g, ''),//remove all whitespace | |
.trim()//remove leading and trailing spaces (supported IE9+) | |
"POINT (-0.159689 51.463423)".match(/(-?\d+(\.\d+)?)/g);//return the latitude & longitude from this WKT string |
This file contains hidden or 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
{ | |
output: { | |
filename: 'myapp.[contenthash].js' | |
} | |
} |
This file contains hidden or 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
using System.IO; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
using System.Web; | |
using System.Web.Mvc; | |
namespace MyApp.Helpers.HtmlHelpers | |
{ | |
public static class HtmlHelperExtensions | |
{ | |
private const string ScriptFolder = "dist"; |
This file contains hidden or 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
<script src="@Html.Raw(Html.GetScripts("myapp.*.js"))"></script> |
This file contains hidden or 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
{ | |
output: { | |
filename: 'myapp.local.js' | |
} | |
} |
OlderNewer