From 88dd1df53fa257b12dfcca894ebb83bac4296fcf Mon Sep 17 00:00:00 2001 From: "mikeshoup@gmail.com" Date: Sat, 18 Dec 2010 16:59:26 +0000 Subject: [PATCH] Added function map scene --- .../app/assistants/main-assistant.js | 19 +++++++- .../app/views/main/main-chrome.js | 45 ++++++++++++++++--- trunk/share-a-bike/appinfo.json | 2 +- trunk/share-a-bike/index.html | 1 + trunk/share-a-bike/sources.json | 34 ++++++++------ 5 files changed, 79 insertions(+), 22 deletions(-) diff --git a/trunk/share-a-bike/app/assistants/main-assistant.js b/trunk/share-a-bike/app/assistants/main-assistant.js index 7b85307..cd9d3c9 100644 --- a/trunk/share-a-bike/app/assistants/main-assistant.js +++ b/trunk/share-a-bike/app/assistants/main-assistant.js @@ -132,13 +132,30 @@ MainAssistant.prototype = { distance: d.toFixed(2) + ' mi', address: closestKiosks[i].Address.Street, bikes: closestKiosks[i].BikesAvailable, - docks: closestKiosks[i].DocksAvailable + docks: closestKiosks[i].DocksAvailable, + latitude: closestKiosks[i].Location.Latitude, + longitude: closestKiosks[i].Location.Longitude }; } this.listModel = { items: kiosks }; + + this.gpsCoord = { + latitude: latitude, + longitude: longitude + }; + this.controller.setWidgetModel("kioskList", this.listModel); + + this.$.mapButton.setDisabled(false); + }, + mapButtonTap: function(inSender, event) { + var argToScene = { + items: this.listModel.items, + gps: this.gpsCoord + }; + this.controller.stageController.pushScene('mapScene', argToScene); } }; \ No newline at end of file diff --git a/trunk/share-a-bike/app/views/main/main-chrome.js b/trunk/share-a-bike/app/views/main/main-chrome.js index c92930a..0acff94 100644 --- a/trunk/share-a-bike/app/views/main/main-chrome.js +++ b/trunk/share-a-bike/app/views/main/main-chrome.js @@ -11,13 +11,15 @@ opus.Gizmo({ }, chrome: [ { - name: "findButton", - ontap: "findButtonTap", - disabled: undefined, - label: "Find Kiosks", - type: "Palm.Mojo.ActivityButton", + name: "mainHeader", + label: "Nearby Kiosks", + type: "Palm.Mojo.Header", l: 0, - t: 0 + t: 452, + styles: { + opacity: 1, + oneLine: false + } }, { name: "scroller1", @@ -48,7 +50,36 @@ opus.Gizmo({ type: "Palm.Mojo.List", l: 0, t: 0, - h: "100%" + h: 100 + } + ] + }, + { + name: "panel1", + layoutKind: "hbox", + dropTarget: true, + type: "Palm.Mojo.Panel", + l: 0, + t: 391, + h: 60, + controls: [ + { + name: "mapButton", + ontap: "mapButtonTap", + disabled: true, + label: "Map", + type: "Palm.Mojo.Button", + l: 0, + t: 0 + }, + { + name: "findButton", + ontap: "findButtonTap", + disabled: undefined, + label: "Find", + type: "Palm.Mojo.ActivityButton", + l: 320, + t: 0 } ] } diff --git a/trunk/share-a-bike/appinfo.json b/trunk/share-a-bike/appinfo.json index 8aa36f7..3212979 100644 --- a/trunk/share-a-bike/appinfo.json +++ b/trunk/share-a-bike/appinfo.json @@ -1,6 +1,6 @@ { "id": "com.mikeshoup.share-a-bike", - "version": "0.1.1", + "version": "0.1.2", "vendor": "Mike Shoup", "type": "web", "main": "index.html", diff --git a/trunk/share-a-bike/index.html b/trunk/share-a-bike/index.html index cfcf83b..15e24ce 100644 --- a/trunk/share-a-bike/index.html +++ b/trunk/share-a-bike/index.html @@ -5,6 +5,7 @@ Share-a-Bike + diff --git a/trunk/share-a-bike/sources.json b/trunk/share-a-bike/sources.json index b8bfce2..6347a3d 100644 --- a/trunk/share-a-bike/sources.json +++ b/trunk/share-a-bike/sources.json @@ -1,13 +1,21 @@ -[ - { - "source": "app\/assistants\/stage-assistant.js" - }, - { - "source": "app\/views\/main\/main-chrome.js", - "scenes": "main" - }, - { - "source": "app\/assistants\/main-assistant.js", - "scenes": "main" - } -] +[ + { + "source": "app/assistants/stage-assistant.js" + }, + { + "source": "app/views/main/main-chrome.js", + "scenes": "main" + }, + { + "source": "app/assistants/main-assistant.js", + "scenes": "main" + }, + { + "source": "app/assistants/mapScene-assistant.js", + "scenes": "mapScene" + }, + { + "source": "app/views/mapScene/mapScene-chrome.js", + "scenes": "mapScene" + } +] \ No newline at end of file