-
Notifications
You must be signed in to change notification settings - Fork 32
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
Developing a button to display current latitude and longitude the current position of map is pointing to #9
Comments
@jywarren If you could tag this, also can I merge PR's in this repo, I couldn't find out how to do it. Is there some privacy issue there, please let me know. Thanks! |
I'd still like to review PRs for the time being, so please be in communication before doing it, but i invited you to be a collaborator a while ago and I think you didn't click the invitation yet? |
I also think this one is totally ready to be a If you could add a bit more detail i'll add the FTO label too! |
Sorry for that, I'll more info to it. |
@jywarren Please have a look |
@jywarren I have added some more info to the issue, is it ready to be a first timer issue? |
I think it is but let's wait until #7 is merged and it is more possible for folks to get started. Great work! |
Can we add a |
Yeah sure !
On 27-Aug-2017 2:26 AM, "Ananyo Maiti" <notifications@github.com> wrote:
Can we add a fto-candidate label here?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVULlJOoy2qiKuUGgCc2gGUAx_Uxg4WHks5scIaDgaJpZM4Nmsy8>
.
|
Hi, i would like to take this if it's still available, i set up the repo locally but i can't find the object.js file where the function should be added and examples.html file where the button should be added, for now, i added the changes to the examples/index.html file and maked them work as expected. |
The code has been restructured a bit. You will need to add the
|
Thanks for the info! I've created a new pull request |
Hi, this is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.
If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!
blu
If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!
The Problem
We have an API available to get the current lat and lon of the map. What we need to do is create a button for template here https://github.com/publiclab/leaflet-blurred-location/blob/master/examples/example.html which will be available as soon as #7 is merged.
Solution
In the file example.html we need to add a button which when clicked alerts us with the lat, lon. The API reference is
blurredLocation.getLat()
andblurredLocation.getLon()
which would return the lat and lon respectively. blurredLocation is a Global object which controls the map. You need to get those co-ordinates from the API usingblurredLocation.getLat()
andblurredLocation.getLon()
. And then display them to the user. It will be something like this in the example.html file.<button onclick="displayLocation()">Location</button>
And adding the function to object.js file
function displayLocation() { if(blurredLocation) { var lat = blurredLocation.getLat(); var lon = blurredLocation.getLon(); alert(lat+','+lon); } }
Remember as soon as you make changes in object.js either run grunt build or have grunt watch running while you save changes, to test them.
Steps to fix
The text was updated successfully, but these errors were encountered: