diff --git a/app/css/app.css b/app/css/app.css index 9d9e723..c493799 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -1,4 +1,4 @@ -body.zipcode-false { +body.location-false { background-image : url('../img/google_maps_hello_world.jpg'); } @@ -14,7 +14,7 @@ body.zipcode-false { background-color: #fff; } -.search-zipcode { +.search-location { margin-top: 10px; } @@ -69,4 +69,10 @@ body.zipcode-false { .table tr.active td { background-color: transparent !important; } +.modal{ + z-index: -99; +} +.modal-backdrop{ + z-index: -100; +} diff --git a/app/index.html b/app/index.html index a804dac..9830aaa 100644 --- a/app/index.html +++ b/app/index.html @@ -8,10 +8,11 @@ + - +
@@ -27,7 +28,8 @@ - + + @@ -35,13 +37,13 @@ diff --git a/app/js/app.js b/app/js/app.js index fb10015..9ce14bf 100644 --- a/app/js/app.js +++ b/app/js/app.js @@ -8,17 +8,18 @@ var lookAroundApp = angular.module("lookAroundApp", [ "lookAroundApp.filters", "lookAroundApp.directives", "ui.bootstrap", - "ngRoute" + "ngRoute", + "google.places" ]); lookAroundApp.config(['$routeProvider', function ($routeProvider) { $routeProvider .when("/", { - controller: "ZipCodeFrmCtrl", - templateUrl: "partials/zipcode.html" + controller: "locFrmCtrl", + templateUrl: "partials/location.html" }) - .when("/search/:zipcode/:place", + .when("/search/:loc/:place", { controller: "SearchCtrl", templateUrl: "partials/search.html" diff --git a/app/js/controllers.js b/app/js/controllers.js index b1989c7..279084e 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -5,8 +5,8 @@ angular.module("lookAroundApp.controllers", [ ]) /** - * [ZipCodeFrmCtrl] - * Responsible for updating the route whenever zipcode is changed + * [locFrmCtrl] + * Responsible for updating the route whenever location is changed * appears in the first page, and the header * * - default placeurl in route parameters is 'atm' @@ -16,11 +16,11 @@ angular.module("lookAroundApp.controllers", [ ]) * @param {[type]} $routeParams * @return {[type]} */ - .controller("ZipCodeFrmCtrl", ['$scope', '$location', '$routeParams', + .controller("locFrmCtrl", ['$scope', '$location', '$routeParams', function ($scope, $location, $routeParams) { var placeurl = $routeParams.place || "atm"; - $scope.sendZip = function (zipcode) { - $location.path("/search/" + zipcode + "/" + placeurl); + $scope.sendLoc = function (loc) { + $location.path("/search/" + loc.formatted_address + "/" + placeurl); }; // Currently displaying Result near ... @@ -41,8 +41,8 @@ angular.module("lookAroundApp.controllers", [ ]) * [SearchCtrl] * This controller is responsible for the main search in the view * - * - It first gets the zip code from the route params and check for the place data - * - it then gets the map latitude and longitude from the zipcode ( using Google GeoCoder ) + * - It first gets the location from the route params and check for the place data + * - it then gets the map latitude and longitude from the location ( using Google GeoCoder ) * - using the places Api, it will fetch the data for the given place type ( 'atm|bar|bus-station' ..etc) * - and renders the map using this data * @@ -57,11 +57,11 @@ angular.module("lookAroundApp.controllers", [ ]) .controller("SearchCtrl", ['$scope', '$routeParams', '$location', 'googleMap', '$http', '$filter', function ($scope, $routeParams, $location, googleMap, $http, $filter) { - $scope.zipCode = $routeParams.zipcode; + $scope.loc = $routeParams.loc; $scope.place = $routeParams.place; - - /* redirect to the home page if there's no zipcode */ - if (!$scope.zipCode) { + console.log($scope.loc); + /* redirect to the home page if there's no location */ + if (!$scope.loc) { $location.path("/"); } @@ -79,7 +79,7 @@ angular.module("lookAroundApp.controllers", [ ]) * @return {string} */ $scope.getUrl = function (placeurl) { - return "#/search/" + $scope.zipCode + placeurl; + return "#/search/" + $scope.loc + placeurl; }; /* @@ -112,16 +112,17 @@ angular.module("lookAroundApp.controllers", [ ]) /* start the Geocoding to get the latitude and longitude from the - zipcode proviced. This lat/long will be served to the places api to fetch the places details + location proviced. This lat/long will be served to the places api to fetch the places details */ googleMap.getGeoCoder().geocode({ - address: $scope.zipCode + address: $scope.loc }, function (results, status) { var lat = results[ 0 ].geometry.location.lat(), lng = results[ 0 ].geometry.location.lng(); /* $scope.$apply is required as this function will be executed inside the GeoCoder context */ $scope.$apply(function () { + console.log(results[ 0 ]); $scope.searchplace = results[ 0 ] && results[ 0 ].formatted_address; }); @@ -220,15 +221,15 @@ angular.module("lookAroundApp.controllers", [ ]) */ .controller("MainCtrl", ['$scope', '$routeParams', '$location', '$window', function ($scope, $routeParams, $location, $window) { - // checks if the url contains any valid zipcode + // checks if the url contains any valid location $scope.applied = function () { - return !!$routeParams.zipcode; + return !!$routeParams.loc; }; // some Google analytics $scope.$on("$viewContentLoaded", function (event) { - $window.ga("send", "pageview", { + /*$window.ga("send", "pageview", { "page": $location.path() - }); + });*/ }); } ]) diff --git a/app/partials/location.html b/app/partials/location.html new file mode 100644 index 0000000..d1b0324 --- /dev/null +++ b/app/partials/location.html @@ -0,0 +1,24 @@ +
+ + +
\ No newline at end of file diff --git a/app/partials/search.html b/app/partials/search.html index 40e4dc3..34e7ab3 100644 --- a/app/partials/search.html +++ b/app/partials/search.html @@ -1,13 +1,16 @@