Comments (6)
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.
Thank you very much Its working fine now.
from react-vector-maps.
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.
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.
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.
Before now I was using your index file as you had used in TooltipLayer.js
But now after your reply I have imported this Vector Map from @south-paw/react-vector-maps
and error changed to node_module
from react-vector-maps.
Related Issues (20)
- Import issue HOT 1
- Improve documentation and examples
- Npm page example typo HOT 1
- SVG to JSON converter not working for Mac paths HOT 1
- How can I show tool tip when I hover over a palace HOT 1
- Tooltips HOT 1
- Add gradients to SVG HOT 2
- On hover increase size/scale of one Path HOT 6
- Add types for typescript
- Labels HOT 1
- Badly need zoom options
- Facing issue with onMouseOut event. Its not firing when the mouse is out of the map HOT 1
- Safari Vector Maps HOT 1
- Converter issue HOT 1
- type of "layerProps" HOT 3
- Russian map is outdated HOT 1
- Map Zoom HOT 1
- All Maps World Arround HOT 1
- Yarn Repository Not Found HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-vector-maps.