React map component for mapmyIndia (https://www.mapmyindia.com/api/advanced-maps/doc/interactive-map-api)
npm install mapmyindia-react
`
$3
`
npm install mapmyindia-react --save
`
$3
`
import Map from "mapmyindia-react";
class App extends React.Component {
render () {
return (
markers={[
{
position: [18.5314, 73.845],
draggable: true,
title: "Marker title",
onClick: e => {
console.log("clicked ");
},
onDragend: e => {
console.log("dragged");
}
}
]}
/>
)
}
}
`
$3
| prop | type | default value |
| ----------- | ------ | :----------------: |
| center | array | [18.5314, 73.8446] |
| zoomControl | bool | true |
| location | bool | true |
| height | string | 500px |
| width | string | |
| zoom | number | 15 |
| hybrid | bool | true |
| search | bool | true |
| markers | array | [] |
Example for marker array
`
[
{
position: [], // [lat, lng]
draggable: false, // true / false
title: '', // string
onClick: () => {}, // Marker click event listener
onDragend: ()=> {} // Marker dragend event listener (if draggable is set)
}
]
``