Skip to content

Uncaught TypeError: options.icon.slice is not a function: new L.AwesomeMarkers.icon do not work on startIcon and endIcon #161

@SubiNesa

Description

@SubiNesa

Currently if we want to use L.AwesomeMarkers.icon it will not work as the error Uncaught TypeError: options.icon.slice is not a function is being triggered

      const options = {
        async: true,
        markers: {
          startIcon: 'leaf-green.png',
          endIcon: new L.AwesomeMarkers.icon({
            icon: 'coffee',
            prefix: 'fa',
            markerColor: 'green',
            iconColor: 'yellow',
          }),
        },
        polyline_options: { color: 'red' },
      };

FIX: Here is the example of the entire project that will work: https://github.com/SubiNesa/gpx/blob/main/leaflet-gpx.html

The only change done is here https://github.com/SubiNesa/gpx/blob/main/gpx.js#L470 compared to https://github.com/mpetazzoni/leaflet-gpx/blob/main/gpx.js#L304

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