{"_id":"@cennavi-fe/minemap2d","_rev":"4-cef28156663990fe0430e5ce7aa1b925","name":"@cennavi-fe/minemap2d","dist-tags":{"latest":"2.1.2"},"versions":{"2.1.1-20240306":{"name":"@cennavi-fe/minemap2d","version":"2.1.1-20240306","keywords":["webgl1","webgis","bigdata","ogc","mvt","dynamic-traffic-line","traffic-eye","geojson"],"author":{"name":"minemap"},"license":"ISC","_id":"@cennavi-fe/minemap2d@2.1.1-20240306","maintainers":[{"name":"wuhaoyuan","email":"alan_why@foxmail.com"},{"name":"zhoumingrui","email":"441821595@qq.com"},{"name":"hhui90068","email":"15738779822@163.com"},{"name":"wb9527","email":"1129305053@qq.com"},{"name":"ndwgg","email":"ndwgg@qq.com"}],"dist":{"shasum":"9bb5ba334b94bc9d9d7beef1e4c27cd7e2593830","tarball":"https://registry.npmjs.org/@cennavi-fe/minemap2d/-/minemap2d-2.1.1-20240306.tgz","fileCount":4,"integrity":"sha512-BKPM/QZR/IPQMyy/FjsLVQnpwRE+7y7esbdWx1zTRV0LG/3ZBL0uLac9SG2AtsIz7kx7M7GZBhTQu/zQHMRRXQ==","signatures":[{"sig":"MEUCIQCdz9w9Jp6fVzmyw7oTMUPjw9dtW+UqGHqMk6uIk0UINAIgH60+v/H0X4AEBTMasR5llpkiBpXlXOkXs4wDAyM4SXg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1007218},"main":"index.js","module":"esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"zhoumingrui","email":"441821595@qq.com"},"_npmVersion":"6.14.17","description":"基于webgl的二维地图引擎，基于mapbox0.49的深度化定制版本","directories":{},"_nodeVersion":"14.21.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/minemap2d_2.1.1-20240306_1709722542426_0.37994040664692297","host":"s3://npm-registry-packages"}},"2.1.1-20240307":{"name":"@cennavi-fe/minemap2d","version":"2.1.1-20240307","keywords":["webgl1","webgis","bigdata","ogc","mvt","dynamic-traffic-line","traffic-eye","geojson"],"author":{"name":"minemap"},"license":"ISC","_id":"@cennavi-fe/minemap2d@2.1.1-20240307","maintainers":[{"name":"wuhaoyuan","email":"alan_why@foxmail.com"},{"name":"zhoumingrui","email":"441821595@qq.com"},{"name":"hhui90068","email":"15738779822@163.com"},{"name":"wb9527","email":"1129305053@qq.com"},{"name":"ndwgg","email":"ndwgg@qq.com"}],"dist":{"shasum":"cd5859c56c90e124bcef6223a9c6ee9a7efe57ae","tarball":"https://registry.npmjs.org/@cennavi-fe/minemap2d/-/minemap2d-2.1.1-20240307.tgz","fileCount":4,"integrity":"sha512-bruJaxfyk2t0WqYqvcSJgzcsPljHMr0FBKJz/IihhA0M9L+YZnodl71391PatTL3NcwAOBC2I9gBNdTgBeIszA==","signatures":[{"sig":"MEUCIDI3ihXJiodcIMAk5TmdcheCwCzqGOdo1dONVhfFh08AAiEAsnVOKZWOT6vIyuUxTBbw1kLmgvmhVcPB4xsnTZBFq90=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1006987},"main":"index.js","module":"esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"zhoumingrui","email":"441821595@qq.com"},"_npmVersion":"6.14.17","description":"基于webgl的二维地图引擎，基于mapbox0.49的深度化定制版本","directories":{},"_nodeVersion":"14.21.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/minemap2d_2.1.1-20240307_1709722685441_0.2747594332032708","host":"s3://npm-registry-packages"}},"2.1.2":{"name":"@cennavi-fe/minemap2d","version":"2.1.2","keywords":["webgl1","webgis","bigdata","ogc","mvt","dynamic-traffic-line","traffic-eye","geojson"],"author":{"name":"minemap"},"license":"ISC","_id":"@cennavi-fe/minemap2d@2.1.2","maintainers":[{"name":"wuhaoyuan","email":"alan_why@foxmail.com"},{"name":"zhoumingrui","email":"441821595@qq.com"},{"name":"hhui90068","email":"15738779822@163.com"},{"name":"wb9527","email":"1129305053@qq.com"},{"name":"ndwgg","email":"ndwgg@qq.com"}],"dist":{"shasum":"58b78d9c735c82e53130f9dbba932a4f27201619","tarball":"https://registry.npmjs.org/@cennavi-fe/minemap2d/-/minemap2d-2.1.2.tgz","fileCount":4,"integrity":"sha512-WktYM7K6CkhCw7zPa7vcvp7Vr2Vh9E8HQjiz0AQMi9+CGgRNDYSovC6REwu2LiyKyxL9y+5kLKrPr5ZvtA4ocA==","signatures":[{"sig":"MEUCIQCOjjCgcKSlF2Fym8GLtE0pRxjCQmZhQ9Cd0EPsi5Kz/AIgPSrO+845vxvl8e+Lr7GEUtSfVH3Q53fxCTxMFMFyPB4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1023042},"main":"index.js","module":"esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"zhoumingrui","email":"441821595@qq.com"},"_npmVersion":"6.14.17","description":"基于webgl的二维地图引擎，基于mapbox0.49的深度化定制版本","directories":{},"_nodeVersion":"14.21.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/minemap2d_2.1.2_1709890655069_0.19218567630081496","host":"s3://npm-registry-packages"}}},"time":{"created":"2024-03-06T10:55:42.311Z","modified":"2025-08-20T06:57:45.396Z","2.1.1-20240306":"2024-03-06T10:55:42.628Z","2.1.1-20240307":"2024-03-06T10:58:05.649Z","2.1.2":"2024-03-08T09:37:35.320Z"},"author":{"name":"minemap"},"license":"ISC","keywords":["webgl1","webgis","bigdata","ogc","mvt","dynamic-traffic-line","traffic-eye","geojson"],"description":"基于webgl的二维地图引擎，基于mapbox0.49的深度化定制版本","maintainers":[{"email":"ndwgg@qq.com","name":"ndwgg"},{"email":"1129305053@qq.com","name":"wb9527"},{"email":"441821595@qq.com","name":"zhoumingrui"},{"email":"alan_why@foxmail.com","name":"wuhaoyuan"}],"readme":"# MineMap3DEngine\n\n## Contents\n\n[TOC]\n\n## 工程介绍\n\nMineMap 2d 正式版，能够矢量加载、交互.\n\n| 序号 |       格式/类型       |             支持的坐标系/版本/格式              |\n| :--: | :-------------------: | :---------------------------------------------: |\n|  1   |          mvt          |                  [3857、4326]                   |\n|  2   |        geojson        |                                                 |\n|  3   |         image         |                 jpg、png、webp                  |\n|  5   |          tms          |                                                 |\n|  6   |         wmts          |                  [3857、4326]                   |\n\n\n## 如何使用？\n\n```shell\n# 安装依赖\nnpm install @cennavi-fe/minemap2d\n\nor\n\npnpm install @cennavi-fe/minemap2d\n```\n\n在 vue 项目的入口文件 main.js 配置\n\n```js\nimport Vue from \"vue\";\nimport App from \"./App.vue\";\n// 引入 minemap css 依赖\nimport \"@cennavi-fe/minemap2d/esm/minemap.css\";\n\n// ...\n```\n\n以 vue2 举例，放到\n\n```html\n<template>\n\t<div class=\"hello\">\n\t\t<div id=\"map\"></div>\n\t</div>\n</template>\n\n<script>\n\timport minemap from \"@cennavi-fe/minemap2d\";\n\n\texport default {\n\t\tname: \"HelloWorld\",\n\t\tprops: {\n\t\t\tmsg: String\n\t\t},\n\t\tmounted() {\n\t\t\tminemap.domainUrl = \"https://minedata.cn\";\n\t\t\tminemap.dataDomainUrl = \"https://minedata.cn\";\n\t\t\tminemap.serverDomainUrl = \"https://minedata.cn\";\n\t\t\tminemap.spriteUrl = \"https://minedata.cn/minemapapi/v3.3.0/sprite/sprite\";\n\t\t\tminemap.serviceUrl = \"https://minedata.cn/service/\";\n\n\t\t\tminemap.key = \"16be596e00c44c86bb1569cb53424dc9\";\n\t\t\tminemap.solution = 12877;\n\t\t\twindow.minemapCDN = \"https://minedata.cn/minemapapi/minemap-CDN\"; // minemapCDN 配置\n\n\t\t\t// 定义空底图样式\n\t\t\tvar style = {\n\t\t\t\tglyphs: \"minemap://fonts/{fontstack}/{range}\",\n\t\t\t\tsprite: \"minemap://sprite/sprite\",\n\t\t\t\tsources: {},\n\t\t\t\tlayers: [],\n\t\t\t\tversion: 8\n\t\t\t};\n\t\t\t/**\n\t\t\t * 初始化地图实例\n\t\t\t */\n\n\t\t\tvar map = new minemap.Map({\n\t\t\t\tcontainer: \"map\",\n\t\t\t\tstyle: style,\n\t\t\t\tbearing: -87.18744098264303,\n\t\t\t\tcenter: [108.94733550459136, 34.30940496948484],\n\t\t\t\tzoom: 15.7,\n\t\t\t\tmaxZoom: 22 /*地图最大缩放等级*/,\n\t\t\t\tminZoom: 1 /*地图最小缩放等级*/\n\t\t\t});\n\t\t\tmap.repaint = true;\n\n\t\t\tmap.on(\"load\", function () {\n\t\t\t\t/*添加栅格图*/\n\t\t\t\tmap.addSource(\"IMAGERY_SOURCE\", {\n\t\t\t\t\ttype: \"raster\", //数据源类型：栅格数据源\n\t\t\t\t\ttiles: [\"https://services.minedata.cn/service/data/satellite?x={x}&y={y}&z={z}\"], //瓦片服务地址\n\t\t\t\t\ttileSize: 256 //瓦片尺寸\n\t\t\t\t});\n\n\t\t\t\tmap.addLayer({\n\t\t\t\t\tid: \"IMAGERY\",\n\t\t\t\t\ttype: \"raster\", //图层类型为\"raster\"\n\t\t\t\t\tsource: \"IMAGERY_SOURCE\",\n\t\t\t\t\tminzoom: 1,\n\t\t\t\t\tmaxzoom: 23\n\t\t\t\t});\n\n\t\t\t});\n\t\t}\n\t};\n</script>\n\n<!-- Add \"scoped\" attribute to limit CSS to this component only -->\n<style scoped>\n\t#map {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\twidth: 100vw;\n\t\theight: 100vh;\n\t}\n</style>\n```\n\nhtml 原生使用方式\n\n```html\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"initial-scale=1,maximum-scale=1,user-scalable=no\" />\n  <title>热力图图层</title>\n  <link rel=\"stylesheet\" href=\"https://minedata.cn/nce-static/support/demo/js-api/zh/css/demo.css\">\n  <!-- 引入MineMap API插件 -->\n  <link rel=\"stylesheet\" href=\"https://minemap.minedata.cn/minemapapi/v2.1.1/minemap.css\">\n  <script src=\"https://minemap.minedata.cn/minemapapi/v2.1.1/minemap.js\"></script>\n  <style>\n    #map {\n      width: 100%;\n      height: 100%;\n    }\n  </style>\n</head>\n<body>\n<div id=\"map\"></div>\n<script>\n  /**\n   * 全局参数设置\n   */\n  minemap.domainUrl = 'https://minemap.minedata.cn';\n  minemap.dataDomainUrl = 'https://minemap.minedata.cn';\n  minemap.serverDomainUrl = 'https://sd-data.minedata.cn';\n  minemap.spriteUrl = 'https://minemap.minedata.cn/minemapapi/v2.1.1/sprite/sprite';\n  minemap.serviceUrl = 'https://service.minedata.cn/service';\n\n  minemap.key = '<您的 key>';\n  minemap.solution = 11003;\n\n  var map = new minemap.Map({\n    container: 'map',\n    style: 'https://service.minedata.cn/map/solu/style/11003',\n    center: [116.46,39.92],\n    zoom: 10,\n    pitch: 60,\n    maxZoom: 17,\n    minZoom: 3,\n    projection: 'MERCATOR'\n  });\n\n  /**\n   * 创建地图对象后，开始加载地图资源，地图资源加载完成后触发load事件\n   */\n  map.on('load', function () {\n    // 增加自定义数据源、自定义图层\n    addSources();\n    addLayers();\n  });\n\n  function addSources() {\n    //添加数据源,该热力图效果，数据源类型支持geojson或vector两种形式\n    map.addSource(\"heatmapSource\", {\n      type: \"geojson\",\n      data: \"https://minedata.cn/nce-static/support/demo/js-api/zh/assets/heatmap-track-geo.json\"/*可以是具体的服务*/\n    });\n  }\n\n  function addLayers() {\n    map.addLayer({\n      \"id\": \"heatmapLayer\",\n      \"type\": \"heatmap\",\n      \"source\": \"heatmapSource\",\n      \"layout\": {\n        \"visibility\": \"visible\"\n      },\n      \"paint\": {\n        // 一个热力图数据点的模糊范围，单位是像素，默认值30；要求：值大于等于1，可根据zoom level进行插值设置\n        \"heatmap-radius\": 30,\n        //一个热力图单个数据点的热力程度，默认值为1；要求：值大于等于0，支持使用property中某个的热力值\n        \"heatmap-weight\": {\n          \"property\": \"mag\",\n          \"stops\": [[0, 0], [10, 1]]\n        },\n        // 用于统一控制热力值的强度，默认值1；要求：值大于等于0，可根据zoom level进行插值设置\n        \"heatmap-intensity\": 1,\n        // 表示热力图颜色阶梯，阶梯的值域范围为0-1，默认值为[\"interpolate\",[\"linear\"],[\"heatmap-density\"],0,\"rgba(0, 0, 255, 0)\",0.1,\"royalblue\",0.3,\"cyan\",0.5,\"lime\",0.7,\"yellow\",1,\"red\"]\n        \"heatmap-color\": [\n          \"interpolate\",\n          [\"linear\"],\n          [\"heatmap-density\"],\n          0, \"rgba(0, 0, 255, 0)\", 0.1, \"royalblue\", 0.3, \"cyan\", 0.5, \"lime\", 0.7, \"yellow\", 1, \"red\"\n        ],\n        // 表示热力图的不透明度，默认值1；值域范围0-1，可根据zoom level进行插值设置\n        \"heatmap-opacity\": 1,\n      }\n    });\n  }\n\n</script>\n</body>\n\n```\n\n## 相关文档\n\n文档[链接](https://minedata.cn/nce-support/webDev/MineMap-2D)\n\n## 更新日志\n\n[2.1.1-20240306]\n\n1. 文档更新\n\n[2.1.1-20240307]\n\n1. 文档更新\n\n[2.1.2]\n\n1. 正式修改为小版本发布的形式，去掉时间戳\n2. 修正部分自动替换的路径中出现双斜杠时有些服务器找不到资源的问题\n\n\n","readmeFilename":"README.md"}