Ejemplo n.º 1
0
var pickStakeLabels = [
	{title:"Top Left / Bottom Right", enabled:false},
	{title:"Top Right / Bottom Left", enabled:false}
];
//Enable Stake Orientation TabbedBar
pickStakeLabels[0].enabled = true;
pickStakeLabels[1].enabled = true;
$.pickStake.labels = pickStakeLabels;

//Start continuous location capture - based on distance filter
var gps = require('location');
	gps.location(function(latitude, longitude, accuracy, error) {
		if(error == true){
			//returns an error
		}else{
			//updated lat & long
			current_latitude = latitude;
			current_longitude = longitude;
			current_accuracy = accuracy;
		}
	});

// Instruciton text
var instructions = 
	"When conducting a site survey, remain on one side of the transect at all times (downslope if applicable) to avoid disturbing the observations.\n\n" +
	"Some example Transect Name schemes are sequential (\"T1\", \"T2\"..), directional (\"South\", \"North\"..), or descriptive (\"Creekside\", \"Hillside\"..)\n\n" +
	"All surveyors require a first name of two or more letters and a last name.\n\n" +
	"Stake Orientation only affects the default value of each plot, and can be altered on a per plot basis to any custom value.\n\n" +
	"Plot Distance is the default distance, in meters, between each plot. Individual plot deviations can be noted when adding a plot.\n\n" +
	"When taking the transect's photo, stand at one end and face the other. Capture the transect and the horizon. This photo will assist in locating the transect when revisiting the site.\n\n" +
	"Capture Location should be completed from the same spot the photo is taken.\n\n\n";
$.info.text = instructions;
Ejemplo n.º 2
0
var busStops = require('bus_stops');
var Q = require('q');
var location = require('location');
var UI = require('ui');
var _ = require('underscore');
var singleStop = require('single_stop');
var Vibe = require('ui/vibe');
var Light = require('ui/light');
var Feature = require('platform/feature');
var ErrorCard = require('error_card');

var sortedStops = Q.all([location.location(), busStops.busStops()])
.spread(busStops.sortByDistance)
.then(function(stops){
  var stopAggregates = stops.map(function(stop){
    return {
      "name": stop.przystanek.properties.stop_name,
      "id": stop.przystanek.id,
      "distance": stop.distance,
      "headsigns": stop.przystanek.properties.headsigns.split(", ")
    };
  }).reduce(function(all, elem){
    var stopAggregate = _.findWhere(all, {"name": elem.name});
    if(_.isUndefined(stopAggregate)){
      all.push({"name": elem.name, "stops": [elem]});
    } else {
      stopAggregate.stops.push(elem);
    }
    return all;
  }, []);