stevage / map-gl-utils

A utility library that makes Mapbox GL JS or Maplibre GL a bit more convenient to work with.
https://npmjs.com/package/map-gl-utils
212 stars 24 forks source link

TypeError: Converting circular structure to JSON occurs when using any map-gl-utils with mapbox-gl v3.6.0 #45

Open jparish3 opened 3 weeks ago

jparish3 commented 3 weeks ago

mapbox-gl.js?v=be7c18f5:26206 Uncaught (in promise) TypeError: Converting circular structure to JSON --> starting at object with constructor 'Object' --- property 'data' closes the circle at JSON.stringify () at Ia._getGlobalId (mapbox-gl.js?v=be7c18f5:26206:40) at Ia._diffStyle (mapbox-gl.js?v=be7c18f5:26209:34) at Map.setStyle (mapbox-gl.js?v=be7c18f5:29935:320) at MapGlUtils.addSource (map-gl-utils.js?v=be7c18f5:489:14) at MapGlUtils.addGeoJSONSource (map-gl-utils.js?v=be7c18f5:474:17) at MapGlUtils.addGeoJSON (map-gl-utils.js?v=be7c18f5:484:17) at map-styles.js:106:11 at callWithErrorHandling (chunk-YPSMCZO7.js?v=be7c18f5:1663:19) at callWithAsyncErrorHandling (chunk-YPSMCZO7.js?v=be7c18f5:1670:17)

pete-volantautonomy commented 2 weeks ago

I have this too. It looks like style.sources[id] = sourceDef as part of addSource(id, sourceDef)