As a consumer of an Opportunity API, I would like to show users a map of location pins for where opportunities are happening
Ideally, I would need to have returned a list of distinct latitude/longitudes of opportunities as well as a count of opportunities in each of those locations
With just a sessions endpoint, a consumer would have to download all pages of data and do in-process grouping to get all the distinct locations
An endpoint e.g. /locations with response like:
{
"@context": [
"https://www.openactive.io/ns/oa.jsonld",
],
"id": "https://exampleapi.com/locations?location.geo[radial]=50.8,-1.6,30",
"type": "Collection",
"totalItems": 22,
"item": [
{
type: "Place",
"totalEvents": 8, /* i.e. how many events are at this location */
name: null,
address: {
type: 'PostalAddress',
streetAddress: 'Quayside Leisure Centre, TQ7 1HH',
postalCode: 'TQ7 1HH',
addressCountry: 'GB',
},
geo: {
type: 'GeoCoordinates',
latitude: 50.280404,
longitude: -3.777604,
},
identifier: null,
amenityFeature: [],
potentialAction: [
{
type: 'SearchAction',
target: 'https://exampleapi.com/sessions?location.geo[radial]=50.280404,-3.777604,0',
},
{
type: 'TravelAction',
distance: 164827,
fromLocation: {
type: 'Place',
geo: {
type: 'GeoCoordinates',
latitude: 50.8,
longitude: -1.6,
},
},
toLocation: {
type: 'Place',
name: null,
address: {
type: 'PostalAddress',
streetAddress: 'Quayside Leisure Centre, TQ7 1HH',
postalCode: 'TQ7 1HH',
addressCountry: 'GB',
},
geo: {
type: 'GeoCoordinates',
latitude: 50.280404,
longitude: -3.777604,
},
identifier: null,
amenityFeature: [],
},
},
],
}
]
}
Proposer
IMIN LTD
Use Case
As a consumer of an Opportunity API, I would like to show users a map of location pins for where opportunities are happening
Ideally, I would need to have returned a list of distinct latitude/longitudes of opportunities as well as a count of opportunities in each of those locations
This information could then fill a collection of pins on a map
Why is this not covered by existing properties?
With just a sessions endpoint, a consumer would have to download all pages of data and do in-process grouping to get all the distinct locations
Please provide a link to example dataProposal
An endpoint e.g.
/locationswith response like:Notes on above data:
totalEventsis a new key. Not sure where else this information could goPlaces - is a list of sessionCollections which only havetotalItemsandidfields as well as some kind of geo field e.g.Example