-
Notifications
You must be signed in to change notification settings - Fork 12
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
write tests that assert the markers are shown or hidden as in the new example code #52
Changes from 6 commits
d3b043a
226e3bd
112185d
7b2b458
199ca0d
174de81
21152a7
6a753c4
1be8a18
dae107f
05b4496
a605c73
8a24f89
afe7aec
095a060
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
|
||
<title>Leaflet.BlurredLocationDisplay</title> | ||
|
||
<script src="https://maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDWgc7p4WWFsO3y0MTe50vF4l4NUPcPuwE"></script> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | ||
<script src="../../../node_modules/jquery/dist/jquery.min.js"></script> | ||
<script src="../../../node_modules/bootstrap/dist/js/bootstrap.min.js"></script> | ||
<link href="../../../node_modules/leaflet/dist/leaflet.css" rel="stylesheet"> | ||
<script src="../../../node_modules/leaflet/dist/leaflet.js"></script> | ||
<script src="../../../node_modules/leaflet-blurred-location/dist/Leaflet.BlurredLocation.js"></script> | ||
<script src="../../../dist/Leaflet.BlurredLocationDisplay.js"></script> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So i think you may want to load these in the Gruntfile on these lines: https://github.com/publiclab/leaflet-blurred-location-display/pull/52/files#diff-35b4a816e0441e6a375cd925af50752cR35 because they won't be loaded from this file until you load the fixture. And some of the tests you may not actually want the HTML fixture data, but just to test basic methods in the JS lib. See for example: |
||
|
||
</head> | ||
|
||
<body> | ||
|
||
<div class="container" > | ||
|
||
<h1>Leaflet BlurredLocationDisplay <small>| by <a href="">Public Lab</a></small></h1> | ||
|
||
<p>This page shows how different markers are shown according to their precision at different zoom levels .</p> | ||
|
||
<hr /> | ||
|
||
<p> | ||
<h3>1.) At zoom level = 5 , all 7 markers are shown : </h3> | ||
<div style="background-color: #d6dfe0;"> | ||
<span style="color: Red"> [23.1 , 77.1] </span>, <br> | ||
<span style="color: Red"> [20.1 , 76.1] </span>, <br> | ||
<span style="color: Green"> [21.111 , 76.111] </span>,<br> | ||
<span style="color: Green">[22.111 , 78.111]</span>,<br> | ||
<span style="color: Black">[23.1234 , 76.1234]</span>,<br> | ||
<span style="color: Yellow"> [24.123456 , 78.123456]</span>,<br> | ||
<span style="color: Yellow"> [25.123456 , 77.123456]</span> | ||
</div> | ||
<div id="map1" class="leaflet-map" style="width: 100%; height: 400px;"></div> | ||
<br><br> | ||
<h3>2.) At zoom level = 6 , 5 markers are shown : </h3> | ||
<div style="background-color: #d6dfe0;"> | ||
<span style="color: Green"> [21.111 , 76.111]</span>,<br> | ||
<span style="color: Green"> [22.111 , 78.111]</span>,<br> | ||
<span style="color: Black"> [23.1234 , 76.1234]</span>,<br> | ||
<span style="color: Yellow"> [24.123456 , 78.123456]</span>,<br> | ||
<span style="color: Yellow"> [25.123456 , 77.123456]</span> | ||
</div> | ||
<div id="map2" class="leaflet-map" style="width: 100%; height: 400px;"></div> | ||
<br><br> | ||
<h3>3.) At zoom level = 8 , 3 markers are shown : </h3> | ||
<div style="background-color: #d6dfe0;"> | ||
<span style="color: Black"> [23.1234 , 76.1234]</span>,<br> | ||
<span style="color: Yellow"> [24.123456 , 78.123456]</span>,<br> | ||
<span style="color: Yellow"> [25.123456 , 77.123456]</span> | ||
</div> | ||
<div id="map3" class="leaflet-map" style="width: 100%; height: 400px;"></div> | ||
|
||
<br /> | ||
|
||
</div> | ||
|
||
<script> | ||
var options1 = { | ||
mapID: 'map1' | ||
} | ||
var options2 = { | ||
mapID: 'map2' | ||
} | ||
var options3 = { | ||
mapID: 'map3' | ||
} | ||
|
||
|
||
var BlurredLocation1 = new BlurredLocation(options1) ; | ||
|
||
var BlurredLocation2 = new BlurredLocation(options2) ; | ||
|
||
var BlurredLocation3 = new BlurredLocation(options3) ; | ||
|
||
/* | ||
zoom_level <= 5 : 7 Markers | ||
zoom_level between 6 and 7 : 5 Markers | ||
zoom_level between 8 and 10 : 3 Markers | ||
zoom_level >= 11 : 2 Markers | ||
*/ | ||
|
||
var locations = [[23.1 , 77.1], | ||
[20.1 , 76.1], | ||
[21.111 , 76.111], | ||
[22.111 , 78.111], | ||
[23.1234 , 76.1234], | ||
[24.123456 , 78.123456], | ||
[25.123456 , 77.123456]]; | ||
|
||
var options_display1 = { | ||
blurredLocation: BlurredLocation1, | ||
locations: locations | ||
} | ||
var options_display2 = { | ||
blurredLocation: BlurredLocation2, | ||
locations: locations | ||
} | ||
var options_display3 = { | ||
blurredLocation: BlurredLocation3, | ||
locations: locations | ||
} | ||
|
||
var blurredLocationDisplay1 = new BlurredLocationDisplay(options_display1); | ||
var blurredLocationDisplay2 = new BlurredLocationDisplay(options_display2); | ||
var blurredLocationDisplay3 = new BlurredLocationDisplay(options_display3); | ||
|
||
BlurredLocation1.map.setView([23,77] , 5) ; | ||
BlurredLocation2.map.setView([23,77] , 6) ; | ||
BlurredLocation3.map.setView([24.23694700391752, 76.89880371093751] , 8) ; | ||
</script> | ||
|
||
<style> | ||
html { background: #f8f8f8; margin-bottom: 100px;} | ||
body { background: none; } | ||
</style> | ||
|
||
|
||
</body> | ||
</html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here i think you need to include the LBLD library itself! See for reference:
https://github.com/publiclab/leaflet-blurred-location/blob/4f452d5cc486ac320fa168eeabbb46bedb1b8378/Gruntfile.js#L31-L41