Files
m3o-go/examples/evchargers/search/searchByLocation.go
2021-10-29 10:44:29 +00:00

22 lines
476 B
Go
Executable File

package example
import (
"fmt"
"os"
"go.m3o.com/evchargers"
)
// Search by giving a coordinate and a max distance, or bounding box and optional filters
func SearchByLocation() {
evchargersService := evchargers.NewEvchargersService(os.Getenv("M3O_API_TOKEN"))
rsp, err := evchargersService.Search(&evchargers.SearchRequest{
Distance: 2000,
Location: &evchargers.Coordinates{
Latitude: 51.53336351319885,
Longitude: -0.0252,
},
})
fmt.Println(rsp, err)
}