All Projects β†’ hentrymartin β†’ rc-here-maps

hentrymartin / rc-here-maps

Licence: other
React components implemented on top of Here Maps API

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to rc-here-maps

Svg World Map
πŸ—Ί A JavaScript library to easily integrate one or more SVG world maps with all nations (countries) and second-level political subdivisions (countries, provinces, states).
Stars: ✭ 38 (+137.5%)
Mutual labels:  maps, javascript-library
here-map-widget-for-jupyter
Use HERE Maps API for JavaScript in your Jupyter Notebook.
Stars: ✭ 29 (+81.25%)
Mutual labels:  maps, heremaps
svelte-mapbox
MapBox Map and Autocomplete components for Svelte (or Vanilla JS)
Stars: ✭ 267 (+1568.75%)
Mutual labels:  maps
react-advertising
A JavaScript library for display ads in React applications.
Stars: ✭ 50 (+212.5%)
Mutual labels:  javascript-library
ChangeNumbersJs
Tiny Library for change number from a language in other language.
Stars: ✭ 14 (-12.5%)
Mutual labels:  javascript-library
hslayers-ng
User interface and map building extensions for OpenLayers
Stars: ✭ 29 (+81.25%)
Mutual labels:  maps
toaststrap
A simple, lightweight JavaScript library for showing Bootstrap 5 toast popups.
Stars: ✭ 16 (+0%)
Mutual labels:  javascript-library
Modern.JS
λͺ¨λ˜ μžλ°”μŠ€ν¬λ¦½νŠΈ 라이브러리/ν”„λ ˆμž„μ›Œν¬ Γ— KIPFA(ν•œκ΅­μΈν„°λ„·μ „λ¬Έκ°€ν˜‘νšŒ)
Stars: ✭ 16 (+0%)
Mutual labels:  javascript-library
census-map-consolidator
Combine Census blocks into new shapes
Stars: ✭ 31 (+93.75%)
Mutual labels:  maps
mapkit-android-demo
MapKit Android demo
Stars: ✭ 92 (+475%)
Mutual labels:  maps
Maps
TGM Maps used on the Warzone server (2017 - 2022).
Stars: ✭ 22 (+37.5%)
Mutual labels:  maps
renovation-core
The Frappe Javascript Front End Missing SDK
Stars: ✭ 23 (+43.75%)
Mutual labels:  javascript-library
react-azure-maps
React Wrapper for azure-maps-control
Stars: ✭ 32 (+100%)
Mutual labels:  maps
planetiler
Flexible tool to build planet-scale vector tilesets from OpenStreetMap data fast
Stars: ✭ 823 (+5043.75%)
Mutual labels:  maps
flatmap.io
πŸš€ The place where people meet technologies
Stars: ✭ 29 (+81.25%)
Mutual labels:  maps
javascript-strong-password-generator
JavaScript Strong Password Generator: based on Jeff Atwood's Post "Password Rules Are Bullshit".
Stars: ✭ 21 (+31.25%)
Mutual labels:  javascript-library
osmscout-sailfish
OSM Scout for Sailfish OS (offline maps and navigation)
Stars: ✭ 42 (+162.5%)
Mutual labels:  maps
huge-uploader-nodejs
Node.js module to handle chunked file uploads sent by huge-uploader
Stars: ✭ 28 (+75%)
Mutual labels:  javascript-library
SSCD.js
Super Simple Collision Detection for JavaScript games!
Stars: ✭ 88 (+450%)
Mutual labels:  javascript-library
osm-extracts
Each day, OSM Extracts by Interline mirrors the entire OpenStreetMap planet and creates city and region sized extracts
Stars: ✭ 34 (+112.5%)
Mutual labels:  maps

RC Here Maps

Build Status GitHub npm Open Source Love

Here Maps provide amazing api's to add map using Javascript. This is a React wrapper for Here Maps API. Right now, this library gives functionalities like creating map and adding objects like Marker, Polygon, Polyline, Rectangle and Circle on top of it.

How to install it

It's pretty easy to install this library in your react app,

npm install rc-here-maps

Prerequisite

Copy the following snippet and paste it in your html file,

  <link href="https://js.api.here.com/v3/3.0/mapsjs-ui.css" rel="stylesheet">

  <script src="https://js.api.here.com/v3/3.0/mapsjs-core.js" type="text/javascript" charset="utf-8"></script>
  <script src="https://js.api.here.com/v3/3.0/mapsjs-service.js" type="text/javascript" charset="utf-8"></script>
  <script src="https://js.api.here.com/v3/3.0/mapsjs-mapevents.js" type="text/javascript" charset="utf-8"></script>
  <script src="https://js.api.here.com/v3/3.0/mapsjs-ui.js" type="text/javascript" charset="utf-8"></script>

Demo

You can see the demo of this library here

Basic Usage

import React, { Component } from 'react';
import { HereMap, Marker, Polyline, Polygon, Circle, Rectangle, PathFinder } from 'rc-here-maps';

class MapDemo extends Component {
  constructor(props) {
    super(props);

    this.center = {
      lat: 52.51,
      lng: 13.4,
    };

    this.bounds = {
      north: 53.1,
      south: 13.1,
      east: 43.1,
      west: 40.1,
    };
  }
  onPolylineDrawn = () => {
    console.log('polyline drawn');
  };

  onPolygonDrawn = () => {
    console.log('Polygon drawn');
  };

  onCircleDrawn = () => {
    console.log('circle drawn');
  };

  onRectangleDrawn = () => {
    console.log('rectangle drawn');
  };

  render() {
    return (
      <div className="map-wrapper">
        <HereMap appId="YYYY" appCode="XXXX" useHTTPS={false} center={this.center}>
          <Marker lat={52.21} lng={48.12}>
            This is a sample marker
          </Marker>

          <Polyline
            dataPoints={[52, 48, 100, 42, 77, 100]}
            strokeColor="#HexCode"
            lineWidth={3}
            onPolylineDrawn={this.onPolylineDrawn}
          />

          <Polygon
            dataPoints={[52, 48, 100, 42, 77, 100]}
            fillColor="#HexCode"
            strokeColor="#HexCode"
            lineWidth={3}
            onPolylineDrawn={this.onPolygonDrawn}
          />

          <Circle
            center={this.center}
            radius={1000}
            fillColor="#HexCode"
            strokeColor="#HexCode"
            onCircleDrawn={this.onCircleDrawn}
          />

          <Rectangle
            bounds={this.bounds}
            fillColor="#HexCode"
            strokeColor="#HexCode"
            onRectangleDrawn={this.onRectangleDrawn}
          />

          <PathFinder waypoints={[{ lat: 52.516, lng: 13.3779 }, { lat: 52.5206, lng: 13.3862 }]} />
          <PathFinder
            waypoints={[{ lat: 52.516, lng: 13.3779 }, { lat: 52.518, lng: 13.4062 }, { lat: 52.519, lng: 13.4162 }]}
            style={{
              lineWidth: 10,
              strokeColor: 'rgba(220, 220, 0, 0.9)',
            }}
          />
        </HereMap>
      </div>
    );
  }
}

export default MapDemo;

Documentation

You can view the documentation here

Feel free to contribute to this repo by raising PR.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].