-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3fc70ae
commit 9ee304b
Showing
8 changed files
with
43 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,24 @@ | ||
/*global BlurredLocation */ | ||
describe("Basic suite", function() { | ||
var map; | ||
|
||
describe("Testing changing view", function() { | ||
"use strict"; | ||
|
||
var fixture = loadFixtures('index.html'); | ||
map = L.map('map'); | ||
|
||
var blurredLocatoion = new BlurredLocation({ | ||
lat: 41.01, | ||
lon: -85.66 | ||
}); | ||
|
||
console.log(blurredLocatoion.getLat() == 41.01); | ||
|
||
map.setView([51.50, -0.09], 13); | ||
|
||
it("lat spec", function() { | ||
expect(blurredLocatoion.getLat()).toBe(41.01); | ||
}); | ||
expect(blurredLocatoion.getLat()).toBe(51.50); | ||
}); | ||
it("lon spec", function() { | ||
expect(blurredLocatoion.getLon()).toBe(-85.66); | ||
expect(blurredLocatoion.getLon()).toBe(-0.09); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
function BlurredLocation(location) { | ||
this.getLat = function () { | ||
return location.lat; | ||
} | ||
this.getLon = function() { | ||
return location.lon; | ||
} | ||
if(map) { | ||
map.setView([location.lat, location.lon], 10); | ||
this.getLat = function () { | ||
return map.getCenter().lat; | ||
} | ||
this.getLon = function() { | ||
return map.getCenter().lng; | ||
} | ||
} | ||
else { | ||
this.getLat = function () { | ||
return location['lat']; | ||
} | ||
this.getLon = function() { | ||
return location['lon']; | ||
} | ||
} | ||
} | ||
|
||
exports.BlurredLocation = BlurredLocation; |