|
/// <reference path="..//intellisense.js" />
/*global $, ViewModel, propertyDataSource, ko*/
ViewModel.GeolocationViewModel = function () {
/// <summary>
/// The view model that backs the a search based on geolocation
/// </summary>
// ----- framework fields
this.factoryName = "GeolocationViewModel";
// ----- public fields
this.lat = undefined;
this.lon = undefined;
this.firstElement = ko.observable(false);
this.lastElement = ko.observable(false);
this.displayString = undefined;
this.totalResults = 0;
// ----- public functions
this.initialise = function (lat, lon) {
/// <summary>
/// Initializes the state of this view model.
/// </summary>
this.lat = lat;
this.lon = lon;
this.displayString = lat.toFixed(2) + ", " + lon.toFixed(2);
};
this.executeSearch = function (pageNumber, callback, errorCallback) {
/// <summary>
/// Executes a search by the geolocation represented by this view model for the given page
/// </summary>
propertyDataSource.findPropertiesByCoordinate(this.lat, this.lon, pageNumber, callback, errorCallback);
};
};
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.