@mappedin/react-sdk
v6.8.0
Published
- [Mappedin Developer Portal](https://developer.mappedin.com) - [Releases and Roadmap](https://developer.mappedin.com/docs/roadmap) - [Getting Started Guide](https://developer.mappedin.com/web-sdk/using-react) - [API Reference](https://developer.mappedin.
Downloads
8,919
Readme
Mappedin React SDK
Resources
- Mappedin Developer Portal
- Releases and Roadmap
- Getting Started Guide
- API Reference
- Demo Keys & Maps
- License
Usage
Installation
npm install @mappedin/react-sdk
or
yarn add @mappedin/react-sdk
Getting Started
import React from 'react';
import { MapView, useMapData } from '@mappedin/react-sdk';
import '@mappedin/react-sdk/lib/esm/index.css';
export default function App() {
const { mapData, isLoading, error } = useMapData({
key: '<key>',
secret: '<secret>',
mapId: '<mapId>',
});
if (isLoading) {
return <div>Loading...</div>;
}
if (error) {
return <div>{error.message}</div>;
}
return mapData ? <MapView mapData={mapData} style={{ width: '650px', height: '650px' }}></MapView> : null;
}For full documentation, read our Getting Started guide on the Developer Portal.
