New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@maptiler/cra-template-maplibre-gl-js

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@maptiler/cra-template-maplibre-gl-js

Quick way to star a web map application with MapLibre GL JS using Create React App.

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

MapLibre GL JS map using React JS

License: MIT

Quick way to star a web map application with MapLibre GL JS using Create React App.

A simple fullscreen map application as an example on how to use MapTiler maps together with React and MapLibre GL JS for your own React app.

Screenshot

react maplibre template

(back to top)

Step-by-step tutorial - How to display a map in React JS using MapLibre GL JS

Documentation: How to display a map in React JS using MapLibre GL JS

Demo

Online demo: https://labs.maptiler.com/cra-template-maplibre-gl-js/

(back to top)

Build With

Getting Started

Prerequisites

  • npm
    npm install npm@latest -g
    

(back to top)

Create an app

To create a new react project run in your command-line:

  npx create-react-app my-react-map --template @maptiler/cra-template-maplibre-gl-js

Navigate to the newly created project folder my-react-map

  cd my-react-map

API KEY

Rename or copy the .env.example file to .env

  cp .env.example .env

Open the .env file, :warning: you will need to replace YOUR_MAPTILER_API_KEY with your own MapTiler API key.

Your MapTiler account access key is on your MapTiler Cloud account page.

:information_source: If you don't have an API KEY you can create it for free at https://www.maptiler.com/cloud/

Run

To start your local environment run:

  npm start

You will find your app on address http://localhost:3000/.

Now you should see the app in your browser.

Build

To build for production, run:

  npm run build

gh-pages

To deploy the app to the gh-pages branch, run:

  npm run deploy

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Acknowledgments

Instead of using or developing a custom map component you can use the reac-map-gl component

Keywords

FAQs

Package last updated on 17 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc