Includes basic svg world map and continents.
npm install react-basic-world-map --save
import BasicWorldMap from 'react-basic-world-map';
<BasicWorldMap />
import BasicWorldMap from 'react-basic-world-map';
<BasicWorldMap
primaryColor="black"
secondaryColor="gray"
/>
import React from 'react';
import BasicWorldMap from 'react-basic-world-map';
export default function App() {
const onClickMapLocation = (selectedContinent: ContinentItem) => {
// do something
}
const continents: ContinentItem[] = [
{ key: "africa", value: "Afrika" },
{ key: "south_america", value: "Güney Amerika" },
{ key: "europe", value: "Avrupa" },
{ key: "asia", value: "Asya" },
{ key: "america", value: "Amerika" },
{ key: "australia", value: "Okyanusya" }
]
return (
<BasicWorldMap
primaryColor="black"
secondaryColor="gray"
onClickMapContinent={onClickMapLocation}
continents= {continents}
/>
)
}
Property | Type |
---|---|
primaryColor | string |
seondaryColor | string |
onClickMapContinent | function |
continents | array |