Skip to content

Not passing optional props breaks map #2

@ChavaSobreyra

Description

@ChavaSobreyra

I'm submitting a ...

  • [x ] bug report
  • feature request
  • other (Please do not submit support requests here (see above))

Current behavior:
When you don't pass optional params, such as paths, the URL generator inserts it as undefined, which can break features

For example, here is a URL generated when I did not pass paths. https://maps.googleapis.com/maps/api/staticmap?center=26.39514,-80.08892&zoom=17&size=150x125&maptype=satellite&format=jpg&key=AIzaSyASPgHKMi6jZTcCvEibvZitZVhtj-Sl3O4&scale=1&language=en&markers=color:red|26.39514,-80.08892undefined

As you can see the URL ends with undefined, which breaks the marker. Remove the undefined at the end, and the marker renders properly.

Expected / new behavior:
If an param is undefined, it should not be inserted into the URL as such

Minimal reproduction of the problem with instructions:
Create static map, don't pass paths

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions