watergis / mapbox-gl-legend

This module adds legend control which is able to create legend panel from mapbox style to mapbox-gl
https://watergis.github.io/mapbox-gl-legend/
MIT License
113 stars 17 forks source link

Errors when loading sprites #8

Closed SamiAlavi closed 3 years ago

SamiAlavi commented 3 years ago

The plugin seems to working correctly but is giving these errors when loading sprites. When I comment out lines 261, 262 in the file dist/index.js the errors stop.

image image

JinIgarashi commented 3 years ago

@SamiAlavi Thank you for the issue. I haven’t tested sprite url for Mapbox studio in this plugin because I am self hosting sprite. You may comment out these two lines in order to stop errors, but it is not permanent solution. These lines are necessary to show some symbol icons.

JinIgarashi commented 3 years ago

@SamiAlavi I fixed this bug in this PR. Could you check feature/adopt4mapboxstyleurl branch whether it can work in your environment? If it can work, I will merge and release as new version.

SamiAlavi commented 3 years ago

The error is still there. I checked the value of accessToken being used in dist/index.js and it was null. When I manually set my accessToken, then no errors came. Hence, I think the accessToken will have to be passed in the constructor.

image

JinIgarashi commented 3 years ago

@SamiAlavi this issue might be the same with mapbox-gl-export. let me think how I can fix it for v2 users.

JinIgarashi commented 3 years ago

@SamiAlavi I think the issue was resolved, so I merged and released it as v1.1.4 although there is still an issue of accesstoken for your v2 environment.