Giter Club home page Giter Club logo

react-bootstrap-buildingid's Introduction

@pnnl/react-bootstrap-buildingid

React components for Unique Building Identification (UBID)

NPM JavaScript Style Guide

Install

npm install --save @pnnl/react-bootstrap-buildingid

Usage

import React from 'react'

import Microsoft from '@pnnl/react-bingmaps'
import '@pnnl/react-bingmaps/dist/index.css'

import { CodeFormGroup } from '@pnnl/react-bootstrap-buildingid'
import '@pnnl/react-bootstrap-buildingid/dist/index.css'

import { Container } from 'react-bootstrap'
import '@pnnl/react-bootstrap-buildingid/dist/index.css'

const App = () => {
  const [code, setCode] = React.useState('');
  const [editing, setEditing] = React.useState(false);
  const [history, setHistory] = React.useState([]);
  const [latitude, setLatitude] = React.useState('');
  const [lockedCode, setLockedCode] = React.useState(undefined);
  const [longitude, setLongitude] = React.useState('');
  const [modalLeftPanelVisible, setModalLeftPanelVisible] = React.useState(false);
  const [modalRightPanelVisible, setModalRightPanelVisible] = React.useState(false);
  const [modalVisible, setModalVisible] = React.useState(false);
  const [placeholderCodeLength, setPlaceholderCodeLength] = React.useState(11);
  const [query, setQuery] = React.useState('');
  const [wkt, setWellKnownText] = React.useState('');

  return (
    <Microsoft.Maps.Api apiKey={process.env.REACT_APP_BING_MAPS_API_KEY} loadModule={['Microsoft.Maps.AutoSuggest', 'Microsoft.Maps.DrawingTools', 'Microsoft.Maps.Search', 'Microsoft.Maps.SpatialMath', 'Microsoft.Maps.WellKnownText']}>
      <Container className="py-5">
        <CodeFormGroup
          code={code}
          editing={editing}
          history={history}
          latitude={latitude}
          lockedCode={lockedCode}
          longitude={longitude}
          modalLeftPanelVisible={modalLeftPanelVisible}
          modalRightPanelVisible={modalRightPanelVisible}
          modalVisible={modalVisible}
          placeholderCodeLength={placeholderCodeLength}
          query={query}
          wkt={wkt}
          onCodeChange={setCode}
          onCodeLengthChange={setPlaceholderCodeLength}
          onEditingChange={setEditing}
          onHistoryChange={setHistory}
          onLatitudeChange={setLatitude}
          onLockedCodeChange={setLockedCode}
          onLongitudeChange={setLongitude}
          onModalLeftPanelHide={() => setModalLeftPanelVisible(false)}
          onModalLeftPanelShow={() => setModalLeftPanelVisible(true)}
          onModalRightPanelHide={() => setModalRightPanelVisible(false)}
          onModalRightPanelShow={() => setModalRightPanelVisible(true)}
          onModalHide={() => setModalVisible(false)}
          onModalShow={() => setModalVisible(true)}
          onQueryChange={setQuery}
          onWellKnownTextChange={setWellKnownText}
        />
      </Container>
    </Microsoft.Maps.Api>
  );
}

export default App

License

Copyright © 2021, Battelle Memorial Institute

See LICENSE in LICENSE.txt

react-bootstrap-buildingid's People

Contributors

markborkum avatar devcentral-pnnl avatar

Stargazers

Bill Eger avatar

Watchers

 avatar James Cloos avatar  avatar  avatar  avatar Leif Carlsen avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.