Updated locations to london locations

This commit is contained in:
Martin Donnelly 2018-10-11 16:33:25 +01:00
parent e3695aed09
commit 13ac0f1503
3 changed files with 23 additions and 7 deletions

11
package-lock.json generated
View File

@ -3395,6 +3395,7 @@
"version": "1.0.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"delayed-stream": "~1.0.0"
}
@ -3457,7 +3458,8 @@
"delayed-stream": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"delegates": {
"version": "1.0.0",
@ -3745,12 +3747,14 @@
"mime-db": {
"version": "1.27.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"mime-types": {
"version": "2.1.15",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"mime-db": "~1.27.0"
}
@ -3826,7 +3830,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"oauth-sign": {
"version": "0.8.2",

View File

@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
const CACHE_VERSION = { 'version': '0.0.808' };
const CACHE_VERSION = { 'version': '0.0.809' };
const PRECACHE = `jubileeData-${CACHE_VERSION.version}`;
const RUNTIME = 'runtime';

View File

@ -79,10 +79,20 @@ const LocationModel = Backbone.Model.extend({
'apiKey': 'AIzaSyA7oGP6QS28tTwtT6UzA7hzh0b3MWwMYB8', // for Mapquest, OpenCage, Google Premier
'formatter': null // 'gpx', 'string', ...
};
const myCoords = { 'home': {
'lat':51.490002, 'long':-0.140245
},
'work':{
'lat':51.5084707, 'long':-0.068798
} };
// rawburn house 51.490002, -0.140245
// thomas more 51.5084707,-0.068798
const geocoder = NodeGeocoder(options);
//55.872407, -3.549003
const homeDistance = distance(55.942673, -4.556334, latitude, longitude);
const workDistance = distance(55.872407, -3.549003, latitude, longitude);
// 55.872407, -3.549003
const homeDistance = distance(myCoords.home.lat, myCoords.home.long, latitude, longitude);
const workDistance = distance(myCoords.work.lat, myCoords.work.long, latitude, longitude);
const atHome = (homeDistance < 0.10);
const atWork = (workDistance < 0.10);
const atHomeOrWork = (atHome || atWork);
@ -95,6 +105,7 @@ const LocationModel = Backbone.Model.extend({
const newLocation = { homeDistance, workDistance, latitude, longitude, atHome, atWork, atHomeOrWork, timestamp, ll, llFixed, llSix, llShort, moving, latlong, 'city' : '', 'cityCC':'' };
console.log('homeDistance', homeDistance, 'workDistance:', workDistance);
// console.log('>> NewLocation', JSON.stringify(newLocation));
// const distanceFromLast = distance(current.latitude, current.longitude, latitude, longitude);