这是indexloc提供的服务,不要输入任何密码
Skip to content

Roads: Nearby Roads does not give error when trying to issue request without billing setup #246

@twa16

Description

@twa16

Call to nearby roads API does not give same error about not having billing setup as the geocoding API does.

Steps to reproduce

  1. Create a basic project requesting snap to roads
  2. Use API key associated with project that does not have billing enabled.
  3. Issue request

One will get an empty response but no error. The geocoding API does return an error stating that billing must be enabled.

Code example

c, err := maps.NewClient(maps.WithAPIKey(os.Getenv("GOOGLE_MAPS_API_KEY")))
	if err != nil {
		log.Fatalf("fatal error: %s", err)
	}

	r := maps.NearestRoadsRequest{Points: utils.GeoPointsToGmapLatLngs(geoPoints)}

	resp, err := c.NearestRoads(context.Background(), &r)
	if err != nil {
		log.Fatalf("fatal error: %s", err)
	}

	pretty.Println(resp.SnappedPoints)

Stack trace

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedWe'd love to have community involvement on this issue.priority: p3Desirable enhancement or fix. May not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions