Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let's meet the react-map-gl at StackBlitz #287

Closed
yuiseki opened this issue Oct 13, 2023 · 3 comments
Closed

Let's meet the react-map-gl at StackBlitz #287

yuiseki opened this issue Oct 13, 2023 · 3 comments
Assignees

Comments

@yuiseki
Copy link
Member

yuiseki commented Oct 13, 2023

Actual Examples

most simple react-map-gl on vitejs

layer of react-map-gl on vitejs

How to start your own react-map-gl project at StackBlitz

Open https://stackblitz.com/

Sign up with GitHub Account

Click + New Project

Click Vite

Click react-ts

Input Terminal

npm i -f maplibre-gl react-map-gl

Edit src/App.tsx

import {
  Map,
  GeolocateControl,
  NavigationControl,
} from 'react-map-gl/maplibre';
import 'maplibre-gl/dist/maplibre-gl.css';

function App() {
  return (
    <div style={{ width: '100vw', height: '100vh' }}>
      <Map
        initialViewState={{
          longitude: 139.795897,
          latitude: 35.723547,
          zoom: 12,
        }}
        style={{ width: '100%', height: '100%' }}
        mapStyle="https://tile.openstreetmap.jp/styles/osm-bright-ja/style.json"
      >
        <GeolocateControl position="top-right" />
        <NavigationControl
          position="top-right"
          visualizePitch={true}
          showZoom={true}
          showCompass={true}
        />
      </Map>
    </div>
  );
}

export default App;

Input Terminal

npm install --legacy-peer-deps && npm run dev
@hfu
Copy link
Contributor

hfu commented Oct 21, 2023

@hfu
Copy link
Contributor

hfu commented Oct 21, 2023

PMTiles を使えるようにして、hash をつけることに成功しました。
https://stackblitz.com/edit/vitejs-vite-dl3ktd?file=src%2FApp.tsx

@hfu
Copy link
Contributor

hfu commented Oct 31, 2023

#274

@hfu hfu closed this as completed Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants