1.0.1 • Published 6 years ago

daum-maps-react v1.0.1

Weekly downloads
19
License
MIT
Repository
github
Last release
6 years ago

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