kadoshms / react-jvectormap

A react wrapper for jvectormap maps
MIT License
98 stars 70 forks source link

Custom Image Markers Causing Error: t.error is not a function #79

Open JeanHules opened 4 years ago

JeanHules commented 4 years ago

index.js?8a37:1 Uncaught (in promise) TypeError: t.error is not a function

series={{ markers: [ { attribute: 'image', scale: { closed: '/public/img/icon-np-1.png', activeUntil2018: '/public/img/icon-np-1.png' }, values: this.state.markers.reduce((p, c, i) => { const pp = p; console.log(pp); pp[i] = c.status; return pp; }, {}), legend: { horizontal: true, title: 'Nuclear power station status', labelRender: (v) => { if (false) { console.log('dd'); } return { closed: 'Closed', activeUntil2018: 'Scheduled for shut down
before 2018', activeUntil2022: 'Scheduled for shut down
before 2022' }[v]; } } } ] }}

I can't figure out why.

fed135 commented 3 years ago

Found this on SO: https://stackoverflow.com/a/40303232

AstaDK commented 2 years ago

Facing the same issue. Any update on this problem? I faced it while I try use marker icon with react

series={{
          markers: [
            {
              attribute: "image",
              legend: {
                horizontal: true,
                labelRender: function noRefCheck() {},
                title: "Nuclear power station status",
              },
              scale: {
                _iconMarker: icons.marker,
              },
              values: {
                0: icons.marker,
                // ...handleRenderMarker(),
              },
            },
          ],
        }}