Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SendLocation updates feature #36

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
823 changes: 643 additions & 180 deletions app/controller/NavigationController.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app/controlls/Code.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ SDL.Code = Em.View.extend({
activate: function() {
this.editor = ace.edit(this._parentView.codeEditorId);
this.editor.setTheme('ace/theme/monokai');
this.editor.$blockScrolling = Infinity;
}
}
);
135 changes: 26 additions & 109 deletions app/model/NavigationModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,9 @@ SDL.NavigationModel = Em.Object.create({
appReqPull: [],

/**
* Start navigation point
* Initial location point
*/
startLoc: '98 Walker St, New York, NY 10013, USA',

/**
* End navigation point
*/
endLoc: '128 Seaman Ave, New York, NY 10034, USA',
initialLoc: '230 Canal St, New York, NY 10013, USA',

/**
* POI list switcher flag
Expand All @@ -70,108 +65,30 @@ SDL.NavigationModel = Em.Object.create({
*/
wpProcessTime: 4000,

LocationDetails: [
{
coordinate: {
latitudeDegrees: 0,
longitudeDegrees: 0
},
locationName: 'locationName',
addressLines: 'addressLines',
locationDescription: 'locationDescription',
phoneNumber: 'phoneNumber',
locationImage: {
value: '',
imageType: 'DYNAMIC'
},
searchAddress: {
countryName: 'countryName',
countryCode: 'countryCode',
postalCode: 'postalCode',
administrativeArea: 'administrativeArea',
subAdministrativeArea: 'subAdministrativeArea',
locality: 'locality',
subLocality: 'subLocality',
thoroughfare: 'thoroughfare',
subThoroughfare: 'subThoroughfare'
}
},
{
coordinate: {
latitudeDegrees: 0,
longitudeDegrees: 0
},
locationName: 'locationName',
addressLines: 'addressLines',
locationDescription: 'locationDescription',
phoneNumber: 'phoneNumber',
locationImage: {
value: 'images/common/defaultButtonImage.png',
imageType: 'DYNAMIC'
},
searchAddress: {
countryName: 'countryName',
countryCode: 'countryCode',
postalCode: 'postalCode',
administrativeArea: 'administrativeArea',
subAdministrativeArea: 'subAdministrativeArea',
locality: 'locality',
subLocality: 'subLocality',
thoroughfare: 'thoroughfare',
subThoroughfare: 'subThoroughfare'
}
},
{
coordinate: {
latitudeDegrees: 0,
longitudeDegrees: 0
},
locationName: 'locationName',
addressLines: 'addressLines',
locationDescription: 'locationDescription',
phoneNumber: 'phoneNumber',
locationImage: {
value: '',
imageType: 'DYNAMIC'
},
searchAddress: {
countryName: 'countryName',
countryCode: 'countryCode',
postalCode: 'postalCode',
administrativeArea: 'administrativeArea',
subAdministrativeArea: 'subAdministrativeArea',
locality: 'locality',
subLocality: 'subLocality',
thoroughfare: 'thoroughfare',
subThoroughfare: 'subThoroughfare'
}
},
{
coordinate: {
latitudeDegrees: 0,
longitudeDegrees: 0
},
locationName: 'locationName',
addressLines: 'addressLines',
locationDescription: 'locationDescription',
phoneNumber: 'phoneNumber',
locationImage: {
value: 'images/common/defaultButtonImage.png',
imageType: 'DYNAMIC'
},
searchAddress: {
countryName: 'countryName',
countryCode: 'countryCode',
postalCode: 'postalCode',
administrativeArea: 'administrativeArea',
subAdministrativeArea: 'subAdministrativeArea',
locality: 'locality',
subLocality: 'subLocality',
thoroughfare: 'thoroughfare',
subThoroughfare: 'subThoroughfare'
}
}
]
/**
* Current location of the vehicle
*/
vehicleLocationMarker: null,

/**
* Selected location
*/
selectedLocationMarker: null,

/**
* Saved destination points array
*/
LocationDetails: [],

/**
* Saved waypoints array
*/
WayPointDetails: [],

/**
* Waypoint markers array
*/
WayPointMarkers: []

}
);
62 changes: 51 additions & 11 deletions app/view/navigationView.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ SDL.NavigationView = Em.ContainerView.create(
'codeEditor',
'POIButton',
'map',
'navigate'
'navigate',
'animate'
],
POIList: SDL.List.extend(
{
Expand All @@ -54,42 +55,59 @@ SDL.NavigationView = Em.ContainerView.create(
itemGenerator: function() {
var items = [];
for (var i = 0; i < SDL.NavigationModel.LocationDetails.length; i++) {
var details = SDL.deepCopy(SDL.NavigationModel.LocationDetails[i]);
items.push(
{
type: SDL.Button,
params: {
itemID: i,
className: 'button',
text: SDL.NavigationModel.LocationDetails[i].locationName,
text: details.locationName ? details.locationName : "Unknown location",
disabled: false,
icon: SDL.NavigationModel.LocationDetails[i].locationImage.value,
templateName: SDL.NavigationModel.LocationDetails[i].locationImage
? '' : 'text',
action: 'openWayPoint',
icon: details.locationImage ? details.locationImage.value : null,
templateName: details.locationImage ? '' : 'text',
action: 'openDestPoint',
target: 'SDL.NavigationController'
}
}
);
}
this.set('disableScrollbar', items.length <= this.itemsOnPage);
return items;
}.property('SDL.NavigationModel.LocationDetails.@each')
}
),
codeEditor: SDL.CodeEditor.extend(
{
codeEditorId: 'navigationEditor',
contentBinding: 'SDL.NavigationModel.currentWayPointData'
contentBinding: 'SDL.NavigationModel.currentWayPointData',
childViews: [
'editor',
'buttonOk',
'buttonSelect',
'buttonDelete',
'backButton'
],
buttonSelect: SDL.Button.extend(
{
classNames: 'button ResetButton',
text: 'Select',
action: 'waypointSelected',
target: 'SDL.NavigationController',
onDown: false
}
)
}
),
POIButton: SDL.Button.extend(
{
classNameBindings: 'SDL.FuncSwitcher.rev::is-disabled',
elementId: 'POIButton',
disabledBinding: Em.Binding.oneWay(
'SDL.NavigationController.isRouteSet'
'SDL.NavigationController.isAnimateStarted'
),
classNames: 'POIButton button',
text: 'POI',
text: 'Waypoints',
action: 'showPoiList',
target: 'SDL.NavigationController'
}
Expand All @@ -105,13 +123,35 @@ SDL.NavigationView = Em.ContainerView.create(
classNameBindings: 'SDL.FuncSwitcher.rev::is-disabled',
elementId: 'navigationButton',
disabledBinding: Em.Binding.oneWay(
'SDL.NavigationController.isRouteSet'
'SDL.NavigationController.isAnimateStarted'
),
classNames: 'navigationButton button',
text: 'Navigate',
action: 'setRoutes',
target: 'SDL.NavigationController'
}
)
),
animate: SDL.Button.extend(
{
classNameBindings: 'SDL.FuncSwitcher.rev::is-disabled',
elementId: 'animateButton',
classNames: 'animateButton button',
disabledBinding: 'getDisabled',
getDisabled: function() {
return !SDL.NavigationController.isRouteSet;
}
.property('SDL.NavigationController.isRouteSet'),
textBinding: 'getAnimateText',
getAnimateText: function() {
return !SDL.NavigationController.isAnimateStarted ?
'Start animation' :
'Stop animation';
}
.property('SDL.NavigationController.isAnimateStarted'),
action: 'startAnimation',
target: 'SDL.NavigationController'
}
),

}
);
17 changes: 16 additions & 1 deletion css/navigation.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,19 @@
z-index: 1;
}

#poiList .list-content {
border-top: 0px;
}

#poiList .list-item {
overflow: hidden;
}

.POIButton {
z-index: 1;
top: 335px;
left: 20px;
width: 50px;
width: 80px;
text-align: center;
}

Expand All @@ -34,6 +42,13 @@
text-align: center;
}

.animateButton {
bottom: 60px;
left: 110px;
width: 125px;
text-align: center;
}

#baseNavigation {
z-index: 2;
position: absolute;
Expand Down
6 changes: 5 additions & 1 deletion ffw/NavigationRPC.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ FFW.Navigation = FFW.RPCObserver.create(
switch (request.method) {
case 'Navigation.IsReady':
{
Em.Logger.log('FFW.' + request.method + 'Response');
Em.Logger.log('FFW.' + request.method + ' Response');
if (!SDL.NavigationController.isInitialized) {
SDL.NavigationController.initialize();
}
this.set('isReady', SDL.NavigationController.isInitialized);
// send repsonse
var JSONMessage = {
'jsonrpc': '2.0',
Expand Down
Binary file added images/nav/marker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
<script type="text/javascript"
src="http://www.google-analytics.com/urchin.js"></script>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false"></script>
src="http://maps.google.com/maps/api/js?
&key=AIzaSyB9dkM17-Zod4h2OOoBhU_T64-02dYIp1c"></script>
<script type="text/javascript"
src="http://www.geocodezip.com/scripts/v3_epoly.js"></script>

Expand Down