From 7cf5c45341fad7c422364e80d87a86ecceeda144 Mon Sep 17 00:00:00 2001 From: Code WvS Date: Fri, 27 Feb 2015 13:18:05 +0100 Subject: add "my location" block and a nominatim search block --- objects.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'objects.js') diff --git a/objects.js b/objects.js index 41ffe3c..91be855 100644 --- a/objects.js +++ b/objects.js @@ -213,6 +213,12 @@ SpriteMorph.prototype.initBlocks = function () { category: 'map', spec: 'my location' }, + findLocation: { + type: 'reporter', + category: 'map', + spec: 'location of %s', + defaults: ['Tiergarten Berlin'] + }, focusMap: { type: 'command', category: 'map', @@ -1770,6 +1776,8 @@ SpriteMorph.prototype.blockTemplates = function (category) { if (cat === 'map') { blocks.push(block('reportUserLocation')); + blocks.push(block('reportMyLocation')); + blocks.push(block('findLocation')); blocks.push(block('focusMap')); blocks.push(block('moveTo')); @@ -3355,6 +3363,10 @@ SpriteMorph.prototype.moveTo = function (pos) { this.updateMarker(); }; +SpriteMorph.prototype.reportMyLocation = function () { + return new List([this.geoposition.lat, this.geoposition.lng]); +}; + // SpriteMorph motion primitives Morph.prototype.setPosition = function (aPoint, justMe) { -- cgit v1.3.1