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:
parent
5737e1a969
commit
88dd1df53f
5 changed files with 79 additions and 22 deletions
|
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
|
@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
<head>
|
||||
<title>Share-a-Bike</title>
|
||||
<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>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
},
|
||||
{
|
||||
"source": "app\/assistants\/main-assistant.js",
|
||||
"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"
|
||||
}
|
||||
]
|
||||
Loading…
Add table
Reference in a new issue