{"id":15059006,"url":"https://github.com/sakitam-fdd/hmap","last_synced_at":"2025-04-10T05:13:56.652Z","repository":{"id":50543024,"uuid":"82883835","full_name":"sakitam-fdd/HMap","owner":"sakitam-fdd","description":":earth: HMap | 基于openlayers的封装组件","archived":false,"fork":false,"pushed_at":"2018-11-04T14:06:57.000Z","size":28154,"stargazers_count":72,"open_issues_count":1,"forks_count":31,"subscribers_count":14,"default_branch":"develope","last_synced_at":"2025-04-10T05:13:49.339Z","etag":null,"topics":["es6","gis","hmap","map","openlayers","openstreetmap","proj4js","truf","vector-tiles","watches","webpack"],"latest_commit_sha":null,"homepage":"https://sakitam-fdd.github.io/HMap/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sakitam-fdd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-23T04:22:48.000Z","updated_at":"2024-08-26T15:35:48.000Z","dependencies_parsed_at":"2022-08-29T15:01:16.462Z","dependency_job_id":null,"html_url":"https://github.com/sakitam-fdd/HMap","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakitam-fdd%2FHMap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakitam-fdd%2FHMap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakitam-fdd%2FHMap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakitam-fdd%2FHMap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sakitam-fdd","download_url":"https://codeload.github.com/sakitam-fdd/HMap/tar.gz/refs/heads/develope","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161277,"owners_count":21057555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["es6","gis","hmap","map","openlayers","openstreetmap","proj4js","truf","vector-tiles","watches","webpack"],"created_at":"2024-09-24T22:35:18.545Z","updated_at":"2025-04-10T05:13:56.631Z","avatar_url":"https://github.com/sakitam-fdd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HMap  |  基于openlayers的封装组件\n\n[![Build Status](https://travis-ci.org/sakitam-fdd/HMap.svg?branch=master)](https://www.travis-ci.org/sakitam-fdd/HMap)\n[![NPM downloads](https://img.shields.io/npm/dm/hmap-js.svg)](https://npmjs.org/package/hmap-js)\n[![](https://data.jsdelivr.com/v1/package/npm/hmap-js/badge)](https://www.jsdelivr.com/package/npm/hmap-js)\n![JS gzip size](http://img.badgesize.io/https://unpkg.com/hmap-js/dist/hmap.js?compression=gzip\u0026label=gzip%20size:%20JS)\n[![Npm package](https://img.shields.io/npm/v/hmap-js.svg)](https://www.npmjs.org/package/hmap-js)\n[![GitHub stars](https://img.shields.io/github/stars/sakitam-fdd/HMap.svg)](https://github.com/sakitam-fdd/HMap/stargazers)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/sakitam-fdd/HMap/master/LICENSE)\n\n- 采用mapbox配置式创建和管理地图\n- 开发者无需关心gis地图相关原理就可以轻松创建地图\n- 相比原生openlayers更易用，也更符合国内webgis应用场景\n- 部分动态渲染图层参考了 [maptalks](https://github.com/maptalks/maptalks.js) 的实现。\n\n## 编译\n\n\u003e 重要: Github 仓库的 /dist 文件夹只有在新版本发布时才会更新。如果想要使用 Github 上 HMap 最新的源码，你需要自己构建。\n\n```bash\ngit clone https://github.com/sakitam-fdd/HMap.git\nnpm install\nnpm run dev\nnpm run build\n```\n\n## 浏览器支持\n\n支持在HTML5和ECMAScript 5的所有现代浏览器上运行。包括Chrome，Firefox，\nSafari和Edge。对于旧版浏览器和平台，如Internet Explorer（至9版）和Android 4.x，\n必须提供`requestAnimationFrame`和`Element.prototype.classList`的polyfill，\n并且使用KML格式需要一个polyfill的URL。\n\n### 安装\n\n#### npm安装\n\n```\nnpm install hmap-js --save\nimport 'hmap-js/dist/hmap.css' // style\nimport HMap from 'hmap-js' // lib\n```\n\n#### cdn\n\n目前可通过 [unpkg.com/hmap-js](https://unpkg.com/hmap-js/dist/hmap.js) / [jsdelivr](https://cdn.jsdelivr.net/npm/hmap-js/dist/hmap.js) 获取最新版本的资源。\n\n```bash\n// jsdelivr (jsdelivr由于缓存原因最好锁定版本号，否则可能会出现意料之外的问题)\nhttps://cdn.jsdelivr.net/npm/hmap-js@1.5.8/dist/hmap.js\nhttps://cdn.jsdelivr.net/npm/hmap-js@1.5.8/dist/hmap.min.js\nhttps://cdn.jsdelivr.net/npm/hmap-js@1.5.8/dist/hmap.css\nhttps://cdn.jsdelivr.net/npm/hmap-js@1.5.8/dist/hmap.min.css\n// npm\nhttps://unpkg.com/hmap-js/dist/hmap.js\nhttps://unpkg.com/hmap-js/dist/hmap.min.js\nhttps://unpkg.com/hmap-js/dist/hmap.css\nhttps://unpkg.com/hmap-js/dist/hmap.min.css\n```\n\n#### 示例\n\n\u003e 注意：ol类库已被打包，对于高级用户，可以直接使用ol来进行必要的操作。\n\n```javascript\nvar Map = new HMap('map', {\n    controls: {\n      loading: true,\n      zoomSlider: true,\n      fullScreen: true\n    },\n    interactions: {\n      shiftDragZoom: false\n    },\n    view: {\n      center: [12118909.300259633, 4086043.1061670054],\n      projection: 'EPSG:3857',\n      zoom: 5, // resolution\n    },\n    baseLayers: [\n      {\n        layerName: 'openstreetmap',\n        isDefault: true,\n        layerType: 'OSM',\n        layerUrl: 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png'\n      }\n    ]\n  });\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsakitam-fdd%2Fhmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsakitam-fdd%2Fhmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsakitam-fdd%2Fhmap/lists"}