daum-maps-react

1.0.1 • Public • Published

daum-maps-react

NPM JavaScript Style Guide

NPM Badge

Install

npm install --save daum-maps-react

Demo

Usage

import React, { Component } from 'react'

import DaumMap from 'daum-maps-react'

class Example extends Component {

    customRender = (element, daum) => {

        console.log(element, daum, this) // map element, daum api, Example Component

        const lat = 37.503716, lng = 127.044844

        daum.maps.load(_ => {

            const map = new daum.maps.Map(element, {
                center: new daum.maps.LatLng(lat, lng),
                level: 3
            })
    
            const marker = new daum.maps.Marker({
                position: new daum.maps.LatLng(lat, lng)
            })

            marker.setMap(map)

        })

    }

    render () {
        return (
            <div style={ { width: '500px', height: '500px' }}>

                <DaumMap
                    apiKey='YOUR_API_KEY'
                    mapId={ 'daum-map' }
                    render= { this.customRender }
                />

            </div>
        )
    }
}

License

MIT © myungjaeyu

/daum-maps-react/

    Package Sidebar

    Install

    npm i daum-maps-react

    Weekly Downloads

    18

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    30 kB

    Total Files

    6

    Last publish

    Collaborators

    • u4bi