pigeon-marker

0.3.4 • Public • Published

pigeon-marker - Marker component for pigeon-maps

npm version

React demo: https://mariusandra.github.io/pigeon-marker/

Inferno demo: https://mariusandra.github.io/pigeon-marker/inferno/

Example: https://github.com/mariusandra/pigeon-marker/blob/master/demo/demo.js

API: https://github.com/mariusandra/pigeon-marker/blob/master/src/index.js

To use in your component (with beta version 0.3.0):

// default for React
import Marker from 'pigeon-marker'
 
// explicitly ask for the React version
import Marker from 'pigeon-marker/react'
 
// explicitly ask for the Inferno version
import Marker from 'pigeon-marker/inferno'
 
// choose the Inferno or React version based on BABEL_ENV
import Marker from 'pigeon-marker/infact'
 
class Demo extends Component {
  handleMarkerClick = ({ event, payload, anchor }) => {
    console.log(`Marker #${payload} clicked at: `, anchor)
  }
 
  render () {
    return (
      <Map defaultCenter={[50.879, 4.6997]} defaultZoom={12} width={600} height={400}>
        <Marker anchor={[50.879, 4.6997]} payload={1} onClick={this.handleMarkerClick} />
      </Map>
    )
  }
}
 

Readme

Keywords

none

Package Sidebar

Install

npm i pigeon-marker

Weekly Downloads

618

Version

0.3.4

License

MIT

Unpacked Size

527 kB

Total Files

48

Last publish

Collaborators

  • mariusandra