1
0
Fork 0
mirror of https://github.com/shouptech/share-a-bike.git synced 2026-02-03 12:29:42 +00:00

Added function map scene

This commit is contained in:
mikeshoup@gmail.com 2010-12-18 16:59:26 +00:00
parent 5737e1a969
commit 88dd1df53f
5 changed files with 79 additions and 22 deletions

View file

@ -132,13 +132,30 @@ MainAssistant.prototype = {
distance: d.toFixed(2) + ' mi', distance: d.toFixed(2) + ' mi',
address: closestKiosks[i].Address.Street, address: closestKiosks[i].Address.Street,
bikes: closestKiosks[i].BikesAvailable, bikes: closestKiosks[i].BikesAvailable,
docks: closestKiosks[i].DocksAvailable docks: closestKiosks[i].DocksAvailable,
latitude: closestKiosks[i].Location.Latitude,
longitude: closestKiosks[i].Location.Longitude
}; };
} }
this.listModel = { this.listModel = {
items: kiosks items: kiosks
}; };
this.gpsCoord = {
latitude: latitude,
longitude: longitude
};
this.controller.setWidgetModel("kioskList", this.listModel); 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);
} }
}; };

View file

@ -11,13 +11,15 @@ opus.Gizmo({
}, },
chrome: [ chrome: [
{ {
name: "findButton", name: "mainHeader",
ontap: "findButtonTap", label: "Nearby Kiosks",
disabled: undefined, type: "Palm.Mojo.Header",
label: "Find Kiosks",
type: "Palm.Mojo.ActivityButton",
l: 0, l: 0,
t: 0 t: 452,
styles: {
opacity: 1,
oneLine: false
}
}, },
{ {
name: "scroller1", name: "scroller1",
@ -48,7 +50,36 @@ opus.Gizmo({
type: "Palm.Mojo.List", type: "Palm.Mojo.List",
l: 0, l: 0,
t: 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
} }
] ]
} }

View file

@ -1,6 +1,6 @@
{ {
"id": "com.mikeshoup.share-a-bike", "id": "com.mikeshoup.share-a-bike",
"version": "0.1.1", "version": "0.1.2",
"vendor": "Mike Shoup", "vendor": "Mike Shoup",
"type": "web", "type": "web",
"main": "index.html", "main": "index.html",

View file

@ -5,6 +5,7 @@
<head> <head>
<title>Share-a-Bike</title> <title>Share-a-Bike</title>
<link href="stylesheets/style.css" media="screen" rel="stylesheet" type="text/css" /> <link href="stylesheets/style.css" media="screen" rel="stylesheet" type="text/css" />
<script src="http://maps.google.com/maps/api/js?sensor=true" type="text/javascript"></script>
<script src="ares.js" type="text/javascript"></script> <script src="ares.js" type="text/javascript"></script>
</head> </head>
<body> <body>

View file

@ -1,13 +1,21 @@
[ [
{ {
"source": "app\/assistants\/stage-assistant.js" "source": "app/assistants/stage-assistant.js"
}, },
{ {
"source": "app\/views\/main\/main-chrome.js", "source": "app/views/main/main-chrome.js",
"scenes": "main" "scenes": "main"
}, },
{ {
"source": "app\/assistants\/main-assistant.js", "source": "app/assistants/main-assistant.js",
"scenes": "main" "scenes": "main"
},
{
"source": "app/assistants/mapScene-assistant.js",
"scenes": "mapScene"
},
{
"source": "app/views/mapScene/mapScene-chrome.js",
"scenes": "mapScene"
} }
] ]