This article discusses the following:
A bounding box is a rectangle shape that is constructed from two sets of latitudes and longitudes. This shape creates an area which can can use to filter Events in the Widgety API. When a bounding box is set, only the Events belonging to Places located in that specific area will be available in the response.
How do I get the correct latitude and longitude for my bounding box?
The easiest way is probably to work from Google Maps:
- Go to https://www.google.co.uk/maps/
- Click on the menu icon (top left corner)
- Click on 'Your Places'
- Click on the MAPS tab
- Select 'CREATE MAP' at the bottom of the page. This will open a new Google Maps window, with additional features.
Once you've reached this page, zoom in to the area for which you're looking to created a bounding box. Once you've found it, click on the 'Draw a line' tool under the search bar, and click on the map to start drawing your box. Once you're done, give it a name and save it.
If your box isn't perfectly square, that's okay. You can fix it by simply dragging the white corners around until it looks square enough.
Now that you can see your area as a box, you need to set two markers in the top right and bottom left corners. To make things easier for you in the next step, call the top right marker 'max' and the bottom left marker 'min'.
As you can see, when you click on a marker, Google Maps will provide you with the latitude and longitude for its location. This is the information you need to set your bounding box in the Widgety Events API.
The first number will always be the latitude, and the second, the longitude.
Once you're happy with your area, you can copy and paste those latitude and longitudes into your request to set your bounding box:
- The data for min will apply to the min_lat and min_lng parameters
- The data for max will apply to the max_lat and max_lng parameters
Please note: the top right marker must always be used for the max parameter.
Comments
0 comments
Please sign in to leave a comment.