1.0.9 • Published 4 years ago

comfortable-google-map-react v1.0.9

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Comfortable-google-map-react

Google Map API for react programmer!!

This API was focused on comfortable programming

Usage example

Sample Image:

Sample Image

Sample code:

import React, { useState } from 'react';
import GoogleMap, { animation } from "comfortable-google-map-react"

function App() {
  const [state, setState] = useState({ A: "a", B: "b" });
  const APIKEY = "YOUR_API_KEY";
  const marker_list = [
    {
      title: "SampleTitle",
      lat: 37.496303,
      lng: 126.957266,
      describe: "Description",
      animation: {
        onMouseOver: animation.marker.BOUNCE_WITH_WINDOWINFO,
        onCreate: animation.DROP,
      },
    },
    {
      lat: 37.4965,
      lng: 126.9577,
    },
  ];

  console.log(state);
  return (
    <div>
      <div>Sample map</div>
      <GoogleMap
        APIKEY={APIKEY}
        width={900}
        height={500}
        lat={37.496303}
        lng={126.957266}
        zoom={16}
        marker_list={marker_list}
        state={state}
        setState={setState}
      ></GoogleMap>
    </div>
  );
}

export default App;

How to use this Module

  1. import module
// import main module and animation set
import GoogleMap, { animation } from "comfortable-google-map-react"
  1. Add information to Google map component
<GoogleMap
  APIKEY={APIKEY}            // your api_key
  width={900}                // map width
  height={500}               // map height
  lat={37.496303}            // latitude of map
  lng={126.957266}           // longtitude of map
  zoom={16}                  // zoom
  marker_list={marker_list}  // marker list(optional)
  state={state}              // your own state. this module add displayed marker list to state.
  setState={setState}        // your own setState. this module add displayed marker list to state.
></GoogleMap>
  1. (optional)Add marker list
const marker_list = [
    {
      title: "SampleTitle",    // this title shows if mouse is on this marker (optional)
      lat: 37.496303,
      lng: 126.957266,
      describe: "Description", // this describe shows with windowinfo. (optional)
      animation: {             // set animation. (optional)
        onMouseOver: animation.marker.BOUNCE_WITH_WINDOWINFO,
        onCreate: animation.DROP,
      },
    },
    {
      lat: 37.4965,
      lng: 126.9577,
    },
  ];

Animation

you can set animation for marker

  • This animation can set under the condition
animationonMouseOveronClickonCreate
BOUNCEO00
DROPxx0

Version

1.0.0 ~ 1.0.* - create module and fix simple error.

Contact

Plase contact this email if you want to ask to devloper...

BeomJunKim – wka8963@gmail.com

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