forgotten-realms-map v2.0.2
Forgotten Realms Map
The forgotten-realms-map library leverages the power of leaflet and d3 to render interactive maps of fantasy realms. Designed for developers looking to integrate a fantasy map into their projects, this library simplifies the process of adding custom interactive maps to web applications.
Features
- Utilizes
leafletfor map interactions. - Uses
d3for adding custom SVG elements and animations. - Easy to integrate with any web project.
- Supports custom markers for significant locations on the map.
Installation
To install the forgotten-realms-map, use npm:
npm install forgotten-realms-mapUsage
First, make sure to include Leaflet's CSS in your project for the map to display correctly. You can include it in your HTML:
<link rel="stylesheet" href="//unpkg.com/leaflet/dist/leaflet.css" />Then, you can use the ForgottenRealmsMap class in your JavaScript file as follows:
import ForgottenRealmsMap from 'forgotten-realms-map';
// Initialize the map by passing the ID of the div where the map should be rendered
const map = new ForgottenRealmsMap('mapId', { /* options here */ });HTML Structure
Ensure you have a div element with the ID that matches the one you provide to the constructor:
<div id="mapId" style="height: 500px;"></div>Options
You can pass an options object to the ForgottenRealmsMap constructor to customize the map. Currently, the library supports the following options:
optionName: Description of what it does.
Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue if you have any suggestions or find any bugs.
License
This project is licensed under the MIT License - see the LICENSE file for details.