Giter Site home page Giter Site logo

toyamarodrigo / react-here-maps Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 875 KB

React hooks, components and examples for HERE Maps API for JavaScript.

Home Page: https://react-here-maps.vercel.app/

TypeScript 76.22% HTML 0.98% CSS 3.82% JavaScript 7.42% MDX 11.55%
here-maps-api heremaps react reactjs map maps

react-here-maps's Introduction

React HERE Maps

This package provides React hooks, components and examples for HERE Maps API for JavaScript.

image

Demo: https://react-here-maps.vercel.app/

Installation

First, you need to include the HERE Maps API for JavaScript CSS in your HTML file.

<!DOCTYPE html>
<html lang="en">
  <head>
    <link rel="stylesheet" type="text/css" href="https://js.api.here.com/v3/3.1/mapsjs-ui.css" />
  </head>
  <body>
    ...
  </body>
</html>
# After that, install the HERE Maps API for JavaScript with your favorite package manager
npm install --save-dev @here/maps-api-for-javascript --registry=https://repo.platform.here.com/artifactory/api/npm/maps-api-for-javascript/
# Then install @toyamarodrigo/react-here-maps with your favorite package manager
npm install @toyamarodrigo/react-here-maps

# or
yarn add @toyamarodrigo/react-here-maps

# or
pnpm add @toyamarodrigo/react-here-maps

Usage

To use @toyamarodrigo/react-here-maps, you will need to obtain an API key from HERE Maps. You can sign up for a free account and obtain an API key here.

https://developer.here.com/tutorials/getting-here-credentials/

Example

import React from 'react';
import { HereMap } from '@toyamarodrigo/react-here-maps';

const App = () => {
  return (
    <div style={{ height: "100vh", width: "100vw" }}>
      <HereMap 
        apiKey={"YOUR_API_KEY"} 
        mapOptions={{
          center: { lat: -34.603722, lng: -58.401592 },
          zoom: 12,
        }}
      >
      {/* Markers, Polylines and stuff */}
      </HereMap>
    </div>
  );
};

TODO

  • Components

    • Map
    • Marker
    • DOM Marker
    • Polygons
    • Polyline
    • Circles
    • InfoWindows
    • Directions
  • Hooks

    • Map Instance - useHereMaps
    • Routing - useRoutingService v8
    • Geocoding & Search - useGeocodingService
    • Isoline - useIsolineService
    • Waypoints - useWaypointsService
    • Matrix - useMatrixService

HERE Maps API Docs

https://developer.here.com/documentation/maps/3.1.38.0/dev_guide/index.html

react-here-maps's People

Contributors

dependabot[bot] avatar toyamarodrigo avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tanca-io

react-here-maps's Issues

Can't install using npm

@toyamarodrigo
PS D:\Faiz\here-maps-test> npm install @toyamarodrigo/react-here-maps
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @toyamarodrigo/[email protected]
npm WARN Found: @here/maps-api-for-javascript@undefined
npm WARN node_modules/@here/maps-api-for-javascript
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer @here/maps-api-for-javascript@"^1.41.1" from @toyamarodrigo/[email protected]
npm WARN node_modules/@toyamarodrigo/react-here-maps
npm WARN @toyamarodrigo/react-here-maps@"*" from the root project
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@here%2fmaps-api-for-javascript - Not found
npm ERR! 404
npm ERR! 404 '@here/maps-api-for-javascript@^1.41.1' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\faizk\AppData\Local\npm-cache_logs\2023-06-09T09_33_16_406Z-debug-0.log

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.