Git Product home page Git Product logo

Comments (6)

South-Paw avatar South-Paw commented on June 18, 2024 1

Okay, think I see where you're going wrong here and I agree that the examples are not as clear as I thought they were went I created them - I'll look to address them at some stage so thanks for pointing this out 😅

The issue you have is that layers is undefined. The error is occurring because undefined.map is invalid (.map is a function of an array, not undefined).

layers is a key inside each map json file and it is undefined because you haven't spread a json map onto the component's usage (and this is where you're correct that the examples are wrong/complicated)

The code in TooltipLayers.js is already wrapping the VectorMap for you - you need to use the TooltipLayers component that it exports as seen here in the storybook file.

Once you've passed a map to it, the error should go away.

You are also correct in changing the ../index import to @south-paw/react-vector-maps - the reason it is index in the example is that I don't want to have my package installing itself for the demo.

I hope this helps, let me know how you get on 👍

from react-vector-maps.

MTayyabMehar avatar MTayyabMehar commented on June 18, 2024 1

Thank you very much Its working fine now.

image

from react-vector-maps.

South-Paw avatar South-Paw commented on June 18, 2024

Hi, I'm pretty confused by this issue.

You're saying that the library is not working but the error is coming from YOUR source files (C:/React Work/check-map-stats/src/components/VectorMap.js) not a node_modules folder of the library as I'd expect if you had installed the library via npm or yarn.

Your 'code' is also just a 1:1 copy of the libraries source and it doesn't use any of the @south-paw/react-vector-maps components so I'm struggling to see how this is an issue with the library?

I'm happy to help out with library issues but right now this looks like an invalid one as you're not even using things correctly in the first place.

from react-vector-maps.

MTayyabMehar avatar MTayyabMehar commented on June 18, 2024

As I had written simple map is working fine means if I just import these two :

import VectorMap from '@south-paw/react-vector-maps';
import world from '@south-paw/react-vector-maps/maps/json/world.json';

and in template add <VectorMap {...world} /> this it shows default map and its perfectly fine.

But I am unable to grasp the situation that in your examples ,take any one of them as I had implemented TooltipLayers example Its not importing any dependency from @south-paw/react-vector-maps so how should I configure it to include @south-paw/react-vector-maps its just giving me error in propTypes.

from react-vector-maps.

MTayyabMehar avatar MTayyabMehar commented on June 18, 2024

please see TooltipLayer.js code It does not include @south-paw/react-vector-maps import and please let me know how should I integrate and run this example If I just want to add tooltipLayer exapmle not whole code, surely I there is some problem in my configuration but I am working on hit and trial because there is no clear document available to configure any example code.

from react-vector-maps.

MTayyabMehar avatar MTayyabMehar commented on June 18, 2024

Before now I was using your index file as you had used in TooltipLayer.js

image
But now after your reply I have imported this Vector Map from @south-paw/react-vector-maps

image

and error changed to node_module

image

from react-vector-maps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.