Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 1 KB

README.md

File metadata and controls

40 lines (28 loc) · 1 KB

GISTDA sphere map component for ReactJS + demo

Modified from longdo-map-demo-reactjs

  1. Replace mapKey value in ./src/map/Map.jsx with your own API key (get one here).

    const mapKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  2. Import map component (Map) and instance (map).

    import { map, Map } from "./map";
  3. Call <Map /> and you should see the map, for example:

    import React from "react";
    
    import { map, Map } from "./map";
    
    const App = () => {
      return (
        <div style={{ height: "80vh" }}>
          <Map />
        </div>
      );
    };
  4. Use map instance to use sphere API, for example:

    map.goTo({ center: { lon: 100.510847, lat: 13.743757 }, zoom: 14 });