-
Notifications
You must be signed in to change notification settings - Fork 78
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
Using Mapknitter API #10
Labels
help wanted
Extra attention is needed
Comments
I think Leaflet has a bounding box request?
…On Fri, Jun 8, 2018 at 3:56 PM, Sagarpreet Chadha ***@***.***> wrote:
Hi @jywarren <https://github.com/jywarren> !
The construction of API for fetching data is solved here :
publiclab/mapknitter#251
<publiclab/mapknitter#251>
The corresponding API example is : https://mapknitter.org/map/
region/Gulf-Coast.json?minlon=-98.8&minlat=23.6&maxlon=-79.1&maxlat=31.8
We can get the map centers from leaflet library using :
var center = _map.getCenter() ;
and Latitude is then center.lat and longitude is center.lng .
*Using this how should we set the minlon , minlat , maxlon , maxlat in the
url ?*
Thanks [image:
![]() |
So we need NorthEast coordinates and SouthWest coordinated of the Bounding box , right ? So , |
i think so - give that a try! We can also swap around a bit if it doesn't
work in all scenarios.
…On Fri, Jun 8, 2018 at 4:44 PM, Sagarpreet Chadha ***@***.***> wrote:
So we need NorthEast coordinates and SouthWest coordinated of the Bounding
box , right ?
See here : https://leafletjs.com/reference-1.3.0.html#
latlngbounds-getnortheast
So ,
NorthEast coordinate = maxlat and maxlon
SouthWest coordinate = minlat and minlon
is this correct @jywarren <https://github.com/jywarren> ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ7DOOYvU_qeVh5tihB31n96AN48dks5t6uIcgaJpZM4Ug3s0>
.
|
This was referenced Jun 9, 2018
Merged
PR #13 . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @jywarren !
The construction of API for fetching data is solved here : publiclab/mapknitter#251
The corresponding API example is : https://mapknitter.org/map/region/Gulf-Coast.json?minlon=-98.8&minlat=23.6&maxlon=-79.1&maxlat=31.8
We can get the map centers from leaflet library using :
var center = _map.getCenter() ;
and Latitude is then
center.lat
and longitude iscenter.lng
.Using this how should we set the minlon , minlat , maxlon , maxlat parameters in the API url ?
Thanks
!
The text was updated successfully, but these errors were encountered: