1.2.4 • Published 4 years ago

map-my-india-react-new-version v1.2.4

Weekly downloads
108
License
-
Repository
-
Last release
4 years ago

MapmyIndia react

React component to implement MapmyIndia Interactive Map API

Getting Started

Prerequisites

Integrate interactive maps from MapmyIndia into your browser application by simply including MapmyIndia's interactive map API in your script source in the head section.

<script src="https://apis.mapmyindia.com/advancedmaps/v1/<Lic_Key>/map_load?v=1.3"></script>

Installing

npm install mapmyindia-react --save

How to use

import Map from "mapmyindia-react";

class App extends React.Component {
	 render () {
		 return (
		 	 <Map
          markers={[
              {
                  position: [18.5314, 73.845],
                  draggable: true,
                  title: "Marker title",
                  onClick: e => {
                      console.log("clicked ");
                  },
                  onDragend: e => {
                      console.log("dragged");
                  }
              }
          ]}
          />
		 )
	 }
}

Props

proptypedefault value
centerarray18.5314, 73.8446
zoomControlbooltrue
locationbooltrue
heightstring500px
widthstring
zoomnumber15
hybridbooltrue
searchbooltrue
markersarray[]

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)
    }
  ]

Map events

Eventdefault value
onResize() => {}
onZoom() => {}
onMove() => {}
onClick() => {}
onDblclick() => {}
onMouseup() => {}
onMousedown() => {}
onMouseover() => {}
onMouseout() => {}
onKeypress() => {}

Author

  • Kshirod

Acknowledgments

  • MapmyIndia Interactive Map API
1.2.4

4 years ago

1.2.0

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.2.3

4 years ago

1.1.4

4 years ago

1.2.2

4 years ago

1.1.3

4 years ago

1.2.1

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago