publiclab / leaflet-blurred-location-display

A library to display points which have been "blurred" for privacy with leaflet-blurred-location
https://publiclab.github.io/leaflet-blurred-location-display/examples/index.html
GNU General Public License v3.0
11 stars 12 forks source link

'n' LBLD objects for 'n' coordinate pair ? #66

Open sagarpreet-chadha opened 5 years ago

sagarpreet-chadha commented 5 years ago

From #64 ,

does options.locations auto-generate the BlurredLocations? Why do we make only one blurredLocation? It kind of seems like we should make one for each coordinate pair, using this syntax?

Hi @jywarren ,

I think options.locations property gives user more flexibility . So if one do not want to pass their API URL and JSON parser into the LBLD library (as we do not support XML parsing and others) , so instead one can pass the coordinates array (locations array) directly into the LBLD object . Makes sense ?

Kindly elaborate more on this issue :smile: ! Thanks !

sagarpreet-chadha commented 5 years ago

Hi @jywarren , I have changed the LBL declaration syntax in PR : https://github.com/publiclab/leaflet-blurred-location/pull/195 . The current declaration of LBLD is pretty simple 😄 :

var blurredLocationDisplay = new BlurredLocationDisplay(options_display);

Should we do any change to LBLD as well ? Kindly elaborate this issue . Thanks !

jywarren commented 5 years ago

Yeah i think it's fine - however does it set up a Leaflet map, or how do we connect it to a leaflet map? Especially, say, if we have more than one on a given page?

On Mon, Apr 8, 2019 at 1:23 PM Sagarpreet Chadha notifications@github.com wrote:

Hi @jywarren https://github.com/jywarren , I have changed the LBL declaration syntax in PR : publiclab/leaflet-blurred-location#195 https://github.com/publiclab/leaflet-blurred-location/pull/195 . The current declaration of LBLD is pretty simple 😄 :

var blurredLocationDisplay = new BlurredLocationDisplay(options_display);

Should we do any change to LBLD as well ? Kindly elaborate this issue . Thanks !

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/leaflet-blurred-location-display/issues/66#issuecomment-480924800, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ_ISncMfZp3X4MrLzLqmxdGTQO9iks5ve3r_gaJpZM4cgpFL .

sagarpreet-chadha commented 5 years ago

So after https://github.com/publiclab/leaflet-blurred-location/pull/195 gets merged , It would be a 3 step process to add LBLD to maps :

1.) Make standard leaflet object : var map123 = L.map('map').setView([23,77] , 3) ;

2.) Pass this leaflet object to LBL : var blurredLocation = new BlurredLocation(options) ; blurredLocation.addTo(map123) ;

3.) Pass LBL object in options_display to LBLD object (no need to pass leaflet map object) : var blurredLocationDisplay = new BlurredLocationDisplay(options_display);

I will write a detailed documentation explaining this in Readme :)