Skip to content

Instantly share code, notes, and snippets.

function Model(props) {
var obj = { 'props': props };
for (o in obj.props) {
if (obj.props.hasOwnProperty(o)) {
this[o] = new Function("value", "if (!arguments.length) return typeof this.props['" + o.toString() +
"'] == 'function' ? this.props['" + o.toString() + "'].call(this) : this.props['" + o.toString() + "'];" +
"this.props['" + o.toString() + "'] = (typeof value == 'function' ? value.call(this) : value); return this")
}
}
(function (navigator) {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(location) {
var lat = location.coords.latitude,
lon = location.coords.longitude,
url = 'https://maps.google.com/maps?q='+lat+','+lon;
console.log('Latitude: %s | Longitude: %s \n%o', lat, lon, url);
var map = window.open(url, "GAMap", "width=1200,height=800");
});
}