Skip to content

Cannot disable startIcon or endIcon #158

@MarsupialFan

Description

@MarsupialFan

According to the Configuring markers section in README.md:

startIcon is used for ...
You can also override any of those to null to disable the corresponding marker altogether.

However, when I set it to null,

        const options = {
            async: true,
            markers: {
                startIcon: null,
            },
        };

I get the following error message:

TypeError: Object.entries requires that input parameter not be null or undefined

I suspect this might be due to lines 298-299 of gpx.js:

      } else if (typeof(value) === 'object') {
        markers[key] = this._prepare_markers(value);

Since the key (startIcon or endIcon) doesn't match the previous if's, and since null is an object, the code calls _prepare_markers recursively with null as the markers parameter, and then Object.entries(markers) barfs.

Should the code refrain from making the recursive call if value is null?

[On a separate note, this issue (from 4 years ago) suggests to set startIconUrl to null, but this no longer works either.]

Thank you!

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