UNPKG

@xuehongbo/map-craft-js

Version:

MapCraftJS 是一个功能强大且灵活的开源 JavaScript 库,旨在简化互动地图的创建和操作。使用 MapCraftJS,开发者可以轻松地将动态地图功能集成到应用程序中,为用户提供根据自定义配置查看、注释和互动的地图体验。(开发中!!!)

85 lines (62 loc) 3.29 kB
# Project Name: **MapCraftJS** ## Project Description (Under Development!!!) **MapCraftJS** is a powerful and flexible open-source JavaScript library designed to simplify the creation and manipulation of interactive maps. With **MapCraftJS**, developers can easily integrate dynamic map functionality into their applications, providing users with a map experience that they can view, annotate, and interact with based on custom configurations. ## Supported Maps - **AMap** - **Baidu Maps** - **SiJi Maps (Dedicated map for State Grid, supports internal network deployment)** - **Nanwang Zhi Kan (Dedicated map for Southern Power Grid, supports internal network deployment)** ## Main Features ### SiJi Maps & Nanwang Zhi Kan - **Line drawing support** - **Fault section rendering** - **Fault point marking** - **Fault impact distribution transformer analysis** - **Power restoration area analysis** - **Fault impact customer analysis** - **Custom map creation**: Easily generate different types of maps using a wide range of configuration options. Supports multiple map providers and formats, ensuring flexibility to meet the needs of various projects. - **Drawing and annotation**: Allows users to draw lines, add points, and annotations on the map. The library supports multiple drawing tools and styles, providing a rich and interactive experience. - **Customizable layers**: Add and manage multiple map layers, including vector layers and raster layers. Customize the visibility and style of layers to meet the needs of the application. - **Extensible API**: Utilize a comprehensive API for advanced customization and integration. Extend the library's capabilities through plugins and modules to meet specific project needs. ## Quick Start To get started with **MapCraftJS**, include the library in your project and set up your first map following the quick start guide. Detailed documentation and examples are provided to help you fully utilize the library's capabilities. ## Installation You can install **MapCraftJS** via npm or include the library directly in your HTML: ```bash npm i @xuehongbo/map-craft-js ``` ## Usage ```javascript import MapClient from '@xuehongbo/map-craft-js' let mapConfig = { platform: type, security: { AMap: { code: '你申请的高德地图code', key: '你申请的高德地图key' }, BMap: { ak: '你申请的百度地图ak' }, EGis:{ key:'你申请的思极地图appKey', secret:'你申请的思极地图appSecret' } } } // 创建地图实例 const client = new MapClient(type, { container: 'map', center: { lng: 118.11964, lat: 24.46433 }, zoom: 15 }); client.on('loaded', () => { client.addMarker({ position: { lng: 118.11964, lat: 24.46433 } }); }); ``` ## Documentation For detailed documentation, including API reference, tutorials, and example usage, please visit the <a href="">MapCraftJS</a> documentation (not yet written). ## License MapCraftJS is released under the MIT license. Under the terms of the license, you are free to use, modify, and distribute the library.