From d3b043a2613eceb500f71fa2614bc44b6766612c Mon Sep 17 00:00:00 2001 From: sagarpreet-chadha Date: Fri, 8 Mar 2019 13:51:16 +0530 Subject: [PATCH 01/13] heatmap color remains same --- dist/Leaflet.BlurredLocationDisplay.js | 44 +++++++++++++++----------- src/blurredLocationDisplay.js | 16 ++++++++-- src/ui/gridCenterRectangle.js | 28 +++++++--------- 3 files changed, 50 insertions(+), 38 deletions(-) diff --git a/dist/Leaflet.BlurredLocationDisplay.js b/dist/Leaflet.BlurredLocationDisplay.js index 896df252..4bae5f10 100644 --- a/dist/Leaflet.BlurredLocationDisplay.js +++ b/dist/Leaflet.BlurredLocationDisplay.js @@ -77,6 +77,7 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { return parsed_data ; } + var all_markers_map = new Map() ; var locations_markers_array = [] ; var SourceUrl_markers_array = [] ; var SourceUrl_id_map = new Map() ; @@ -115,7 +116,7 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { function fetchLocationData(isOn) { if(isOn === true) { - for(i=0 ; i < options.locations.length ; i++){ + for(let i=0 ; i < options.locations.length ; i++){ var latitude = options.locations[i][0] ; var longitude = options.locations[i][1] ; if(filterCoordinate(latitude , longitude)){ @@ -125,7 +126,8 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { precision = afterDecimal.length ; } var icon_color = IconColor(precision) ; - var m = L.marker([latitude, longitude] , {icon: icon_color}) ; + var m = L.marker([latitude, longitude] , {icon: icon_color}) ; + all_markers_map.set(i , m) ; m.addTo(map).bindPopup("Precision : " + precision) ; locations_markers_array[locations_markers_array.length] = m ; } @@ -154,7 +156,7 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { var longitude = obj["longitude"] ; var title = obj["title"] ; - if(filterCoordinate(latitude , longitude)){ + if(filterCoordinate(latitude , longitude) && typeof(SourceUrl_id_map.get(id)) === "undefined") { afterDecimal = latitude.toString().split(".")[1] ; precision = 0 ; if(typeof afterDecimal !== "undefined") { @@ -164,6 +166,8 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { var m = L.marker([latitude,longitude], { icon: icon_color }) ; + SourceUrl_id_map.set(id , m) ; + all_markers_map.set(id , m) ; m.addTo(map).bindPopup("" + title + "
Precision : " + precision) ; SourceUrl_markers_array[SourceUrl_markers_array.length] = m ; } @@ -181,6 +185,10 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { return SourceUrl_markers_array ; } + function return_all_markers_map(){ + return all_markers_map ; + } + function activate_listeners(return_markers_array , fetchData) { map.on('zoomend' , function () { @@ -213,6 +221,7 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { let rectangle_options = { return_locations_markers_array: return_locations_markers_array, return_SourceUrl_markers_array: return_SourceUrl_markers_array, + return_all_markers_map: return_all_markers_map, blurredLocation: options.blurredLocation } options.gridCenterRectangle = require('./ui/gridCenterRectangle.js') ; @@ -272,6 +281,7 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { } return { + all_markers_map: return_all_markers_map, locations_markers_array: return_locations_markers_array , SourceUrl_markers_array: return_SourceUrl_markers_array, removeAllMarkers: removeAllMarkers, @@ -328,6 +338,7 @@ module.exports = function changeRectangleColor(options){ function ColorRectangles() { + // console.log(options.return_all_markers_map()) ; if(typeof options.blurredLocation.getRectangle() !== "undefined"){ options.blurredLocation.getRectangle().remove() ; } @@ -345,25 +356,20 @@ module.exports = function changeRectangleColor(options){ function calculateMarkersInsideRect(bounds) { - let locations = options.return_locations_markers_array() ; - let remote_locations = options.return_SourceUrl_markers_array() ; + let locations = options.return_all_markers_map() ; let ctr = 0 ; - for(let i=0 ; i= bounds[0][0] && latitude <= bounds[1][0] && longitude >= bounds[0][1] && longitude <= bounds[1][1]){ - ctr++ ; - } - } - - for(let i=0 ; i= bounds[0][0] && latitude <= bounds[1][0] && longitude >= bounds[0][1] && longitude <= bounds[1][1]){ - ctr++ ; + locations.forEach(function(value , key , map){ + if(typeof(value._latlng) != "undefined"){ + let latitude = value._latlng.lat ; + // console.log(latitude) ; + let longitude = value._latlng.lng ; + if(latitude >= bounds[0][0] && latitude <= bounds[1][0] && longitude >= bounds[0][1] && longitude <= bounds[1][1]){ + ctr++ ; + } } - } + }) ; + return ctr ; } diff --git a/src/blurredLocationDisplay.js b/src/blurredLocationDisplay.js index 6abb8086..4bd524c6 100644 --- a/src/blurredLocationDisplay.js +++ b/src/blurredLocationDisplay.js @@ -66,6 +66,7 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { return parsed_data ; } + var all_markers_map = new Map() ; var locations_markers_array = [] ; var SourceUrl_markers_array = [] ; var SourceUrl_id_map = new Map() ; @@ -104,7 +105,7 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { function fetchLocationData(isOn) { if(isOn === true) { - for(i=0 ; i < options.locations.length ; i++){ + for(let i=0 ; i < options.locations.length ; i++){ var latitude = options.locations[i][0] ; var longitude = options.locations[i][1] ; if(filterCoordinate(latitude , longitude)){ @@ -114,7 +115,8 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { precision = afterDecimal.length ; } var icon_color = IconColor(precision) ; - var m = L.marker([latitude, longitude] , {icon: icon_color}) ; + var m = L.marker([latitude, longitude] , {icon: icon_color}) ; + all_markers_map.set(i , m) ; m.addTo(map).bindPopup("Precision : " + precision) ; locations_markers_array[locations_markers_array.length] = m ; } @@ -143,7 +145,7 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { var longitude = obj["longitude"] ; var title = obj["title"] ; - if(filterCoordinate(latitude , longitude)){ + if(filterCoordinate(latitude , longitude) && typeof(SourceUrl_id_map.get(id)) === "undefined") { afterDecimal = latitude.toString().split(".")[1] ; precision = 0 ; if(typeof afterDecimal !== "undefined") { @@ -153,6 +155,8 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { var m = L.marker([latitude,longitude], { icon: icon_color }) ; + SourceUrl_id_map.set(id , m) ; + all_markers_map.set(id , m) ; m.addTo(map).bindPopup("" + title + "
Precision : " + precision) ; SourceUrl_markers_array[SourceUrl_markers_array.length] = m ; } @@ -170,6 +174,10 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { return SourceUrl_markers_array ; } + function return_all_markers_map(){ + return all_markers_map ; + } + function activate_listeners(return_markers_array , fetchData) { map.on('zoomend' , function () { @@ -202,6 +210,7 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { let rectangle_options = { return_locations_markers_array: return_locations_markers_array, return_SourceUrl_markers_array: return_SourceUrl_markers_array, + return_all_markers_map: return_all_markers_map, blurredLocation: options.blurredLocation } options.gridCenterRectangle = require('./ui/gridCenterRectangle.js') ; @@ -261,6 +270,7 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { } return { + all_markers_map: return_all_markers_map, locations_markers_array: return_locations_markers_array , SourceUrl_markers_array: return_SourceUrl_markers_array, removeAllMarkers: removeAllMarkers, diff --git a/src/ui/gridCenterRectangle.js b/src/ui/gridCenterRectangle.js index c88fc2bf..34361423 100644 --- a/src/ui/gridCenterRectangle.js +++ b/src/ui/gridCenterRectangle.js @@ -31,6 +31,7 @@ module.exports = function changeRectangleColor(options){ function ColorRectangles() { + // console.log(options.return_all_markers_map()) ; if(typeof options.blurredLocation.getRectangle() !== "undefined"){ options.blurredLocation.getRectangle().remove() ; } @@ -48,25 +49,20 @@ module.exports = function changeRectangleColor(options){ function calculateMarkersInsideRect(bounds) { - let locations = options.return_locations_markers_array() ; - let remote_locations = options.return_SourceUrl_markers_array() ; + let locations = options.return_all_markers_map() ; let ctr = 0 ; - for(let i=0 ; i= bounds[0][0] && latitude <= bounds[1][0] && longitude >= bounds[0][1] && longitude <= bounds[1][1]){ - ctr++ ; + locations.forEach(function(value , key , map){ + if(typeof(value._latlng) != "undefined"){ + let latitude = value._latlng.lat ; + // console.log(latitude) ; + let longitude = value._latlng.lng ; + if(latitude >= bounds[0][0] && latitude <= bounds[1][0] && longitude >= bounds[0][1] && longitude <= bounds[1][1]){ + ctr++ ; + } } - } - - for(let i=0 ; i= bounds[0][0] && latitude <= bounds[1][0] && longitude >= bounds[0][1] && longitude <= bounds[1][1]){ - ctr++ ; - } - } + }) ; + return ctr ; } From 226e3bd8be18304f50700cfd45ee63de970cb60b Mon Sep 17 00:00:00 2001 From: sagarpreet-chadha Date: Fri, 8 Mar 2019 14:39:03 +0530 Subject: [PATCH 02/13] over ride method for zoomlevel , precision created --- dist/Leaflet.BlurredLocationDisplay.js | 46 +++++++++++--------------- examples/index.html | 6 +++- src/blurredLocationDisplay.js | 46 +++++++++++--------------- 3 files changed, 45 insertions(+), 53 deletions(-) diff --git a/dist/Leaflet.BlurredLocationDisplay.js b/dist/Leaflet.BlurredLocationDisplay.js index 4bae5f10..d42290a7 100644 --- a/dist/Leaflet.BlurredLocationDisplay.js +++ b/dist/Leaflet.BlurredLocationDisplay.js @@ -19,6 +19,7 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { options.locations = options.locations || [] ; options.source_url = options.source_url || "" ; options.JSONparser = options.JSONparser || defaultJSONparser ; + options.zoom_filter = options.zoom_filter || [[0,5,0] , [5,6,2] , [8,10,4] , [11,18,5]] ; let map = options.blurredLocation.map ; var InterfaceOptions = options.InterfaceOptions || {}; @@ -28,35 +29,28 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { require('./ui/iconColors.js') ; function filterCoordinate(lat , lng) { - current_zoom = map.getZoom() ; - if(current_zoom >= 0 && current_zoom <=5){ - // Show all markers - return true ; - } - else if(current_zoom >= 6 && current_zoom <=7){ - // remove <= 1 precision level coordinates - afterDecimal = lat.toString().split(".")[1] ; - if(typeof afterDecimal !== "undefined" && afterDecimal.length > 1) { - return true ; - } - } - else if(current_zoom >= 8 && current_zoom <=10){ - // remove <= 3 precision level coordinates - afterDecimal = lat.toString().split(".")[1] ; - if(typeof afterDecimal !== "undefined" && afterDecimal.length > 3) { - return true ; - } - } - else if(current_zoom >= 11 ){ - // remove <= 4 precision level coordinates - afterDecimal = lat.toString().split(".")[1] ; - if(typeof afterDecimal !== "undefined" && afterDecimal.length > 4) { - return true ; - } + for(let i=0 ; i < options.zoom_filter.length ; i++){ + if(current_zoom >= options.zoom_filter[i][0] && current_zoom <= options.zoom_filter[i][1]) + { + let afterDecimal = lat.toString().split(".")[1] ; + let precision = 0 ; + if(typeof afterDecimal === "undefined") { + precision = 0 ; + } + else{ + precision = afterDecimal.length ; + } + if(precision >= options.zoom_filter[i][2]){ + return true ; + } + else{ + return false ; + } + } } - + return false ; } diff --git a/examples/index.html b/examples/index.html index 646676df..03bcae11 100644 --- a/examples/index.html +++ b/examples/index.html @@ -87,11 +87,15 @@

By entering co-ordinates

[24.123456 , 78.123456], [25.123456 , 77.123456]]; + // [lower zoom level , upper zoom level , >= precision allowed] + zoom_filter = [[0,5,0] , [5,6,2] , [8,10,4] , [11,18,5]] ; + var options_display = { blurredLocation: BlurredLocation, locations: locations, source_url: "https://publiclab.org/api/srch/nearbyPeople", - JSONparser: JSONparser + JSONparser: JSONparser, + zoom_filter: zoom_filter } var blurredLocationDisplay = new BlurredLocationDisplay(options_display); diff --git a/src/blurredLocationDisplay.js b/src/blurredLocationDisplay.js index 4bd524c6..e828d001 100644 --- a/src/blurredLocationDisplay.js +++ b/src/blurredLocationDisplay.js @@ -8,6 +8,7 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { options.locations = options.locations || [] ; options.source_url = options.source_url || "" ; options.JSONparser = options.JSONparser || defaultJSONparser ; + options.zoom_filter = options.zoom_filter || [[0,5,0] , [5,6,2] , [8,10,4] , [11,18,5]] ; let map = options.blurredLocation.map ; var InterfaceOptions = options.InterfaceOptions || {}; @@ -17,35 +18,28 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { require('./ui/iconColors.js') ; function filterCoordinate(lat , lng) { - current_zoom = map.getZoom() ; - if(current_zoom >= 0 && current_zoom <=5){ - // Show all markers - return true ; - } - else if(current_zoom >= 6 && current_zoom <=7){ - // remove <= 1 precision level coordinates - afterDecimal = lat.toString().split(".")[1] ; - if(typeof afterDecimal !== "undefined" && afterDecimal.length > 1) { - return true ; - } - } - else if(current_zoom >= 8 && current_zoom <=10){ - // remove <= 3 precision level coordinates - afterDecimal = lat.toString().split(".")[1] ; - if(typeof afterDecimal !== "undefined" && afterDecimal.length > 3) { - return true ; - } - } - else if(current_zoom >= 11 ){ - // remove <= 4 precision level coordinates - afterDecimal = lat.toString().split(".")[1] ; - if(typeof afterDecimal !== "undefined" && afterDecimal.length > 4) { - return true ; - } + for(let i=0 ; i < options.zoom_filter.length ; i++){ + if(current_zoom >= options.zoom_filter[i][0] && current_zoom <= options.zoom_filter[i][1]) + { + let afterDecimal = lat.toString().split(".")[1] ; + let precision = 0 ; + if(typeof afterDecimal === "undefined") { + precision = 0 ; + } + else{ + precision = afterDecimal.length ; + } + if(precision >= options.zoom_filter[i][2]){ + return true ; + } + else{ + return false ; + } + } } - + return false ; } From 112185d04faa83cf2d3b5fd7c35033171f855338 Mon Sep 17 00:00:00 2001 From: Sagarpreet Chadha Date: Fri, 8 Mar 2019 14:49:55 +0530 Subject: [PATCH 03/13] Update README.md --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index c13d41d7..8bc7cc5f 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,22 @@ var options_display = { } ``` +##### Changing the zoom levels range where 'x' precision marker should be visible : + +```js + // [lower zoom level , upper zoom level , >= precision allowed] + zoom_filter = [[0,5,0] , [5,6,2] , [8,10,4] , [11,18,5]] ; +``` +The first number signifies the lower zoom level . + +The second number signifies the upper zoom level . + +The last number signifies that all markers having precision greater than equal to this number should be shown . + +The default zoom level filter array is : +```js +[[0,5,0] , [5,6,2] , [8,10,4] , [11,18,5]] ; +``` ##### Using external API to fetch data ```js From 7b2b458a5c1f01b98030b8482752fcb12d9911dd Mon Sep 17 00:00:00 2001 From: sagarpreet-chadha Date: Fri, 8 Mar 2019 16:41:02 +0530 Subject: [PATCH 04/13] testing init --- Gruntfile.js | 14 ++- spec/javascripts/fixtures/example.html | 125 +++++++++++++++++++++++++ spec/javascripts/test_spec.js | 10 ++ 3 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 spec/javascripts/fixtures/example.html diff --git a/Gruntfile.js b/Gruntfile.js index 3618bbc7..674c4460 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -28,10 +28,18 @@ module.exports = function(grunt) { }, jasmine: { - src: "src/client/js/*.js", + src: "dist/*.js", options: { specs: "spec/javascripts/*spec.js", - vendor: ['node_modules/jquery/dist/jquery.js','dist/Leaflet.BlurredLocationDisplay.js','node_modules/jasmine-jquery/lib/jasmine-jquery.js'], + vendor: [ + 'node_modules/jquery/dist/jquery.js', + 'node_modules/bootstrap/dist/js/bootstrap.min.js', + 'node_modules/jasmine-jquery/lib/jasmine-jquery.js' , + 'node_modules/jasmine-ajax/lib/mock-ajax.js', + 'https://maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDWgc7p4WWFsO3y0MTe50vF4l4NUPcPuwE', + 'node_modules/leaflet-blurred-location/dist/Leaflet.BlurredLocation.js' , + 'node_modules/leaflet/dist/leaflet-src.js' + ] } }, @@ -50,9 +58,11 @@ module.exports = function(grunt) { }); /* Default (development): Watch files and build on change. */ + grunt.registerTask("default", ["watch", "jasmine"]); grunt.registerTask('build', [ 'browserify:dist' ]); grunt.registerTask('test', ['jshint', 'jasmine']); grunt.registerTask('build', ['browserify']); + grunt.loadNpmTasks("grunt-contrib-jasmine"); }; diff --git a/spec/javascripts/fixtures/example.html b/spec/javascripts/fixtures/example.html new file mode 100644 index 00000000..6bdcb7a8 --- /dev/null +++ b/spec/javascripts/fixtures/example.html @@ -0,0 +1,125 @@ + + + + + Leaflet.BlurredLocationDisplay + + + + + + + + + + + + + + +
+ +

Leaflet BlurredLocationDisplay | by Public Lab

+ +

This page shows how different markers are shown according to their precision at different zoom levels .

+ +
+ +

+

1.) At zoom level = 5 , all 7 markers are shown :

+
+ [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] +
+
+

+

2.) At zoom level = 6 , 5 markers are shown :

+
+ [21.111 , 76.111],
+ [22.111 , 78.111],
+ [23.1234 , 76.1234],
+ [24.123456 , 78.123456],
+ [25.123456 , 77.123456] +
+
+

+

3.) At zoom level = 8 , 3 markers are shown :

+
+ [23.1234 , 76.1234],
+ [24.123456 , 78.123456],
+ [25.123456 , 77.123456] +
+
+ +
+ +
+ + + + + + + + diff --git a/spec/javascripts/test_spec.js b/spec/javascripts/test_spec.js index 269a9d28..fc50e422 100644 --- a/spec/javascripts/test_spec.js +++ b/spec/javascripts/test_spec.js @@ -1,5 +1,15 @@ describe("Basic testing", function() { + "use strict"; + var fixture = loadFixtures('example.html'); + it("Basic Test", function () { expect(true).toBe(true); }); + + it("Checks if at zoom level 5 , all 7 markers are shown", function () { + // BlurredLocation1.map.setZoom(5); + + expect($("#map1").children()[0].childNodes[3].childNodes.length).toBe(7) ; + }); + }); From 199ca0db3792b5115b3b58bcc2f173a32562cf29 Mon Sep 17 00:00:00 2001 From: sagarpreet-chadha Date: Fri, 8 Mar 2019 16:52:55 +0530 Subject: [PATCH 05/13] jasmine.json changed --- Gruntfile.js | 2 +- spec/support/jasmine.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 674c4460..ad5573a7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -37,8 +37,8 @@ module.exports = function(grunt) { 'node_modules/jasmine-jquery/lib/jasmine-jquery.js' , 'node_modules/jasmine-ajax/lib/mock-ajax.js', 'https://maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDWgc7p4WWFsO3y0MTe50vF4l4NUPcPuwE', + 'node_modules/leaflet/dist/leaflet-src.js', 'node_modules/leaflet-blurred-location/dist/Leaflet.BlurredLocation.js' , - 'node_modules/leaflet/dist/leaflet-src.js' ] } }, diff --git a/spec/support/jasmine.json b/spec/support/jasmine.json index 3ea31669..c9b53dbf 100644 --- a/spec/support/jasmine.json +++ b/spec/support/jasmine.json @@ -1,7 +1,7 @@ { "spec_dir": "spec", "spec_files": [ - "**/*[sS]pec.js" + "spec/**/*.js" ], "helpers": [ "helpers/**/*.js" From 174de81c5c6208c1ad15be786ad25ce55e17ed36 Mon Sep 17 00:00:00 2001 From: sagarpreet-chadha Date: Fri, 8 Mar 2019 17:13:13 +0530 Subject: [PATCH 06/13] tests added --- spec/javascripts/fixtures/example.html | 2 +- spec/javascripts/test_spec.js | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/spec/javascripts/fixtures/example.html b/spec/javascripts/fixtures/example.html index 6bdcb7a8..f8e5ece2 100644 --- a/spec/javascripts/fixtures/example.html +++ b/spec/javascripts/fixtures/example.html @@ -85,7 +85,7 @@

3.) At zoom level = 8 , 3 markers are shown :

zoom_level >= 11 : 2 Markers */ - locations = [[23.1 , 77.1], + var locations = [[23.1 , 77.1], [20.1 , 76.1], [21.111 , 76.111], [22.111 , 78.111], diff --git a/spec/javascripts/test_spec.js b/spec/javascripts/test_spec.js index fc50e422..c05dd81e 100644 --- a/spec/javascripts/test_spec.js +++ b/spec/javascripts/test_spec.js @@ -7,9 +7,18 @@ describe("Basic testing", function() { }); it("Checks if at zoom level 5 , all 7 markers are shown", function () { - // BlurredLocation1.map.setZoom(5); - + BlurredLocation1.map.setZoom(5); expect($("#map1").children()[0].childNodes[3].childNodes.length).toBe(7) ; }); + it("Checks if at zoom level 6 , only 5 markers are shown", function () { + BlurredLocation2.map.setZoom(6); + expect($("#map2").children()[0].childNodes[3].childNodes.length).toBe(5) ; + }); + + it("Checks if at zoom level 8 , only 3 markers are shown", function () { + BlurredLocation2.map.setZoom(8); + expect($("#map2").children()[0].childNodes[3].childNodes.length).toBe(3) ; + }); + }); From 21152a754f3e11e88c0312012f3701667beddb9f Mon Sep 17 00:00:00 2001 From: sagarpreet-chadha Date: Thu, 14 Mar 2019 17:12:12 +0530 Subject: [PATCH 07/13] done changes --- Gruntfile.js | 17 +++++--- package.json | 4 +- spec/javascripts/fixtures/example.html | 54 +++++++++++--------------- spec/javascripts/test_spec.js | 24 ++++++++---- 4 files changed, 52 insertions(+), 47 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index ad5573a7..e451cfc4 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -28,7 +28,7 @@ module.exports = function(grunt) { }, jasmine: { - src: "dist/*.js", + src: "src/client/js/*.js", options: { specs: "spec/javascripts/*spec.js", vendor: [ @@ -37,8 +37,13 @@ module.exports = function(grunt) { 'node_modules/jasmine-jquery/lib/jasmine-jquery.js' , 'node_modules/jasmine-ajax/lib/mock-ajax.js', 'https://maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDWgc7p4WWFsO3y0MTe50vF4l4NUPcPuwE', - 'node_modules/leaflet/dist/leaflet-src.js', - 'node_modules/leaflet-blurred-location/dist/Leaflet.BlurredLocation.js' , + 'node_modules/leaflet/dist/leaflet.js', + 'node_modules/leaflet-blurred-location/dist/Leaflet.BlurredLocation.js', + 'dist/Leaflet.BlurredLocationDisplay.js' + ], + styles: [ + 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css', + 'node_modules/leaflet/dist/leaflet.css' ] } }, @@ -58,11 +63,11 @@ module.exports = function(grunt) { }); /* Default (development): Watch files and build on change. */ + grunt.loadNpmTasks("grunt-contrib-jasmine"); grunt.registerTask("default", ["watch", "jasmine"]); + grunt.registerTask("test", ["jshint", "jasmine"]); grunt.registerTask('build', [ 'browserify:dist' ]); - grunt.registerTask('test', ['jshint', 'jasmine']); - grunt.registerTask('build', ['browserify']); - grunt.loadNpmTasks("grunt-contrib-jasmine"); + }; diff --git a/package.json b/package.json index 9187c7af..6991b0fb 100644 --- a/package.json +++ b/package.json @@ -36,11 +36,11 @@ "require": "^2.4.20", "resig-class": "^1.0.0", "leaflet-graticule": "git://github.com/jywarren/Leaflet.Graticule.git#patch-1", - "leaflet-blurred-location": "git://github.com/publiclab/leaflet-blurred-location#feature_API_modifications" + "leaflet-blurred-location": "^1.2.7" }, "dependencies": { "jquery": "^3.2.1", - "leaflet-blurred-location": "git://github.com/publiclab/leaflet-blurred-location#feature_API_modifications", + "leaflet-blurred-location": "^1.2.7", "map_module": "git://github.com/publiclab/leaflet-blurred-location.git#master" } } diff --git a/spec/javascripts/fixtures/example.html b/spec/javascripts/fixtures/example.html index f8e5ece2..011d1849 100644 --- a/spec/javascripts/fixtures/example.html +++ b/spec/javascripts/fixtures/example.html @@ -4,15 +4,7 @@ Leaflet.BlurredLocationDisplay - - - - - - - - - + @@ -60,8 +52,18 @@

3.) At zoom level = 8 , 3 markers are shown :

+ + + + + + - - - - - diff --git a/spec/javascripts/test_spec.js b/spec/javascripts/test_spec.js index c05dd81e..393bd991 100644 --- a/spec/javascripts/test_spec.js +++ b/spec/javascripts/test_spec.js @@ -1,24 +1,34 @@ describe("Basic testing", function() { "use strict"; - var fixture = loadFixtures('example.html'); + + beforeEach(function(){ + loadFixtures('example.html'); + }); + it("Basic Test", function () { expect(true).toBe(true); }); it("Checks if at zoom level 5 , all 7 markers are shown", function () { - BlurredLocation1.map.setZoom(5); - expect($("#map1").children()[0].childNodes[3].childNodes.length).toBe(7) ; + //BlurredLocation1.map.setZoom(5); + expect($("#map1").children()[0].childNodes[3].childNodes.length).toBe(0) ; }); it("Checks if at zoom level 6 , only 5 markers are shown", function () { - BlurredLocation2.map.setZoom(6); - expect($("#map2").children()[0].childNodes[3].childNodes.length).toBe(5) ; + //BlurredLocation2.map.setZoom(6); + expect($("#map2").children()[0].childNodes[3].childNodes.length).toBe(0) ; }); it("Checks if at zoom level 8 , only 3 markers are shown", function () { - BlurredLocation2.map.setZoom(8); - expect($("#map2").children()[0].childNodes[3].childNodes.length).toBe(3) ; + // BlurredLocation3.map.setZoom(8); + expect($("#map3").children()[0].childNodes[3].childNodes.length).toBe(0) ; }); + it("maps are loaded", function () { + expect($("#map1")).toBeInDOM() ; + expect($("#map2")).toBeInDOM() ; + expect($("#map3")).toBeInDOM() ; + }); + }); From 1be8a1805d818bcd64561ead563fbd840813a630 Mon Sep 17 00:00:00 2001 From: sagarpreet-chadha Date: Thu, 14 Mar 2019 17:29:47 +0530 Subject: [PATCH 08/13] changes recommended by jeff --- spec/javascripts/fixtures/example.html | 5 +---- spec/javascripts/test_spec.js | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/spec/javascripts/fixtures/example.html b/spec/javascripts/fixtures/example.html index 011d1849..131cd7b2 100644 --- a/spec/javascripts/fixtures/example.html +++ b/spec/javascripts/fixtures/example.html @@ -3,7 +3,6 @@ Leaflet.BlurredLocationDisplay - @@ -100,8 +99,6 @@

3.) At zoom level = 8 , 3 markers are shown :

blurredLocation: BlurredLocation3, locations: locations }; - - $(document).ready(function(){ var blurredLocationDisplay1 = new BlurredLocationDisplay(options_display1); var blurredLocationDisplay2 = new BlurredLocationDisplay(options_display2); @@ -110,6 +107,6 @@

3.) At zoom level = 8 , 3 markers are shown :

BlurredLocation1.map.setView([23,77] , 5) ; BlurredLocation2.map.setView([23,77] , 6) ; BlurredLocation3.map.setView([24.23694700391752, 76.89880371093751] , 8) ; - }) ; + diff --git a/spec/javascripts/test_spec.js b/spec/javascripts/test_spec.js index 393bd991..dd3c42b9 100644 --- a/spec/javascripts/test_spec.js +++ b/spec/javascripts/test_spec.js @@ -1,10 +1,7 @@ describe("Basic testing", function() { "use strict"; - beforeEach(function(){ - loadFixtures('example.html'); - }); - + var fixture = loadFixtures('example.html'); it("Basic Test", function () { expect(true).toBe(true); From dae107f7745a1f9505cb7179054635a1a16e59da Mon Sep 17 00:00:00 2001 From: sagarpreet-chadha Date: Sun, 17 Mar 2019 23:26:49 +0530 Subject: [PATCH 09/13] test --- Gruntfile.js | 2 +- spec/javascripts/fixtures/example.html | 21 ++++++++++++--------- spec/javascripts/test_spec.js | 11 +++++++---- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index e451cfc4..f07970b8 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -28,7 +28,7 @@ module.exports = function(grunt) { }, jasmine: { - src: "src/client/js/*.js", + src: "dist/*.js", options: { specs: "spec/javascripts/*spec.js", vendor: [ diff --git a/spec/javascripts/fixtures/example.html b/spec/javascripts/fixtures/example.html index 131cd7b2..20674127 100644 --- a/spec/javascripts/fixtures/example.html +++ b/spec/javascripts/fixtures/example.html @@ -3,7 +3,10 @@ Leaflet.BlurredLocationDisplay - + + + + @@ -99,14 +102,14 @@

3.) At zoom level = 8 , 3 markers are shown :

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) ; + + // 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) ; diff --git a/spec/javascripts/test_spec.js b/spec/javascripts/test_spec.js index dd3c42b9..56e223ae 100644 --- a/spec/javascripts/test_spec.js +++ b/spec/javascripts/test_spec.js @@ -1,24 +1,27 @@ describe("Basic testing", function() { "use strict"; - var fixture = loadFixtures('example.html'); + // var fixture = loadFixtures('example.html'); it("Basic Test", function () { expect(true).toBe(true); }); it("Checks if at zoom level 5 , all 7 markers are shown", function () { - //BlurredLocation1.map.setZoom(5); + BlurredLocation1.map.setZoom(5); + loadFixtures('example.html'); expect($("#map1").children()[0].childNodes[3].childNodes.length).toBe(0) ; }); it("Checks if at zoom level 6 , only 5 markers are shown", function () { - //BlurredLocation2.map.setZoom(6); + // BlurredLocation2.map.setZoom(6); + loadFixtures('example.html'); expect($("#map2").children()[0].childNodes[3].childNodes.length).toBe(0) ; }); it("Checks if at zoom level 8 , only 3 markers are shown", function () { - // BlurredLocation3.map.setZoom(8); + //BlurredLocation3.map.setZoom(8); + loadFixtures('example.html'); expect($("#map3").children()[0].childNodes[3].childNodes.length).toBe(0) ; }); From 05b44961de864dd33c15f777fc1287b6da0bd351 Mon Sep 17 00:00:00 2001 From: sagarpreet-chadha Date: Thu, 28 Mar 2019 11:44:52 +0530 Subject: [PATCH 10/13] gruntfile modified --- Gruntfile.js | 11 +++-------- examples/example.html | 2 +- spec/javascripts/fixtures/example.html | 25 +++++++++++++------------ spec/javascripts/test_spec.js | 7 +++---- 4 files changed, 20 insertions(+), 25 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index f07970b8..bf31c004 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -28,22 +28,17 @@ module.exports = function(grunt) { }, jasmine: { - src: "dist/*.js", + src: ['dist/client/Leaflet.BlurredLocationDisplay.js'], options: { specs: "spec/javascripts/*spec.js", vendor: [ + 'dist/Leaflet.BlurredLocationDisplay.js', 'node_modules/jquery/dist/jquery.js', 'node_modules/bootstrap/dist/js/bootstrap.min.js', 'node_modules/jasmine-jquery/lib/jasmine-jquery.js' , 'node_modules/jasmine-ajax/lib/mock-ajax.js', 'https://maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDWgc7p4WWFsO3y0MTe50vF4l4NUPcPuwE', - 'node_modules/leaflet/dist/leaflet.js', - 'node_modules/leaflet-blurred-location/dist/Leaflet.BlurredLocation.js', - 'dist/Leaflet.BlurredLocationDisplay.js' - ], - styles: [ - 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css', - 'node_modules/leaflet/dist/leaflet.css' + 'node_modules/leaflet-blurred-location/dist/Leaflet.BlurredLocation.js' ] } }, diff --git a/examples/example.html b/examples/example.html index d6dbe016..7dc6ae92 100644 --- a/examples/example.html +++ b/examples/example.html @@ -9,7 +9,7 @@ - + diff --git a/spec/javascripts/fixtures/example.html b/spec/javascripts/fixtures/example.html index 20674127..2b903a47 100644 --- a/spec/javascripts/fixtures/example.html +++ b/spec/javascripts/fixtures/example.html @@ -7,10 +7,11 @@ + - +

Leaflet BlurredLocationDisplay | by Public Lab

@@ -59,11 +60,7 @@

3.) At zoom level = 8 , 3 markers are shown :

body { background: none; } - - - - - + + + + diff --git a/spec/javascripts/test_spec.js b/spec/javascripts/test_spec.js index 56e223ae..92bafbd8 100644 --- a/spec/javascripts/test_spec.js +++ b/spec/javascripts/test_spec.js @@ -8,21 +8,20 @@ describe("Basic testing", function() { }); it("Checks if at zoom level 5 , all 7 markers are shown", function () { - BlurredLocation1.map.setZoom(5); loadFixtures('example.html'); - expect($("#map1").children()[0].childNodes[3].childNodes.length).toBe(0) ; + expect($("#map1").children()[0].childNodes[3].childNodes.length).toBe(7) ; }); it("Checks if at zoom level 6 , only 5 markers are shown", function () { // BlurredLocation2.map.setZoom(6); loadFixtures('example.html'); - expect($("#map2").children()[0].childNodes[3].childNodes.length).toBe(0) ; + expect($("#map2").children()[0].childNodes[3].childNodes.length).toBe(5) ; }); it("Checks if at zoom level 8 , only 3 markers are shown", function () { //BlurredLocation3.map.setZoom(8); loadFixtures('example.html'); - expect($("#map3").children()[0].childNodes[3].childNodes.length).toBe(0) ; + expect($("#map3").children()[0].childNodes[3].childNodes.length).toBe(3) ; }); it("maps are loaded", function () { From a605c7350b990c7a79693429ac356c7bcbfdc11e Mon Sep 17 00:00:00 2001 From: sagarpreet-chadha Date: Thu, 28 Mar 2019 21:05:38 +0530 Subject: [PATCH 11/13] last test runs now/fixtures are loaded now --- spec/javascripts/test_spec.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/spec/javascripts/test_spec.js b/spec/javascripts/test_spec.js index 92bafbd8..a1bac79c 100644 --- a/spec/javascripts/test_spec.js +++ b/spec/javascripts/test_spec.js @@ -1,31 +1,32 @@ describe("Basic testing", function() { "use strict"; - // var fixture = loadFixtures('example.html'); + // var fixture = loadFixtures('example.html'); it("Basic Test", function () { expect(true).toBe(true); }); it("Checks if at zoom level 5 , all 7 markers are shown", function () { - loadFixtures('example.html'); + var fixture = loadFixtures('example.html'); expect($("#map1").children()[0].childNodes[3].childNodes.length).toBe(7) ; }); it("Checks if at zoom level 6 , only 5 markers are shown", function () { // BlurredLocation2.map.setZoom(6); - loadFixtures('example.html'); + var fixture = loadFixtures('example.html'); expect($("#map2").children()[0].childNodes[3].childNodes.length).toBe(5) ; }); it("Checks if at zoom level 8 , only 3 markers are shown", function () { //BlurredLocation3.map.setZoom(8); - loadFixtures('example.html'); + var fixture = loadFixtures('example.html'); expect($("#map3").children()[0].childNodes[3].childNodes.length).toBe(3) ; }); it("maps are loaded", function () { - expect($("#map1")).toBeInDOM() ; + var fixture = loadFixtures('example.html'); + expect(document.getElementById('map1')).toBeInDOM() ; expect($("#map2")).toBeInDOM() ; expect($("#map3")).toBeInDOM() ; }); From afe7aecd5009a190483f9b19e7a89448cada63c6 Mon Sep 17 00:00:00 2001 From: sagarpreet-chadha Date: Mon, 1 Apr 2019 15:30:47 +0530 Subject: [PATCH 12/13] specRunner added --- Gruntfile.js | 11 ++++--- _SpecRunner.html | 41 ++++++++++++++++++++++++++ package.json | 8 ++--- spec/javascripts/fixtures/example.html | 20 ------------- spec/javascripts/test_spec.js | 15 ++++++---- 5 files changed, 61 insertions(+), 34 deletions(-) create mode 100644 _SpecRunner.html diff --git a/Gruntfile.js b/Gruntfile.js index bf31c004..d0f97c72 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -28,18 +28,21 @@ module.exports = function(grunt) { }, jasmine: { - src: ['dist/client/Leaflet.BlurredLocationDisplay.js'], + src: ['dist/Leaflet.BlurredLocationDisplay.js'], options: { specs: "spec/javascripts/*spec.js", vendor: [ - 'dist/Leaflet.BlurredLocationDisplay.js', 'node_modules/jquery/dist/jquery.js', 'node_modules/bootstrap/dist/js/bootstrap.min.js', 'node_modules/jasmine-jquery/lib/jasmine-jquery.js' , 'node_modules/jasmine-ajax/lib/mock-ajax.js', - 'https://maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDWgc7p4WWFsO3y0MTe50vF4l4NUPcPuwE', 'node_modules/leaflet-blurred-location/dist/Leaflet.BlurredLocation.js' - ] + ], + summary: false, + keepRunner: true, + '--web-security' : false, + '--local-to-remote-url-access' : true, + '--ignore-ssl-errors' : true } }, diff --git a/_SpecRunner.html b/_SpecRunner.html new file mode 100644 index 00000000..3151d3d5 --- /dev/null +++ b/_SpecRunner.html @@ -0,0 +1,41 @@ + + + + + Jasmine Spec Runner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/package.json b/package.json index 2b5e6855..ffe9dac5 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "grunt": "^1.0.4", "grunt-browserify": "^5.3.0", "grunt-contrib-concat": "^1.0.1", - "grunt-contrib-jasmine": "^1.1.0", + "grunt-contrib-jasmine": "^2.0.3", "grunt-contrib-jshint": "^2.1.0", "grunt-contrib-uglify": "^2.2.0", "grunt-contrib-watch": "^1.1.0", @@ -29,18 +29,16 @@ "jasmine": "^3.3.1", "jasmine-ajax": "^4.0.0", "jasmine-jquery": "^2.1.1", + "jasmine-fixture": "^2.0.0", "leaflet": "^1.4.0", "leaflet-graticule": "git://github.com/jywarren/Leaflet.Graticule.git#patch-1", - "map_module": "git://github.com/publiclab/leaflet-blurred-location#master", "matchdep": "^2.0.0", "require": "^2.4.20", "resig-class": "^1.0.0", - "leaflet-graticule": "git://github.com/jywarren/Leaflet.Graticule.git#patch-1", "leaflet-blurred-location": "^1.2.7" }, "dependencies": { "jquery": "^3.3.1", - "leaflet-blurred-location": "^1.2.7", - "map_module": "git://github.com/publiclab/leaflet-blurred-location.git#master" + "leaflet-blurred-location": "^1.2.7" } } diff --git a/spec/javascripts/fixtures/example.html b/spec/javascripts/fixtures/example.html index 2b903a47..ba91e895 100644 --- a/spec/javascripts/fixtures/example.html +++ b/spec/javascripts/fixtures/example.html @@ -1,16 +1,4 @@ - - - - Leaflet.BlurredLocationDisplay - - - - - - - -
@@ -55,11 +43,6 @@

3.) At zoom level = 8 , 3 markers are shown :

- - - - - diff --git a/spec/javascripts/test_spec.js b/spec/javascripts/test_spec.js index a1bac79c..20c0e6e6 100644 --- a/spec/javascripts/test_spec.js +++ b/spec/javascripts/test_spec.js @@ -1,31 +1,36 @@ +//jasmine.getFixtures().fixturesPath = 'spec/javascripts/fixtures' ; + describe("Basic testing", function() { - "use strict"; // var fixture = loadFixtures('example.html'); + beforeEach(function () { + loadFixtures('example.html'); + }); + it("Basic Test", function () { expect(true).toBe(true); }); it("Checks if at zoom level 5 , all 7 markers are shown", function () { - var fixture = loadFixtures('example.html'); + // var fixture = loadFixtures('example.html'); expect($("#map1").children()[0].childNodes[3].childNodes.length).toBe(7) ; }); it("Checks if at zoom level 6 , only 5 markers are shown", function () { // BlurredLocation2.map.setZoom(6); - var fixture = loadFixtures('example.html'); + // var fixture = loadFixtures('example.html'); expect($("#map2").children()[0].childNodes[3].childNodes.length).toBe(5) ; }); it("Checks if at zoom level 8 , only 3 markers are shown", function () { //BlurredLocation3.map.setZoom(8); - var fixture = loadFixtures('example.html'); + // var fixture = loadFixtures('example.html'); expect($("#map3").children()[0].childNodes[3].childNodes.length).toBe(3) ; }); it("maps are loaded", function () { - var fixture = loadFixtures('example.html'); + // var fixture = loadFixtures('example.html'); expect(document.getElementById('map1')).toBeInDOM() ; expect($("#map2")).toBeInDOM() ; expect($("#map3")).toBeInDOM() ; From 095a0609ea2fff9c641dde2a4660da8a0977e575 Mon Sep 17 00:00:00 2001 From: sagarpreet-chadha Date: Mon, 1 Apr 2019 18:15:22 +0530 Subject: [PATCH 13/13] tests running now :) --- Gruntfile.js | 3 +- _SpecRunner.html | 2 + package.json | 9 +- spec/javascripts/fixtures/example.html | 544 ++++++++++++++++++++++++- 4 files changed, 548 insertions(+), 10 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index d0f97c72..368951b2 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -36,7 +36,8 @@ module.exports = function(grunt) { 'node_modules/bootstrap/dist/js/bootstrap.min.js', 'node_modules/jasmine-jquery/lib/jasmine-jquery.js' , 'node_modules/jasmine-ajax/lib/mock-ajax.js', - 'node_modules/leaflet-blurred-location/dist/Leaflet.BlurredLocation.js' + 'node_modules/leaflet-blurred-location/dist/Leaflet.BlurredLocation.js', + 'node_modules/leaflet-graticule/Leaflet.Graticule.js' ], summary: false, keepRunner: true, diff --git a/_SpecRunner.html b/_SpecRunner.html index 3151d3d5..250126e3 100644 --- a/_SpecRunner.html +++ b/_SpecRunner.html @@ -30,6 +30,8 @@ + + diff --git a/package.json b/package.json index ffe9dac5..1808a180 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "grunt": "^1.0.4", "grunt-browserify": "^5.3.0", "grunt-contrib-concat": "^1.0.1", - "grunt-contrib-jasmine": "^2.0.3", + "grunt-contrib-jasmine": "^1.1.0", "grunt-contrib-jshint": "^2.1.0", "grunt-contrib-uglify": "^2.2.0", "grunt-contrib-watch": "^1.1.0", @@ -29,16 +29,15 @@ "jasmine": "^3.3.1", "jasmine-ajax": "^4.0.0", "jasmine-jquery": "^2.1.1", - "jasmine-fixture": "^2.0.0", "leaflet": "^1.4.0", - "leaflet-graticule": "git://github.com/jywarren/Leaflet.Graticule.git#patch-1", "matchdep": "^2.0.0", "require": "^2.4.20", "resig-class": "^1.0.0", - "leaflet-blurred-location": "^1.2.7" + "leaflet-graticule": "git://github.com/jywarren/Leaflet.Graticule.git#patch-1", + "leaflet-blurred-location": "git://github.com/publiclab/leaflet-blurred-location#main" }, "dependencies": { "jquery": "^3.3.1", - "leaflet-blurred-location": "^1.2.7" + "leaflet-blurred-location": "git://github.com/publiclab/leaflet-blurred-location#main" } } diff --git a/spec/javascripts/fixtures/example.html b/spec/javascripts/fixtures/example.html index ba91e895..18ac9d38 100644 --- a/spec/javascripts/fixtures/example.html +++ b/spec/javascripts/fixtures/example.html @@ -1,5 +1,539 @@ + + + + Leaflet.BlurredLocationDisplay + + + + + + + + + + + + + + +

Leaflet BlurredLocationDisplay | by Public Lab

@@ -62,7 +596,7 @@

3.) At zoom level = 8 , 3 markers are shown :

var BlurredLocation3 = new BlurredLocation(options3) ; - var locations = [[23.1 , 77.1], + var input_locations = [[23.1 , 77.1], [20.1 , 76.1], [21.111 , 76.111], [22.111 , 78.111], @@ -72,15 +606,15 @@

3.) At zoom level = 8 , 3 markers are shown :

var options_display1 = { blurredLocation: BlurredLocation1, - locations: locations + locations: input_locations }; var options_display2 = { blurredLocation: BlurredLocation2, - locations: locations + locations: input_locations }; var options_display3 = { blurredLocation: BlurredLocation3, - locations: locations + locations: input_locations }; var blurredLocationDisplay1 = new BlurredLocationDisplay(options_display1); @@ -94,3 +628,5 @@

3.) At zoom level = 8 , 3 markers are shown :

+ +